/* ===========================
   concepts.news v2 - Styles
   Surreal Typographic Broadsheet
   =========================== */

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

:root {
    --deep-indigo: #0B0A1A;
    --aged-linen: #F5F0E8;
    --tarnished-gold: #C4A35A;
    --bruised-violet: #4A3B6B;
    --smoked-rose: #8C5E5E;
    --graphite-mist: #6B6560;
    --warm-sand: #A09880;
    --diagonal-angle: 7deg;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Literata', serif;
    --font-mono: 'DM Mono', monospace;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    background-color: var(--deep-indigo);
    color: var(--aged-linen);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- SVG Filters (Hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ===========================
   HERO SECTION
   =========================== */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--deep-indigo);
    overflow: hidden;
    scroll-snap-align: start;
}

.hero-rule {
    position: absolute;
    top: 61.8%;
    left: 50%;
    transform: translateX(-50%);
    width: 0%;
    height: 1px;
    background-color: var(--tarnished-gold);
    transition: none;
}

.hero-rule.animate {
    animation: ruleExpand 800ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes ruleExpand {
    from { width: 0%; }
    to { width: 100%; }
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(48px, 12vw, 180px);
    letter-spacing: -0.03em;
    color: var(--aged-linen);
    text-transform: uppercase;
    display: flex;
    opacity: 0;
    transition: opacity 600ms ease;
    user-select: none;
    position: relative;
    z-index: 2;
}

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

.hero-title .letter {
    display: inline-block;
    transition: font-weight 1200ms cubic-bezier(0.16, 1, 0.3, 1),
                font-variation-settings 1200ms cubic-bezier(0.16, 1, 0.3, 1);
    font-variation-settings: 'wght' var(--letter-weight, 700);
    font-weight: var(--letter-weight, 700);
}

.hero-suffix {
    font-family: var(--font-display);
    font-weight: 100;
    font-size: clamp(24px, 4vw, 60px);
    color: var(--aged-linen);
    position: absolute;
    right: 8%;
    top: calc(50% + clamp(30px, 6vw, 90px));
    opacity: 0;
    transition: opacity 400ms ease;
    z-index: 2;
    letter-spacing: 0.05em;
    font-variation-settings: 'wght' 100;
}

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

/* Hero weight morphing animation */
@keyframes weightBreathe {
    0% { font-variation-settings: 'wght' 100; font-weight: 100; }
    50% { font-variation-settings: 'wght' 900; font-weight: 900; }
    100% { font-variation-settings: 'wght' 100; font-weight: 100; }
}

.hero-title .letter.breathing {
    animation: weightBreathe 12s ease-in-out infinite;
}

/* ===========================
   TIMELINE SPINE
   =========================== */
.timeline-spine {
    position: fixed;
    right: 32px;
    top: 0;
    height: 100vh;
    width: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 100;
    pointer-events: none;
}

.timeline-counter {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--tarnished-gold);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding-top: 20px;
    opacity: 0;
    transition: opacity 400ms ease;
}

.timeline-counter.visible {
    opacity: 1;
}

.timeline-line {
    flex: 1;
    width: 1px;
    background-color: var(--tarnished-gold);
    opacity: 0.3;
    margin-top: 12px;
    position: relative;
}

/* ===========================
   DIAGONAL DIVIDERS
   =========================== */
.diagonal-divider {
    width: 100%;
    height: 80px;
    position: relative;
    z-index: 5;
    overflow: hidden;
    transition: clip-path 200ms ease;
}

.diagonal-odd {
    background: linear-gradient(
        to bottom right,
        var(--aged-linen) 0%,
        var(--aged-linen) 49.5%,
        transparent 49.5%,
        transparent 50.5%,
        var(--deep-indigo) 50.5%
    );
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 80px * tan(7deg)));
}

.diagonal-even {
    background: linear-gradient(
        to bottom left,
        var(--deep-indigo) 0%,
        var(--deep-indigo) 49.5%,
        transparent 49.5%,
        transparent 50.5%,
        var(--aged-linen) 50.5%
    );
    clip-path: polygon(0 0, 100% calc(80px * tan(7deg)), 100% 100%, 0 100%);
}

/* Breathing oscillation on diagonal dividers */
.diagonal-divider.breathing-active.diagonal-odd {
    animation: diagonalBreathOdd 4s ease-in-out infinite;
}

.diagonal-divider.breathing-active.diagonal-even {
    animation: diagonalBreathEven 4s ease-in-out infinite;
}

@keyframes diagonalBreathOdd {
    0%, 100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 80px * tan(7deg)));
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 80px * tan(7.5deg)));
    }
}

@keyframes diagonalBreathEven {
    0%, 100% {
        clip-path: polygon(0 0, 100% calc(80px * tan(7deg)), 100% 100%, 0 100%);
    }
    50% {
        clip-path: polygon(0 0, 100% calc(80px * tan(7.5deg)), 100% 100%, 0 100%);
    }
}

/* Apply ink-bleed filter on diagonal dividers (desktop only) */
@media (min-width: 769px) {
    .diagonal-divider.ink-bleed-active {
        filter: url(#ink-bleed);
    }
    .diagonal-divider.ink-bleed-hover {
        filter: url(#ink-bleed-hover);
    }
}

/* ===========================
   STORY BANDS
   =========================== */
.story-band {
    position: relative;
    min-height: 80vh;
    width: 100%;
    background-color: var(--aged-linen);
    color: var(--deep-indigo);
    display: flex;
    align-items: flex-start;
    scroll-snap-align: start;
    transition: background-color 300ms ease;
}

.story-band-dark {
    background-color: var(--deep-indigo);
    color: var(--aged-linen);
}

.story-content {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 20vh 48px 12vh 48px;
    display: grid;
    grid-template-columns: 55% 1fr;
    gap: 24px;
    position: relative;
}

.story-left {
    max-width: 100%;
}

.story-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.category-tag {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--aged-linen);
    background-color: var(--bruised-violet);
    padding: 4px 12px;
    transform: skewX(-7deg);
    display: inline-block;
}

.story-band:not(.story-band-dark) .category-tag {
    color: var(--aged-linen);
    background-color: var(--bruised-violet);
}

.story-date {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--graphite-mist);
}

.category-glyph {
    width: 32px;
    height: 32px;
    margin-bottom: 16px;
}

.category-glyph svg {
    width: 100%;
    height: 100%;
    transition: transform 200ms ease-in-out;
}

.story-band:hover .category-glyph svg {
    transform: rotate(15deg);
}

.story-headline {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(32px, 5vw, 72px);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 24px;
    transition: font-variation-settings 200ms ease;
    font-variation-settings: 'wght' var(--headline-weight, 700);
}

.story-lede {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 19px;
    line-height: 1.55;
    margin-bottom: 20px;
    max-width: 38ch;
    color: inherit;
    opacity: 0.85;
}

.story-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    max-width: 38ch;
    color: inherit;
    opacity: 0.75;
}

.story-band-dark .story-body {
    color: var(--warm-sand);
    opacity: 1;
}

.story-band:not(.story-band-dark) .story-body {
    color: var(--graphite-mist);
    opacity: 1;
}

.story-band-dark .story-date {
    color: var(--warm-sand);
}

/* Timeline node inside story */
.story-timeline-node {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding-top: 4vh;
    padding-right: 24px;
}

.timeline-node-marker {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid var(--tarnished-gold);
    background-color: transparent;
    transition: background-color 400ms ease, transform 400ms ease;
}

.timeline-node-marker.filled {
    background-color: var(--tarnished-gold);
}

.story-band:hover .timeline-node-marker {
    animation: nodePulse 400ms ease;
}

@keyframes nodePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* ===========================
   INTERSTITIAL PANELS
   =========================== */
.interstitial-panel {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-color: var(--deep-indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    scroll-snap-align: start;
}

.interstitial-content {
    text-align: center;
    padding: 48px;
    max-width: 900px;
    position: relative;
    z-index: 2;
}

.interstitial-quote {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(28px, 5vw, 72px);
    letter-spacing: 0.08em;
    color: var(--aged-linen);
    line-height: 1.25;
    margin-bottom: 32px;
}

.interstitial-quote .quote-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 300ms ease, transform 300ms ease;
    margin-right: 0.25em;
}

.interstitial-quote .quote-word.revealed {
    opacity: 1;
    transform: translateY(0);
}

.interstitial-attribution {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    color: var(--smoked-rose);
    font-style: normal;
    display: block;
    opacity: 0;
    transition: opacity 400ms ease;
}

.interstitial-attribution.visible {
    opacity: 1;
}

.interstitial-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 59, 107, 0.05) 0%, transparent 70%);
    animation: glowPulse 30s ease-in-out infinite;
    z-index: 1;
}

@keyframes glowPulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.4); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.3; }
}

/* ===========================
   FOOTER COLOPHON
   =========================== */
.colophon {
    background-color: var(--deep-indigo);
    color: var(--warm-sand);
    padding: 80px 48px 48px;
    border-top: 1px solid var(--tarnished-gold);
}

.colophon-grid {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
}

.colophon-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tarnished-gold);
    margin-bottom: 16px;
}

.colophon-col p {
    font-family: var(--font-body);
    font-size: 11px;
    line-height: 1.6;
    color: var(--warm-sand);
    margin-bottom: 8px;
}

.specimen-space {
    font-family: var(--font-display) !important;
    font-weight: 300;
}

.specimen-literata {
    font-family: var(--font-body) !important;
    font-weight: 400;
}

.specimen-mono {
    font-family: var(--font-mono) !important;
    font-weight: 400;
    letter-spacing: 0.08em;
}

.colophon-copy {
    margin-top: 24px;
    color: var(--graphite-mist);
    font-size: 10px;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
    :root {
        --diagonal-angle: 4deg;
    }

    .timeline-spine {
        display: none;
    }

    .story-content {
        grid-template-columns: 1fr;
        padding: 12vh 24px 8vh;
    }

    .story-timeline-node {
        display: none;
    }

    .story-lede,
    .story-body {
        max-width: 100%;
    }

    .interstitial-panel {
        min-height: 60vh;
    }

    .interstitial-quote {
        letter-spacing: 0.05em;
    }

    .colophon-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .colophon {
        padding: 48px 24px 32px;
    }

    .hero-suffix {
        right: 24px;
    }

    .diagonal-divider {
        height: 40px;
    }

    /* Reduced diagonal angle on mobile */
    .diagonal-odd {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 40px * tan(4deg)));
    }

    .diagonal-even {
        clip-path: polygon(0 0, 100% calc(40px * tan(4deg)), 100% 100%, 0 100%);
    }

    /* Mobile horizontal progress nodes between stories */
    .story-band::after {
        content: '';
        display: block;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        border: 1px solid var(--tarnished-gold);
        position: absolute;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
    }

    .story-band.story-passed::after {
        background-color: var(--tarnished-gold);
    }

    /* Remove diagonal breathing on mobile */
    .diagonal-divider.breathing-active.diagonal-odd,
    .diagonal-divider.breathing-active.diagonal-even {
        animation: none;
    }
}

/* ===========================
   LINK STYLES
   =========================== */
a {
    color: var(--tarnished-gold);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 200ms ease, background-color 200ms ease;
}

a:hover {
    border-bottom-color: var(--tarnished-gold);
    background-color: rgba(74, 59, 107, 0.15);
}

/* Selection colors */
::selection {
    background-color: var(--bruised-violet);
    color: var(--aged-linen);
}

/* Custom cursor for nav hover - diagonal slash feel */
.category-tag {
    cursor: pointer;
}
