/* ========================================
   MCP Wrapped 2025 - Main Styles
   ======================================== */

/* CSS Variables */
:root {
    /* Colors - Light Theme */
    --color-bg: #ffffff;
    --color-bg-alt: #f8fafc;
    --color-surface: #f1f5f9;
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-accent-primary: #3b82f6;
    --color-accent-secondary: #ec4899;
    --color-accent-tertiary: #fbbf24;
    --color-gradient-start: #3b82f6;
    --color-gradient-mid: #a855f7;
    --color-gradient-end: #ec4899;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', var(--font-primary);
    --font-hero: 'Plus Jakarta Sans', var(--font-display);
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;
    --space-2xl: 8rem;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
    --transition-slower: 800ms ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    display: flex;
    flex-direction: column;
}

/* ========================================
   Section Base Styles
   ======================================== */

.section {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg) var(--space-md);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

/* Decorative overlays should not affect layout */
.section-decoration {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* Alternating backgrounds after the hero section */
.section:not(.section-hero) {
    background-color: var(--color-bg);
}

/* Hero is the 1st <section>; make the next section start on white */
.section:not(.section-hero):nth-of-type(odd) {
    background-color: var(--color-bg-alt);
}

/* Section Navigation Arrow */
.section-nav-arrow {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-accent-primary);
    transition: all var(--transition-base);
    z-index: 10;
}

.section-nav-arrow:hover {
    background: var(--color-accent-primary);
    color: white;
    border-color: var(--color-accent-primary);
    transform: translateX(-50%) scale(1.1);
}

.section-nav-arrow:focus {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
}

.section-nav-up {
    bottom: auto;
    top: 1rem;
}

.section-hero .section-nav-arrow {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.section-hero .section-nav-arrow:hover {
    background: var(--color-accent-primary);
    border-color: var(--color-accent-primary);
    color: white;
}

.section-hero .section-nav-up {
    display: none;
}

/* ========================================
   Hero Section
   ======================================== */

.section-hero {
    background: #0f0f1a;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    overflow: hidden;
    justify-content: center;
    padding: 0;
}

.hero-content {
    text-align: center;
    z-index: 10;
    max-width: 900px;
    position: relative;
    padding: var(--space-lg) var(--space-md);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(236, 72, 153, 0.2));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 50px;
    padding: var(--space-sm) var(--space-lg);
    margin-bottom: var(--space-lg);
    animation: fadeInDown 0.8s ease forwards;
}

.badge-year {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.badge-text {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.hero-title {
    font-family: var(--font-hero);
    font-size: clamp(1.75rem, 5vw, 3.5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: var(--space-md);
    letter-spacing: -0.02em;
}

.title-line {
    display: block;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.title-line:nth-child(1) { animation-delay: 0.2s; }
.title-line:nth-child(2) { animation-delay: 0.4s; }

/* Model Context Protocol - Bold */
.title-mcp {
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.03em;
}

/* Wrapped - Boxed container */
.title-wrapped-container {
    display: inline-block;
    margin-top: var(--space-md);
}

.title-wrapped {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));
    color: #ffffff;
    padding: 0.1em 0.4em;
    border-radius: 0.15em;
    transform: rotate(-2deg);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

/* Individual character styling */
.title-wrapped .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px);
}

.title-wrapped .char.animate {
    animation: charBounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.title-wrapped .char:nth-child(1) { --char-delay: 0s; }
.title-wrapped .char:nth-child(2) { --char-delay: 0.08s; }
.title-wrapped .char:nth-child(3) { --char-delay: 0.16s; }
.title-wrapped .char:nth-child(4) { --char-delay: 0.24s; }
.title-wrapped .char:nth-child(5) { --char-delay: 0.32s; }
.title-wrapped .char:nth-child(6) { --char-delay: 0.40s; }
.title-wrapped .char:nth-child(7) { --char-delay: 0.48s; }
.title-wrapped .char:nth-child(8) { --char-delay: 0.56s; }

.title-wrapped .char.asterisk {
    font-size: 0.6em;
    vertical-align: super;
    margin-left: 0.05em;
}

@keyframes charBounceIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    60% {
        opacity: 1;
        transform: translateY(-8px) scale(1.1);
    }
    80% {
        transform: translateY(4px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.title-accent {
    background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-mid), var(--color-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin: 0 auto var(--space-lg);
    opacity: 0;
    animation: fadeIn 0.8s ease 0.8s forwards;
}

.hero-subtitle .highlight {
    background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));
    color: #ffffff;
    font-weight: 600;
    padding: 0.1em 0.3em;
    border-radius: 0.2em;
}

.hero-footnote {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    opacity: 0;
    animation: fadeIn 0.8s ease 1.5s forwards;
    margin-top: var(--space-lg);
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-text-muted);
    font-size: 0.875rem;
    opacity: 0;
    animation: fadeIn 0.8s ease 1.2s forwards;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--color-accent-primary);
    border-bottom: 2px solid var(--color-accent-primary);
    transform: rotate(45deg);
}

/* Hero Background - Starry Sky */
.hero-background {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    background-color: #0f0f1a;
    background-image:
        radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1a 70%),
        radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.65) 0%, transparent 100%),
        radial-gradient(1px 1px at 20% 50%, rgba(255, 255, 255, 0.55) 0%, transparent 100%),
        radial-gradient(1px 1px at 35% 15%, rgba(255, 255, 255, 0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 55% 35%, rgba(255, 255, 255, 0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 75%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 45%, rgba(255, 255, 255, 0.65) 0%, transparent 100%),
        radial-gradient(1px 1px at 95% 90%, rgba(255, 255, 255, 0.55) 0%, transparent 100%);
    background-repeat:
        no-repeat,
        repeat, repeat, repeat, repeat, repeat, repeat, repeat;
    background-size:
        cover,
        260px 260px, 260px 260px, 260px 260px, 260px 260px, 260px 260px, 260px 260px, 260px 260px;
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-repeat: repeat;
    background-position: 0 0;
}

.stars-small {
    background-image: 
        radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 20% 50%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 30% 10%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 30%, rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 80%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 15%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 60%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 40%, rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 15% 85%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 25% 35%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 35% 90%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 45% 5%, rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 55% 55%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 65% 25%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 75% 75%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 45%, rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 95% 95%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 5% 65%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 12% 42%, rgba(255,255,255,0.5) 0%, transparent 100%);
    background-size: 250px 250px;
    animation: starsPan 80s linear infinite;
}

.stars-medium {
    background-image: 
        radial-gradient(1.5px 1.5px at 15% 25%, rgba(255,255,255,0.9) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 35% 65%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 55% 15%, rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 75% 85%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 95% 35%, rgba(255,255,255,0.9) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 25% 95%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 45% 45%, rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 65% 5%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 85% 55%, rgba(255,255,255,0.9) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 5% 75%, rgba(255,255,255,0.7) 0%, transparent 100%);
    background-size: 350px 350px;
    animation: starsPan 120s linear infinite;
}

.stars-large {
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,1) 0%, transparent 100%),
        radial-gradient(2px 2px at 50% 70%, rgba(255,255,255,0.9) 0%, transparent 100%),
        radial-gradient(2px 2px at 80% 20%, rgba(255,255,255,1) 0%, transparent 100%),
        radial-gradient(2.5px 2.5px at 30% 80%, rgba(59,130,246,0.9) 0%, transparent 100%),
        radial-gradient(2.5px 2.5px at 70% 50%, rgba(236,72,153,0.8) 0%, transparent 100%),
        radial-gradient(2px 2px at 10% 60%, rgba(255,255,255,1) 0%, transparent 100%),
        radial-gradient(2px 2px at 90% 90%, rgba(255,255,255,0.9) 0%, transparent 100%);
    background-size: 450px 450px;
    animation: starsPan 200s linear infinite;
}

@keyframes starsPan {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 0 -1000px;
    }
}

/* Rocket Launch Animation */
.rocket-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 3;
}

.rocket-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.rocket {
    position: absolute;
    width: 72px;
    height: 72px;
    opacity: 0;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    transform-origin: center center;
    z-index: 2;
}

/* ========================================
   Departure Board Styles
   ======================================== */

.departure-board-container {
    display: flex;
    justify-content: center;
    margin: var(--space-md) 0;
}

.departure-board {
    padding: 0.4em 0.5em;
    display: inline-block;
    line-height: 1.3em;
    background: rgb(30, 30, 30);
    border-radius: 0.21em;
    color: #ffe45c;
    font-family: 'Space Grotesk', Helvetica, sans-serif;
    font-size: clamp(2.5rem, 10vw, 6rem);
    font-weight: 700;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.departure-board .row {
    display: flex;
    justify-content: center;
}

.departure-board span.letter {
    display: inline-block;
    width: 0.85em;
    margin: 0 0.05em;
    height: 1.3em;
    text-align: center;
    position: relative;
    background: #1a1a1a;
    border-radius: 0.08em;
    box-shadow: 
        inset 0 -0.07em 0 rgba(50, 50, 50, 0.7), 
        inset 0 -0.14em 0 rgba(0, 0, 0, 0.7), 
        inset 0.14em 0 0.28em rgba(0, 0, 0, 0.9), 
        inset -0.14em 0 0.28em rgba(0, 0, 0, 0.9),
        0 0.07em 0 rgba(255, 255, 255, 0.1);
}

.departure-board span.letter:before {
    border-top: 0.07em solid rgba(0, 0, 0, 0.6);
    border-bottom: 0.07em solid rgba(255, 255, 255, 0.06);
    height: 0;
    position: relative;
    width: 100%;
    left: 0;
    top: 0.62em;
    content: " ";
    display: block;
    z-index: 2;
}

.departure-board span.fold {
    display: block;
    position: absolute;
    height: 0;
    top: 0.65em;
}

.departure-board span.flap {
    display: block;
    position: absolute;
    top: 0;
    width: 0.85em;
    height: 0.65em;
    margin: 0;
    overflow: hidden;
}

.departure-board span.text {
    width: 100%;
    display: block;
}

.departure-board span.bottom {
    top: 0.65em;
}

.departure-board span.bottom span.text {
    position: relative;
    top: -0.65em;
}

.departure-board span.flap.falling {
    display: none;
    bottom: 0;
    top: auto;
}

.departure-board span.flap.falling span.text {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-top: 0.03em solid #333;
    border-bottom: 0.03em solid #333;
    background: #111;
    display: block;
    position: relative;
    transform: scaleY(1);
    transition: transform linear;
}

/* ========================================
   Metric Section
   ======================================== */

.section-metric {
    text-align: center;
    justify-content: center;
    padding: var(--space-lg) var(--space-md);
}

.metric-container {
    z-index: 2;
    max-width: 800px;
    width: 100%;
}

.metric-dual {
    gap: var(--space-lg);
}

.metric-dual .metric-group {
    text-align: center;
    min-width: 200px;
}

.metric-dual .metric-context {
    width: 100%;
    max-width: 480px;
    text-align: center;
    margin-top: var(--space-xs);
}

.metric-label {
    font-size: clamp(0.75rem, 1.8vw, 1rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent-primary);
    margin-bottom: var(--space-sm);
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-slow);
}

.metric-value {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 15vw, 10rem);
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-mid), var(--color-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--transition-slower);
}

.metric-context,
.metric-subtitle {
    font-size: clamp(0.875rem, 2vw, 1.1rem);
    color: var(--color-text-muted);
    margin-top: var(--space-sm);
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-slow);
    transition-delay: 0.3s;
    max-width: 500px;
}

.highlight {
    background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));
    color: #ffffff;
    font-weight: 600;
    padding: 0.05em 0.25em;
    border-radius: 0.15em;
    text-decoration: none;
    white-space: nowrap;
}

/* Shipping Section */
.section-shipping {
    justify-content: center;
    padding: var(--space-lg) var(--space-md);
}

.shipping-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    max-width: 600px;
    text-align: center;
}

@media (max-width: 900px) {
    .shipping-container {
        gap: var(--space-md);
    }
}

.shipping-content {
    flex: 1;
    max-width: 600px;
}

.shipping-narrative {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    line-height: 2;
    color: var(--color-text-muted);
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-slow);
    transition-delay: 0.2s;
}

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

.shipping-narrative .highlight {
    background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));
    color: #ffffff;
    font-weight: 600;
}

/* Stacking Cards Animation */
.stack {
    --stack-dur: 2s;
    --stack-delay: 0.05;
    --stack-spacing: 15%;
    --stack-hue: 260;

    overflow: visible;
    position: relative;
    width: 10em;
    height: 20em;
    background: transparent;
    flex-shrink: 0;
}

.stack__card {
    aspect-ratio: 1;
    position: absolute;
    inset: 0;
    top: var(--stack-spacing);
    margin: auto;
    width: 70%;
    transform: rotateX(45deg) rotateZ(-45deg);
    transform-style: preserve-3d;
}

.stack__card::before {
    animation: stackCard var(--stack-dur) infinite;
    background-color: hsl(var(--stack-hue) 70% 55%);
    border-radius: 7.5%;
    box-shadow: -0.5em 0.5em 1.5em hsl(var(--stack-hue) 70% 15% / 0.3);
    content: "";
    display: block;
    position: absolute;
    inset: 0;
}

.stack__card:nth-child(2) {
    top: 0;
}

.stack__card:nth-child(2)::before {
    animation-delay: calc(var(--stack-dur) * (-1 + var(--stack-delay)));
    background-color: hsl(var(--stack-hue) 70% 65%);
}

.stack__card:nth-child(3) {
    top: calc(var(--stack-spacing) * -1);
}

.stack__card:nth-child(3)::before {
    animation-delay: calc(var(--stack-dur) * (-1 + var(--stack-delay) * 2));
    background-color: hsl(var(--stack-hue) 70% 80%);
}

@keyframes stackCard {
    0%, 100% {
        animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
        transform: translateZ(0);
    }
    11% {
        animation-timing-function: cubic-bezier(0.32, 0, 0.67, 0);
        opacity: 1;
        transform: translateZ(0.125em);
    }
    34% {
        animation-timing-function: steps(1);
        opacity: 0;
        transform: translateZ(-12em);
    }
    48% {
        animation-timing-function: linear;
        opacity: 0;
        transform: translateZ(12em);
    }
    57% {
        animation-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
        opacity: 1;
        transform: translateZ(0);
    }
    61% {
        animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
        transform: translateZ(-1.8em);
    }
    74% {
        animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
        transform: translateZ(0.6em);
    }
    87% {
        animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
        transform: translateZ(-0.2em);
    }
}

@media (max-width: 900px) {
    .stack {
        width: 10em;
        height: 22em;
    }
}

/* NPM congratulations callout */
.metric-container.metric-congrats {
    gap: var(--space-md);
}

.metric-container.metric-congrats .metric-context {
    margin-top: 0;
}

.metric-value.metric-value-logo {
    background: none;
    -webkit-text-fill-color: initial;
    display: flex;
    justify-content: center;
    align-items: center;
}

.npm-logo-burst {
    position: relative;
    display: inline-block;
    line-height: 1;
}

.npm-logo {
    width: clamp(100px, 18vw, 160px);
    height: auto;
    display: block;
    position: relative;
    z-index: 2;
}

.confetti-canvas {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    z-index: 1;
    pointer-events: none;
}

/* Visible state */
.section.visible .metric-label,
.section.visible .metric-context,
.section.visible .metric-subtitle {
    opacity: 1;
    transform: translateY(0);
}

.section.visible .metric-value {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   List Section
   ======================================== */

.section-list {
    background: none;
}

/* Chart Section */
.section-chart {
    background: none;
}

.chart-section-container {
    width: 100%;
    max-width: 700px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}

.section-subtitle {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-top: 0;
    margin-bottom: var(--space-lg);
    text-align: center;
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.repo-highlight {
    display: inline-block;
    font-family: var(--font-mono), monospace !important;
    font-size: 0.85rem !important;
    background: #374151 !important;
    color: #ffffff !important;
    padding: 0.15em 0.4em;
    border-radius: 0.25em;
    white-space: nowrap;
}

.section-repo {
    text-align: center;
    margin-bottom: var(--space-sm);
}

.chart-wrapper {
    width: 100%;
    margin-bottom: var(--space-md);
}

.chart-wrapper canvas {
    width: 100% !important;
    /* Let Chart.js use the available vertical space.
       (A low max-height causes horizontal bars to overlap.) */
    max-height: none;
}

/* Stars Chart Section */
.chart-subtitle {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-top: 0;
    margin-bottom: var(--space-lg);
    text-align: center;
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.stars-chart-wrapper {
    width: 100%;
    height: 200px;
    margin-bottom: var(--space-md);
}

.stars-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.star-stat {
    text-align: center;
}

.star-stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.star-stat-value.growth {
    color: #10b981;
}

.star-stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

.star-stat-arrow {
    font-size: 1.5rem;
    color: var(--color-text-muted);
    opacity: 0.5;
}

.list-container {
    width: 100%;
    max-width: 700px;
    max-height: calc(100vh - 8rem);
}

/* Contributors Chart */
.contributors-chart-container {
    max-width: 700px;
}

.contributors-chart-wrapper {
    width: 100%;
    height: 420px;
    padding-left: 10px;
}

/* Chatty PRs Section */
.chatty-prs-container {
    max-width: 650px;
}

.chatty-prs-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: var(--space-lg);
}

.chatty-pr-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-slow);
    transition-delay: calc(var(--delay) * 0.1s);
}

.chatty-pr-item:hover {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.03);
}

.section.visible .chatty-pr-item {
    opacity: 1;
    transform: translateY(0);
}

.pr-author-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pr-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    flex-shrink: 0;
}

.pr-title {
    flex: 1;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.3;
}

.pr-comments {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    background: rgba(0, 0, 0, 0.04);
    padding: 2px 6px;
    border-radius: 10px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Matrix Box Section */
.matrix-box {
    position: relative;
    width: 100%;
    max-width: 600px;
    padding: 2.5rem 2rem;
    background: #0a0e17;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    margin: 0 auto;
}

.matrix-background {
    position: absolute;
    inset: 0;
    display: grid;
    padding: 1.5rem;
    font-family: var(--font-mono), monospace;
    font-size: clamp(0.5rem, 1.5vw, 0.85rem);
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.1);
    user-select: none;
    overflow: hidden;
}

.matrix-char {
    text-align: center;
    transition: color 0.8s ease, text-shadow 0.8s ease;
}

.matrix-char.lit {
    color: rgba(255, 255, 255, 0.35);
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
}

.matrix-word {
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 800;
    letter-spacing: 0.15em;
    color: #fff;
    text-align: center;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.metric-narrative {
    font-family: var(--font-primary);
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    text-align: center;
    max-width: 450px;
    line-height: 1.5;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-sm);
    color: var(--color-text);
}

/* Content containers - flex grow to center remaining content */
.metric-container,
.chart-container,
.list-container,
.summary-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    justify-content: center;
    width: 100%;
}

/* Ranking List */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: var(--space-lg) var(--space-xl);
    opacity: 0;
    transform: translateX(-50px);
    transition: all var(--transition-slow);
    transition-delay: calc(var(--delay) * 0.15s);
}

.ranking-item:hover {
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateX(10px);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
}

.section.visible .ranking-item {
    opacity: 1;
    transform: translateX(0);
}

.rank-number {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-accent-primary);
    min-width: 50px;
}

.rank-name {
    font-size: 1.25rem;
    font-weight: 600;
    flex: 1;
}

.rank-count {
    font-size: 1rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* Server Grid */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
}

.server-card {
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    padding: var(--space-xl);
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--transition-slow);
}

.server-card:hover {
    border-color: rgba(236, 72, 153, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15);
}

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

.section.visible .server-card:nth-child(1) { transition-delay: 0.1s; }
.section.visible .server-card:nth-child(2) { transition-delay: 0.2s; }
.section.visible .server-card:nth-child(3) { transition-delay: 0.3s; }
.section.visible .server-card:nth-child(4) { transition-delay: 0.4s; }
.section.visible .server-card:nth-child(5) { transition-delay: 0.5s; }
.section.visible .server-card:nth-child(6) { transition-delay: 0.6s; }

.server-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.server-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.server-calls {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* ========================================
   Chart Section
   ======================================== */

.section-chart {
    background: none;
}

.chart-container {
    width: 100%;
    max-width: 800px;
    max-height: calc(100vh - 8rem);
}

.activity-visualization {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}

.peak-time,
.peak-day,
.peak-month {
    background: linear-gradient(135deg, var(--color-surface), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 24px;
    padding: var(--space-xl);
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--transition-slow);
}

.section.visible .peak-time { transition-delay: 0.1s; }
.section.visible .peak-day { transition-delay: 0.2s; }
.section.visible .peak-month { transition-delay: 0.3s; }

.section.visible .peak-time,
.section.visible .peak-day,
.section.visible .peak-month {
    opacity: 1;
    transform: translateY(0);
}

.peak-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.peak-value {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Summary Section
   ======================================== */

.section-summary {
    background: #0f0f1a;
}

.section-summary .section-title {
    color: #ffffff;
}

.section-summary .summary-text {
    color: rgba(255, 255, 255, 0.7);
}

.section-summary .section-nav-arrow {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.section-summary .section-nav-arrow:hover {
    background: var(--color-accent-primary);
    border-color: var(--color-accent-primary);
    color: white;
}

.section-summary .summary-link {
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.section-summary .summary-link:hover {
    background: var(--color-accent-primary);
    border-color: var(--color-accent-primary);
    color: #ffffff;
}

.summary-container {
    text-align: center;
    max-width: 700px;
    max-height: calc(100vh - 8rem);
    position: relative;
    z-index: 1;
    padding: 0 var(--space-md);
}

.particle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.thank-you-word {
    display: inline-block;
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 10vw, 5rem);
    font-weight: 900;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));
    color: #ffffff;
    padding: 0.1em 0.4em;
    border-radius: 0.15em;
    margin-bottom: var(--space-md);
    opacity: 0;
    transform: scale(0.8) rotate(-1deg);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: 0.4s;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.3);
}

.section.visible .thank-you-word {
    opacity: 1;
    transform: scale(1);
}

.summary-links {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    margin-top: var(--space-xl);
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-slow);
    transition-delay: 0.6s;
}

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

.summary-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: 2px solid var(--color-accent-primary);
    border-radius: 12px;
    color: var(--color-accent-primary);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-base);
}

.summary-link:hover {
    background: var(--color-accent-primary);
    border-color: var(--color-accent-primary);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.summary-text {
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: var(--space-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-slow);
    transition-delay: 0.3s;
}

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

.summary-badge {
    background: linear-gradient(135deg, var(--color-surface), rgba(139, 92, 246, 0.15));
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 24px;
    padding: var(--space-xl) var(--space-2xl);
    display: inline-block;
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--transition-slow);
    transition-delay: 0.5s;
}

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

.badge-icon {
    font-size: 4rem;
    margin-bottom: var(--space-md);
}

.badge-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.badge-description {
    font-size: 1rem;
    color: var(--color-text-muted);
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
    padding: var(--space-md) var(--space-lg);
    background: var(--color-bg-alt);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.site-footer .footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.site-footer .footer-text {
    color: var(--color-text-muted);
}

.site-footer .footer-separator {
    opacity: 0.4;
}

.site-footer a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.site-footer a:hover {
    color: var(--color-accent-primary);
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scrollBounce {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(10px); }
}

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

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .section {
        padding: var(--space-md) var(--space-sm);
    }
    
    .section > * {
        max-height: calc(100vh - 6rem);
    }
    
    .hero-title {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
    }
    
    .shipping-container {
        gap: var(--space-lg);
    }
    
    .stack {
        width: 8em;
        height: 16em;
    }
    
    .stars-chart-wrapper {
        height: 160px;
    }
    
    .contributors-chart-wrapper {
        height: 320px;
    }
    
    .star-stat-value {
        font-size: 1.25rem;
    }
    
    .star-stat-label {
        font-size: 0.7rem;
    }
    
    .thank-you-word {
        font-size: clamp(2rem, 9vw, 3.5rem);
    }
    
    .matrix-box {
        padding: 1.5rem 1rem;
    }
    
    .matrix-background {
        padding: 1rem 0.5rem;
    }
    
    .matrix-word {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
    }
    
    .ranking-item {
        flex-wrap: wrap;
        padding: var(--space-md);
    }
    
    .rank-number {
        font-size: 1.25rem;
    }
    
    .rank-name {
        font-size: 1rem;
    }
    
    .server-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    
    .server-card {
        padding: var(--space-lg);
    }
    
    .activity-visualization {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .departure-board {
        font-size: clamp(2rem, 9vw, 4rem);
    }
    
    .chatty-pr-item {
        padding: 0.4rem 0.5rem;
    }
    
    .pr-title {
        font-size: 0.7rem;
    }
    
    .pr-number {
        font-size: 0.65rem;
    }
    
    .pr-author-avatar {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .section {
        padding: var(--space-sm);
    }
    
    .section > * {
        max-height: calc(100vh - 5rem);
    }
    
    .hero-badge {
        padding: var(--space-xs) var(--space-md);
    }
    
    .hero-title {
        font-size: clamp(1.25rem, 4.5vw, 2rem);
    }
    
    .server-grid {
        grid-template-columns: 1fr;
    }
    
    .ranking-item {
        gap: var(--space-md);
    }
    
    .stars-chart-wrapper {
        height: 140px;
    }
    
    .contributors-chart-wrapper {
        height: 300px;
    }
    
    .departure-board {
        font-size: clamp(1.75rem, 8vw, 3rem);
    }
    
    .summary-links {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .summary-link {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}

/* Short viewport (landscape mobile) */
@media (max-height: 700px) {
    .section {
        padding: var(--space-sm) var(--space-md);
    }
    
    .section > * {
        max-height: calc(100vh - 4rem);
    }
    
    .hero-title {
        font-size: clamp(1.25rem, 4vw, 2rem);
        margin-bottom: var(--space-sm);
    }
    
    .hero-subtitle {
        font-size: clamp(0.85rem, 2vw, 1rem);
        margin-bottom: var(--space-sm);
    }
    
    .hero-footnote {
        margin-top: var(--space-md);
    }
    
    .shipping-narrative {
        font-size: clamp(0.8rem, 1.5vw, 0.95rem);
        line-height: 1.5;
    }
    
    .stack {
        width: 7em;
        height: 14em;
    }
    
    .departure-board {
        font-size: clamp(1.75rem, 7vw, 3.5rem);
        padding: 0.3em 0.4em;
    }
    
    .departure-board-container {
        margin: var(--space-sm) 0;
    }
    
    .metric-label {
        margin-bottom: var(--space-xs);
        font-size: clamp(0.65rem, 1.5vw, 0.85rem);
    }
    
    .metric-context {
        font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    }
    
    .stars-chart-wrapper {
        height: 150px;
        margin-bottom: var(--space-sm);
    }
    
    .contributors-chart-wrapper {
        height: 280px;
    }
    
    .stars-stats {
        gap: var(--space-md);
    }
    
    .star-stat-value {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: clamp(1.25rem, 3.5vw, 2rem);
        margin-bottom: var(--space-xs);
    }

    .section-subtitle {
        margin-top: 0;
        margin-bottom: var(--space-md);
    }
    
    .chart-subtitle {
        margin-top: 0;
        margin-bottom: var(--space-md);
    }
    
    .matrix-box {
        padding: 1.5rem 1rem;
    }
    
    .matrix-background {
        padding: 0.75rem 0.25rem;
    }
    
    .matrix-word {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }
    
    .metric-narrative {
        font-size: 0.85rem;
        margin-top: 0.75rem;
    }
    
    .thank-you-word {
        font-size: clamp(1.75rem, 7vw, 3rem);
        margin-bottom: var(--space-sm);
    }
    
    .summary-text {
        font-size: clamp(0.8rem, 1.5vw, 0.95rem);
        margin-bottom: var(--space-md);
    }
    
    .summary-links {
        margin-top: var(--space-md);
    }
    
    .npm-logo {
        width: clamp(80px, 15vw, 120px);
    }
    
    .section-nav-arrow {
        width: 36px;
        height: 36px;
        bottom: 0.75rem;
    }
    
    .section-nav-up {
        top: 0.75rem;
    }
}

/* ========================================
   Utility Classes
   ======================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
