/* =============================================================
   GLOBAL STYLES — Shared across all pages
   ============================================================= */

/* --- CSS Variables --- */
:root {
    --bg: #0A0A0C;
    --surface: #111114;
    --surface-hover: #18181C;
    --border: #1E1E24;
    --text-primary: #4AEDC4;
    --text-secondary: #ecece8;
    --text-muted: #55555F;
    --accent: #4AEDC4;
    --accent-dim: rgba(74, 237, 196, 0.08);
    --accent-glow: rgba(74, 237, 196, 0.15);
    --serif: 'DM Serif Display', Georgia, serif;
    --sans: 'DM Sans', -apple-system, sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

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

/* --- Base --- */
html {
    scroll-behavior: smooth;
    background: var(--bg);
    overflow-x: hidden;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: #FFFFFF;
    line-height: 1.7;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

/* --- NAV --- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 24px 48px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    max-width: 100vw;
    overflow: hidden;
}

.nav-logo {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.nav-logo span { color: var(--accent); }

.nav-back {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.nav-back:hover { color: var(--accent); }

/* --- HERO --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 48px 96px;
    position: relative;
    overflow: hidden;
    max-width: 100vw;
}

.hero::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    animation: drift 12s ease-in-out infinite;
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-40px, 30px); }
}

.hero-meta {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 32px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.3s;
}

.hero-title {
    font-family: var(--serif);
    font-size: clamp(36px, 5.5vw, 72px);
    font-weight: 400;
    line-height: 1.1;
    max-width: 800px;
    color: var(--text-primary);
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.5s;
}

.hero-subtitle {
    margin-top: 32px;
    font-size: 18px;
    font-weight: 300;
    color: var(--text-secondary);
    max-width: 560px;
    line-height: 1.8;
    text-align: justify;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.7s;
}

.hero-context {
    display: flex;
    gap: 32px;
    margin-top: 32px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.8s;
}

.hero-context-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero-context-label {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
}

.hero-context-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.hero-role {
    margin-top: 24px;
    font-size: 15px;
    font-weight: 300;
    color: var(--text-secondary);
    max-width: 560px;
    line-height: 1.7;
    text-align: justify;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.9s;
}

.hero-divider {
    width: 48px;
    height: 1px;
    background: var(--accent);
    margin-top: 48px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 1.0s;
}

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

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: absolute;
    bottom: 32px;
    right: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 1.2s;
}

.scroll-indicator span {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--text-muted);
    writing-mode: vertical-rl;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* --- CONTENT --- */
.content {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 48px;
}

/* --- SECTION --- */
.section {
    padding: 96px 0;
    border-top: 1px solid var(--border);
    opacity: 0;
    transform: translateY(32px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.section-label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-label::before {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--accent);
}

.section h2 {
    font-family: var(--serif);
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 28px;
    color: var(--text-primary);
}

.section p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.85;
    margin-bottom: 20px;
    font-weight: 300;
    text-align: justify;
    overflow-wrap: break-word;
    word-break: break-word;
}

.section p:last-child { margin-bottom: 0; }

.highlight {
    color: var(--text-primary);
    font-weight: 400;
}

/* --- Stat Callout --- */
.stat-callout {
    margin: 48px 0;
    padding: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 2px solid var(--accent);
    border-radius: 2px;
}

.stat-number {
    font-family: var(--mono);
    font-size: 48px;
    font-weight: 300;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 12px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 300;
}

/* --- SVG Visual Containers --- */
.svg-visual-container {
    width: 100%;
    overflow: hidden;
    margin: 24px 0 0 0;
    padding: 0;
}

.svg-visual-container svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}

/* min-height removed — SVGs size naturally from viewBox aspect ratio */

/* --- Utility: Section intro text --- */
.section-intro {
    margin-top: -20px;
    margin-bottom: 16px;
    font-size: 17px;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.6;
    text-align: justify;
}

/* --- Utility: Post-SVG paragraph --- */
.post-svg-text {
    margin-top: 5px;
}

/* --- Utility: Chapter divider --- */
.chapter-divider {
    margin: 56px 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.chapter-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
}

/* --- Utility: Chapter block first --- */
.chapter-block-first {
    margin-top: 40px;
}

/* Listen chapter uses a 780-wide viewBox vs 680 for others.
   Scale text up by 780/680 ≈ 1.15× so it appears the same visual size. */
.chapter-block-first .svg-ch-title { font-size: 34px; }
.chapter-block-first .svg-ch-close { font-size: 25px; }
.chapter-block-first .svg-sans-18  { font-size: 23px; }

/* --- FOOTER --- */
footer {
    padding: 64px 48px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.footer-cta {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 1px;
    padding: 12px 24px;
    border: 1px solid var(--accent);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.footer-cta:hover {
    background: var(--accent);
    color: var(--bg);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    nav { padding: 16px 24px; }
    .hero { padding: 0 24px 64px; }
    .hero-subtitle { font-size: 17px; }
    .content { padding: 0 24px; }
    .section { padding: 64px 0; }
    .section h2 { font-size: clamp(26px, 4vw, 36px); }
    .section p { font-size: 15px; }
    .section-intro { font-size: 18px; }
    footer { padding: 48px 24px; flex-direction: column; gap: 24px; }
    .scroll-indicator { display: none; }
    .hero-context { flex-direction: column; gap: 16px; }
    .hero-role { font-size: 14px; }
    .stat-callout { padding: 28px; }
    .stat-number { font-size: 42px; }

    /* Tighten chapter divider + SVG gap on mobile */
    .chapter-divider { margin: 32px 0; }
    .svg-visual-container { margin-top: 8px; }

    /* Expand SVGs beyond content padding for more visual space */
    .svg-visual-container {
        margin-left: -12px;
        margin-right: -12px;
        width: calc(100% + 24px);
    }
}

@media (max-width: 480px) {
    nav { padding: 12px 16px; }
    .nav-logo { font-size: 11px; letter-spacing: 2px; }
    .hero { padding: 0 16px 48px; }
    .hero-title { font-size: clamp(32px, 8vw, 48px); }
    .hero-subtitle { font-size: 16px; }
    .content { padding: 0 16px; }
    .section h2 { font-size: clamp(24px, 5.5vw, 32px); }
    .section p { font-size: 14px; }
    footer { padding: 36px 16px; }

    .chapter-divider { margin: 24px 0; }
    .svg-visual-container { margin-top: 4px; }

    /* Expand SVGs further on small screens */
    .svg-visual-container {
        margin-left: -8px;
        margin-right: -8px;
        width: calc(100% + 16px);
    }
}
