/* layer2.quest - Frutiger Aero Layer 2 Design */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: "Cormorant Garamond", Georgia, serif;
    color: #2d3436;
    background: linear-gradient(170deg, #f0f7f4 0%, #a8edea 30%, #fed6e3 60%, #f0f7f4 100%);
    background-attachment: fixed;
    line-height: 1.6;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* Section Layout */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: clamp(4rem, 8vh, 8rem) clamp(1rem, 4vw, 4rem);
    position: relative;
}

/* Gradient Divider Lines */
.section-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #74ebd5 50%, transparent 100%);
}

.gradient-divider {
    width: clamp(60px, 12vw, 160px);
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #74ebd5 50%, transparent 100%);
    margin: 1.5rem auto;
}

.gradient-divider-wide {
    width: clamp(100px, 20vw, 300px);
}

/* Glass Panel Component */
.glass-panel {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-radius: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px rgba(116, 235, 213, 0.12);
    padding: clamp(2rem, 4vw, 4rem);
}

/* Typography */
.domain-title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 600;
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 12px rgba(116, 235, 213, 0.25), 0 0 40px rgba(168, 237, 234, 0.15);
    color: #2d3436;
    text-align: center;
}

.subtitle {
    font-size: clamp(0.875rem, 1.1vw, 1rem);
    color: #636e72;
    text-align: center;
}

.label {
    font-family: "Lato", sans-serif;
    font-weight: 300;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: clamp(0.75rem, 1vw, 0.875rem);
    color: #636e72;
}

h2, h3 {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 600;
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1.1;
    color: #2d3436;
}

p {
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.6;
    max-width: 72ch;
    color: #2d3436;
}

/* Section 0 - Substrate */
#section-substrate {
    overflow: hidden;
}

.watermark-2 {
    position: absolute;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 700;
    font-size: clamp(30rem, 60vw, 60rem);
    line-height: 1;
    color: rgba(168, 237, 234, 0.05);
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

#section-substrate .reveal {
    position: relative;
    z-index: 1;
    text-align: center;
}

/* Section 1 - Throughput Chart */
.chart-container {
    width: 90vw;
    max-width: 1200px;
    margin-bottom: 2rem;
}

#throughput-chart {
    width: 100%;
    height: auto;
}

.chart-label {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: 14px;
    fill: #636e72;
}

.chart-label-y {
    text-anchor: end;
}

.chart-caption {
    max-width: 72ch;
    text-align: center;
}

.chart-caption p {
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    color: #636e72;
    font-style: italic;
    font-weight: 300;
}

/* Section 2 - Proof Architecture */
.proof-stack {
    position: relative;
    width: min(90vw, 700px);
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.proof-card {
    position: absolute;
    width: 100%;
    max-width: 600px;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.proof-card .label {
    display: block;
    margin-bottom: 1rem;
    color: #74ebd5;
    font-weight: 700;
}

.proof-card p {
    font-size: clamp(0.9rem, 1.1vw, 1.1rem);
}

.proof-card-back {
    transform: translateY(-40px) translateX(20px) scale(0.92);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    background: rgba(168, 237, 234, 0.25);
    z-index: 1;
}

.proof-card-mid {
    transform: translateY(-20px) translateX(10px) scale(0.96);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    background: rgba(255, 255, 255, 0.45);
    z-index: 2;
}

.proof-card-front {
    transform: translateY(0) translateX(0) scale(1);
    backdrop-filter: blur(8px) saturate(1.4);
    -webkit-backdrop-filter: blur(8px) saturate(1.4);
    z-index: 3;
}

/* Section 3 - Ecosystem Map */
.ecosystem-container {
    width: 90vw;
    max-width: 1000px;
}

#ecosystem-map {
    width: 100%;
    height: auto;
}

.node-label {
    font-family: "Lato", sans-serif;
    font-size: 12px;
    font-weight: 400;
    fill: #2d3436;
    text-anchor: middle;
    letter-spacing: 0.02em;
}

.node-label-primary {
    font-size: 14px;
    font-weight: 700;
}

.node-label-sm {
    font-size: 11px;
    font-weight: 300;
}

/* Node pulse animations */
@keyframes nodePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.node-pulse { animation: nodePulse 8s ease-in-out infinite; }
.node-pulse-delay-1 { animation: nodePulse 8s ease-in-out 2s infinite; }
.node-pulse-delay-2 { animation: nodePulse 8s ease-in-out 4s infinite; }
.node-pulse-delay-3 { animation: nodePulse 8s ease-in-out 6s infinite; }

/* Section 4 - Horizon */
#section-horizon {
    overflow: hidden;
}

.horizon-content {
    text-align: center;
    z-index: 1;
    position: relative;
}

.large-numeral {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(15rem, 40vw, 30rem);
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(170deg, #a8edea, #fed6e3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 24px rgba(116, 235, 213, 0.3));
}

.closing-statement {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(1.1rem, 1.5vw, 1.5rem);
    font-weight: 300;
    font-style: italic;
    color: #636e72;
    text-align: center;
}

.closing-statement em {
    font-style: italic;
}

/* Sparklines */
.sparkline {
    position: absolute;
    width: clamp(100px, 20vw, 250px);
    height: 40px;
    bottom: 20%;
}

.sparkline-left {
    left: 5%;
}

.sparkline-right {
    right: 5%;
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(2rem);
    transition: opacity 1.2s cubic-bezier(0.23, 1, 0.32, 1), transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .proof-stack {
        min-height: 600px;
    }

    .proof-card-back {
        transform: translateY(-30px) translateX(10px) scale(0.94);
    }

    .proof-card-mid {
        transform: translateY(-15px) translateX(5px) scale(0.97);
    }

    .sparkline {
        display: none;
    }
}

@media (max-width: 480px) {
    .proof-stack {
        min-height: 500px;
    }

    .proof-card {
        max-width: 100%;
    }

    .chart-container {
        width: 95vw;
    }
}

/* Additional accent colors */
.glass-panel:hover {
    box-shadow: 0 8px 32px rgba(116, 235, 213, 0.12), 0 0 20px rgba(255, 236, 210, 0.15);
}

.proof-card .label {
    text-shadow: 0 0 20px rgba(255, 154, 158, 0.2);
}

/* Subtle warm glow for glass surfaces - uses #ffecd2 accent */
.glass-panel::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 236, 210, 0.08), transparent 60%);
    pointer-events: none;
}

.glass-panel {
    position: relative;
}

/* Retro Coral accent - #ff9a9e */
.proof-card-front .label {
    color: #ff9a9e;
}

/* Lavender Circuit accent - #acb6e5 */
.ecosystem-container {
    filter: drop-shadow(0 0 40px rgba(172, 182, 229, 0.1));
}

#section-ecosystem::before {
    content: "";
    position: absolute;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(172, 182, 229, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
