/* ========================================
   prototype.quest — styles.css
   Monochrome glassmorphic immersive scroll
   ======================================== */

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

html {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

html::-webkit-scrollbar {
    width: 6px;
}

html::-webkit-scrollbar-track {
    background: transparent;
}

html::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}

body {
    background: #0a0a0a;
    color: #e8e8e8;
    margin: 0;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

main {
    position: relative;
}

/* ========================================
   Acts (Sections)
   ======================================== */
.act {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Glass Card System
   ======================================== */
.glass-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    padding: 2.5rem;
    max-width: 72ch;
}

/* ========================================
   Floating Elements
   ======================================== */
.floating-elements-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    contain: layout style paint;
    overflow: hidden;
}

.floating-el {
    position: absolute;
    pointer-events: none;
    will-change: transform;
}

.floating-el--circle {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
}

.floating-el--line {
    width: 40px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.floating-el--square {
    width: 10px;
    height: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes floatDrift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(var(--fx, 20px), var(--fy, -30px)) rotate(var(--fr, 5deg)); }
    50% { transform: translate(var(--fx2, -15px), var(--fy2, 25px)) rotate(var(--fr2, -8deg)); }
    75% { transform: translate(var(--fx3, 10px), var(--fy3, -15px)) rotate(var(--fr3, 3deg)); }
}

/* ========================================
   Annotations
   ======================================== */
.annotation {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #888888;
    opacity: 0.5;
    display: block;
    margin-bottom: 1rem;
}

/* ========================================
   ACT I — The Question
   ======================================== */
#act-1 {
    min-height: 100vh;
    flex-direction: column;
    background: #0a0a0a;
}

.hero-word {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(5rem, 14vw, 12rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.12);
    white-space: nowrap;
    z-index: 2;
    user-select: none;
}

.hero-char {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.hero-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) perspective(800px) rotateY(0deg) rotateX(0deg);
    width: 320px;
    height: 200px;
    z-index: 1;
    animation: heroCardSpin 30s linear infinite;
}

@keyframes heroCardSpin {
    0% { transform: translate(-50%, -50%) perspective(800px) rotateY(0deg) rotateX(5deg); }
    50% { transform: translate(-50%, -50%) perspective(800px) rotateY(180deg) rotateX(-5deg); }
    100% { transform: translate(-50%, -50%) perspective(800px) rotateY(360deg) rotateX(5deg); }
}

.hero-question {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Source Sans 3', sans-serif;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    font-weight: 300;
    color: #e8e8e8;
    text-align: center;
    opacity: 0;
    z-index: 3;
    max-width: 50ch;
    transition: opacity 0.8s ease;
}

/* ========================================
   ACT II — The Material
   ======================================== */
#act-2 {
    min-height: 100vh;
    background: linear-gradient(to bottom, #0a0a0a, #1a1a1a);
}

.material-cards {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    padding: 2rem;
    z-index: 1;
}

.material-card {
    transform: translateX(-100px) rotate(var(--card-tilt, 0deg));
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s ease;
    max-width: 520px;
}

.material-card.visible {
    transform: translateX(0) rotate(var(--card-tilt, 0deg));
    opacity: 1;
}

.card-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #e8e8e8;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.card-body {
    font-family: 'Source Sans 3', sans-serif;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    font-weight: 300;
    line-height: 1.72;
    color: #e8e8e8;
}

/* ========================================
   ACT III — The Process
   ======================================== */
#act-3 {
    min-height: 150vh;
    flex-direction: column;
    background: #1a1a1a;
    padding: 10vh 0;
}

.timeline-svg {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 90%;
    z-index: 1;
}

.timeline-line {
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 1;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 0.1s linear;
}

.timeline-nodes {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6rem;
    width: 100%;
    max-width: 900px;
    padding: 4rem 2rem;
}

.timeline-node {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    position: relative;
}

.node-left {
    flex-direction: row;
    justify-content: flex-end;
    padding-right: calc(50% + 2rem);
}

.node-right {
    flex-direction: row-reverse;
    justify-content: flex-end;
    padding-left: calc(50% + 2rem);
}

.node-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: #1a1a1a;
    position: absolute;
    left: 50%;
    top: 1rem;
    transform: translateX(-50%) scale(0);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 3;
}

.node-dot.active {
    transform: translateX(-50%) scale(1);
}

.node-panel {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.node-panel.active {
    opacity: 1;
    transform: translateY(0);
}

.node-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #e8e8e8;
    margin-bottom: 0.5rem;
}

/* ========================================
   ACT IV — The Proof
   ======================================== */
#act-4 {
    min-height: 100vh;
    background: linear-gradient(to bottom, #1a1a1a, #0a0a0a);
}

.proof-card {
    width: 80vw;
    max-width: 900px;
    height: 70vh;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    position: relative;
}

.wireframe-svg {
    width: 100%;
    height: auto;
    max-height: 80%;
}

.wf-el {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 1;
    transition: fill 1s ease, stroke 1s ease, stroke-width 0.6s ease;
}

.wf-el.realized {
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 1.5;
}

.wf-topbar.realized {
    fill: rgba(255, 255, 255, 0.06);
}

.wf-sidebar.realized {
    fill: rgba(255, 255, 255, 0.03);
}

.wf-content-1.realized {
    fill: rgba(255, 255, 255, 0.05);
}

.wf-content-2.realized,
.wf-content-3.realized {
    fill: rgba(255, 255, 255, 0.04);
}

.wf-button.realized {
    fill: rgba(255, 255, 255, 0.1);
    stroke: rgba(255, 255, 255, 0.5);
}

.wf-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    fill: rgba(255, 255, 255, 0);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: fill 0.8s ease;
}

.wf-label.visible {
    fill: rgba(255, 255, 255, 0.5);
}

.typewriter-labels {
    margin-top: 2rem;
    text-align: center;
}

.tw-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: #888888;
    letter-spacing: 0.05em;
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid rgba(255, 255, 255, 0.5);
    width: 0;
}

.tw-label.typing {
    animation: typewriter 2.5s steps(var(--tw-chars, 40)) forwards,
               blinkCursor 0.6s step-end infinite;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blinkCursor {
    50% { border-color: transparent; }
}

/* ========================================
   ACT V — The Invitation
   ======================================== */
#act-5 {
    min-height: 100vh;
    background: #2a2a2a;
}

.invitation-content {
    text-align: center;
    z-index: 1;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.invitation-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.invitation-domain {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.04em;
    margin-bottom: 1.5rem;
}

.invitation-prompt {
    font-family: 'Source Sans 3', sans-serif;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    font-weight: 300;
    color: #e8e8e8;
    margin-bottom: 2rem;
}

.invitation-email {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: #888888;
    letter-spacing: 0.1em;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .node-left {
        padding-right: 0;
        padding-left: calc(50% + 1.5rem);
        flex-direction: row-reverse;
    }

    .node-right {
        padding-left: calc(50% + 1.5rem);
    }

    .material-cards {
        padding: 2rem 1rem;
    }

    .proof-card {
        width: 95vw;
        height: 60vh;
        padding: 1.5rem;
    }
}
