/* ========================================================================
   saram.ai  —  Scandinavian editorial-flow / serif-classic / pastel
   Palette:
     #F5F0F0  warm blush (primary background)
     #94A3B8  slate mist (primary text)
     #CBD5E1  mountain gray (landscapes / dividers)
     #FECDD3  petal pink (pastel accent)
     #D1D5B8  sage soft (secondary pastel)
     #334155  deep slate (headings / emphasis)
     #FAFAF9  snow white (lightest surface)
   ======================================================================== */

:root {
    --c-blush: #F5F0F0;
    --c-mist: #94A3B8;
    --c-mountain: #CBD5E1;
    --c-petal: #FECDD3;
    --c-sage: #D1D5B8;
    --c-slate: #334155;
    --c-snow: #FAFAF9;

    --f-display: "Cormorant Garamond", "Lora", Georgia, serif;
    --f-body: "Lora", Georgia, "Times New Roman", serif;
    --f-mono: "DM Mono", "JetBrains Mono", ui-monospace, monospace;

    --measure: 38rem;          /* ~640px reading column */
    --rhythm: clamp(80px, 12vh, 160px);
    --para-gap: 1.5em;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--c-blush);
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--f-body);
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.9;
    color: var(--c-slate);
    background: var(--c-blush);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--c-slate);
    text-decoration: none;
    border-bottom: 1px solid var(--c-mountain);
    transition: color 0.4s ease, border-color 0.4s ease;
}

a:hover {
    color: var(--c-mist);
    border-bottom-color: var(--c-petal);
}

em {
    font-style: italic;
    font-family: var(--f-body);
}

h1, h2, h3 {
    font-family: var(--f-display);
    font-weight: 600;
    color: var(--c-slate);
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 3em 0 1em;
}

hr {
    border: 0;
}

/* ----- noise filter SVG (kept off-flow) ----- */
.noise-defs {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ----- noise overlay applied to sections ----- */
.noise-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.03;
    z-index: 0;
    background-image:
        radial-gradient(circle at 30% 20%, rgba(51, 65, 85, 0.5) 0.5px, transparent 1px),
        radial-gradient(circle at 70% 60%, rgba(51, 65, 85, 0.4) 0.5px, transparent 1px),
        radial-gradient(circle at 45% 80%, rgba(51, 65, 85, 0.3) 0.5px, transparent 1px);
    background-size: 3px 3px, 4px 4px, 5px 5px;
    mix-blend-mode: multiply;
}

.noise-overlay--soft {
    opacity: 0.025;
}

/* ========================================================================
   Human Threshold (100vh)
   ======================================================================== */

.threshold {
    position: relative;
    min-height: 100vh;
    background: var(--c-blush);
    padding: clamp(28px, 5vw, 56px) clamp(24px, 6vw, 80px) 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.threshold__header {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.meta-mark {
    font-family: var(--f-mono);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--c-mist);
    text-transform: lowercase;
}

.meta-mark--right {
    text-align: right;
}

.threshold__inner {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: clamp(24px, 8vh, 80px);
    padding-bottom: clamp(120px, 28vh, 280px);
    max-width: 920px;
    margin: 0 auto;
    width: 100%;
    text-align: left;
}

.wordmark {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: clamp(56px, 11vw, 168px);
    letter-spacing: 0.05em;          /* will animate to -0.01em */
    color: var(--c-slate);
    margin: 0;
    line-height: 1;
    opacity: 0;
    transition: opacity 1.6s ease, letter-spacing 0.8s ease;
    will-change: opacity, letter-spacing;
}

.wordmark.is-revealed {
    opacity: 1;
    letter-spacing: -0.01em;
}

.wordmark__sub {
    margin-top: clamp(16px, 3vh, 32px);
    font-family: var(--f-body);
    font-size: clamp(15px, 1.3vw, 17px);
    color: var(--c-mist);
    max-width: 28em;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1.4s ease 0.6s, transform 1.4s ease 0.6s;
}

.wordmark.is-revealed + .wordmark__sub {
    opacity: 1;
    transform: translateY(0);
}

/* mountain SVG sits across the bottom third */
.mountains {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 36vh;
    min-height: 220px;
    z-index: 1;
    display: block;
}

.ridge {
    fill: var(--c-mountain);
    transition: d 8s ease-in-out;
}

.ridge--back {
    opacity: 0.45;
}

.ridge--mid {
    opacity: 0.65;
}

.ridge--front {
    opacity: 0.85;
}

/* scroll cue */
.scroll-cue {
    position: absolute;
    bottom: clamp(20px, 4vh, 36px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--c-slate);
    border-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.55;
    transition: opacity 0.6s ease;
}

.scroll-cue:hover {
    opacity: 1;
    color: var(--c-slate);
}

.scroll-cue__line {
    display: block;
    width: 1px;
    height: 36px;
    background: var(--c-slate);
    animation: scroll-bob 2.4s ease-in-out infinite;
    transform-origin: top;
}

@keyframes scroll-bob {
    0%, 100% { transform: scaleY(0.4); opacity: 0.4; }
    50%      { transform: scaleY(1);   opacity: 1; }
}

/* ========================================================================
   Editorial Chapters
   ======================================================================== */

.chapter {
    position: relative;
    padding-block: var(--rhythm);
    padding-inline: clamp(24px, 6vw, 80px);
    overflow: hidden;
}

.chapter--blush { background: var(--c-blush); }
.chapter--snow  { background: var(--c-snow); }
.chapter--sage  {
    background: linear-gradient(180deg, var(--c-snow) 0%, #ECECDF 100%);
}

/* chapter rail (the I. ——— title chip) */
.chapter__rail {
    position: relative;
    z-index: 2;
    max-width: var(--measure);
    margin: 0 auto 2.4em;
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-mist);
}

.chapter__rail--center {
    justify-content: center;
    text-align: center;
    max-width: 720px;
}

.chapter__number {
    font-family: var(--f-display);
    font-style: italic;
    font-weight: 500;
    font-size: 18px;
    letter-spacing: 0;
    color: var(--c-slate);
    text-transform: none;
}

.chapter__rule {
    flex: 0 0 56px;
    height: 1px;
    background: var(--c-mountain);
}

.chapter__label {
    /* normal */
}

/* prose column (editorial flow, ~640px max) */
.prose {
    position: relative;
    z-index: 2;
    max-width: var(--measure);
    margin: 0 auto;
}

.prose p {
    margin: 0 0 var(--para-gap);
}

.chapter__title {
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 500;
    margin: 0 0 1.2em;
    color: var(--c-slate);
}

.chapter__title em {
    font-style: italic;
    color: var(--c-mist);
}

.lede {
    font-size: clamp(18px, 1.7vw, 21px);
    line-height: 1.7;
    color: var(--c-slate);
    font-style: italic;
    margin-bottom: 2em;
}

.dropcap {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 4.6em;
    float: left;
    line-height: 0.85;
    margin: 0.08em 0.12em 0 -0.04em;
    color: var(--c-slate);
}

.signoff {
    font-style: italic;
    color: var(--c-mist);
}

.signoff--mono {
    font-family: var(--f-mono);
    font-style: normal;
    font-size: 14px;
    letter-spacing: 0.04em;
}

/* mountain rule (a divider that echoes the landscape) */
.rule {
    margin: 4em auto;
    height: 18px;
    width: 100%;
    background:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 18' preserveAspectRatio='none'><path d='M0,15 C30,8 50,14 80,10 C110,6 140,14 200,10 L200,18 L0,18 Z' fill='%23CBD5E1' opacity='0.7'/></svg>")
        center/100% 100% no-repeat;
    border: 0;
}

/* plate figure inside chapter II */
.plate {
    margin: 4em 0;
    padding: 0;
}

.plate__art {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--c-mountain);
    background: var(--c-snow);
}

.plate figcaption {
    margin-top: 0.8em;
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--c-mist);
    text-align: center;
}

.plate figcaption em {
    font-family: var(--f-body);
    font-style: italic;
    text-transform: none;
    letter-spacing: 0;
}

/* fade-up for prose chapters */
.chapter .prose,
.chapter__rail,
.chapter__title {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.chapter.is-visible .prose,
.chapter.is-visible .chapter__rail,
.chapter.is-visible .chapter__title {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================================================
   The Mirror — parallel human / AI columns
   ======================================================================== */

.mirror {
    position: relative;
    padding-block: var(--rhythm);
    padding-inline: clamp(24px, 6vw, 80px);
    background: var(--c-blush);
    overflow: hidden;
}

.mirror__title {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: clamp(28px, 4vw, 48px);
    text-align: center;
    color: var(--c-slate);
    margin: 0 auto 0.6em;
    max-width: 18ch;
    line-height: 1.2;
}

.mirror__intro {
    max-width: 38em;
    margin: 0 auto 4em;
    text-align: center;
    color: var(--c-mist);
    font-style: italic;
    font-size: clamp(15px, 1.3vw, 17px);
}

.mirror__columns {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: clamp(24px, 4vw, 64px);
    max-width: 1080px;
    margin: 0 auto;
    align-items: stretch;
}

.mirror__col {
    padding: clamp(24px, 3vw, 40px);
    background: var(--c-snow);
    border: 1px solid var(--c-mountain);
    display: flex;
    flex-direction: column;
    gap: 2em;
    transition: transform 1s ease, opacity 1s ease;
    opacity: 0;
    transform: translateY(20px);
}

.mirror.is-visible .mirror__col {
    opacity: 1;
    transform: translateY(0);
}

.mirror.is-visible .mirror__col--ai {
    transition-delay: 0.18s;
}

.mirror__col--human {
    background: var(--c-snow);
}

.mirror__col--ai {
    background: var(--c-snow);
}

.col-tag {
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-mist);
    border-bottom: 1px solid var(--c-mountain);
    padding-bottom: 0.6em;
    width: fit-content;
}

.col-tag--ai {
    color: var(--c-slate);
}

.mirror__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.1em;
}

.mirror__list li {
    display: flex;
    align-items: baseline;
    gap: 0.7em;
    line-height: 1.6;
    color: var(--c-slate);
}

.mirror__list--mono li {
    font-family: var(--f-mono);
    font-size: 13px;
    letter-spacing: 0.01em;
    color: var(--c-slate);
}

.dot {
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-top: 0.55em;
    transform-origin: center;
}

.dot--human {
    background: var(--c-petal);
    border-radius: 50%;
}

.dot--ai {
    background: var(--c-mist);
    border-radius: 1px;
}

.mirror__divider {
    width: 4px;
}

.mirror__divider svg {
    width: 4px;
    height: 100%;
    display: block;
}

/* morph SVG (one per column) */
.morph {
    width: 100%;
    height: auto;
    max-width: 200px;
    align-self: center;
    margin-top: auto;
}

.morph__path {
    fill: var(--c-petal);
    opacity: 0.85;
    transition: d 3s cubic-bezier(0.45, 0.05, 0.35, 1), fill 3s ease;
}

.morph__path--ai {
    fill: var(--c-mountain);
}

.mirror.is-morphed .morph__path {
    /* organic <-> geometric counter-shape */
    d: path("M100,30 L170,80 L170,120 L100,175 L30,120 L30,80 Z");
    fill: var(--c-mountain);
}

.mirror.is-morphed .morph__path--ai {
    d: path("M100,30 C150,30 175,80 170,120 C165,160 130,180 100,175 C70,180 35,160 30,120 C25,80 50,30 100,30 Z");
    fill: var(--c-petal);
}

.mirror__close {
    text-align: center;
    margin: 4em auto 0;
    max-width: 32em;
    color: var(--c-mist);
    font-style: italic;
}

/* ========================================================================
   Horizon Footer
   ======================================================================== */

.horizon {
    position: relative;
    padding: var(--rhythm) clamp(24px, 6vw, 80px) clamp(40px, 6vh, 80px);
    background: linear-gradient(180deg, var(--c-blush) 0%, #ECE5E5 100%);
    overflow: hidden;
}

.horizon__mountains {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 200px;
    z-index: 0;
}

.horizon__inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.4em;
}

.horizon__mark {
    font-family: var(--f-display);
    font-size: clamp(28px, 4vw, 44px);
    color: var(--c-slate);
    margin: 0;
    letter-spacing: -0.01em;
}

.horizon__line {
    margin: 0;
    color: var(--c-mist);
    font-style: italic;
}

.horizon__line--mono {
    font-family: var(--f-mono);
    font-style: normal;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--c-mist);
    margin-top: 0.6em;
}

.horizon__line--mono a {
    border-bottom: 0;
    color: var(--c-slate);
}

.horizon__line--mono a:hover {
    color: var(--c-mist);
}

/* ========================================================================
   Responsive
   ======================================================================== */

@media (max-width: 720px) {
    .threshold__header {
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
    }

    .meta-mark--right {
        text-align: left;
    }

    .mirror__columns {
        grid-template-columns: 1fr;
    }

    .mirror__divider {
        display: none;
    }

    .chapter__rail {
        gap: 10px;
    }

    .chapter__rule {
        flex-basis: 32px;
    }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ridge,
    .morph__path,
    .scroll-cue__line,
    .wordmark,
    .wordmark__sub,
    .chapter .prose,
    .chapter__rail,
    .chapter__title,
    .mirror__col {
        transition: none !important;
        animation: none !important;
    }
}
