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

:root {
    --color-bg: #1a1410;
    --color-surface: #2a1f18;
    --color-surface-alt: #34261d;
    --color-text: #e8d5c4;
    --color-text-muted: #b09a84;
    --color-accent: #d4a853;
    --color-accent-hover: #e6c06e;
    --color-danger: #c44d4d;
    --color-success: #6ba86b;
    --color-border: #4a3a2e;
    --font-body: Georgia, 'Times New Roman', serif;
    --font-heading: Georgia, 'Times New Roman', serif;
    --font-mono: 'Courier New', Courier, monospace;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --max-width: 800px;
    --transition: 0.2s ease;
}

html {
    font-size: 17px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Skip Link ===== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 10px;
    background: var(--color-accent);
    color: #000;
    padding: 8px 16px;
    border-radius: var(--radius);
    z-index: 1000;
    font-weight: bold;
    transition: top 0.3s;
}
.skip-link:focus {
    top: 10px;
}

/* ===== Header ===== */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-accent);
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: bold;
}
.logo-icon {
    flex-shrink: 0;
}
.logo-text {
    white-space: nowrap;
}
.site-nav ul {
    list-style: none;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.site-nav a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition);
}
.site-nav a:hover,
.site-nav a:focus {
    color: var(--color-accent);
}

/* ===== Main ===== */
main {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 20px 48px;
    width: 100%;
}

/* ===== Hero ===== */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.hero-content {
    flex: 1 1 300px;
}
.hero-content h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--color-accent);
    margin-bottom: 12px;
    line-height: 1.3;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 24px;
    max-width: 500px;
}
.hero-illustration {
    flex: 0 0 auto;
    color: var(--color-text-muted);
    opacity: 0.8;
}

/* ===== Buttons ===== */
.btn-primary,
.btn-secondary,
.btn-outline {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
    text-align: center;
    line-height: 1.4;
}
.btn-primary {
    background: var(--color-accent);
    color: #1a1410;
    font-weight: bold;
    border-color: var(--color-accent);
}
.btn-primary:hover,
.btn-primary:focus {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
}
.btn-secondary {
    background: var(--color-surface-alt);
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn-secondary:hover,
.btn-secondary:focus {
    background: var(--color-border);
}
.btn-outline {
    background: transparent;
    color: var(--color-text-muted);
    border-color: var(--color-border);
}
.btn-outline:hover,
.btn-outline:focus {
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

/* ===== Quiz Section ===== */
.quiz-section {
    margin-bottom: 40px;
}
.quiz-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow);
}
.progress-bar {
    height: 6px;
    background: var(--color-border);
    border-radius: 3px;
    margin-bottom: 16px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}
.step-indicator {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    font-family: var(--font-mono);
}
.question-text {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--color-text);
}
.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}
.option-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 14px 18px;
    background: var(--color-surface-alt);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1.5;
}
.option-btn:hover,
.option-btn:focus {
    border-color: var(--color-accent);
    background: #3d2e22;
}
.option-btn.selected {
    border-color: var(--color-accent);
    background: #3d2e22;
    box-shadow: inset 0 0 0 1px var(--color-accent);
}
.quiz-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ===== Result Section ===== */
.result-section {
    margin-bottom: 40px;
}
.result-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow);
}
.result-card h2 {
    font-family: var(--font-heading);
    color: var(--color-accent);
    margin-bottom: 16px;
    font-size: 1.4rem;
}
.backstory-output {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
    font-size: 1.05rem;
    line-height: 1.8;
    white-space: pre-wrap;
}
.plot-hooks {
    margin-bottom: 20px;
}
.plot-hooks h3 {
    font-family: var(--font-heading);
    color: var(--color-text);
    margin-bottom: 10px;
    font-size: 1.1rem;
}
.plot-hooks ul {
    list-style: none;
    padding-left: 0;
}
.plot-hooks li {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-muted);
}
.plot-hooks li:last-child {
    border-bottom: none;
}
.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.copy-feedback {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--color-success);
    min-height: 1.5em;
}

/* ===== Supporting Content ===== */
.supporting-content {
    margin-bottom: 40px;
}
.supporting-content h2 {
    font-family: var(--font-heading);
    color: var(--color-accent);
    margin-bottom: 20px;
    font-size: 1.5rem;
}
.support-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.support-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
}
.support-card h3 {
    font-family: var(--font-heading);
    color: var(--color-text);
    margin-bottom: 10px;
    font-size: 1.1rem;
}
.support-card p,
.support-card li {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 8px;
}
.support-card ul {
    padding-left: 20px;
}
.support-card li {
    margin-bottom: 6px;
}
.support-card strong {
    color: var(--color-text);
}

/* ===== FAQ ===== */
.faq-section {
    margin-bottom: 40px;
}
.faq-section h2 {
    font-family: var(--font-heading);
    color: var(--color-accent);
    margin-bottom: 16px;
    font-size: 1.5rem;
}
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.faq-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
}
.faq-item dt {
    font-weight: bold;
    color: var(--color-text);
    margin-bottom: 4px;
    font-size: 1rem;
}
.faq-item dd {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}
.footer-inner p {
    margin-bottom: 8px;
}
.footer-links a {
    color: var(--color-accent);
    text-decoration: none;
}
.footer-links a:hover {
    text-decoration: underline;
}
.footer-version {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
    .hero {
        flex-direction: column;
        text-align: center;
    }
    .hero-content h1 {
        font-size: 1.7rem;
    }
    .hero-subtitle {
        font-size: 1rem;
        max-width: 100%;
    }
    .hero-illustration {
        display: none;
    }
    .support-grid {
        grid-template-columns: 1fr;
    }
    .quiz-card,
    .result-card {
        padding: 20px 16px;
    }
    .result-actions {
        flex-direction: column;
    }
    .result-actions .btn-primary,
    .result-actions .btn-secondary,
    .result-actions .btn-outline {
        width: 100%;
    }
    .header-inner {
        flex-direction: column;
        gap: 8px;
    }
    .site-nav ul {
        gap: 10px;
        justify-content: center;
    }
}

@media (max-width: 400px) {
    html {
        font-size: 15px;
    }
    .quiz-actions {
        flex-direction: column;
    }
    .quiz-actions button {
        width: 100%;
    }
}

/* ===== Focus visible ===== */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ===== Hidden attribute ===== */
[hidden] {
    display: none !important;
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
