/* ══════════════════════════════════════════════════════
   STORY PAGE - The ASI Timeline
   Grounded Elite Design System - Blue Gradient Theme
   ══════════════════════════════════════════════════════ */

/* ── HERO ── */

.story-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}
.story-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    left: 50%;
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 65%);
    transform: translateX(-50%);
    pointer-events: none;
}

/* Hero title with gradient text */
.story-hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-1, #0f172a);
    letter-spacing: -1px;
}
.story-gradient-text {
    background: var(--accent-gradient-vivid);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
[data-theme='dark'] .story-gradient-text {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #60a5fa 50%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
[data-theme='dark'] .story-hero-title {
    color: #ffffff;
}

/* ── HERO STATS ── */

.story-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 700px;
    margin: 0 auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2.5rem;
}
.story-stat {
    text-align: center;
    position: relative;
}
.story-stat:not(:first-child)::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
}
.story-stat-val {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    font-weight: 800;
    background: var(--accent-gradient-vivid);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
}
[data-theme='dark'] .story-stat-val {
    background: linear-gradient(135deg, #60a5fa 0%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.story-stat-plus {
    font-size: 0.6em;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}
.story-stat-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.4;
}

/* ── CHAPTER NAV (sticky timeline dots) ── */

.chapter-nav {
    position: sticky;
    top: 72px;
    z-index: 50;
    background: var(--bg-1);
    padding: 1rem 0;
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.chapter-nav.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.chapter-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}
.chapter-dots::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 40px;
    right: 40px;
    height: 2px;
    background: var(--border-color);
    transform: translateY(-50%);
    z-index: 0;
}
.chapter-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    cursor: pointer;
    position: relative;
    z-index: 1;
    text-decoration: none;
}
.chapter-dot .dot-circle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-1);
    transition: all 0.3s ease;
}
.chapter-dot.active .dot-circle {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-primary-glow);
}
.chapter-dot .dot-year {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-3);
    transition: color 0.3s;
}
.chapter-dot.active .dot-year {
    color: var(--text-1);
    font-weight: 700;
}

/* ── CHAPTERS ── */

.chapters-container {
    scroll-behavior: smooth;
    max-width: 780px;
    margin: 0 auto;
    padding: 3rem var(--page-padding) 2rem;
}

.chapter {
    position: relative;
    padding: 0 0 2.5rem;
    border-bottom: 1px solid var(--border-color);
}
.chapter:last-child {
    border-bottom: none;
}

.chapter-inner {
    display: flex;
    align-items: flex-start;
    gap: 2.5rem;
    padding: 0;
}
.chapter-text {
    flex: 1;
    min-width: 0;
}

/* Chapter illustration */
.ch-illust {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    margin-top: 2.5rem;
    opacity: 0.15;
}
.chapter:first-child .ch-illust {
    margin-top: 0;
}
.ch-illust svg {
    width: 100%;
    height: 100%;
    color: var(--accent-primary);
}

/* Year marker */
.chapter-text .ch-year {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-primary);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    padding-top: 2.5rem;
}
.chapter:first-child .chapter-text .ch-year {
    padding-top: 0;
}

.chapter-text h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 800;
    color: var(--text-1);
    line-height: 1.2;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}
.chapter-text p {
    color: var(--text-2);
    font-size: 0.95rem;
    line-height: 1.7;
    max-width: 640px;
}

/* ── CHAPTER BADGES ── */

.ch-badges {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}
.ch-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text-3);
    background: transparent;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}
.ch-badge svg {
    flex-shrink: 0;
    color: var(--text-3);
    opacity: 0.5;
}

/* Dark mode badge overrides */
[data-theme='dark'] .ch-badge {
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-3);
}
[data-theme='dark'] .ch-badge svg {
    color: var(--text-3);
}

/* Light mode badge overrides */
[data-theme='light'] .ch-badge {
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--text-3);
}


/* ── CTA PREMIUM CARD (Blue Gradient) ── */

.story-cta-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(99, 102, 241, 0.1) 50%, rgba(139, 92, 246, 0.07) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 24px;
    padding: 5rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.story-cta-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
                radial-gradient(circle at 70% 50%, rgba(99, 102, 241, 0.06) 0%, transparent 60%);
    pointer-events: none;
}
.story-cta-card h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
    position: relative;
    z-index: 1;
}
.story-cta-card p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}
.story-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 1;
    letter-spacing: 0.3px;
}
.story-cta-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-primary-glow);
}
.story-cta-btn i {
    font-size: 0.85rem;
    transition: transform 0.3s;
}
.story-cta-btn:hover i {
    transform: translateX(3px);
}

/* ── RESPONSIVE ── */

@media (max-width: 900px) {
    .chapter-dots { gap: 0; padding: 0 1rem; }
    .story-hero-stats { grid-template-columns: 1fr; gap: 1.5rem; max-width: 300px; }
    .story-stat:not(:first-child)::before { display: none; }
    .story-cta-card { padding: 3rem 2rem; }
}

/* ── 768px - Tablet portrait ── */
@media (max-width: 768px) {
    .story-hero {
        padding-top: 80px;
        min-height: 100vh;
    }
    .story-hero-title { font-size: clamp(2.2rem, 5vw, 3rem); }

    /* Container padding */
    .chapters-container { padding-left: 1.25rem; padding-right: 1.25rem; }

    /* Chapter cards */
    .chapter {
        padding: 1.25rem 1.25rem 1.25rem;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        background: var(--bg-2);
        margin-bottom: 1rem;
        border-bottom: 1px solid var(--border-color);
    }
    .chapter:last-child { border-bottom: 1px solid var(--border-color); margin-bottom: 0; }
    .chapter-text .ch-year { padding-top: 0; }
    .chapter:first-child .chapter-text .ch-year { padding-top: 0; }
    .chapter-text h2 { font-size: clamp(1.3rem, 2.5vw, 1.7rem); }
    .chapter-text p { font-size: 0.92rem; }
    .ch-illust { display: none; }
    .chapter-nav { display: none; }
    .ch-badges { display: none; }

    /* Stats - horizontal 3-col (override 900px stack) */
    .story-hero-stats {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0 !important;
        padding-top: 1.5rem;
        max-width: 100% !important;
    }
    .story-stat { text-align: center; }
    .story-stat:not(:first-child)::before { display: block !important; }
    .story-stat-val { font-size: clamp(1.6rem, 5vw, 2rem); }
    .story-stat-label { font-size: 0.6rem; letter-spacing: 1.5px; }

    /* CTA */
    .story-cta-card h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
    .story-cta-card p { font-size: 1rem; }
    .story-cta-btn { padding: 0.85rem 2rem; font-size: 0.92rem; }
}

/* ── 480px - Phone-specific ── */
@media (max-width: 480px) {
    .story-hero {
        padding-top: 80px;
        min-height: 100vh;
    }
    .story-hero-title {
        font-size: clamp(1.8rem, 6vw, 2.4rem);
        margin-bottom: 1rem;
    }

    /* Chapters - compact cards */
    .chapter { padding: 1rem; margin-bottom: 0.75rem; border-radius: 10px; }
    .chapter-text .ch-year { font-size: 0.72rem; }
    .chapter-text h2 { font-size: 1.15rem; margin-bottom: 0.35rem; }
    .chapter-text p { font-size: 0.85rem; line-height: 1.6; }

    /* CTA card */
    .story-cta-card {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }
    .story-cta-card h2 { font-size: 1.5rem; margin-bottom: 1rem; }
    .story-cta-card p { font-size: 0.9rem; margin-bottom: 1.5rem; }
    .story-cta-btn {
        padding: 0.8rem 1.8rem;
        font-size: 0.88rem;
        border-radius: 40px;
    }
}

/* ── 360px - Small phones ── */
@media (max-width: 360px) {
    .story-hero { padding-top: 80px; min-height: 100vh; }
    .story-hero-title { font-size: 1.6rem; }
    .story-stat-val { font-size: 1.5rem; }
    .story-stat-label { font-size: 0.55rem; }
    .chapters-container { padding-left: 1rem; padding-right: 1rem; }
    .chapter { padding: 0.85rem; margin-bottom: 0.6rem; border-radius: 8px; }
    .chapter-text .ch-year { font-size: 0.68rem; }
    .chapter-text h2 { font-size: 1rem; }
    .chapter-text p { font-size: 0.8rem; }
    .story-cta-card { padding: 1.5rem 1.2rem; }
    .story-cta-card h2 { font-size: 1.3rem; }
}

/* ── DARK MODE ENHANCEMENTS ── */

[data-theme='dark'] .ch-year {
    color: #60a5fa;
}
[data-theme='dark'] .ch-year::after {
    background: rgba(96, 165, 250, 0.15);
}
[data-theme='dark'] .chapter:not(:last-child)::after {
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.06) 20%, rgba(255,255,255,0.06) 80%, transparent 100%);
}

@media (max-width: 768px) {
    [data-theme='dark'] .chapter {
        border-color: rgba(96, 165, 250, 0.12);
        background: rgba(255, 255, 255, 0.02);
    }
}

[data-theme='dark'] .chapter-dot.active .dot-circle {
    border-color: #60a5fa;
    background: #60a5fa;
    box-shadow: 0 0 16px rgba(96, 165, 250, 0.5);
}

[data-theme='dark'] .story-cta-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(99, 102, 241, 0.12) 50%, rgba(139, 92, 246, 0.08) 100%);
    border-color: rgba(59, 130, 246, 0.25);
}

[data-theme='dark'] .story-cta-card h2 {
    color: #fff;
}

[data-theme='dark'] .ch-illust {
    opacity: 0.25;
}
[data-theme='dark'] .ch-illust svg {
    color: #60a5fa;
}

[data-theme='dark'] .story-cta-card p {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme='dark'] .story-hero::before {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 65%);
}

/* ── LIGHT MODE OVERRIDES ── */

[data-theme='light'] .story-hero-stats {
    border-top-color: rgba(0, 0, 0, 0.1);
}
[data-theme='light'] .story-stat:not(:first-child)::before {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme='light'] .story-hero::before {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 65%);
}

[data-theme='light'] .chapter-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

[data-theme='light'] .chapter-dots::before {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme='light'] .chapter-dot .dot-circle {
    border-color: rgba(0, 0, 0, 0.15);
    background: #fff;
}

[data-theme='light'] .chapter-dot.active .dot-circle {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

[data-theme='light'] .ch-year {
    color: var(--accent-primary);
}
[data-theme='light'] .ch-year::after {
    background: rgba(59, 130, 246, 0.12);
}
[data-theme='light'] .chapter:not(:last-child)::after {
    background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.06) 20%, rgba(0,0,0,0.06) 80%, transparent 100%);
}



[data-theme='light'] .story-cta-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(99, 102, 241, 0.06) 50%, rgba(139, 92, 246, 0.04) 100%);
    border-color: rgba(59, 130, 246, 0.15);
}

[data-theme='light'] .story-cta-card h2 {
    color: var(--text-1);
}

[data-theme='light'] .story-cta-card p {
    color: var(--text-2);
}

[data-theme='light'] .story-cta-btn {
    border-color: rgba(0, 0, 0, 0.2);
    color: var(--text-1);
}
[data-theme='light'] .story-cta-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.25);
}
