/* Silver Quill Books — Interactive Reader Quiz */
:root {
  --bg: #0b0e18;
  --bg-deep: #080a12;
  --surface: #121727;
  --surface-elevated: #171d32;
  --border: rgba(226, 199, 133, 0.24);
  --border-strong: rgba(226, 199, 133, 0.56);
  --gold: #e2c785;
  --gold-bright: #f1dca3;
  --gold-dim: #b79c5b;
  --ink: #f5f0e4;
  --ink-muted: #b5bccd;
  --ink-dark: #101320;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.52);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --font-serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 18% 12%, rgba(226, 199, 133, 0.10), transparent 44%),
    radial-gradient(circle at 86% 84%, rgba(65, 86, 158, 0.18), transparent 48%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--gold);
}

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.page-frame {
  max-width: 980px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 32px;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 2px 18px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: contain;
}

.brand-name {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.catalog-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  transition: border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.catalog-link:hover {
  border-color: var(--border-strong);
  color: var(--gold);
}

/* Main Card */
.app-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.card {
  width: 100%;
  background: linear-gradient(165deg, rgba(23, 29, 50, 0.96), rgba(14, 18, 32, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 245, 214, 0.08);
  padding: 26px 20px;
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(226, 199, 133, 0.11);
  border-radius: 14px;
  pointer-events: none;
}

.view-panel[hidden] {
  display: none;
}

.view-panel.is-active {
  animation: fadeUp 0.28s ease-out both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

/* Intro View */
.intro-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: center;
}

.hero-title {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6.2vw, 3.15rem);
  line-height: 1.1;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.hero-subtitle {
  margin: 0 0 24px;
  font-size: 1.02rem;
  color: var(--ink-muted);
  max-width: 48ch;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.meta-note {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
  opacity: 0.85;
}

/* 4-Cover Showcase Grid */
.cover-showcase {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 340px;
  margin: 0 auto;
}

.showcase-card {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(226, 199, 133, 0.34);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  background: #0d101c;
  aspect-ratio: 5 / 8;
}

.showcase-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tilt-b, .tilt-d {
  transform: translateY(10px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.96rem;
  text-decoration: none;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  padding: 13px 24px;
  transition: transform 0.16s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn-lg {
  padding: 15px 28px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--ink-dark);
  box-shadow: 0 10px 26px rgba(226, 199, 133, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #f8e7b7, var(--gold-bright));
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(226, 199, 133, 0.32);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border);
  color: var(--ink);
  padding: 11px 16px;
  font-size: 0.88rem;
}

.btn-outline:hover {
  border-color: var(--border-strong);
  background: rgba(226, 199, 133, 0.10);
  color: var(--gold-bright);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 8px;
}

.btn-ghost:hover {
  color: var(--gold);
  background: rgba(255, 255, 255, 0.04);
}

.btn-ghost-bordered {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--ink-muted);
  padding: 11px 18px;
  font-size: 0.88rem;
}

.btn-ghost-bordered:hover {
  border-color: var(--border-strong);
  color: var(--gold);
}

/* Quiz Question View */
.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.progress-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 24px;
}

.progress-fill {
  height: 100%;
  width: 14.3%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
  border-radius: var(--radius-pill);
  transition: width 0.28s ease;
}

.question-eyebrow {
  margin-bottom: 8px;
}

.question-title {
  margin: 0 0 22px;
  font-family: var(--font-serif);
  font-size: clamp(1.38rem, 4.5vw, 1.95rem);
  line-height: 1.24;
  color: var(--ink);
  font-weight: 700;
}

.options-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.option-btn {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(226, 199, 133, 0.22);
  border-radius: var(--radius-md);
  color: var(--ink);
  padding: 15px 16px;
  font-family: var(--font-sans);
  font-size: 0.96rem;
  line-height: 1.45;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.14s ease;
}

.option-btn:hover {
  border-color: var(--gold);
  background: rgba(226, 199, 133, 0.10);
  transform: translateY(-1px);
}

.option-btn.is-selected {
  border-color: var(--gold-bright);
  background: rgba(226, 199, 133, 0.16);
}

.option-letter {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(226, 199, 133, 0.45);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.option-btn:hover .option-letter,
.option-btn.is-selected .option-letter {
  background: var(--gold);
  color: var(--ink-dark);
  border-color: var(--gold);
}

/* Result View */
.result-eyebrow {
  text-align: center;
  margin-bottom: 18px;
  color: var(--gold);
}

.result-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
}

.result-cover-wrap {
  width: min(230px, 68vw);
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(226, 199, 133, 0.46);
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.62), 0 0 40px rgba(226, 199, 133, 0.12);
  background: #0c101b;
}

.result-cover {
  width: 100%;
  height: auto;
  display: block;
}

.result-details {
  text-align: center;
}

.result-title {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 5.2vw, 2.3rem);
  line-height: 1.15;
  color: var(--ink);
}

.result-author {
  margin: 0 0 16px;
  font-size: 0.96rem;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.result-hook {
  margin: 0 0 14px;
  padding: 12px 16px;
  border-left: 3px solid var(--gold);
  background: rgba(226, 199, 133, 0.06);
  border-radius: 0 10px 10px 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink);
  text-align: left;
}

.result-match {
  margin: 0 0 22px;
  font-size: 0.95rem;
  color: var(--ink-muted);
  text-align: left;
}

.result-cta-wrap {
  margin-bottom: 4px;
}

/* Share Box */
.share-box {
  margin-top: 28px;
  padding: 18px 16px;
  border-radius: var(--radius-md);
  background: rgba(8, 11, 20, 0.56);
  border: 1px solid rgba(226, 199, 133, 0.18);
}

.share-header {
  margin-bottom: 14px;
}

.share-heading {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.share-preview {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
  font-style: italic;
}

.share-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.share-btn {
  width: 100%;
  padding: 11px 12px;
}

.share-icon {
  font-size: 0.95rem;
  line-height: 1;
}

/* Runner-Ups */
.runner-ups {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.runner-ups-heading {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
}

.runner-ups-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.runner-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(226, 199, 133, 0.16);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.runner-card:hover {
  border-color: var(--gold);
  background: rgba(226, 199, 133, 0.07);
}

.runner-cover {
  width: 50px;
  height: 78px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
  border: 1px solid rgba(226, 199, 133, 0.25);
}

.runner-info {
  min-width: 0;
  flex: 1;
}

.runner-genre {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 2px;
}

.runner-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.runner-author {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.runner-arrow {
  color: var(--gold);
  font-size: 1rem;
  flex-shrink: 0;
}

.result-footer-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 22px 8px 4px;
  font-size: 0.8rem;
  color: var(--ink-muted);
  opacity: 0.82;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--gold);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* Tablet & Desktop Enhancements */
@media (min-width: 720px) {
  .page-frame {
    padding: 26px 28px 40px;
  }

  .card {
    padding: 44px 46px;
  }

  .intro-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
  }

  .cover-showcase {
    max-width: 380px;
    gap: 16px;
  }

  .result-eyebrow {
    text-align: left;
  }

  .result-layout {
    grid-template-columns: 240px 1fr;
    gap: 36px;
    align-items: start;
  }

  .result-cover-wrap {
    width: 240px;
    margin: 0;
  }

  .result-details {
    text-align: left;
  }

  .result-cta-wrap .btn-block {
    width: auto;
  }

  .share-buttons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .runner-ups-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
