.dark .card {
    color: var(--ink);
    background: var(--bright)
}

.dark .card p {
    color: var(--soft)
}

.dark .card:hover,
.dark .card.yellow:hover {
    color: var(--ink);
    background: var(--yellow);
    border-color: var(--yellow)
}

.dark .card:hover p,
.dark .card.yellow:hover p {
    color: var(--ink)
}

:root {
    --paper: #f4f1e9;
    --bright: #fffefa;
    --ink: #182130;
    --soft: #526071;
    --line: #d9d8d0;
    --yellow: #f4bd31;
    --blue: #dce8ed;
    --radius: 16px;
    --shadow-soft: 0 16px 35px rgb(24 33 48 / 10%), 0 2px 6px rgb(24 33 48 / 6%);
    --shadow-lift: 0 24px 50px rgb(24 33 48 / 17%), 0 6px 12px rgb(24 33 48 / 8%);
    --display: "Space Grotesk", sans-serif;
    --body: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@keyframes page-enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

body {
    margin: 0;
    color: var(--ink);
    background: linear-gradient(135deg, var(--paper) 0%, #f8f5ed 48%, #e9eff0 100%);
    background-attachment: fixed;
    font-family: var(--body);
    -webkit-font-smoothing: antialiased;
    animation: page-enter .7s ease both;
}

body:before {
    position: fixed;
    z-index: -1;
    inset: 0;
    opacity: .25;
    pointer-events: none;
    content: "";
    background-image: radial-gradient(#394655 .55px, transparent .55px);
    background-size: 17px 17px;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color .2s ease, opacity .2s ease;
}

img {
    display: block;
    max-width: 100%
}

.wrap {
    width: min(1180px, calc(100% - 40px));
    margin: auto
}

.display,
h1,
h2,
h3 {
    font-family: var(--display);
    letter-spacing: -.055em
}

.eyebrow {
    color: #a06e00;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    padding: 14px 20px;
    color: var(--bright);
    background: var(--ink);
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgb(24 33 48 / 12%);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.button:hover {
    box-shadow: 0 13px 24px rgb(24 33 48 / 20%);
    transform: translateY(-3px);
}

.button.light {
    color: var(--ink);
    background: var(--bright)
}

.arrow {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    color: var(--ink);
    background: var(--yellow)
}

header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid rgb(217 216 208 / 80%);
    background: rgb(244 241 233 / 90%);
    backdrop-filter: blur(18px)
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-family: var(--display);
    font-size: 21px;
    font-weight: 700
}

.brand::after {
    content: "Crestum";
    letter-spacing: -.04em
}

.brand-mark {
    position: relative;
    display: block;
    width: 40px;
    height: 40px;
    overflow: hidden;
    flex: 0 0 40px;
    border-radius: 50%;
    background: var(--bright)
}

.brand-mark img {
    position: absolute;
    top: 0;
    left: 50%;
    width: 110%;
    max-width: none;
    height: auto;
    transform: translateX(-50%);
    mix-blend-mode: multiply
}

.brand:hover .brand-mark img {
    transform: translateX(-50%) scale(1.06);
    transition: transform .35s ease
}

.links {
    display: flex;
    gap: 25px;
    color: var(--soft);
    font-size: 13px;
    font-weight: 600
}

.links a:hover,
.footer-links a:hover {
    color: var(--ink)
}

.nav-cta {
    border-bottom: 1px solid var(--ink);
    padding-bottom: 4px;
    font-size: 13px;
    font-weight: 700
}

.menu-toggle {
    display: none;
    border: 0;
    background: none;
    font-size: 21px;
    cursor: pointer
}

.page-hero {
    padding: 100px 0 90px;
    background: linear-gradient(120deg, rgb(220 232 237 / 92%), rgb(244 241 233 / 70%));
    box-shadow: inset 0 -1px rgb(24 33 48 / 5%)
}

.page-hero-grid {
    display: grid;
    grid-template-columns: 1fr .75fr;
    gap: 70px;
    align-items: end
}

h1 {
    max-width: 760px;
    margin: 17px 0 22px;
    font-size: clamp(48px, 7vw, 84px);
    font-weight: 500;
    line-height: .95
}

h2 {
    margin: 12px 0 0;
    font-size: clamp(36px, 5vw, 60px);
    font-weight: 500;
    line-height: 1
}

h3 {
    font-size: 24px;
    font-weight: 500
}

.lead {
    max-width: 580px;
    color: var(--soft);
    font-size: 16px;
    line-height: 1.65
}

.hero-image {
    width: 100%;
    height: 330px;
    object-fit: cover;
    border-radius: var(--radius) 76px var(--radius) var(--radius);
    box-shadow: var(--shadow-lift)
}

.section {
    padding: 100px 0
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 30px;
    margin-bottom: 42px
}

.section-intro {
    max-width: 340px;
    margin: 0;
    color: var(--soft);
    font-size: 14px;
    line-height: 1.65
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    border: 0;
    background: transparent
}

.card {
    min-height: 260px;
    padding: 27px;
    color: var(--ink);
    border: 1px solid rgb(217 216 208 / 80%);
    border-radius: var(--radius);
    background: linear-gradient(145deg, var(--bright), #f7f4ec);
    box-shadow: var(--shadow-soft);
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease, color .25s ease
}

.card h3,
.card strong {
    color: #182130 !important
}

.card:hover {
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lift);
    transform: translateY(-6px)
}

.card.yellow {
    background: linear-gradient(145deg, #f8c843, var(--yellow));
    border-color: var(--yellow)
}

.card p {
    color: #526071 !important;
    font-size: 13px;
    line-height: 1.6
}

.card strong {
    font-family: var(--display);
    font-size: 14px
}

.card h3 {
    margin: 42px 0 10px
}

.dark {
    color: var(--bright);
    background: linear-gradient(140deg, #202d43, var(--ink) 55%, #101824);
    box-shadow: inset 0 1px rgb(255 255 255 / 5%), inset 0 -1px rgb(0 0 0 / 20%)
}

.dark .eyebrow {
    color: var(--yellow)
}

.dark .card { border-color: rgb(217 216 208 / 55%) }

.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    margin-top: 55px;
    border-top: 1px solid #ffffff33;
    background: #ffffff33
}

.step {
    min-height: 220px;
    padding: 24px 20px 10px 0;
    background: var(--ink)
}

.step:not(:first-child) {
    padding-left: 20px
}

.step b {
    color: var(--yellow);
    font-family: var(--display)
}

.step h3 {
    margin-top: 42px
}

.step p {
    color: #b9c1ca;
    font-size: 13px;
    line-height: 1.55
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px
}

.photo-card {
    position: relative;
    min-height: 390px;
    overflow: hidden;
    color: var(--bright);
    border-radius: var(--radius);
    background: var(--ink);
    box-shadow: var(--shadow-lift)
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .75;
    transition: transform .8s cubic-bezier(.2,.7,.2,1), opacity .4s ease
}

.photo-card:hover img { opacity: .9; transform: scale(1.06) }

.photo-card:after {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 35%, #182130e8);
    content: ""
}

.photo-copy {
    position: absolute;
    z-index: 1;
    right: 30px;
    bottom: 28px;
    left: 30px
}

.photo-copy h3 {
    max-width: 480px;
    margin: 8px 0;
    font-size: 36px
}

.photo-copy p {
    color: #d4d9dc;
    font-size: 13px;
    line-height: 1.55
}

.contact-grid {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 85px
}

.contact-copy {
    max-width: 380px;
    color: #b9c1ca;
    line-height: 1.65
}

.details {
    display: grid;
    gap: 18px;
    margin-top: 42px;
    color: #fff;
    font-size: 13px
}

.details small {
    display: block;
    margin-bottom: 4px;
    color: var(--yellow);
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase
}

.contact-form {
    display: grid;
    gap: 16px;
    padding: 30px;
    color: var(--ink);
    border-radius: var(--radius);
    background: linear-gradient(145deg, var(--bright), #f4f0e7);
    box-shadow: var(--shadow-lift)
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px
}

label {
    display: grid;
    gap: 7px;
    color: var(--soft);
    font-size: 11px;
    font-weight: 700
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    padding: 12px;
    color: var(--ink);
    background: var(--paper);
    font: inherit;
    font-size: 13px
}

textarea {
    min-height: 125px;
    resize: vertical
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--ink);
    outline: 3px solid rgb(244 189 49 / 35%);
    outline-offset: 1px
}

footer {
    padding: 30px 0;
    background: var(--bright)
}

.footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--soft);
    font-size: 12px
}

.footer-links {
    display: flex;
    gap: 20px
}

.journal-note {
    display: flex;
    min-height: 205px;
    align-items: center;
    gap: 20px;
    border: 1px solid rgb(24 33 48 / 12%);
    border-radius: var(--radius) 76px var(--radius) var(--radius);
    padding: 35px;
    background: linear-gradient(135deg, rgb(255 254 250 / 92%), rgb(220 232 237 / 68%))
}

.journal-note-mark {
    display: grid;
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
    place-items: center;
    border-radius: 50%;
    color: var(--ink);
    background: var(--yellow);
    font-size: 28px
}

.journal-note > span:last-child {
    font-family: var(--display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .12em
}

.journal-note small {
    display: block;
    margin-top: 8px;
    color: var(--soft);
    font-family: var(--body);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px
}

.article-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bright);
    box-shadow: var(--shadow-soft);
    transition: transform .2s ease, box-shadow .2s ease
}

.article-card:hover {
    box-shadow: var(--shadow-lift);
    transform: translateY(-3px)
}

.article-image {
    width: 100%;
    height: 230px;
    object-fit: cover
}

.article-copy {
    padding: 27px
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #94700e;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase
}

.article-meta time {
    color: var(--soft);
    font-size: 9px;
    letter-spacing: .04em
}

.article-copy h2 {
    margin: 20px 0 11px;
    font-size: clamp(23px, 3vw, 32px);
    line-height: 1.08
}

.article-excerpt {
    color: var(--soft);
    font-size: 13px;
    line-height: 1.65
}

.article-details {
    margin-top: 20px;
    border-top: 1px solid var(--line);
    padding-top: 15px
}

.article-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    list-style: none
}

.article-details summary::-webkit-details-marker {
    display: none
}

.article-details summary span {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 50%;
    background: var(--yellow);
    transition: transform .2s ease
}

.article-details[open] summary span {
    transform: rotate(90deg)
}

.article-body {
    padding-top: 10px
}

.article-body p {
    color: var(--soft);
    font-size: 13px;
    line-height: 1.75;
    white-space: normal
}

.article-body .article-author {
    margin-top: 24px;
    color: var(--ink);
    font-size: 11px;
    font-weight: 700
}

.article-grid > .empty-state {
    display: grid;
    min-height: 230px;
    grid-column: 1 / -1;
    align-content: center;
    justify-items: center;
    gap: 9px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 30px;
    background: var(--bright);
    text-align: center
}

.article-grid > .empty-state strong {
    font-family: var(--display);
    font-size: 19px
}

.article-grid > .empty-state > span:not(.empty-icon) {
    color: var(--soft);
    font-size: 13px;
    line-height: 1.6
}

.journal-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px
}

.journal-cta h2 {
    max-width: 600px
}

.journal-cta .button {
    flex: 0 0 auto
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important
    }
}

@media(max-width:800px) {
    .wrap {
        width: min(100% - 30px, 620px)
    }

    .links,
    .nav-cta {
        display: none
    }

    .menu-toggle {
        display: block
    }

    .nav.open {
        flex-wrap: wrap
    }

    .nav.open .links {
        display: grid;
        order: 3;
        width: 100%;
        gap: 0;
        padding: 12px 0;
        border-top: 1px solid var(--line)
    }

    .nav.open .links a {
        padding: 11px 0
    }

    .page-hero {
        padding: 65px 0
    }

    .page-hero-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 38px
    }

    .section {
        padding: 70px 0
    }

    .section-head {
        display: grid;
        gap: 17px
    }

    .grid-3,
    .split,
    .article-grid {
        grid-template-columns: 1fr
    }

    .journal-note {
        min-height: 145px
    }

    .journal-cta {
        align-items: flex-start;
        flex-direction: column
    }
    .steps {
        grid-template-columns: 1fr 1fr;
        margin-top: 35px
    }

    .step {
        min-height: 190px;
        padding-left: 0 !important
    }

    .step:nth-child(odd) {
        padding-right: 12px
    }

    .step:nth-child(even) {
        padding-left: 12px !important
    }

    .form-row {
        grid-template-columns: 1fr
    }

    .footer-row {
        align-items: flex-start;
        flex-direction: column
    }
}

.card.yellow,
.card.yellow h3,
.card.yellow strong,
.card.yellow p {
    color: var(--ink)
}

/* Keep card headings readable inside dark sections and after database hydration. */
.dark .card h3,
.dark .card strong,
.dark .card.yellow h3,
.dark .card.yellow strong {
    color: var(--ink) !important
}

.dark .card p,
.dark .card.yellow p {
    color: var(--soft) !important
}