/* ==============================================
   turingtest.quest — Retro-Futuristic Botanical
   Interrogation Parlor
   ============================================== */

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

:root {
    --parchment: #F5E6D0;
    --copper: #C86B3A;
    --bark-deep: #5C3A1E;
    --walnut: #7A4428;
    --moss-gold: #A8923B;
    --night: #1E1510;
    --sage: #8B9D77;
    --terracotta: #D4A574;
}

html {
    overflow: hidden;
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--night);
    color: var(--parchment);
    height: 100vh;
    overflow: hidden;
}

/* ---- Horizontal Scroll Track ---- */

.scroll-track {
    display: flex;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.scroll-track::-webkit-scrollbar {
    display: none;
}

/* ---- Panels ---- */

.panel {
    flex: 0 0 100vw;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

.panel-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    position: relative;
}

/* Glass pane overlay — amber greenhouse tint */
.glass-pane-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(200, 107, 58, 0.05) 0%,
        rgba(168, 146, 59, 0.08) 50%,
        rgba(139, 157, 119, 0.05) 100%
    );
    pointer-events: none;
}

/* Panel backgrounds */
.panel-entry {
    background: radial-gradient(ellipse at 30% 60%, rgba(92, 58, 30, 0.4) 0%, var(--night) 70%);
}

.panel-question {
    background: radial-gradient(ellipse at 70% 40%, rgba(122, 68, 40, 0.25) 0%, var(--night) 70%);
}

.panel-answer {
    background: radial-gradient(ellipse at 30% 50%, rgba(139, 157, 119, 0.15) 0%, var(--night) 70%);
}

.panel-gate {
    background: radial-gradient(ellipse at 50% 50%, rgba(168, 146, 59, 0.2) 0%, var(--night) 70%);
}

/* Greenhouse mullion borders */
.panel::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 5%,
        var(--walnut) 20%,
        var(--walnut) 80%,
        transparent 95%
    );
    opacity: 0.4;
    z-index: 2;
}

.panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 5%,
        var(--walnut) 20%,
        var(--walnut) 80%,
        transparent 95%
    );
    opacity: 0.2;
    z-index: 2;
}

/* ---- Botanical Specimens ---- */

.botanical-specimen {
    position: absolute;
    opacity: 0.6;
    transition: opacity 0.8s ease;
}

.panel.in-view .botanical-specimen {
    opacity: 1;
}

.plant-svg {
    width: 100%;
    height: 100%;
}

.specimen-fern {
    right: 8%;
    top: 10%;
    width: 250px;
    height: 340px;
}

.specimen-flytrap {
    left: 8%;
    top: 15%;
    width: 220px;
    height: 300px;
}

.specimen-sunflower {
    right: 8%;
    top: 10%;
    width: 240px;
    height: 340px;
}

.specimen-mimosa {
    left: 8%;
    top: 12%;
    width: 230px;
    height: 320px;
}

.specimen-orchid {
    right: 8%;
    top: 12%;
    width: 230px;
    height: 330px;
}

.specimen-roots {
    left: 8%;
    top: 8%;
    width: 240px;
    height: 360px;
}

/* SVG drawing animation */
.plant-svg path,
.plant-svg line,
.plant-svg circle,
.plant-svg ellipse {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 2s ease;
}

.panel.in-view .plant-svg path,
.panel.in-view .plant-svg line,
.panel.in-view .plant-svg circle,
.panel.in-view .plant-svg ellipse {
    stroke-dashoffset: 0;
}

/* ---- Entry Panel ---- */

.panel-entry .panel-inner {
    flex-direction: column;
    gap: 2rem;
}

.title-main {
    font-family: 'Baloo 2', cursive;
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: 0.02em;
    color: var(--parchment);
    text-align: center;
}

.title-quest {
    color: var(--copper);
    font-size: 0.6em;
}

.subtitle {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    color: var(--sage);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-align: center;
}

.scroll-hint {
    margin-top: 3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: hintPulse 2s ease-in-out infinite;
}

.hint-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: var(--terracotta);
    opacity: 0.7;
}

.hint-arrow {
    font-size: 1.5rem;
    color: var(--copper);
    animation: arrowSlide 1.5s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes arrowSlide {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

/* ---- Conversation Cards ---- */

.conversation-card {
    max-width: 550px;
    position: relative;
    z-index: 1;
}

.panel-question .panel-inner {
    justify-content: flex-end;
    padding-right: 10%;
}

.panel-answer .panel-inner {
    justify-content: flex-start;
    padding-left: 10%;
}

.card-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--moss-gold);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

.panel.in-view .card-label {
    opacity: 1;
    transform: translateY(0);
}

.card-question {
    font-family: 'Baloo 2', cursive;
    font-size: clamp(1.5rem, 3.5vw, 2.8rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: var(--parchment);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.8s ease 0.4s, transform 0.8s ease 0.4s;
}

.panel.in-view .card-question {
    opacity: 1;
    transform: translateY(0);
}

.card-response {
    font-family: 'Lora', serif;
    font-size: clamp(0.9rem, 1.3vw, 1.1rem);
    line-height: 1.7;
    color: var(--terracotta);
    font-style: italic;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.8s ease 0.7s, transform 0.8s ease 0.7s;
}

.panel.in-view .card-response {
    opacity: 1;
    transform: translateY(0);
}

.card-attribution {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--sage);
    opacity: 0;
    transition: opacity 0.8s ease 1s;
}

.panel.in-view .card-attribution {
    opacity: 0.7;
}

/* ---- Gate Panel ---- */

.gate-frame {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    height: 440px;
    opacity: 0.25;
}

.gate-svg {
    width: 100%;
    height: 100%;
}

.gate-text {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 500px;
}

.gate-title {
    font-family: 'Baloo 2', cursive;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 800;
    color: var(--parchment);
    margin-bottom: 1.5rem;
}

.gate-question {
    font-family: 'Lora', serif;
    font-size: clamp(0.9rem, 1.3vw, 1.1rem);
    line-height: 1.8;
    color: var(--terracotta);
    margin-bottom: 2rem;
}

.gate-final {
    font-family: 'Baloo 2', cursive;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--copper);
    margin-bottom: 2.5rem;
}

.verdict-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.verdict-btn {
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.8rem 2.5rem;
    border: 2px solid;
    background: transparent;
    cursor: pointer;
    transition: all 0.4s ease;
}

.verdict-human {
    color: var(--sage);
    border-color: var(--sage);
}

.verdict-human:hover {
    background: var(--sage);
    color: var(--night);
}

.verdict-machine {
    color: var(--copper);
    border-color: var(--copper);
}

.verdict-machine:hover {
    background: var(--copper);
    color: var(--night);
}

.verdict-response {
    font-family: 'Lora', serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--moss-gold);
    font-style: italic;
    min-height: 3rem;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.verdict-response.visible {
    opacity: 1;
}

/* ---- Progress Bar ---- */

.progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(122, 68, 40, 0.2);
    z-index: 100;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--sage), var(--copper));
    transition: width 0.3s ease;
}

/* ---- Panel Counter ---- */

.panel-counter {
    position: fixed;
    bottom: 1.5rem;
    right: 2rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--walnut);
    z-index: 100;
    letter-spacing: 0.1em;
}

.counter-current {
    color: var(--copper);
}

/* ---- Ambient particles (added via JS) ---- */

.dust-particle {
    position: fixed;
    width: 2px;
    height: 2px;
    background: var(--moss-gold);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 50;
    animation: dustFloat linear infinite;
}

@keyframes dustFloat {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }
    20% {
        opacity: 0.4;
    }
    80% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) translateX(30px);
    }
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .panel-inner {
        padding: 2rem;
        flex-direction: column;
    }

    .panel-question .panel-inner,
    .panel-answer .panel-inner {
        justify-content: center;
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .botanical-specimen {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        width: 150px;
        height: 200px;
        margin-bottom: 1rem;
    }

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

    .gate-frame {
        width: 250px;
        height: 320px;
    }
}
