:root {
    color-scheme: dark;
    --background: #1a1a1a;
    --surface: rgba(255, 255, 255, 0.045);
    --text: #f0f2f5;
    --muted: #aaa;
    --soft: #d4d4d8;
    --violet: #c9a7ee;
    --deep-violet: #8a2be2;
    --line: rgba(201, 167, 238, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: "Helvetica Neue", Arial, sans-serif;
    line-height: 1.9;
}

a {
    color: inherit;
}

.page-header,
.section,
.closing,
footer {
    width: min(calc(100% - 2rem), 1040px);
    margin-inline: auto;
}

.page-header {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 2rem 0 0;
    text-align: center;
}

.site-nav {
    align-self: stretch;
    margin-bottom: clamp(3rem, 7vw, 5rem);
    text-align: right;
}

.site-nav a,
.return-link {
    color: #b9a7c8;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.return-link:hover,
.return-link:focus-visible {
    color: var(--text);
    border-color: var(--violet);
}

.eyebrow,
.section-number {
    margin: 0 0 1rem;
    color: var(--violet);
    font-size: 1.6rem;
    letter-spacing: 0.2em;
}

.eyebrow {
    font-size: 0.72rem;
}

.relationship-image {
    width: min(100%, 675px);
    margin: 0 auto 5rem;
}

.relationship-image img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
}

.relationship-image figcaption {
    margin-top: 1rem;
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

h1 {
    margin: 0;
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.4;
}

.lead {
    margin: 2.5rem 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.2rem);
}

.section {
    padding: 8rem 0;
}

.section--intro {
    padding-top: 0;
}

.section > h2,
.encounter h2,
.closing h2 {
    margin: 0 0 2rem;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 400;
    letter-spacing: 0.03em;
    line-height: 1.55;
}

.section > p,
.encounter-copy > p,
.beyond > p {
    max-width: 720px;
    color: var(--muted);
}

.section--intro > p:not(.section-number),
.dialogue > .section-intro {
    margin-inline: auto;
    text-align: center;
}

.section--intro > h2,
.dialogue > h2,
.section--intro > .section-number,
.dialogue > .section-number {
    text-align: center;
}

.triad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    max-width: 960px;
    margin: 4rem auto;
}

.triad-card {
    position: relative;
    z-index: 1;
    min-height: 220px;
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #212022;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.triad-card h3 {
    margin: 0 0 1rem;
    color: var(--text);
    font-size: 1.3rem;
    font-weight: 400;
}

.triad-label {
    margin: 0 0 1.5rem;
    color: var(--violet);
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    font-weight: 300;
    letter-spacing: 0.12em;
    line-height: 1;
}

.triad-card p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.quiet-emphasis {
    color: var(--soft) !important;
    font-size: 1.15rem;
}

.encounter {
    display: grid;
    grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
    gap: clamp(3rem, 9vw, 8rem);
    align-items: center;
}

.encounter-symbol {
    display: grid;
    width: min(100%, 300px);
    aspect-ratio: 2 / 3;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(138, 43, 226, 0.18), rgba(255, 255, 255, 0.025));
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
}

.encounter-symbol span {
    width: 72px;
    height: 72px;
    border: 1px solid var(--violet);
    transform: rotate(45deg);
    opacity: 0.65;
}

.cycle {
    display: grid;
    gap: 2.5rem;
    max-width: 720px;
    margin: 4rem auto 0;
    padding: 0;
    list-style: none;
}

.cycle li {
    position: relative;
    display: grid;
    grid-template-columns: 3rem 1fr;
    min-height: 0;
    padding: 1.5rem 1.75rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #202020;
}

.cycle li:not(:last-child)::after {
    position: absolute;
    z-index: 1;
    top: calc(100% + 0.15rem);
    left: 50%;
    content: "↓";
    color: var(--violet);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 0 14px rgba(201, 167, 238, 0.5);
    transform: translateX(-50%);
}

.cycle li:last-child::after {
    position: absolute;
    right: 1rem;
    bottom: 0.6rem;
    content: "↺";
    color: var(--violet);
    font-size: 1.5rem;
}

.cycle span {
    grid-row: 1 / 3;
    color: var(--violet);
    font-size: 0.85rem;
}

.cycle strong {
    font-weight: 400;
}

.cycle small {
    margin-top: 0.4rem;
    color: var(--muted);
    line-height: 1.6;
}

.beyond {
    max-width: 800px;
}

.beyond > h2 {
    font-size: clamp(2.4rem, 5vw, 3.5rem);
}

.formula {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin: 4rem 0;
    padding: 2rem 0;
    border-block: 1px solid var(--line);
    text-align: center;
}

.formula p {
    margin: 0;
    color: var(--soft);
    line-height: 1.6;
}

.formula span {
    display: block;
    color: var(--violet);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
}

.formula b {
    color: #75687f;
    font-weight: 300;
}

.closing {
    padding: 10rem 0;
    text-align: center;
}

.closing h2 {
    margin-inline: auto;
}

.return-link {
    display: inline-block;
    margin-top: 2rem;
    padding-bottom: 0.25rem;
}

footer {
    padding: 2rem 0 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

footer p {
    margin: 0.4rem 0;
    color: #7f7f87;
    font-size: 0.8rem;
}

@media (max-width: 760px) {
    .page-header {
        padding-bottom: 0;
    }

    .wide-only {
        display: none;
    }

    .section {
        padding: 5rem 0;
    }

    .relationship-image {
        width: min(100%, 360px);
        margin-bottom: 4rem;
    }

    .triad {
        display: flex;
        gap: 1rem;
        flex-direction: column;
        margin: 3rem auto;
    }

    .triad-card {
        min-height: 0;
    }

    .encounter {
        display: block;
    }

    .encounter-symbol {
        width: 160px;
        margin: 0 auto 4rem;
    }

    .cycle {
        gap: 2.5rem;
    }

    .cycle li {
        padding: 1.25rem;
    }

    .cycle li:not(:last-child)::after {
        top: calc(100% + 0.15rem);
        right: auto;
        bottom: auto;
    }

    .cycle strong {
        margin-top: 0;
    }

    .formula {
        flex-direction: column;
        gap: 1.5rem;
    }

    .formula b {
        line-height: 1;
    }

    .closing {
        padding: 7rem 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
