/* ============================================
   prototype.report - Y2K Futurism x Vintage Patina
   ============================================ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.65;
    color: #5C4F4A;
    background-color: #F5EDE3;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Palette Variables --- */
:root {
    --bg-parchment: #F5EDE3;
    --surface-linen: #EDE4D8;
    --text-chocolate: #3B2F2F;
    --text-taupe: #5C4F4A;
    --text-stone: #8A7B72;
    --accent-rose: #C4918A;
    --accent-teal: #7BA4A8;
    --accent-gold: #C9A96E;
    --deco-cream: #E8D5C0;
    --shadow-sepia: #D4C4B0;
    --polaroid-border: #EDE4D8;
}

/* --- Typography --- */
h1, h2, .section-title, .hero-title, .closing-title {
    font-family: 'Abril Fatface', serif;
    color: var(--text-chocolate);
    letter-spacing: -0.02em;
}

.card-spec, .spec-label, .timeline-date, .card-back-content {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    letter-spacing: 0.04em;
    color: var(--text-stone);
}

/* --- Sections --- */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    z-index: 2;
}

.section-hero { background-color: #F5EDE3; }
.section-gallery { background-color: #F2E8DB; }
.section-timeline { background-color: #EDE4D8; }
.section-showcase { background-color: #F0E7DD; }
.section-archive { background-color: #F5EDE3; }
.section-closing { background-color: #EBE0D3; }

.section-title {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    margin-bottom: 60px;
    text-align: center;
}

/* --- Parallax Background Layer (Lane 1) --- */
.parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    will-change: transform;
}

.starburst-bg {
    position: absolute;
}

.starburst-bg-1 {
    width: 300px;
    height: 300px;
    top: 5%;
    left: 8%;
}

.starburst-bg-2 {
    width: 220px;
    height: 220px;
    top: 25%;
    right: 5%;
}

.starburst-bg-3 {
    width: 180px;
    height: 180px;
    top: 55%;
    left: 15%;
}

.starburst-bg-4 {
    width: 260px;
    height: 260px;
    top: 75%;
    right: 12%;
}

.starburst-bg-5 {
    width: 200px;
    height: 200px;
    top: 130%;
    left: 5%;
}

.orbital-ring {
    position: absolute;
}

.orbital-ring-1 {
    width: 500px;
    height: 250px;
    top: 15%;
    left: 50%;
    transform: translateX(-50%) rotate(-15deg);
}

.orbital-ring-2 {
    width: 400px;
    height: 300px;
    top: 60%;
    right: -5%;
}

.orbital-ring-3 {
    width: 450px;
    height: 200px;
    top: 110%;
    left: -5%;
    transform: rotate(10deg);
}

/* --- Parallax Foreground Layer (Lane 3) --- */
.parallax-fg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    will-change: transform;
}

.twinkle {
    position: absolute;
    width: 16px;
    height: 16px;
}

.twinkle-1 { top: 8%; left: 12%; }
.twinkle-2 { top: 15%; right: 20%; width: 12px; height: 12px; }
.twinkle-3 { top: 30%; left: 70%; width: 18px; height: 18px; }
.twinkle-4 { top: 42%; left: 5%; width: 14px; height: 14px; }
.twinkle-5 { top: 55%; right: 8%; width: 10px; height: 10px; }
.twinkle-6 { top: 68%; left: 25%; width: 16px; height: 16px; }
.twinkle-7 { top: 78%; right: 30%; width: 14px; height: 14px; }
.twinkle-8 { top: 88%; left: 60%; width: 12px; height: 12px; }
.twinkle-9 { top: 95%; left: 15%; width: 18px; height: 18px; }
.twinkle-10 { top: 105%; right: 15%; width: 10px; height: 10px; }

/* Chrome Bubbles */
.chrome-bubble {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffffff, var(--shadow-sepia));
    opacity: 0.4;
}

.chrome-bubble::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ffffff;
    top: 4px;
    left: 5px;
}

.chrome-bubble-1 { top: 12%; left: 85%; width: 18px; height: 18px; }
.chrome-bubble-2 { top: 35%; left: 3%; width: 22px; height: 22px; }
.chrome-bubble-3 { top: 50%; right: 15%; width: 16px; height: 16px; }
.chrome-bubble-4 { top: 72%; left: 40%; width: 24px; height: 24px; }
.chrome-bubble-5 { top: 82%; right: 5%; width: 18px; height: 18px; }
.chrome-bubble-6 { top: 92%; left: 55%; width: 20px; height: 20px; }

/* --- Scroll-to-top Button --- */
.scroll-top-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.4s ease;
    padding: 8px;
}

.scroll-top-btn.visible {
    opacity: 0.7;
}

.scroll-top-btn:hover {
    opacity: 1;
    transform: scale(1.15);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* --- Hero Section --- */
.section-hero {
    position: relative;
    overflow: hidden;
}

.hero-starburst-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.hero-starburst {
    position: absolute;
}

.hero-starburst-primary {
    width: min(80vw, 600px);
    height: min(80vw, 600px);
    animation: rotate 120s linear infinite;
}

.hero-starburst-secondary {
    width: min(60vw, 450px);
    height: min(60vw, 450px);
    animation: rotate 80s linear infinite reverse;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-content {
    position: relative;
    z-index: 5;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 1.05;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-title-line {
    display: block;
    opacity: 0;
}

.hero-title-line.animated {
    animation: none;
}

.hero-title-line .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hero-title-line .char.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Polaroid Frames --- */
.polaroid-frame {
    border-radius: 6px;
    border: 8px solid var(--polaroid-border);
    border-bottom: 32px solid var(--polaroid-border);
    box-shadow: 4px 6px 20px rgba(60, 47, 40, 0.15);
    overflow: hidden;
    background: var(--polaroid-border);
}

.polaroid-inner {
    width: 100%;
    height: 100%;
    min-height: 200px;
    background: linear-gradient(135deg, var(--accent-rose), var(--accent-teal));
    filter: sepia(0.2) saturate(0.7) contrast(0.95) brightness(1.05);
    position: relative;
}

.polaroid-inner::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 30%;
    width: 40%;
    height: 40%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.15), transparent);
}

.hero-polaroid {
    transform: rotate(-2deg);
}

.hero-polaroid .polaroid-frame {
    width: 280px;
}

.hero-polaroid .polaroid-inner {
    min-height: 200px;
    background: linear-gradient(160deg, var(--accent-rose) 0%, var(--accent-teal) 60%, var(--accent-gold) 100%);
}

.polaroid-tilt-left {
    transform: rotate(-3deg);
}

.polaroid-tilt-right {
    transform: rotate(2deg);
}

/* Polaroid Variants */
.polaroid-variant-1 {
    background: linear-gradient(120deg, var(--accent-rose), #7BA4A8 60%, var(--deco-cream)) !important;
}

.polaroid-variant-2 {
    background: linear-gradient(200deg, var(--accent-teal), var(--accent-gold) 50%, var(--accent-rose)) !important;
}

.polaroid-variant-3 {
    background: linear-gradient(45deg, var(--accent-gold), var(--accent-rose) 40%, var(--accent-teal)) !important;
}

.polaroid-variant-showcase {
    min-height: 320px;
    background: linear-gradient(135deg, var(--accent-teal) 0%, var(--accent-rose) 40%, var(--accent-gold) 70%, var(--deco-cream) 100%) !important;
}

.polaroid-variant-showcase::before {
    content: '';
    position: absolute;
    top: 10%;
    right: 15%;
    width: 50%;
    height: 50%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 169, 110, 0.3), transparent);
}

/* Archive Thumbnails */
.polaroid-thumb {
    width: 140px;
}

.polaroid-thumb .polaroid-inner {
    min-height: 100px;
}

.polaroid-thumb-1 { background: linear-gradient(135deg, #C4918A, #D4C4B0) !important; }
.polaroid-thumb-1 .polaroid-inner { background: linear-gradient(135deg, #C4918A, #D4C4B0) !important; }
.polaroid-thumb-2 { background: linear-gradient(135deg, #7BA4A8, #E8D5C0) !important; }
.polaroid-thumb-2 .polaroid-inner { background: linear-gradient(135deg, #7BA4A8, #E8D5C0) !important; }
.polaroid-thumb-3 { background: linear-gradient(135deg, #C9A96E, #C4918A) !important; }
.polaroid-thumb-3 .polaroid-inner { background: linear-gradient(135deg, #C9A96E, #C4918A) !important; }
.polaroid-thumb-4 { background: linear-gradient(135deg, #D4C4B0, #7BA4A8) !important; }
.polaroid-thumb-4 .polaroid-inner { background: linear-gradient(135deg, #D4C4B0, #7BA4A8) !important; }
.polaroid-thumb-5 { background: linear-gradient(200deg, #C4918A, #C9A96E) !important; }
.polaroid-thumb-5 .polaroid-inner { background: linear-gradient(200deg, #C4918A, #C9A96E) !important; }
.polaroid-thumb-6 { background: linear-gradient(45deg, #7BA4A8, #C4918A) !important; }
.polaroid-thumb-6 .polaroid-inner { background: linear-gradient(45deg, #7BA4A8, #C4918A) !important; }
.polaroid-thumb-7 { background: linear-gradient(160deg, #C9A96E, #7BA4A8) !important; }
.polaroid-thumb-7 .polaroid-inner { background: linear-gradient(160deg, #C9A96E, #7BA4A8) !important; }
.polaroid-thumb-8 { background: linear-gradient(90deg, #C4918A, #D4C4B0) !important; }
.polaroid-thumb-8 .polaroid-inner { background: linear-gradient(90deg, #C4918A, #D4C4B0) !important; }

/* --- Flip Cards --- */
.flip-card {
    perspective: 1200px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.7s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner,
.flip-card.is-flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-front {
    transform: translateZ(1px);
}

.card-back {
    transform: rotateY(180deg) translateZ(1px);
    background: var(--surface-linen);
    border-radius: 8px;
    border: 1px solid var(--text-stone);
    padding: 24px;
}

.card-label {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-taupe);
    margin-top: 12px;
}

.card-back-content {
    width: 100%;
}

.card-back-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--text-stone);
}

.card-back-title {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    color: var(--text-chocolate);
    letter-spacing: 0.04em;
}

.card-spec {
    margin-bottom: 8px;
    line-height: 1.5;
}

.spec-label {
    color: var(--accent-gold);
    font-weight: 400;
}

/* --- Gallery Section --- */
.gallery-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    max-width: 1200px;
    width: 100%;
    flex-wrap: wrap;
}

.flip-card-1,
.flip-card-2,
.flip-card-3 {
    width: 260px;
    height: 360px;
}

.flip-card-1 .polaroid-frame,
.flip-card-2 .polaroid-frame,
.flip-card-3 .polaroid-frame {
    width: 220px;
}

.flip-card-1 .polaroid-inner,
.flip-card-2 .polaroid-inner,
.flip-card-3 .polaroid-inner {
    min-height: 180px;
}

/* --- Timeline Section --- */
.section-timeline {
    padding-top: 100px;
    padding-bottom: 100px;
}

.timeline-container {
    position: relative;
    max-width: 800px;
    width: 100%;
    padding: 0 20px;
}

.timeline-ribbon {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--accent-gold) 10%, var(--accent-gold) 90%, transparent);
    transform: translateX(-50%);
}

.timeline-node {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 60px;
    padding-left: calc(50% + 30px);
}

.timeline-node-right {
    padding-left: 0;
    padding-right: calc(50% + 30px);
    flex-direction: row-reverse;
    text-align: right;
}

.timeline-star {
    position: absolute;
    left: 50%;
    top: 5px;
    transform: translateX(-50%);
    z-index: 3;
}

.timeline-content {
    max-width: 300px;
}

.timeline-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    color: var(--accent-gold);
    letter-spacing: 0.06em;
    display: block;
    margin-bottom: 8px;
}

.timeline-text {
    font-family: 'Work Sans', sans-serif;
    font-size: clamp(0.9rem, 1.6vw, 1rem);
    color: var(--text-taupe);
    line-height: 1.6;
}

/* --- Showcase Section --- */
.showcase-container {
    display: flex;
    justify-content: center;
    max-width: 1200px;
    width: 100%;
}

.flip-card-showcase {
    width: 450px;
    height: 480px;
}

.polaroid-large {
    width: 400px;
}

/* Blueprint diagram on back */
.card-back-blueprint {
    position: relative;
}

.blueprint-diagram {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 16px auto 20px;
}

.blueprint-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--text-stone);
}

.blueprint-circle-outer {
    width: 160px;
    height: 160px;
    top: 0;
    left: 0;
}

.blueprint-circle-mid {
    width: 100px;
    height: 100px;
    top: 30px;
    left: 30px;
}

.blueprint-circle-inner {
    width: 40px;
    height: 40px;
    top: 60px;
    left: 60px;
    background: radial-gradient(circle, var(--accent-gold) 0%, transparent 70%);
    opacity: 0.4;
}

.blueprint-line {
    position: absolute;
    background: var(--text-stone);
    opacity: 0.4;
}

.blueprint-line-h {
    width: 160px;
    height: 1px;
    top: 80px;
    left: 0;
}

.blueprint-line-v {
    width: 1px;
    height: 160px;
    top: 0;
    left: 80px;
}

.blueprint-line-d1 {
    width: 226px;
    height: 1px;
    top: 80px;
    left: -33px;
    transform: rotate(45deg);
    transform-origin: center;
}

.blueprint-line-d2 {
    width: 226px;
    height: 1px;
    top: 80px;
    left: -33px;
    transform: rotate(-45deg);
    transform-origin: center;
}

.blueprint-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-gold);
}

.blueprint-dot-1 { top: 0; left: 77px; }
.blueprint-dot-2 { top: 77px; right: 0; }
.blueprint-dot-3 { bottom: 0; left: 77px; }
.blueprint-dot-4 { top: 77px; left: 0; }

/* --- Archive Strip --- */
.section-archive {
    min-height: 80vh;
}

.archive-strip {
    width: 100%;
    max-width: 1200px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 20px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--shadow-sepia) transparent;
}

.archive-strip::-webkit-scrollbar {
    height: 6px;
}

.archive-strip::-webkit-scrollbar-track {
    background: transparent;
}

.archive-strip::-webkit-scrollbar-thumb {
    background-color: var(--shadow-sepia);
    border-radius: 3px;
}

.archive-track {
    display: flex;
    gap: 24px;
    padding: 10px 24px;
    width: max-content;
}

.archive-thumb {
    width: 160px;
    height: 200px;
    flex-shrink: 0;
}

.archive-thumb .card-back {
    padding: 16px;
}

.card-back-mini {
    text-align: center;
}

.card-back-mini .card-back-title {
    display: block;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--text-chocolate);
}

/* --- Closing Section --- */
.section-closing {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.closing-starburst {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(90vw, 700px);
    height: min(90vw, 700px);
    pointer-events: none;
    animation: rotate 150s linear infinite;
}

.closing-content {
    position: relative;
    z-index: 5;
    max-width: 600px;
}

.closing-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.25;
    margin-bottom: 24px;
}

.closing-text {
    font-family: 'Work Sans', sans-serif;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: var(--text-taupe);
    line-height: 1.7;
    margin-bottom: 40px;
}

.closing-star {
    margin-bottom: 24px;
}

.closing-domain {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.8rem, 1.4vw, 1rem);
    color: var(--text-stone);
    letter-spacing: 0.08em;
}

/* --- Reveal Animations --- */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* --- Hover Interactions --- */
.twinkle {
    transition: transform 0.3s ease;
}

.flip-card {
    transition: transform 0.2s ease;
}

/* Star pulse on hover for timeline stars */
.timeline-star svg {
    transition: transform 0.3s ease;
}

.timeline-node:hover .timeline-star svg {
    transform: scale(1.2);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .gallery-container {
        flex-direction: column;
        align-items: center;
        gap: 50px;
    }

    .flip-card-1,
    .flip-card-2,
    .flip-card-3 {
        width: 280px;
        height: 380px;
    }

    .flip-card-showcase {
        width: 320px;
        height: 440px;
    }

    .polaroid-large {
        width: 280px;
    }

    .polaroid-variant-showcase {
        min-height: 240px;
    }

    .timeline-ribbon {
        left: 20px;
    }

    .timeline-node {
        padding-left: 60px;
    }

    .timeline-node-right {
        padding-left: 60px;
        padding-right: 0;
        flex-direction: row;
        text-align: left;
    }

    .timeline-star {
        left: 20px;
        transform: translateX(-50%);
    }
}

@media (max-width: 600px) {
    .section {
        padding: 60px 16px;
    }

    .hero-polaroid .polaroid-frame {
        width: 220px;
    }

    .hero-polaroid .polaroid-inner {
        min-height: 160px;
    }

    .flip-card-1,
    .flip-card-2,
    .flip-card-3 {
        width: 260px;
        height: 360px;
    }

    .flip-card-1 .polaroid-frame,
    .flip-card-2 .polaroid-frame,
    .flip-card-3 .polaroid-frame {
        width: 200px;
    }

    .flip-card-showcase {
        width: 280px;
        height: 400px;
    }

    .polaroid-large {
        width: 240px;
    }

    .archive-thumb {
        width: 140px;
        height: 180px;
    }

    .polaroid-thumb {
        width: 120px;
    }

    .polaroid-thumb .polaroid-inner {
        min-height: 80px;
    }

    .starburst-bg-1 { width: 200px; height: 200px; }
    .starburst-bg-2 { width: 150px; height: 150px; }
    .starburst-bg-3 { width: 120px; height: 120px; }
    .starburst-bg-4 { width: 180px; height: 180px; }
    .orbital-ring-1 { width: 300px; height: 150px; }
    .orbital-ring-2 { width: 250px; height: 180px; }
}