/* ============================================
   A HUMAN-AI MANIFESTO
   One design: clean, modern, futuristic, dimensional.
   Content is the hero.
   ============================================ */

/* --- Design Tokens --- */
:root {
    /* Dark is the default (futuristic base) */
    --bg: #0a0c10;
    --bg-elev: #0e1219;
    --surface: #11161f;
    --surface-2: #141b26;
    --text: #eef2f8;
    --text-secondary: #aab4c2;
    --text-muted: #69748699;
    --text-muted-solid: #697486;
    --border: #1c2432;
    --border-strong: #2a3547;
    --accent: #6ea8fe;
    --accent-2: #9b8cff;
    --accent-soft: rgba(110, 168, 254, 0.14);
    --glow: rgba(110, 168, 254, 0.35);
    --nav-bg: rgba(10, 12, 16, 0.72);
    --ghost: rgba(255, 255, 255, 0.028);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.6);

    /* Typography */
    --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    /* Spacing scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    --space-5xl: 8rem;

    /* Layout */
    --container-max: 1120px;
    --container-narrow: 680px;
    --nav-height: 68px;
    --radius: 16px;
    --radius-sm: 10px;

    /* Transitions */
    --t-fast: 160ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-base: 320ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow: 640ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-sans);
    font-size: 1.08rem;
    line-height: 1.78;
    color: var(--text);
    background: var(--bg);
    transition: background-color var(--t-base), color var(--t-base);
    overflow-x: hidden;
}

/* Ambient depth: soft gradient field behind everything */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(60% 45% at 50% -5%, var(--accent-soft) 0%, transparent 60%),
        radial-gradient(40% 30% at 100% 100%, var(--accent-soft) 0%, transparent 70%);
    opacity: 0.9;
}

::selection {
    background: var(--accent);
    color: #fff;
}

/* --- Reading progress bar --- */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 100%;
    transform-origin: 0 50%;
    transform: scaleX(var(--scroll-progress, 0));
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 12px var(--glow);
    z-index: 1200;
    transition: transform 80ms linear;
}

/* --- Layout --- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.container-narrow {
    max-width: var(--container-narrow);
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: transparent;
    z-index: 1000;
    transition: background-color var(--t-base), border-color var(--t-base), backdrop-filter var(--t-base);
    border-bottom: 1px solid transparent;
}

.nav.scrolled {
    background: var(--nav-bg);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-xl);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

/* A/H hybrid wordmark: "AI" that also reads "HI" */
.wordmark {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1;
    color: var(--text);
}

.wordmark-rest { margin-left: 0.32em; }

.ai-logo {
    height: 1.05em;
    width: auto;
    display: block;
}

.ai-ink { fill: currentColor; }
.ai-accent { fill: var(--accent); }

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 450;
    transition: color var(--t-fast);
}

.nav-links a:hover { color: var(--text); }

/* --- Hero --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--nav-height) var(--space-xl) var(--space-3xl);
    position: relative;
}

.hero-content {
    max-width: 860px;
    position: relative;
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-xl);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 9vw, 6rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-2xl);
    background: linear-gradient(180deg, var(--text) 30%, color-mix(in srgb, var(--text) 55%, var(--accent)) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-divider {
    width: 72px;
    height: 3px;
    margin: 0 auto var(--space-2xl);
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 16px var(--glow);
}

.hero-subtitle {
    font-size: 1.3rem;
    line-height: 1.7;
    color: var(--text-secondary);
    font-weight: 350;
}

/* Elevator-style "down" call button */
.scroll-indicator {
    position: absolute;
    bottom: var(--space-3xl);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--accent);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    animation: float 2.5s ease-in-out infinite;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.scroll-indicator svg {
    filter: drop-shadow(0 0 6px var(--glow));
}

.scroll-indicator:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md), 0 0 22px var(--glow);
}

@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* --- Preamble --- */
.preamble {
    padding: var(--space-5xl) var(--space-xl);
}

.preamble p {
    margin-bottom: var(--space-lg);
    color: var(--text-secondary);
}

.preamble .lead {
    font-size: 1.3rem;
    line-height: 1.75;
    color: var(--text);
    margin-bottom: var(--space-2xl);
    font-weight: 400;
}

.emphasis {
    color: var(--text);
    font-weight: 500;
}

.preamble .emphasis {
    font-family: var(--font-display);
    font-size: 1.24rem;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

/* --- Principles --- */
.principles {
    padding: var(--space-2xl) var(--space-xl) var(--space-5xl);
}

.principles-heading {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: var(--space-2xl);
}

/* Inline accent for phrases like "It is cognitive." */
.accent-text { color: var(--accent); }

.principle {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(1.75rem, 5vw, 3.25rem);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    isolation: isolate;
    opacity: 0;
    transform: translateY(34px);
    transition: opacity var(--t-slow), transform var(--t-slow), border-color var(--t-base), box-shadow var(--t-base);
}

.principle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Accent hairline across the top of each card */
.principle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity var(--t-base);
}

/* Big dimensional ghost numeral for memorability */
.principle::after {
    content: attr(data-index);
    position: absolute;
    top: -0.32em;
    right: 0.04em;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(9rem, 22vw, 17rem);
    line-height: 1;
    color: var(--ghost);
    z-index: -1;
    pointer-events: none;
    letter-spacing: -0.04em;
}

.principle:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
}

.principle:hover::before { opacity: 1; }

.principle-title {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 3.2vw, 1.75rem);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--accent);
    margin-bottom: var(--space-xl);
    padding-right: 3.5rem; /* clearance for the floor numeral */
}

.principle-body p {
    margin-bottom: var(--space-lg);
    color: var(--text-secondary);
}

.principle-body .emphasis {
    font-family: var(--font-display);
    font-size: 1.15rem;
    line-height: 1.5;
    color: var(--text);
    letter-spacing: -0.01em;
}

.principle-body .flow-text {
    padding: var(--space-lg) var(--space-xl);
    border-left: 2px solid var(--accent);
    color: var(--text);
    background: var(--surface-2);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: var(--space-lg) 0;
}

.principle-body ul {
    list-style: none;
    padding: var(--space-xs) 0 var(--space-md) var(--space-sm);
}

.principle-body ul li {
    position: relative;
    padding-left: var(--space-lg);
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

.principle-body ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 10px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* Two-column comparison */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    padding: var(--space-sm) 0 var(--space-md);
    margin: var(--space-md) 0;
}

.two-columns .column {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-lg);
}

.two-columns h4 {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-md);
}

.two-columns ul { padding: 0; }
.two-columns ul li { margin-bottom: var(--space-xs); }

/* --- Closing --- */
.closing {
    padding: var(--space-5xl) var(--space-xl);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.closing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(680px, calc(100% - 4rem));
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
    z-index: 1;
}



.closing-title {
    position: relative;
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-2xl);
    color: var(--text);
    padding-right: 3.5rem; /* clearance for the L numeral */
}

/* Lobby: the "L" sits at the title's top-right, exactly like a floor numeral */
.closing-title::after {
    content: 'L';
    position: absolute;
    top: -0.32em;
    right: 0.04em;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(9rem, 22vw, 17rem);
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--ghost);
    z-index: -1;
    pointer-events: none;
}

.closing-body p {
    margin-bottom: var(--space-lg);
    color: var(--text-secondary);
}

.closing-body .emphasis {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--text);
}

.closing-question {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 1.9rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
    padding: var(--space-lg) 0;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.closing-final {
    margin-top: var(--space-3xl);
    padding: var(--space-2xl);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.closing-final p {
    font-size: 1.15rem;
    color: var(--text-secondary);
}

.final-statement {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.5vw, 2.1rem);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.02em;
    margin-top: var(--space-sm);
    color: var(--text);
}

.final-statement::after {
    content: '';
    display: block;
    width: 56px;
    height: 3px;
    margin-top: var(--space-lg);
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 16px var(--glow);
}

/* --- Footer --- */
.footer {
    padding: var(--space-3xl) var(--space-xl);
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 500;
}

.footer-text {
    font-size: 0.85rem;
    color: var(--text-muted-solid);
}

/* --- Elevator floor indicator + jump menu --- */
.elevator {
    position: fixed;
    right: clamp(12px, 2.5vw, 28px);
    top: 50%;
    transform: translateY(-50%) translateX(24px);
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-base), transform var(--t-base);
}

.elevator.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}

/* Current-floor display (also the toggle) */
.elevator-current {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
    min-width: 62px;
    font: inherit;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: border-color var(--t-fast), transform var(--t-fast);
}

.elevator-current:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.elevator.open .elevator-current {
    border-color: var(--accent);
}

.elevator-dir {
    font-size: 0.72rem;
    line-height: 1;
    color: var(--accent);
    animation: elevator-bob 1.5s ease-in-out infinite;
}

@keyframes elevator-bob {
    0%, 100% { transform: translateY(-1px); opacity: 0.55; }
    50% { transform: translateY(2px); opacity: 1; }
}

.elevator-floor {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1;
    color: var(--text);
    min-width: 1.5em;
    text-align: center;
    text-shadow: 0 0 18px var(--glow);
}

.elevator-floor.changing {
    animation: floor-drop 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes floor-drop {
    0% { transform: translateY(-45%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.elevator-label {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-muted-solid);
}

/* Jump menu: the button panel */
.elevator-panel {
    display: none;
    flex-direction: column;
    gap: 3px;
    padding: 8px;
    max-height: min(58vh, 440px);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    scrollbar-width: thin;
}

.elevator.open .elevator-panel {
    display: flex;
    animation: floor-drop 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.floor-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 32px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.floor-btn:hover {
    background: var(--surface-2);
    color: var(--text);
}

.floor-btn.current {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

@media (max-width: 600px) {
    .elevator { right: 10px; }
    .elevator-current {
        padding: 8px 10px;
        min-width: 48px;
        border-radius: 12px;
    }
    .elevator-floor { font-size: 1.25rem; }
    .elevator-label { display: none; }
    .floor-btn { width: 38px; height: 30px; }
}

/* --- Fade-in for reading rhythm --- */
[data-animate] { will-change: opacity, transform; }

/* --- Responsive --- */
@media (max-width: 768px) {
    :root { --nav-height: 60px; }

    .container { padding: 0 var(--space-lg); }

    .hero {
        padding-top: calc(var(--nav-height) + var(--space-2xl));
        min-height: 92vh;
    }

    .preamble { padding: var(--space-4xl) var(--space-lg); }
    .principles { padding: var(--space-xl) var(--space-lg) var(--space-4xl); }
    .closing { padding: var(--space-4xl) var(--space-lg); }

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

    .footer-inner {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .nav-links { gap: var(--space-md); }
}

@media (max-width: 480px) {
    body { font-size: 1.02rem; }
    .hero-subtitle { font-size: 1.08rem; }
    .hero-subtitle br { display: none; }
    .preamble .lead { font-size: 1.12rem; }
    .principle { padding: 1.5rem 1.35rem; }
    .principle::after { font-size: 8rem; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .principle,
    .scroll-indicator,
    .progress-bar,
    .elevator-dir,
    .elevator-floor {
        transition: none;
        animation: none;
    }
    .principle { opacity: 1; transform: none; }
}

/* --- Print --- */
@media print {
    .nav, .scroll-indicator, .progress-bar, .elevator { display: none; }
    .closing::after { display: none; }
    body::before { display: none; }
    .hero { min-height: auto; padding: var(--space-2xl) 0; }
    .principle {
        opacity: 1;
        transform: none;
        break-inside: avoid;
        box-shadow: none;
        border-color: #ccc;
    }
    .principle::after { display: none; }
}
