/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --substrate: #e2e4e8;
    --shadow-dark: #b8bcc4;
    --shadow-light: #f4f6fa;
    --text-primary: #2b2d31;
    --text-secondary: #4a4d54;
    --text-tertiary: #7d818a;
    --accent-warm: #c4653a;
    --accent-cool: #3a7c8c;
    --text-muted: #6b6f78;
    --border-light: #a0a4ac;
    --skeleton-mid: #eceef2;
    --neo-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--substrate);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    color: var(--text-secondary);
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    letter-spacing: 0.005em;
    line-height: 1.65;
    overflow-x: hidden;
}

/* === NAVIGATION PILL === */
#nav-pill {
    position: fixed;
    top: 32px;
    right: 32px;
    z-index: 100;
    padding: 12px 24px;
    border-radius: 40px;
    background: var(--substrate);
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
    cursor: pointer;
    transition: box-shadow 0.3s var(--neo-ease);
}

#nav-pill:hover {
    box-shadow: 12px 12px 20px var(--shadow-dark), -12px -12px 20px var(--shadow-light);
}

.nav-wordmark {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* === BANDS === */
.band {
    width: 100%;
    position: relative;
}

.band + .band {
    margin-top: 120px;
}

/* === HERO BAND === */
.hero-band {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 8%;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-headline {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(2.4rem, 6vw, 5.6rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--text-primary);
    text-transform: none;
    padding: 48px;
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.4s var(--neo-ease);
}

.hero-headline.visible {
    opacity: 1;
}

.hero-subtext {
    margin-top: 32px;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 560px;
    opacity: 0;
    transition: opacity 0.4s var(--neo-ease) 0.2s;
}

.hero-subtext.visible {
    opacity: 1;
}

/* Neomorphic raised */
.neo-raised {
    background: var(--substrate);
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
    border-radius: 16px;
}

/* Neomorphic inset */
.neo-inset {
    background: var(--substrate);
    box-shadow: inset 8px 8px 16px var(--shadow-dark), inset -8px -8px 16px var(--shadow-light);
    border-radius: 16px;
}

/* Inset text effect */
.neo-text-inset {
    color: var(--text-secondary);
    text-shadow:
        1px 1px 2px var(--shadow-light),
        -1px -1px 2px var(--shadow-dark);
}

/* Hero shadow breathing */
@keyframes hero-breathe {
    0%, 100% {
        box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
    }
    50% {
        box-shadow: 8.5px 8.5px 16.5px var(--shadow-dark), -8.5px -8.5px 16.5px var(--shadow-light);
    }
}

.hero-headline.visible {
    animation: hero-breathe 8s var(--neo-ease) infinite;
}

/* === WAVE FORMS === */
.wave-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.wave-svg {
    width: 100%;
    height: 100%;
}

.wave-path {
    fill: none;
    stroke: var(--shadow-dark);
    stroke-opacity: 0.15;
    stroke-width: 1.5;
}

/* === SKELETON LOADING === */
.skeleton-block {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    background: var(--substrate);
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--neo-ease);
}

.skeleton-block.active {
    opacity: 1;
}

.skeleton-shimmer {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    background: linear-gradient(90deg, var(--substrate) 25%, var(--skeleton-mid) 50%, var(--substrate) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.8s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* === STORY BANDS === */
.story-band {
    padding: 0 8%;
}

.story-container {
    display: flex;
    align-items: stretch;
    gap: 48px;
}

.story-left {
    flex-direction: row;
}

.story-right {
    flex-direction: row-reverse;
}

.story-tile {
    flex: 0 0 65%;
    position: relative;
    padding: 48px;
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.3s var(--neo-ease);
}

.story-tile:hover {
    box-shadow: 12px 12px 20px rgba(58, 124, 140, 0.25), -12px -12px 20px var(--shadow-light);
}

.story-content {
    position: relative;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s var(--neo-ease);
}

.story-content.visible {
    opacity: 1;
}

.story-headline {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.story-excerpt {
    color: var(--text-secondary);
    max-width: 560px;
}

/* Tile texture on hover */
.tile-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: url(#leather-grain);
    opacity: 0;
    transition: opacity 0.4s var(--neo-ease);
    pointer-events: none;
    z-index: 1;
    background: var(--substrate);
}

.story-tile:hover .tile-texture {
    opacity: 0.03;
}

/* Story meta */
.story-meta {
    flex: 0 0 30%;
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    border-radius: 16px;
}

.meta-date,
.meta-category,
.meta-readtime {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
}

.new-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-warm);
}

/* === WAVE SEPARATORS === */
.wave-separator {
    margin-top: 48px;
    width: 100%;
    height: 40px;
}

.separator-svg {
    width: 100%;
    height: 100%;
}

.separator-wave {
    fill: none;
    stroke: var(--text-tertiary);
    stroke-opacity: 0.3;
    stroke-width: 2;
}

/* === INTERSTITIAL BANDS === */
.interstitial-band {
    min-height: 30vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 8%;
}

.interstitial-content {
    max-width: 700px;
    text-align: center;
    padding: 48px;
}

.interstitial-text {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-secondary);
}

/* === TERMINAL BAND === */
.terminal-band {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 8%;
    position: relative;
    overflow: hidden;
}

.terminal-content {
    max-width: 640px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.terminal-text {
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    line-height: 1.75;
    color: var(--text-secondary);
}

.terminal-waves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    z-index: 1;
}

.terminal-wave-svg {
    width: 100%;
    height: 100%;
}

.terminal-wave-path {
    fill: none;
    stroke: var(--accent-cool);
    stroke-opacity: 0.2;
    stroke-width: 2;
}

/* Terminal wave breathing */
@keyframes terminal-breathe {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.25; }
}

.terminal-wave-path {
    animation: terminal-breathe 4s var(--neo-ease) infinite;
}

.tw-2 { animation-delay: 1.3s; }
.tw-3 { animation-delay: 2.6s; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .story-container {
        flex-direction: column;
    }

    .story-right {
        flex-direction: column;
    }

    .story-tile {
        flex: 1 1 auto;
    }

    .story-meta {
        flex: 1 1 auto;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-headline {
        padding: 32px;
    }

    #nav-pill {
        top: 16px;
        right: 16px;
    }
}
