/* conc.quest - Motion-Heavy Interactive Quest */

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

:root {
    --bg-deep: #1A1625;
    --bg-card: #2A2438;
    --violet: #A855F7;
    --cyan: #22D3EE;
    --lime: #84CC16;
    --danger: #FF3366;
    --gold: #FFD700;
    --light-violet: #A78BFA;
    --white: #FFFFFF;
    --dim: #4A4458;
}

body {
    background-color: var(--bg-deep);
    color: var(--white);
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ============================
   HERO: QUEST START
   ============================ */

#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#quest-path-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#start-path {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    transition: stroke-dashoffset 1.5s ease-out;
}

#start-path.drawn {
    stroke-dashoffset: 0;
}

#start-node {
    transition: opacity 0.5s ease, r 0.5s ease;
}

#start-node.visible {
    opacity: 1;
}

#hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

#hero-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.02em;
    color: var(--white);
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

#hero-subtitle {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    color: var(--light-violet);
    margin-top: 16px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#hero-subtitle.visible {
    opacity: 1;
}

/* ============================
   SECTION LABELS
   ============================ */

.section-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    letter-spacing: 0.1em;
    color: var(--light-violet);
    text-align: center;
    margin-bottom: 48px;
}

/* ============================
   THREAD FORK
   ============================ */

#thread-fork {
    padding: 100px 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.thread-paths {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.thread-lane {
    display: flex;
    align-items: center;
    gap: 24px;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.thread-lane.visible {
    opacity: 1;
    transform: translateX(0);
}

.thread-lane[data-thread="cyan"] {
    transform: translateX(30px);
}

.thread-lane[data-thread="cyan"].visible {
    transform: translateX(0);
}

.thread-lane[data-thread="lime"] {
    transform: translateX(-30px);
}

.thread-line {
    width: 4px;
    height: 100%;
    min-height: 80px;
    border-radius: 2px;
    flex-shrink: 0;
}

.violet-line { background-color: var(--violet); box-shadow: 0 0 8px rgba(168, 85, 247, 0.4); }
.cyan-line { background-color: var(--cyan); box-shadow: 0 0 8px rgba(34, 211, 238, 0.4); }
.lime-line { background-color: var(--lime); box-shadow: 0 0 8px rgba(132, 204, 22, 0.4); }

.station-card {
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    max-width: 280px;
    position: relative;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.station-card.visible {
    opacity: 1;
    transform: scale(1);
}

.station-card[data-color="violet"] { border: 1px solid rgba(168, 85, 247, 0.3); }
.station-card[data-color="cyan"] { border: 1px solid rgba(34, 211, 238, 0.3); }
.station-card[data-color="lime"] { border: 1px solid rgba(132, 204, 22, 0.3); }

.station-card h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    margin-bottom: 8px;
}

.station-card[data-color="violet"] h3 { color: var(--violet); }
.station-card[data-color="cyan"] h3 { color: var(--cyan); }
.station-card[data-color="lime"] h3 { color: var(--lime); }

.station-card p {
    font-size: clamp(0.8rem, 0.9vw, 0.9rem);
    color: var(--light-violet);
    line-height: 1.6;
}

.station-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    position: absolute;
    left: -28px;
    top: 24px;
}

.violet-dot { background-color: var(--violet); box-shadow: 0 0 12px rgba(168, 85, 247, 0.5); }
.cyan-dot { background-color: var(--cyan); box-shadow: 0 0 12px rgba(34, 211, 238, 0.5); }
.lime-dot { background-color: var(--lime); box-shadow: 0 0 12px rgba(132, 204, 22, 0.5); }

/* ============================
   RACE CONDITION ZONE
   ============================ */

#race-zone {
    padding: 100px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.race-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.danger-zone {
    border: 2px dashed var(--danger);
    border-radius: 4px;
    padding: 20px 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: flash 0.5s step-start infinite;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.warning-icon {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 18px solid var(--danger);
}

.danger-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--danger);
    letter-spacing: 0.1em;
}

.race-paths {
    display: flex;
    gap: 40px;
    width: 100%;
    justify-content: center;
}

.race-path {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.race-line {
    width: 4px;
    height: 60px;
    border-radius: 2px;
}

.violet-bg { background-color: var(--violet); box-shadow: 0 0 8px rgba(168, 85, 247, 0.4); }
.cyan-bg { background-color: var(--cyan); box-shadow: 0 0 8px rgba(34, 211, 238, 0.4); }

.race-card {
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 16px 24px;
    text-align: center;
    border: 1px solid var(--dim);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.race-card.winner {
    border-color: var(--gold);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.3);
}

.race-card.loser {
    opacity: 0.5;
}

.race-card.loser h3 {
    text-decoration: line-through;
}

.race-card h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}

.race-card p {
    font-size: 0.85rem;
    color: var(--light-violet);
}

/* ============================
   MUTEX GATE
   ============================ */

#mutex-gate {
    padding: 100px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.mutex-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.mutex-queue {
    display: flex;
    gap: 16px;
}

.queue-thread {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    opacity: 0.4;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.queue-thread.active {
    opacity: 1;
    transform: scale(1.2);
}

.queue-thread.passed {
    opacity: 0.2;
    transform: scale(0.8);
}

.mutex-lock {
    position: relative;
    width: 48px;
    height: 64px;
}

.lock-body {
    width: 48px;
    height: 36px;
    background-color: var(--bg-deep);
    border: 2px solid var(--gold);
    border-radius: 4px;
    position: absolute;
    bottom: 0;
    transition: border-color 0.3s ease;
}

.lock-shackle {
    width: 28px;
    height: 20px;
    border: 3px solid var(--gold);
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    position: absolute;
    top: 4px;
    left: 10px;
    transition: transform 0.3s ease;
}

.mutex-lock.open .lock-shackle {
    transform: rotate(45deg) translateX(6px) translateY(-4px);
}

.mutex-lock.open .lock-body {
    border-color: var(--lime);
}

.mutex-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--dim);
    text-align: center;
}

/* ============================
   QUEST COMPLETE FOOTER
   ============================ */

#quest-complete {
    padding: 100px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.complete-node {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background-color: var(--violet);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.4);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.complete-node.visible {
    opacity: 1;
    transform: scale(1);
}

.complete-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    color: var(--white);
    text-align: center;
}

.footer-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--dim);
}

/* ============================
   RESPONSIVE
   ============================ */

@media (max-width: 768px) {
    .thread-lane {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 32px;
    }

    .thread-line {
        width: 100%;
        height: 4px;
        min-height: auto;
    }

    .station-dot {
        left: auto;
        top: -24px;
        left: 0;
    }

    .race-paths {
        flex-direction: column;
        align-items: center;
    }
}
