/* ================================================================
   AETHEROS — Dark Editorial Manifesto

   A completely different design language from the main site.
   The main site sells features. This page sells a thesis.
   Dark, typographic, commanding — the text IS the design.
   ================================================================ */

/* ================================================================
   PAGE FOUNDATION
   ================================================================ */

.os-page {
    background: #110E0B;
    color: rgba(250, 247, 242, 0.78);
    min-height: 100vh;
}

.os-page .grain {
    opacity: 0.035;
}

.os-page .scroll-progress {
    background: linear-gradient(90deg, #D4920A, #B87D08);
}

/* Override nav for dark page */
.os-page header {
    background: rgba(17, 14, 11, 0.82);
    border-color: rgba(250, 247, 242, 0.08);
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
}

.os-page .logo { color: rgba(250, 247, 242, 0.9); }

.os-page .nav-links a {
    color: rgba(250, 247, 242, 0.5);
}

.os-page .nav-links a:hover,
.os-page .nav-links a.active {
    color: rgba(250, 247, 242, 0.9);
    background: rgba(250, 247, 242, 0.06);
}

.os-page .nav-cta {
    background: rgba(250, 247, 242, 0.1) !important;
    border: 1px solid rgba(250, 247, 242, 0.15) !important;
    color: rgba(250, 247, 242, 0.9) !important;
}

.os-page .nav-cta:hover {
    background: rgba(250, 247, 242, 0.15) !important;
}

/* Mobile nav overlay */
@media (max-width: 768px) {
    .os-page header { width: calc(100% - 1.2rem); top: 10px; }
    .os-page nav { min-height: 56px; padding: 0 0.8rem 0 1rem; }

    .os-page .hamburger { display: block; z-index: 200; }
    .os-page .hamburger span { background: rgba(250, 247, 242, 0.8); }

    .os-page .nav-links {
        position: fixed; inset: 0; z-index: 180;
        background: rgba(17, 14, 11, 0.96);
        backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
        transform: translateY(-102%); transition: transform 0.36s var(--ease);
        flex-direction: column; justify-content: center; gap: 0.5rem;
    }

    .os-page .nav-links.active { transform: translateY(0); }

    .os-page .nav-links a {
        color: rgba(250, 247, 242, 0.7);
        font-family: var(--font-sans);
        text-transform: none;
        font-size: 1.15rem;
        letter-spacing: 0.04em;
        padding: 0.65rem 1.2rem;
        opacity: 0; transform: translateY(-10px);
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    .os-page .nav-links.active a { opacity: 1; transform: translateY(0); }
    .os-page .nav-links.active a:nth-child(1) { transition-delay: 0.04s; }
    .os-page .nav-links.active a:nth-child(2) { transition-delay: 0.09s; }
    .os-page .nav-links.active a:nth-child(3) { transition-delay: 0.14s; }
    .os-page .nav-links.active a:nth-child(4) { transition-delay: 0.18s; }
    .os-page .nav-links.active a:nth-child(5) { transition-delay: 0.22s; }
    .os-page .nav-links.active a:nth-child(6) { transition-delay: 0.26s; }

    .os-page .nav-cta { margin-left: 0; }
}

/* ================================================================
   CONTAINER & VERTICAL RHYTHM
   ================================================================ */

.os-container {
    width: min(780px, 100% - 3rem);
    margin: 0 auto;
}

.os-container--wide {
    width: min(1000px, 100% - 3rem);
    margin: 0 auto;
}

.os-section {
    padding: clamp(5rem, 12vw, 9rem) 0;
    position: relative;
}

.os-rule {
    width: 48px;
    height: 1px;
    background: rgba(212, 146, 10, 0.4);
    border: none;
    margin: 0 auto clamp(4rem, 8vw, 6rem);
}

/* ================================================================
   TYPOGRAPHY — Large, editorial, commanding
   ================================================================ */

.os-headline {
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: #FAF7F2;
}

.os-headline em {
    font-style: italic;
    color: #D4920A;
}

.os-h1 {
    font-size: clamp(3.2rem, 7vw + 1rem, 6.5rem);
}

.os-h2 {
    font-size: clamp(2rem, 4vw + 0.6rem, 3.6rem);
}

.os-h3 {
    font-size: clamp(1.4rem, 2vw + 0.5rem, 2rem);
}

.os-body {
    font-family: var(--font-sans);
    font-size: clamp(1.05rem, 0.4vw + 0.9rem, 1.2rem);
    line-height: 1.75;
    color: rgba(250, 247, 242, 0.6);
    max-width: 58ch;
}

.os-body strong {
    color: rgba(250, 247, 242, 0.88);
    font-weight: 600;
}

.os-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: #D4920A;
    margin-bottom: 1.5rem;
    display: block;
}

.os-pullquote {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 3vw + 0.4rem, 2.6rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: rgba(250, 247, 242, 0.88);
    border-left: 2px solid rgba(212, 146, 10, 0.4);
    padding-left: clamp(1.2rem, 2vw, 2rem);
    margin: clamp(3rem, 6vw, 5rem) 0;
    max-width: 28ch;
}

.os-pullquote em {
    font-style: italic;
    color: #D4920A;
}

/* ================================================================
   HERO — Full viewport, single statement
   ================================================================ */

.os-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 160px 0 100px;
    position: relative;
    overflow: hidden;
}

.os-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(212, 146, 10, 0.06) 0%, transparent 70%);
    pointer-events: none;
    animation: hero-breathe 8s ease-in-out infinite;
}

.os-hero::after {
    content: '';
    position: absolute;
    top: 10%;
    left: 55%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(212, 146, 10, 0.035) 0%, transparent 65%);
    pointer-events: none;
    animation: hero-drift 12s ease-in-out infinite;
    z-index: 0;
}

@keyframes hero-breathe {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
    50% { transform: translateX(-50%) scale(1.2); opacity: 0.5; }
}

@keyframes hero-drift {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
    50% { transform: translateX(-40%) translateY(-40px); opacity: 1; }
}

.os-hero-inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
}

.os-hero .os-h1 {
    margin-bottom: 2rem;
    max-width: 16ch;
}

.os-hero .os-body {
    max-width: 44ch;
    text-align: center;
    margin: 0 auto;
    font-size: clamp(1.08rem, 0.4vw + 0.95rem, 1.22rem);
}

.os-hero-actions {
    margin-top: 2.8rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem;
}

/* Hero entrance sequence — CSS animations on page load */
.os-hero .os-label {
    opacity: 0;
    animation: os-entrance 0.7s var(--ease-smooth) 0.15s forwards;
}

.os-hero-words .os-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(28px);
    animation: os-entrance 0.5s var(--ease-smooth) forwards;
}

.os-hero-words .os-word:nth-child(1) { animation-delay: 0.3s; }
.os-hero-words .os-word:nth-child(2) { animation-delay: 0.38s; }
.os-hero-words .os-word:nth-child(3) { animation-delay: 0.46s; }
.os-hero-words .os-word:nth-child(4) { animation-delay: 0.54s; }
.os-hero-words .os-word:nth-child(5) { animation-delay: 0.62s; }
.os-hero-words .os-word:nth-child(6) { animation-delay: 0.7s; }

.os-hero .os-body {
    opacity: 0;
    animation: os-entrance 0.8s var(--ease-smooth) 0.95s forwards;
}

.os-hero .os-hero-actions {
    opacity: 0;
    animation: os-entrance 0.8s var(--ease-smooth) 1.15s forwards;
}

@keyframes os-entrance {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons — adapted for dark */
.os-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0.85rem 2rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: var(--fs-small);
    font-family: var(--font-sans);
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    background: #D4920A;
    color: #110E0B;
    box-shadow: 0 4px 24px rgba(212, 146, 10, 0.25);
}

.os-btn-primary:hover {
    background: #E8A30E;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(212, 146, 10, 0.3);
}

.os-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0.85rem 2rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: var(--fs-small);
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.3s var(--ease);
    background: transparent;
    color: rgba(250, 247, 242, 0.7);
    border: 1.5px solid rgba(250, 247, 242, 0.15);
}

.os-btn-ghost:hover {
    color: rgba(250, 247, 242, 0.95);
    border-color: rgba(250, 247, 242, 0.3);
    transform: translateY(-2px);
}

/* ================================================================
   PROBLEM — Prose with stats woven in
   ================================================================ */

.os-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin: clamp(3rem, 6vw, 5rem) 0;
    background: rgba(250, 247, 242, 0.06);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.os-stat {
    padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.2rem, 2vw, 2rem);
    background: rgba(17, 14, 11, 0.9);
    text-align: center;
}

.os-stat-number {
    font-family: var(--font-serif);
    font-size: clamp(2.4rem, 4vw + 0.5rem, 3.8rem);
    font-weight: 400;
    color: #D4920A;
    line-height: 1;
    margin-bottom: 0.6rem;
    display: block;
}

.os-stat-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(250, 247, 242, 0.45);
    line-height: 1.5;
    display: block;
}

/* ================================================================
   PRIMITIVES — The OS analogy (the ONE structured visual)
   ================================================================ */

.os-primitives {
    border: 1px solid rgba(250, 247, 242, 0.06);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-top: clamp(2.5rem, 5vw, 4rem);
}

.os-primitive-row {
    display: grid;
    grid-template-columns: 1fr 40px 1.2fr;
    align-items: center;
    padding: clamp(1.2rem, 2.5vw, 1.8rem) clamp(1.4rem, 3vw, 2.4rem);
    border-bottom: 1px solid rgba(250, 247, 242, 0.05);
    transition: background 0.25s ease;
}

.os-primitive-row:last-child {
    border-bottom: none;
}

.os-primitive-row:hover {
    background: rgba(250, 247, 242, 0.02);
}

.os-prim-label {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(250, 247, 242, 0.35);
    margin-bottom: 0.2rem;
    display: block;
}

.os-prim-name {
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 1.2vw + 0.5rem, 1.35rem);
    color: rgba(250, 247, 242, 0.55);
    line-height: 1.25;
}

.os-prim-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(212, 146, 10, 0.4);
}

.os-prim-arrow svg {
    width: 18px;
    height: 18px;
}

.os-prim-value {
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 1.2vw + 0.5rem, 1.35rem);
    color: #FAF7F2;
    line-height: 1.25;
    display: block;
}

.os-prim-desc {
    font-size: 0.86rem;
    color: rgba(250, 247, 242, 0.4);
    line-height: 1.55;
    margin-top: 0.25rem;
}

/* ================================================================
   SECTIONS — Flowing editorial blocks
   ================================================================ */

.os-numbered {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: rgba(212, 146, 10, 0.5);
    margin-bottom: 1.2rem;
    display: block;
}

.os-section .os-h2 {
    margin-bottom: 1.5rem;
}

.os-section .os-body + .os-body {
    margin-top: 1.2rem;
}

/* Source list — for the integration section */
.os-source-list {
    margin-top: clamp(2.5rem, 5vw, 4rem);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.os-source-item {
    display: grid;
    grid-template-columns: clamp(120px, 16vw, 180px) 1fr;
    gap: clamp(1rem, 2vw, 2rem);
    padding: clamp(1.2rem, 2vw, 1.6rem) 0;
    border-top: 1px solid rgba(250, 247, 242, 0.06);
    align-items: baseline;
}

.os-source-item:last-child {
    border-bottom: 1px solid rgba(250, 247, 242, 0.06);
}

.os-source-name {
    font-family: var(--font-sans);
    font-size: var(--fs-h3);
    font-weight: 600;
    color: rgba(250, 247, 242, 0.85);
    line-height: 1.3;
}

.os-source-desc {
    font-size: clamp(0.95rem, 0.3vw + 0.85rem, 1.06rem);
    color: rgba(250, 247, 242, 0.5);
    line-height: 1.65;
    max-width: 52ch;
}

/* Module list — minimal, manifesto-style */
.os-module-list {
    margin-top: clamp(2.5rem, 5vw, 4rem);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border: 1px solid rgba(250, 247, 242, 0.06);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.os-module {
    padding: clamp(1.4rem, 2.5vw, 2rem) clamp(1.4rem, 2.5vw, 2rem);
    border-bottom: 1px solid rgba(250, 247, 242, 0.05);
    border-right: 1px solid rgba(250, 247, 242, 0.05);
    transition: background 0.25s ease;
}

.os-module:hover {
    background: rgba(250, 247, 242, 0.02);
}

.os-module:nth-child(2n) {
    border-right: none;
}

.os-module:nth-last-child(-n+2) {
    border-bottom: none;
}

.os-module-name {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: clamp(1rem, 0.3vw + 0.9rem, 1.12rem);
    color: rgba(250, 247, 242, 0.85);
    margin-bottom: 0.4rem;
    display: block;
}

.os-module-desc {
    font-size: 0.9rem;
    color: rgba(250, 247, 242, 0.42);
    line-height: 1.6;
}

/* ================================================================
   THE LOOP — Typographic cycle
   ================================================================ */

.os-loop-sequence {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.8rem, 2vw, 1.5rem);
    margin: clamp(2.5rem, 5vw, 4rem) 0;
    flex-wrap: wrap;
}

.os-loop-step {
    font-family: var(--font-serif);
    font-size: clamp(1.3rem, 2vw + 0.4rem, 2rem);
    color: #FAF7F2;
    white-space: nowrap;
}

.os-loop-arrow {
    color: rgba(212, 146, 10, 0.4);
    font-size: 1.2rem;
}

.os-loop-return-text {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(212, 146, 10, 0.35);
    margin-top: 0.75rem;
}

/* ================================================================
   CTA — Final statement
   ================================================================ */

.os-cta {
    text-align: center;
    padding: clamp(6rem, 14vw, 11rem) 0 clamp(5rem, 10vw, 8rem);
}

.os-cta .os-h2 {
    margin-bottom: 1.5rem;
    max-width: 18ch;
    margin-left: auto;
    margin-right: auto;
}

.os-cta .os-body {
    max-width: 46ch;
    margin: 0 auto;
    text-align: center;
}

.os-cta-actions {
    margin-top: 2.8rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem;
}

/* ================================================================
   AMBIENT SECTION GLOWS — Subtle depth and progression
   ================================================================ */

.os-section::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle, rgba(212, 146, 10, 0.022) 0%, transparent 65%);
}

main > .os-section:nth-child(odd)::after {
    top: 10%;
    right: -15%;
}

main > .os-section:nth-child(even)::after {
    bottom: 10%;
    left: -15%;
}

/* ================================================================
   SECTION INDICATOR — Fixed chapter marker in left margin
   ================================================================ */

.os-section-indicator {
    position: fixed;
    left: clamp(1.5rem, 3vw, 3rem);
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.os-section-indicator.visible {
    opacity: 1;
}

.os-section-indicator-num {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(212, 146, 10, 0.5);
    transition: all 0.35s ease;
}

.os-section-indicator-line {
    width: 1px;
    height: 28px;
    background: linear-gradient(180deg, rgba(212, 146, 10, 0.25), transparent);
}

@media (max-width: 900px) {
    .os-section-indicator { display: none; }
}

/* ================================================================
   FOOTER — Self-contained (sections.css not loaded on this page)
   ================================================================ */

.os-page .footer-dark {
    padding: 2.5rem 0;
    background: linear-gradient(180deg, #110E0B 0%, #0A0807 100%);
    border-top: 1px solid rgba(250, 247, 242, 0.05);
}

.os-page .footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.os-page .footer-dark .logo {
    color: var(--dark-ink-soft);
}

.os-page .footer-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.9rem;
    font-size: var(--fs-small);
    color: var(--dark-ink-soft);
}

.os-page .footer-links a {
    transition: color 0.2s ease;
}

.os-page .footer-links a:hover {
    color: var(--dark-ink);
}

/* ================================================================
   REVEAL ANIMATIONS — Subtle for manifesto
   ================================================================ */

.os-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.8s cubic-bezier(0.2, 0.72, 0.2, 1),
        transform 1s cubic-bezier(0.2, 0.72, 0.2, 1);
}

.os-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.os-reveal-stagger > .os-reveal:nth-child(1) { transition-delay: 0ms; }
.os-reveal-stagger > .os-reveal:nth-child(2) { transition-delay: 80ms; }
.os-reveal-stagger > .os-reveal:nth-child(3) { transition-delay: 160ms; }
.os-reveal-stagger > .os-reveal:nth-child(4) { transition-delay: 240ms; }
.os-reveal-stagger > .os-reveal:nth-child(5) { transition-delay: 320ms; }
.os-reveal-stagger > .os-reveal:nth-child(6) { transition-delay: 400ms; }

/* Primitives — staggered wipe reveal (left to right) */
.os-reveal.os-reveal--wipe {
    transform: translateX(-24px);
}

.os-reveal.os-reveal--wipe.visible {
    transform: translateX(0);
}

.os-primitives > .os-reveal:nth-child(1) { transition-delay: 0ms; }
.os-primitives > .os-reveal:nth-child(2) { transition-delay: 140ms; }
.os-primitives > .os-reveal:nth-child(3) { transition-delay: 280ms; }
.os-primitives > .os-reveal:nth-child(4) { transition-delay: 420ms; }

body.reduce-motion .os-reveal {
    opacity: 1;
    transform: none;
    transition: none;
}

body.reduce-motion .os-hero .os-label,
body.reduce-motion .os-hero-words .os-word,
body.reduce-motion .os-hero .os-body,
body.reduce-motion .os-hero .os-hero-actions {
    opacity: 1;
    transform: none;
    animation: none;
}

body.reduce-motion .os-hero::before,
body.reduce-motion .os-hero::after {
    animation: none;
}

body.reduce-motion .os-section-indicator {
    display: none;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 768px) {
    .os-hero { padding: 130px 0 60px; min-height: auto; }

    .os-hero-actions {
        flex-direction: column;
        width: 100%;
        align-items: center;
    }

    .os-hero-actions a {
        width: min(300px, 100%);
    }

    .os-stats-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .os-stat {
        border-bottom: 1px solid rgba(250, 247, 242, 0.04);
    }

    .os-stat:last-child {
        border-bottom: none;
    }

    .os-primitive-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .os-prim-arrow {
        transform: rotate(90deg);
        justify-content: flex-start;
        padding: 0.2rem 0;
    }

    .os-source-item {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }

    .os-module-list {
        grid-template-columns: 1fr;
    }

    .os-module {
        border-right: none;
    }

    .os-module:last-child {
        border-bottom: none;
    }

    .os-module:nth-last-child(2) {
        border-bottom: 1px solid rgba(250, 247, 242, 0.05);
    }

    .os-loop-sequence {
        flex-direction: column;
        gap: 0.5rem;
    }

    .os-loop-arrow {
        transform: rotate(90deg);
    }

    .os-cta-actions {
        flex-direction: column;
        align-items: center;
    }

    .os-cta-actions a {
        width: min(300px, 100%);
    }

    .os-pullquote {
        font-size: clamp(1.3rem, 4vw, 1.8rem);
    }

    .os-page .footer-row {
        flex-direction: column;
        text-align: center;
    }

    .os-page .footer-links {
        justify-content: center;
    }
}
