/* === VARIABLES === */
:root {
  --bg: #0a0a0f;
  --surface: #13131a;
  --surface-2: #1c1c28;
  --border: #2a2a3a;
  --border-hover: #4a4a6a;
  --text: #e8e8f0;
  --muted: #8585a5;
  --gold: #c9a84c;
  --gold-hover: #d4b05a;
  --gold-dim: rgba(201, 168, 76, 0.12);
  --radius: 12px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.65;
  min-height: 100vh;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === ACCESSIBILITY === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 8px;
  background: var(--gold);
  color: #000;
  padding: 8px 16px;
  border-radius: 0 0 6px 6px;
  font-weight: 600;
  font-size: 0.85rem;
  z-index: 9999;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* === HOME PAGE === */

.site-header {
  padding: 90px 0 64px;
  text-align: center;
}

.site-logo {
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
  display: block;
  margin-bottom: 14px;
}

.site-tagline {
  color: var(--muted);
  font-size: 1.05rem;
  font-style: italic;
}

.section-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.quiz-section {
  padding: 64px 0 96px;
}

.quiz-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 32px;
}

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}

/* Quiz card — active */
.quiz-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px 28px;
  text-decoration: none;
  color: var(--text);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  cursor: pointer;
}

.quiz-card:hover {
  border-color: var(--gold-dim);
  border-color: rgba(201, 168, 76, 0.4);
  background: var(--surface-2);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(201, 168, 76, 0.08);
}

/* Quiz card — coming soon */
.quiz-card--locked {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.quiz-card-badge {
  position: absolute;
  top: -1px;
  right: 20px;
  background: var(--gold);
  color: #000;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 0 0 6px 6px;
}

.quiz-card-icon {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 4px;
}

.quiz-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
}

.quiz-card-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.quiz-card-cta {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 600;
  margin-top: 10px;
  letter-spacing: 0.02em;
}

.quiz-card-cta--locked {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

/* === QUIZ PAGE === */

.quiz-page {
  min-height: 100vh;
}

.back-link {
  position: fixed;
  top: 20px;
  left: 20px;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  z-index: 200;
  letter-spacing: 0.04em;
  transition: color 0.2s;
  padding: 6px 2px;
}

.back-link:hover { color: var(--gold); }

/* Progress bar */
.progress-track {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border);
  z-index: 100;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  transition: width 0.5s var(--ease);
  width: 0%;
}

/* Screens */
.screen { display: none; }

/* Centered screens (loading, intro) */
.screen.screen-centered.active {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  flex-direction: column;
}

/* Block screens (question, result) — need to scroll */
.screen.screen-block.active {
  display: block;
  min-height: 100vh;
}

/* === LOADING === */
.loader {
  display: flex;
  gap: 10px;
  align-items: center;
}

.loader span {
  display: block;
  width: 9px;
  height: 9px;
  background: var(--gold);
  border-radius: 50%;
  animation: loaderPulse 1.3s ease-in-out infinite;
}
.loader span:nth-child(2) { animation-delay: 0.18s; }
.loader span:nth-child(3) { animation-delay: 0.36s; }

@keyframes loaderPulse {
  0%, 80%, 100% { opacity: 0.15; transform: scale(0.75); }
  40% { opacity: 1; transform: scale(1); }
}

/* === INTRO === */
.intro-inner {
  text-align: center;
  max-width: 580px;
  padding: 40px 24px;
}

.intro-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 20px;
}

.intro-title {
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

.intro-sub {
  color: var(--muted);
  font-style: italic;
  font-size: 1.05rem;
  margin-bottom: 48px;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 34px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease), opacity 0.2s;
  font-family: inherit;
  letter-spacing: 0.03em;
}

.btn-gold {
  background: var(--gold);
  color: #000;
}
.btn-gold:hover {
  background: var(--gold-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--border-hover);
  background: var(--surface);
}

.btn-outline {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

/* === QUESTION SCREEN === */
.question-wrap {
  padding-top: 100px;
  padding-bottom: 80px;
}

.q-meta {
  margin-bottom: 28px;
}

.q-num {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.q-text {
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-weight: 600;
  line-height: 1.45;
  max-width: 680px;
  margin-bottom: 40px;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.answers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
  max-width: 860px;
}

.answer-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  text-align: left;
  color: var(--text);
  font-size: 0.93rem;
  line-height: 1.55;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.2s, background 0.2s, opacity 0.25s, transform 0.25s;
}

.answer-btn:hover:not(:disabled) {
  border-color: rgba(201, 168, 76, 0.5);
  background: var(--surface-2);
}

.answer-btn.selected {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.answer-btn:disabled {
  cursor: default;
}

/* === RESULT SCREEN === */
.result-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: background 1.2s ease;
}

.result-wrap {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-top: 80px;
  padding-bottom: 80px;
  max-width: 680px;
  margin: 0 auto;
}

.result-hat {
  font-size: 4rem;
  display: block;
  margin-bottom: 32px;
  animation: float 3.5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(-2deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}

.result-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 12px;
}

.result-house {
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  margin-bottom: 48px;
  transition: color 0.6s ease;
}

.result-body {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--muted);
  text-align: left;
  white-space: pre-line;
  margin-bottom: 56px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.result-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* === QUESTION IMAGE === */
.q-image-wrap {
  width: 100%;
  height: 260px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}

.q-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.82) saturate(0.9);
}

/* === SEO CONTENT SECTION (H1, intro, FAQ) === */
.seo-content {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 72px 0 80px;
}

.seo-h1 {
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
  color: var(--text);
}

.seo-intro {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 680px;
  margin-bottom: 56px;
}

.faq-section {
  max-width: 720px;
}

.faq-heading {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 32px;
  color: var(--text);
}

.faq-item {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.faq-item:last-child {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.4;
}

.faq-answer {
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.75;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .answers-grid {
    grid-template-columns: 1fr;
  }

  .result-btns {
    flex-direction: column;
    align-items: center;
  }

  .question-wrap {
    padding-top: 72px;
  }

  .q-image-wrap {
    height: 180px;
  }
}
