/* ============================================
   dilemma.quest — styles.css
   Brutalist-scholarly aesthetic
   ============================================ */

/* Palette: #c8c8d8 #00e5ff #ff9500 #ff0066 #1a1a1a #2a2b35 #2a2a2a #f0f0f0 #0a0b12 #14151f */

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    overflow-x: hidden;
}

body {
    background: #0a0b12;
    color: #f0f0f0;
    font-family: 'Literata', Georgia, serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ---- Chambers ---- */
.chamber {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
}

/* ---- Opening Chamber ---- */
.chamber-opening {
    background: #0a0b12;
}

.opening-fork {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.opening-fork.visible {
    opacity: 1;
}

.opening-fork .fork-trunk {
    animation: drawLine 1.2s ease-out 0.5s forwards;
}

.opening-fork .fork-left {
    animation: drawLine 0.8s ease-out 1.7s forwards;
}

.opening-fork .fork-right {
    animation: drawLine 0.8s ease-out 1.7s forwards;
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

.opening-title {
    font-family: 'Anybody', sans-serif;
    font-size: clamp(3rem, 8vw + 1rem, 7rem);
    font-weight: 900;
    font-variation-settings: 'wdth' 75;
    color: #f0f0f0;
    text-transform: lowercase;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: fadeIn 1s ease-out 2.8s forwards;
}

.opening-title .dot {
    color: #ff0066;
}

.opening-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    color: #c8c8d8;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-top: 1.5rem;
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: fadeIn 1s ease-out 3.4s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    z-index: 2;
    opacity: 0;
    animation: fadeIn 1s ease-out 4s forwards;
}

.scroll-arrow {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.5rem;
    color: #c8c8d8;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ---- Dilemma Chambers ---- */
.fork-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.bg-fork {
    width: 100%;
    height: 100%;
}

.chamber-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.chamber-title {
    font-family: 'Anybody', sans-serif;
    font-size: clamp(2rem, 5vw + 0.5rem, 4.5rem);
    font-weight: 800;
    font-variation-settings: 'wdth' 75;
    color: #f0f0f0;
    text-align: center;
    transition: font-variation-settings 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    transform: translateY(30px);
    transition: font-variation-settings 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.6s ease-out,
                transform 0.6s ease-out;
}

.chamber-title.in-view {
    font-variation-settings: 'wdth' 125;
    opacity: 1;
    transform: translateY(0);
}

.chamber-body {
    font-family: 'Literata', Georgia, serif;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: #c8c8d8;
    text-align: center;
    max-width: 650px;
    line-height: 1.8;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out 0.2s, transform 0.6s ease-out 0.2s;
}

.chamber-title.in-view ~ .chamber-body,
.chamber-body.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Dilemma Cards ---- */
.dilemma-card {
    width: 100%;
    max-width: 420px;
    height: 180px;
    perspective: 1000px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out 0.4s, transform 0.5s ease-out 0.4s;
}

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

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

.dilemma-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2rem;
    border: 1px solid;
}

.card-front {
    background: #1a1a1a;
    border-color: #2a2b35;
}

.card-back {
    background: #1a1a1a;
    transform: rotateY(180deg);
}

/* Alternate card colors */
#card-1 .card-front { border-color: rgba(255, 0, 102, 0.3); }
#card-1 .card-back { border-color: #ff0066; }
#card-2 .card-front { border-color: rgba(0, 229, 255, 0.3); }
#card-2 .card-back { border-color: #00e5ff; }
#card-3 .card-front { border-color: rgba(0, 229, 255, 0.3); }
#card-3 .card-back { border-color: #00e5ff; }
#card-4 .card-front { border-color: rgba(255, 149, 0, 0.3); }
#card-4 .card-back { border-color: #ff9500; }
#card-5 .card-front { border-color: rgba(255, 149, 0, 0.3); }
#card-5 .card-back { border-color: #ff9500; }
#card-6 .card-front { border-color: rgba(255, 0, 102, 0.3); }
#card-6 .card-back { border-color: #ff0066; }
#card-7 .card-front { border-color: rgba(255, 0, 102, 0.3); }
#card-7 .card-back { border-color: #ff0066; }
#card-8 .card-front { border-color: rgba(0, 229, 255, 0.3); }
#card-8 .card-back { border-color: #00e5ff; }

.card-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.card-front .card-label { color: #c8c8d8; }

#card-1 .card-back .card-label { color: #ff0066; }
#card-2 .card-back .card-label { color: #00e5ff; }
#card-3 .card-back .card-label { color: #00e5ff; }
#card-4 .card-back .card-label { color: #ff9500; }
#card-5 .card-back .card-label { color: #ff9500; }
#card-6 .card-back .card-label { color: #ff0066; }
#card-7 .card-back .card-label { color: #ff0066; }
#card-8 .card-back .card-label { color: #00e5ff; }

.card-front p, .card-back p {
    font-family: 'Literata', Georgia, serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #f0f0f0;
    text-align: center;
}

.card-back p {
    font-style: italic;
}

.card-hint {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: #2a2b35;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 0.75rem;
    transition: color 0.3s ease;
}

.dilemma-card:hover .card-hint {
    color: #c8c8d8;
}

/* ---- Closing Chamber ---- */
.chamber-closing {
    background: #0a0b12;
}

.closing-forks {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
    pointer-events: none;
}

.closing-fork-svg {
    width: 80%;
    max-width: 600px;
    height: auto;
}

.closing-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.closing-title {
    font-family: 'Anybody', sans-serif;
    font-size: clamp(2rem, 5vw + 0.5rem, 4rem);
    font-weight: 800;
    font-variation-settings: 'wdth' 100;
    color: #f0f0f0;
    margin-bottom: 1rem;
}

.closing-body {
    font-family: 'Literata', Georgia, serif;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: #c8c8d8;
    font-style: italic;
    margin-bottom: 3rem;
}

.closing-counter {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: #2a2b35;
    letter-spacing: 0.15em;
}

.counter-value {
    color: #ff0066;
    font-size: 1.2rem;
}

/* ---- Divider Lines Between Chambers ---- */
.chamber:not(.chamber-opening):not(.chamber-closing)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, #2a2b35, transparent);
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .dilemma-card {
        max-width: 100%;
        height: 200px;
    }

    .card-front, .card-back {
        padding: 1.2rem 1.5rem;
    }

    .chamber-content {
        gap: 1rem;
    }
}
