/* ===========================
   prototype.quest - Styles
   Light-academia prototype workshop
   =========================== */

:root {
    --deep-charcoal: #1a202c;
    --slate: #2d3748;
    --cool-gray: #4a5568;
    --silver-mist: #a0aec0;
    --pale-fog: #edf2f7;
    --warm-paper: #f7f5f0;
    --blueprint: #5a7fa0;
    --amber: #d4a853;
    --copper: #b87333;
    --steel-light: #b0b8c1;
    --annotation: #90a4ae;
}

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

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

body {
    font-family: 'Source Serif 4', Georgia, serif;
    color: var(--cool-gray);
    background: var(--pale-fog);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === Stage Indicator === */
.stage-indicator {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stage-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--cool-gray);
    background: transparent;
    transition: background-color 0.5s ease, border-color 0.5s ease;
    cursor: pointer;
}

.stage-dot.active {
    background-color: var(--cool-gray);
}

.stage-dot.amber-active {
    background-color: var(--amber);
    border-color: var(--amber);
}

/* === Workshop Stations === */
.workshop-station {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

.station-concept {
    background: var(--pale-fog);
}

.station-sketch {
    background: var(--warm-paper);
}

.station-structure {
    background: var(--deep-charcoal);
}

.station-refine {
    background: var(--pale-fog);
}

.station-prototype {
    background: var(--deep-charcoal);
}

/* === Blueprint Grid === */
.blueprint-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(160,174,192,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(160,174,192,0.08) 1px, transparent 1px),
        linear-gradient(rgba(160,174,192,0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(160,174,192,0.12) 1px, transparent 1px);
    background-size:
        40px 40px,
        40px 40px,
        200px 200px,
        200px 200px;
    z-index: 1;
}

.blueprint-grid-warm {
    background-image:
        linear-gradient(rgba(160,174,192,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(160,174,192,0.06) 1px, transparent 1px),
        linear-gradient(rgba(160,174,192,0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(160,174,192,0.1) 1px, transparent 1px);
    background-size:
        40px 40px,
        40px 40px,
        200px 200px,
        200px 200px;
}

/* === Parallax Layers === */
.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.parallax-mid {
    pointer-events: auto;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.parallax-bg {
    z-index: 1;
}

.parallax-fg {
    z-index: 2;
}

/* === Particle Canvas === */
.particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

/* === Dashed Construction Lines === */
.dashed-line {
    position: absolute;
    pointer-events: none;
}

.dashed-h {
    height: 1px;
    background-image: linear-gradient(to right, rgba(160,174,192,0.1) 8px, transparent 8px);
    background-size: 12px 1px;
}

.dashed-v {
    width: 1px;
    background-image: linear-gradient(to bottom, rgba(160,174,192,0.1) 8px, transparent 8px);
    background-size: 1px 12px;
}

.dashed-light.dashed-h {
    background-image: linear-gradient(to right, rgba(160,174,192,0.06) 8px, transparent 8px);
}

.dashed-light.dashed-v {
    background-image: linear-gradient(to bottom, rgba(160,174,192,0.06) 8px, transparent 8px);
}

/* === Section Ghost Numbers === */
.section-ghost-number {
    position: absolute;
    font-family: 'Archivo Black', sans-serif;
    font-size: 12vw;
    color: var(--slate);
    opacity: 0.04;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    line-height: 1;
    user-select: none;
}

.ghost-dark {
    color: var(--pale-fog);
    opacity: 0.05;
}

.ghost-amber {
    color: var(--amber);
    opacity: 0.06;
}

/* === Annotation Floats === */
.annotation-float {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--annotation);
    opacity: 0.5;
    position: absolute;
    pointer-events: none;
}

.annotation-float-light {
    color: var(--annotation);
    opacity: 0.35;
}

/* === Content Layout === */
.content-golden {
    width: 75vw;
    max-width: 1200px;
    display: flex;
    gap: 3rem;
    padding: 2rem;
    position: relative;
    z-index: 5;
}

.content-major {
    flex: 1.618;
    max-width: 640px;
}

.content-minor {
    flex: 1;
}

.content-centered {
    text-align: center;
    max-width: 580px;
    padding: 2rem;
    position: relative;
    z-index: 5;
}

.content-final {
    max-width: 700px;
}

/* === Typography === */
.station-title {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(4rem, 10vw, 7rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--slate);
    line-height: 1.05;
    margin-bottom: 1.5rem;
}

.station-title-amber {
    color: var(--amber);
}

.station-subtitle {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--slate);
    line-height: 1.1;
    margin-bottom: 2rem;
}

.station-subtitle-light {
    color: var(--pale-fog);
}

.station-subtitle-offset {
    position: absolute;
    top: 10%;
    left: 8%;
    z-index: 5;
}

.station-tagline {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.05rem, 1.4vw, 1.25rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: var(--cool-gray);
    max-width: 580px;
}

.station-tagline-light {
    color: #e2e8f0;
}

.station-body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: var(--cool-gray);
    margin-bottom: 1.5rem;
    max-width: 640px;
}

.station-body-light {
    color: #e2e8f0;
}

/* === DM Sans Sub-headlines === */
h3 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    letter-spacing: 0.06em;
    color: var(--cool-gray);
}

/* === Annotation Sidebar === */
.annotation-sidebar {
    padding: 1.5rem 0;
    border-left: 1px solid rgba(160,174,192,0.2);
    padding-left: 1.5rem;
    margin-top: 2rem;
}

.annotation-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--annotation);
    opacity: 0.5;
    line-height: 1.8;
    margin-bottom: 1.2rem;
}

/* === Section SVGs === */
.section-svg {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.svg-sphere {
    right: 5%;
    top: 10%;
    width: 38.2%;
    max-width: 450px;
    opacity: 0.2;
}

.svg-linkage {
    left: 55%;
    top: 15%;
    width: 40%;
    max-width: 500px;
    opacity: 0.2;
}

.svg-floorplan {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    max-width: 800px;
    opacity: 0.25;
}

.svg-topo {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    max-width: 700px;
    opacity: 0.2;
    z-index: 1;
}

.svg-wireframe {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    max-width: 600px;
    opacity: 0.25;
    animation: wireframe-sway 10s ease-in-out infinite;
}

/* === Linkage Animation === */
.linkage-group {
    transform-origin: 225px 160px;
    animation: linkage-sway 6s ease-in-out infinite;
}

@keyframes linkage-sway {
    0%, 100% { transform: rotate(-1.5deg); }
    50% { transform: rotate(1.5deg); }
}

/* === Wireframe 3D Sway === */
@keyframes wireframe-sway {
    0%, 100% { transform: translate(-50%, -50%) perspective(800px) rotateY(-2deg); }
    50% { transform: translate(-50%, -50%) perspective(800px) rotateY(2deg); }
}

/* === Refine Cards === */
.refine-cards {
    display: flex;
    gap: 2rem;
    padding: 0 8%;
    position: relative;
    z-index: 5;
    margin-top: 8vh;
    flex-wrap: wrap;
    justify-content: center;
}

.refine-card {
    width: 240px;
    min-height: 180px;
    background: var(--warm-paper);
    padding: 1.8rem 1.5rem;
    position: relative;
    box-shadow: 0 2px 20px rgba(0,0,0,0.04);
}

.refine-card:nth-child(1) {
    transform: translateY(0);
}

.refine-card:nth-child(2) {
    transform: translateY(30px);
}

.refine-card:nth-child(3) {
    transform: translateY(60px);
}

.card-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.72;
    color: var(--cool-gray);
}

/* === Corner Brackets === */
.corner-bracket {
    position: absolute;
    width: 8px;
    height: 8px;
    pointer-events: none;
}

.corner-tl {
    top: 6px;
    left: 6px;
    border-top: 1px solid var(--silver-mist);
    border-left: 1px solid var(--silver-mist);
}

.corner-tr {
    top: 6px;
    right: 6px;
    border-top: 1px solid var(--silver-mist);
    border-right: 1px solid var(--silver-mist);
}

.corner-bl {
    bottom: 6px;
    left: 6px;
    border-bottom: 1px solid var(--silver-mist);
    border-left: 1px solid var(--silver-mist);
}

.corner-br {
    bottom: 6px;
    right: 6px;
    border-bottom: 1px solid var(--silver-mist);
    border-right: 1px solid var(--silver-mist);
}

/* === Section Transitions === */
.section-transition {
    position: relative;
    height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(
        to bottom,
        var(--pale-fog) 0%,
        var(--warm-paper) 50%,
        var(--pale-fog) 100%
    );
}

.transition-svg {
    width: 100%;
    height: 80px;
}

.transition-line {
    transition: opacity 0.3s ease;
}

.transition-detail {
    transition: opacity 0.6s ease;
}

/* Dark-to-light transitions */
#transition12 {
    background: linear-gradient(
        to bottom,
        var(--warm-paper) 0%,
        var(--pale-fog) 100%
    );
}

#transition23 {
    background: linear-gradient(
        to bottom,
        var(--deep-charcoal) 0%,
        rgba(26,32,44,0.5) 30%,
        var(--pale-fog) 70%,
        var(--pale-fog) 100%
    );
}

#transition34 {
    background: linear-gradient(
        to bottom,
        var(--pale-fog) 0%,
        rgba(26,32,44,0.3) 50%,
        var(--deep-charcoal) 100%
    );
}

/* === Zoom Focus Animation === */
.zoom-focus {
    opacity: 0;
    transform: scale(1.15);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.zoom-focus.visible {
    opacity: 1;
    transform: scale(1);
}

/* Staggered content blocks in section 2 */
.station-sketch .station-body.zoom-focus:nth-of-type(2) {
    transition-delay: 0.2s;
}

/* Staggered cards */
.refine-card.zoom-focus {
    transition-delay: var(--card-delay, 0ms);
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    .zoom-focus {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .linkage-group {
        animation: none;
    }

    .svg-wireframe {
        animation: none;
    }

    .particle-canvas {
        display: none;
    }
}

/* === Responsive === */
@media (max-width: 768px) {
    .stage-indicator {
        right: 12px;
    }

    .stage-dot {
        width: 8px;
        height: 8px;
    }

    .content-golden {
        flex-direction: column;
        width: 90vw;
        gap: 1.5rem;
    }

    .content-minor {
        margin-top: 1rem;
    }

    .refine-cards {
        flex-direction: column;
        align-items: center;
        padding: 0 5%;
    }

    .refine-card {
        width: 90%;
        max-width: 300px;
    }

    .refine-card:nth-child(1),
    .refine-card:nth-child(2),
    .refine-card:nth-child(3) {
        transform: translateY(0);
    }

    .station-subtitle-offset {
        position: relative;
        top: auto;
        left: auto;
        text-align: center;
        padding-top: 10vh;
    }

    .svg-sphere {
        width: 60%;
        opacity: 0.12;
    }

    .svg-linkage {
        width: 60%;
        left: 20%;
        opacity: 0.12;
    }

    .section-ghost-number {
        font-size: 20vw;
    }
}
