/* ===== Zen Mode ===== */

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

:root {
    --zen-text: #2c2825;
    --zen-muted: #a09888;
    --zen-watermark: rgba(0, 0, 0, 0.03);
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Georgia', 'Times New Roman', serif;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.8s ease;
}

/* Deterministic color palette — cycled by question index */
body.zen-bg-0 { background: #f5f3f0; }
body.zen-bg-1 { background: #f0f4f0; }
body.zen-bg-2 { background: #f0f0f5; }
body.zen-bg-3 { background: #f5f0ee; }
body.zen-bg-4 { background: #f0f3f5; }
body.zen-bg-5 { background: #f4f5f0; }
body.zen-bg-6 { background: #f5f2f5; }
body.zen-bg-7 { background: #eef5f2; }

.zen-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    position: relative;
}

/* Giant faint watermark — The Question Machine mark, rendered monochrome.
   zen.css doesn't load style.css, so the logo classes are styled here. */
.zen-watermark {
    position: absolute;
    left: -10vw;
    top: 50%;
    transform: translateY(-50%);
    z-index: 0;
    pointer-events: none;
    line-height: 1;
}

.zen-watermark .qm-logo {
    display: block;
    width: 58vw;
    height: 58vw;
}

.zen-watermark .qm-ring,
.zen-watermark .qm-ticks line,
.zen-watermark .qm-orbit-path,
.zen-watermark .qm-mark {
    fill: none;
    stroke: var(--zen-watermark);
}

.zen-watermark .qm-ring { stroke-width: 1.5; }
.zen-watermark .qm-ticks line { stroke-width: 1.5; stroke-linecap: round; }
.zen-watermark .qm-orbit-path { stroke-width: 1; stroke-dasharray: 1.5 7.5; }
.zen-watermark .qm-mark { stroke-width: 7; stroke-linecap: round; }

.zen-watermark .qm-node,
.zen-watermark .qm-dot {
    fill: var(--zen-watermark);
}

.zen-watermark .qm-orbit {
    transform-origin: 60px 60px;
    animation: qm-orbit-spin 90s linear infinite;
}

@keyframes qm-orbit-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .zen-watermark .qm-orbit { animation: none; }
}

.zen-question {
    position: relative;
    z-index: 1;
    font-size: clamp(1.5rem, 4vw, 3rem);
    line-height: 1.5;
    text-align: center;
    color: var(--zen-text);
    letter-spacing: -0.01em;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.zen-question.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

.zen-question.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.zen-generator {
    position: relative;
    z-index: 1;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--zen-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: 'Inter', -apple-system, sans-serif;
    transition: opacity 0.4s ease;
}

.zen-generator.fade-out {
    opacity: 0;
}

/* Exit button */
.zen-exit {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--zen-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.zen-container:hover .zen-exit,
.zen-exit:focus {
    opacity: 0.6;
}

.zen-exit:hover {
    opacity: 1 !important;
}

.zen-exit svg {
    width: 100%;
    height: 100%;
}

.zen-exit i {
    font-size: 1.5rem;
    line-height: 36px;
}

/* Hint at bottom */
.zen-hint {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--zen-muted);
    font-family: 'Inter', -apple-system, sans-serif;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.zen-container:hover .zen-hint {
    opacity: 0.5;
}

@media (max-width: 640px) {
    .zen-question {
        font-size: clamp(1.25rem, 5vw, 2rem);
        padding: 1rem;
    }

    .zen-watermark .qm-logo {
        width: 95vw;
        height: 95vw;
    }
}

/* ===== Dim Theme ===== */
:root.dim {
    --zen-text: #c8c2b8;
    --zen-muted: #6a6458;
    --zen-watermark: rgba(255, 255, 255, 0.03);
}

:root.dim body.zen-bg-0 { background: #2a2825; }
:root.dim body.zen-bg-1 { background: #282a28; }
:root.dim body.zen-bg-2 { background: #28282a; }
:root.dim body.zen-bg-3 { background: #2a2827; }
:root.dim body.zen-bg-4 { background: #27292a; }
:root.dim body.zen-bg-5 { background: #2a2a28; }
:root.dim body.zen-bg-6 { background: #2a282a; }
:root.dim body.zen-bg-7 { background: #272a29; }

/* ===== Dark Theme ===== */
:root.dark {
    --zen-text: #d4d4d8;
    --zen-muted: #5a5a62;
    --zen-watermark: rgba(255, 255, 255, 0.02);
}

:root.dark body.zen-bg-0 { background: #1a1a1e; }
:root.dark body.zen-bg-1 { background: #1a1e1a; }
:root.dark body.zen-bg-2 { background: #1a1a1e; }
:root.dark body.zen-bg-3 { background: #1e1a1a; }
:root.dark body.zen-bg-4 { background: #1a1c1e; }
:root.dark body.zen-bg-5 { background: #1c1e1a; }
:root.dark body.zen-bg-6 { background: #1e1a1e; }
:root.dark body.zen-bg-7 { background: #1a1e1c; }
