/* Baillies Brewery — eLearning module */

@font-face {
  font-family: "Lexend";
  src: url("assets/fonts/Lexend-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lexend";
  src: url("assets/fonts/Lexend-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lexend";
  src: url("assets/fonts/Lexend-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #F4F1E9;
  --cream-2: #EAE5D7;
  --cream-3: #DCD5C1;
  --ink: #2E2D32;
  --ink-2: #1A1A1D;
  --black: #000000;
  --amber: #FABD67;
  --amber-deep: #E89D38;
  --line: rgba(46, 45, 50, 0.18);
  --line-strong: rgba(46, 45, 50, 0.55);

  --shadow-card: 0 1px 0 rgba(46,45,50,0.08), 0 18px 40px -24px rgba(46,45,50,0.35);
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Lexend", system-ui, -apple-system, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============ Tweak: Last Call (dark mood) ============ */
.shell[data-mood="lastcall"] {
  --cream: #1A1A1D;
  --cream-2: #232328;
  --cream-3: #2E2D32;
  --ink: #F4F1E9;
  --ink-2: #FFFFFF;
  --line: rgba(244, 241, 233, 0.18);
  --line-strong: rgba(244, 241, 233, 0.55);
}
.shell[data-mood="lastcall"] body { background: var(--cream); color: var(--ink); }
[data-mood="lastcall"] .topbar { background: rgba(26,26,29,0.85); }
[data-mood="lastcall"] .topbar .logo img.logo-img { filter: invert(1) brightness(1.4) hue-rotate(180deg); }
[data-mood="lastcall"] .cover .right { background: #0A0A0C; box-shadow: 0 0 0 1px rgba(250,189,103,0.18), 0 30px 80px -30px rgba(250,189,103,0.25); }
[data-mood="lastcall"] .cover .right .meta { background: #0A0A0C; }
[data-mood="lastcall"] .callout { background: var(--cream-2); }
[data-mood="lastcall"] .cert { background: var(--cream-2); border-color: rgba(244,241,233,0.18); }
[data-mood="lastcall"] .quiz-card,
[data-mood="lastcall"] .scenario-card,
[data-mood="lastcall"] .beer .glass-pane { background: var(--cream-2); }
[data-mood="lastcall"] .wall-tile,
[data-mood="lastcall"] .intro-list .item,
[data-mood="lastcall"] .pair-grid .pair,
[data-mood="lastcall"] .do-dont > div,
[data-mood="lastcall"] .pairing-target,
[data-mood="lastcall"] .quiz-option,
[data-mood="lastcall"] .match-options .opt,
[data-mood="lastcall"] .menu-panel,
[data-mood="lastcall"] .pairing-foods .food { background: var(--cream); }
[data-mood="lastcall"] .pairing-foods { background: var(--cream-2); }
[data-mood="lastcall"] .feedback { background: var(--cream-3); }
[data-mood="lastcall"] .quiz-option.right,
[data-mood="lastcall"] .match-options .opt.right { background: var(--amber); color: var(--ink-2); }
[data-mood="lastcall"] .quiz-option.right *,
[data-mood="lastcall"] .match-options .opt.right * { color: #1A1A1D; }
[data-mood="lastcall"] .btn { color: var(--ink); border-color: var(--ink); }
[data-mood="lastcall"] .btn:hover { background: var(--ink); color: var(--cream); }
[data-mood="lastcall"] .btn.primary { background: var(--ink); color: var(--cream); }
[data-mood="lastcall"] .btn.primary:hover { background: var(--amber); color: #1A1A1D; border-color: var(--amber-deep); }
[data-mood="lastcall"] .topbar .menu-btn { color: var(--ink); border-color: var(--ink); }
[data-mood="lastcall"] .topbar .menu-btn:hover { background: var(--ink); color: var(--cream); }
[data-mood="lastcall"] .progress-fill { background: var(--amber); }
[data-mood="lastcall"] .wall-tile.active { background: var(--amber); color: #1A1A1D; }
[data-mood="lastcall"] .menu-link.active { background: var(--amber); color: #1A1A1D; }
[data-mood="lastcall"] .pairing-target.right { background: rgba(250,189,103,0.22); }

/* ============ Tweak: Service (dense, behind-the-bar) ============ */
[data-voice="service"] .page { padding: 16px clamp(14px, 3vw, 28px) 80px; max-width: 1480px; }
[data-voice="service"] h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
[data-voice="service"] h2 { font-size: clamp(1.2rem, 2.2vw, 1.6rem); }
[data-voice="service"] .cover { min-height: auto; gap: 24px; grid-template-columns: 1.4fr 1fr; }
[data-voice="service"] .cover h1 { font-size: clamp(1.8rem, 4vw, 3.2rem); }
[data-voice="service"] .cover .right { min-height: 260px; padding: 24px; }
[data-voice="service"] .cover .right .stamp-big { font-size: clamp(1.2rem, 2.2vw, 1.6rem); }
[data-voice="service"] .cover .right .hop { width: 220px; height: 220px; right: -20px; bottom: -20px; }
[data-voice="service"] .lede { max-width: 60ch; font-size: 0.95rem; }
[data-voice="service"] .stat-row { padding: 12px 0; gap: 22px; }
[data-voice="service"] .stat .num { font-size: 1.4rem; }
[data-voice="service"] .nav-row { margin-top: 24px; padding-top: 16px; }
[data-voice="service"] .btn { padding: 10px 16px; font-size: 0.78rem; }
[data-voice="service"] .beer { gap: 24px; grid-template-columns: 280px 1fr; }
[data-voice="service"] .beer .info { gap: 16px; }
[data-voice="service"] .beer .glass-pane { padding: 14px; gap: 10px; }
[data-voice="service"] .beer .glass-pane .glass-art { max-width: 200px; }
[data-voice="service"] .beer .glass-pane .stat-grid .stat .num { font-size: 1.15rem; }
[data-voice="service"] .callout { padding: 16px 18px 16px 22px; }
[data-voice="service"] .callout p { font-size: 0.92rem; line-height: 1.45; }
[data-voice="service"] .note-chip { padding: 4px 10px; font-size: 0.72rem; }
[data-voice="service"] .pair-grid .pair { padding: 10px 8px; font-size: 0.78rem; }
[data-voice="service"] .do-dont > div { padding: 12px 14px; }
[data-voice="service"] .do-dont ul { font-size: 0.82rem; }
[data-voice="service"] .section-title { margin-bottom: 8px; }
[data-voice="service"] .wall-tile { padding: 16px; min-height: 220px; gap: 8px; }
[data-voice="service"] .wall-tile .glass { height: 88px; }
[data-voice="service"] .scenario-card,
[data-voice="service"] .quiz-card { padding: 22px; }
[data-voice="service"] .scenario-card .quote,
[data-voice="service"] .quiz-card .qtext { font-size: clamp(1.1rem, 2vw, 1.4rem); }
[data-voice="service"] .match-options .opt,
[data-voice="service"] .quiz-option { padding: 10px 14px; }
[data-voice="service"] .pairing-target { min-height: 110px; padding: 12px; }

@media (min-width: 880px) {
  [data-voice="service"] .beer { grid-template-columns: 280px 1fr; }
  [data-voice="service"] .beer .glass-pane { position: sticky; top: 70px; }
}

/* ============ Tweak: Clean (no paper grain) ============ */
[data-texture="clean"] body::before,
.shell[data-texture="clean"] ~ * body::before { display: none; }
[data-texture="clean"] .cover .right::before,
[data-texture="clean"] .cert::before,
[data-texture="clean"] .cert::after { display: none; }
[data-texture="clean"] .callout::before { opacity: 0; }
[data-texture="clean"] h1, [data-texture="clean"] h2, [data-texture="clean"] h3 {
  letter-spacing: -0.025em;
}
[data-texture="clean"] .note-chip,
[data-texture="clean"] .btn,
[data-texture="clean"] .menu-link,
[data-texture="clean"] .quiz-option,
[data-texture="clean"] .match-options .opt,
[data-texture="clean"] .pairing-foods .food,
[data-texture="clean"] .pairing-target .drops .placed { border-radius: 8px; }
[data-texture="clean"] .scenario-card,
[data-texture="clean"] .quiz-card,
[data-texture="clean"] .beer .glass-pane,
[data-texture="clean"] .cert,
[data-texture="clean"] .callout,
[data-texture="clean"] .cover .right,
[data-texture="clean"] .pairing-foods { border-radius: 12px; }
[data-texture="clean"] .wall-grid,
[data-texture="clean"] .pair-grid,
[data-texture="clean"] .pairing-targets,
[data-texture="clean"] .do-dont,
[data-texture="clean"] .intro-list { border-radius: 12px; overflow: hidden; }

/* paper texture only when chosen */
body::before { display: none; }
.shell[data-texture="paper"] ~ * body::before,
body:has(.shell[data-texture="paper"])::before { display: block; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
button:focus-visible { outline: 2px solid var(--amber-deep); outline-offset: 3px; }

h1, h2, h3, h4 { font-weight: 900; letter-spacing: -0.01em; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(2.4rem, 6vw, 5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); letter-spacing: -0.01em; }

.eyebrow {
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.7;
}

.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}
.rule-strong {
  border: 0;
  border-top: 2px solid var(--ink);
  margin: 0;
}

/* ============ Shell ============ */
.shell {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.topbar .logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  padding: 0;
}
.topbar .logo img.logo-img { height: 38px; width: auto; display: block; }
.topbar .logo img { width: 28px; height: 28px; display: block; }
.topbar .crumbs {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.7;
  margin-left: 8px;
}
.topbar .progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 12px;
}
.progress-track {
  flex: 1;
  height: 4px;
  background: var(--cream-3);
  border-radius: 99px;
  overflow: hidden;
  max-width: 360px;
}
.progress-fill {
  display: block;
  height: 100%;
  background: var(--ink);
  transition: width 380ms cubic-bezier(0.65, 0, 0.35, 1);
}
.progress-label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.7;
  white-space: nowrap;
}
.topbar .menu-btn {
  padding: 8px 14px;
  border: 1px solid var(--ink);
  border-radius: 99px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  background: transparent;
  transition: background 160ms, color 160ms;
}
.topbar .menu-btn:hover { background: var(--ink); color: var(--cream); }
.topbar .menu-btn.active { background: var(--amber); border-color: var(--amber-deep); color: var(--ink); }

/* ============ Page ============ */
.page {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 64px) clamp(20px, 5vw, 56px) 120px;
  position: relative;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 0;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  transition: transform 120ms, background 160ms, color 160ms, border-color 160ms;
}
.btn:hover { transform: translateY(-1px); background: var(--ink); color: var(--cream); }
.btn.primary { background: var(--ink); color: var(--cream); }
.btn.primary:hover { background: var(--amber); color: var(--ink); border-color: var(--amber-deep); }
.btn.amber { background: var(--amber); border-color: var(--amber-deep); }
.btn.amber:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn .arrow { font-size: 1.05em; line-height: 1; }

.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

/* ============ Cover (Welcome) ============ */
.cover {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(24px, 5vw, 80px);
  align-items: stretch;
  min-height: calc(100vh - 200px);
}
.cover .left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}
.cover h1 {
  font-size: clamp(2.6rem, 7vw, 6rem);
}
.cover .lede {
  max-width: 36ch;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.55;
  opacity: 0.85;
}
.cover .lede-note {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  max-width: 38ch;
  margin: 18px 0 4px;
  padding: 16px 18px;
  background: var(--cream-2);
  border-left: 3px solid var(--amber-deep);
}
.cover .lede-note .hand {
  flex: 0 0 auto;
  font-size: 1.6rem;
  line-height: 1;
  margin-top: 2px;
}
.cover .lede-note p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  opacity: 0.9;
}
.cover .stat-row {
  display: flex; gap: 32px; flex-wrap: wrap;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}
.stat { line-height: 1; }
.stat .num { font-weight: 900; font-size: 2rem; letter-spacing: -0.02em; }
.stat .lbl { font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.7; margin-top: 6px; }

.cover .right {
  position: relative;
  background: var(--ink);
  color: var(--cream);
  padding: clamp(24px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  min-height: 420px;
}
.cover .right::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(244,241,233,0.18);
  pointer-events: none;
}
.cover .right .hop {
  position: absolute;
  right: -40px; bottom: -40px;
  width: 360px; height: 360px;
  opacity: 0.95;
}
.cover .right .stamp {
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.7;
}
.cover .right .stamp-big {
  font-weight: 900;
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -0.02em;
  margin: 16px 0 0;
  max-width: 14ch;
}
.cover .right .meta {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 0.85rem;
  position: relative;
  z-index: 2;
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid rgba(244,241,233,0.28);
  background: var(--ink);
  box-shadow: 0 12px 40px -16px rgba(0,0,0,0.7);
}
.cover .right .meta > div { display: flex; flex-direction: column; gap: 2px; }
.cover .right .meta > div + div { margin-top: 4px; padding-top: 8px; border-top: 1px dashed rgba(244,241,233,0.12); }
.cover .right .meta strong { font-weight: 500; opacity: 0.7; letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.7rem; }
.cover .right .cover-headline { position: relative; z-index: 2; }

@media (max-width: 880px) {
  .cover {
    display: flex;
    flex-direction: column;
    min-height: auto;
    gap: 28px;
  }
  .cover .left { display: contents; }
  /* Re-establish vertical rhythm now that .left's children are siblings of .right */
  .cover .left > * + * { margin-top: 28px; }
  .cover .left > .lede-note { margin-top: 18px; }
  /* The button wrapper is the last child of .left; push it below the stamp box */
  .cover .left > :last-child { order: 2; margin-top: 0; }
  .cover .right { order: 1; min-height: 320px; margin-top: 0; }
}

/* ============ Wall (TOC) ============ */
.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 36px;
}
.wall-tile {
  background: var(--cream);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  position: relative;
  transition: background 160ms;
  text-align: left;
  align-items: stretch;
  min-height: 320px;
}
.wall-tile:hover { background: var(--cream-2); }
.wall-tile.active { background: var(--ink); color: var(--cream); }
.wall-tile.done::after {
  content: "✓";
  position: absolute;
  top: 14px; right: 14px;
  width: 22px; height: 22px;
  background: var(--amber);
  color: var(--ink);
  display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 900;
  border-radius: 50%;
}
.wall-tile .num {
  font-weight: 900;
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  opacity: 0.5;
}
.wall-tile .glass { height: 140px; display: grid; place-items: center; }
.wall-tile .name { font-weight: 900; font-size: 1.25rem; letter-spacing: -0.01em; line-height: 1.1; }
.wall-tile .style { font-size: 0.75rem; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.7; }

/* ============ Beer detail ============ */
.beer {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.beer .glass-pane {
  position: sticky;
  top: 90px;
  background: var(--cream-2);
  border: 1px solid var(--line);
  padding: 24px;
  display: flex; flex-direction: column; align-items: center;
  gap: 18px;
}
.beer .glass-pane .glass-art { width: 100%; max-width: 320px; }
.beer .glass-pane .glass-label {
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.7;
  text-align: center;
}
.beer .glass-pane .stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  width: 100%;
  border-top: 2px solid var(--ink);
  margin-top: 8px;
  padding-top: 16px;
  gap: 8px;
}
.beer .glass-pane .stat-grid .stat { text-align: center; }
.beer .glass-pane .stat-grid .stat .num { font-size: 1.5rem; }

/* Tooltip on the ABV / IBU / SRM labels — hover or focus reveals an explainer. */
.beer .glass-pane .stat-grid .stat .lbl[data-tip] {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: help;
  border-bottom: 1px dotted var(--line-strong);
  padding-bottom: 1px;
}
.beer .glass-pane .stat-grid .stat .lbl[data-tip] .tip-mark {
  display: inline-grid;
  place-items: center;
  width: 12px; height: 12px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0.6;
  transition: opacity 160ms ease, background 160ms ease, color 160ms ease;
}
.beer .glass-pane .stat-grid .stat .lbl[data-tip]:hover .tip-mark,
.beer .glass-pane .stat-grid .stat .lbl[data-tip]:focus-visible .tip-mark {
  opacity: 1;
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.beer .glass-pane .stat-grid .stat .lbl[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 240px;
  padding: 10px 12px;
  background: var(--ink);
  color: var(--cream);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-transform: none;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  box-shadow: 0 18px 40px -16px rgba(0,0,0,0.45);
  transition: opacity 160ms ease, transform 160ms ease;
}
.beer .glass-pane .stat-grid .stat .lbl[data-tip]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%) translateY(4px);
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--ink);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  transition: opacity 160ms ease, transform 160ms ease;
}
.beer .glass-pane .stat-grid .stat .lbl[data-tip]:hover::after,
.beer .glass-pane .stat-grid .stat .lbl[data-tip]:focus-visible::after,
.beer .glass-pane .stat-grid .stat .lbl[data-tip]:hover::before,
.beer .glass-pane .stat-grid .stat .lbl[data-tip]:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* Edge stats — push the tooltip inward so it doesn't clip the glass pane. */
.beer .glass-pane .stat-grid .stat:first-child .lbl[data-tip]::after {
  left: 0;
  transform: translateX(0) translateY(4px);
}
.beer .glass-pane .stat-grid .stat:first-child .lbl[data-tip]:hover::after,
.beer .glass-pane .stat-grid .stat:first-child .lbl[data-tip]:focus-visible::after {
  transform: translateX(0) translateY(0);
}
.beer .glass-pane .stat-grid .stat:last-child .lbl[data-tip]::after {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(4px);
}
.beer .glass-pane .stat-grid .stat:last-child .lbl[data-tip]:hover::after,
.beer .glass-pane .stat-grid .stat:last-child .lbl[data-tip]:focus-visible::after {
  transform: translateX(0) translateY(0);
}

.beer .info { display: flex; flex-direction: column; gap: 28px; }
.beer .info h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
.beer .style-line { font-size: 0.78rem; letter-spacing: 0.32em; text-transform: uppercase; opacity: 0.7; }
.beer .tagline { font-size: clamp(1.05rem, 1.4vw, 1.25rem); font-weight: 500; max-width: 50ch; }

.notes { display: flex; flex-wrap: wrap; gap: 8px; }
.note-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--ink);
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.callout {
  position: relative;
  padding: 28px 28px 28px 32px;
  background: var(--ink);
  color: var(--cream);
}
.callout .label {
  font-size: 0.72rem; letter-spacing: 0.32em; text-transform: uppercase;
  opacity: 0.7; margin-bottom: 10px;
}
.callout p { margin: 0; font-size: 1rem; line-height: 1.55; }
.callout::before {
  content: "“";
  position: absolute;
  top: -10px; left: 18px;
  font-family: Georgia, serif;
  font-size: 4rem; line-height: 1;
  color: var(--amber);
}

.do-dont { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.do-dont > div { background: var(--cream); padding: 18px 20px; }
.do-dont .label { font-size: 0.7rem; letter-spacing: 0.32em; text-transform: uppercase; font-weight: 900; margin-bottom: 10px; }
.do-dont .label.do { color: var(--ink); }
.do-dont .label.dont { color: #B33A2B; }
.do-dont ul { margin: 0; padding-left: 16px; font-size: 0.92rem; line-height: 1.45; }
.do-dont li + li { margin-top: 6px; }

.flavor-bars { display: grid; gap: 10px; }
.flavor-bars .row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 14px; }
.flavor-bars .lbl { font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.75; }
.flavor-bars .bar { height: 8px; background: var(--cream-3); position: relative; }
.flavor-bars .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); }
.flavor-bars .bar.amber i { background: var(--amber-deep); }

.pair-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px; background: var(--line); border: 1px solid var(--line);
}
@media (min-width: 480px) {
  .pair-grid { grid-template-columns: repeat(2, 1fr); }
}
.pair-grid .pair {
  background: var(--cream);
  padding: 14px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

.section-title {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 16px;
}
.section-title .t {
  font-weight: 900; letter-spacing: 0.02em; text-transform: uppercase;
  font-size: 0.78rem; letter-spacing: 0.32em;
}
.section-title .line { flex: 1; height: 1px; background: var(--line); }

@media (max-width: 880px) {
  .beer { grid-template-columns: 1fr; }
  .beer .glass-pane { position: relative; top: 0; }
  .do-dont { grid-template-columns: 1fr; }
}

/* ============ Matching game ============ */
.match-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  margin-top: 32px;
}
.scenario-card {
  background: var(--cream-2);
  border: 1px solid var(--line);
  padding: clamp(24px, 4vw, 40px);
  position: relative;
}
.scenario-card .portrait-wrap {
  width: clamp(96px, 16vw, 140px);
  aspect-ratio: 120 / 140;
  margin: 0 0 20px;
  color: var(--ink);
  opacity: 0.92;
}
.scenario-card .portrait-wrap .portrait { width: 100%; height: 100%; }
.scenario-card .portrait-wrap svg { display: block; width: 100%; height: 100%; }
.scenario-card .num {
  font-size: 0.72rem; letter-spacing: 0.32em; text-transform: uppercase;
  opacity: 0.7; margin-bottom: 16px;
}
.scenario-card .quote {
  font-weight: 900; font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.2; letter-spacing: -0.01em;
}
.scenario-card .vibe {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.85;
}

.match-options { display: grid; gap: 10px; }
.match-options .opt {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  background: var(--cream);
  text-align: left;
  transition: background 160ms, border-color 160ms;
  cursor: pointer;
}
.match-options .opt:hover { background: var(--cream-2); border-color: var(--ink); }
.match-options .opt.right { background: var(--amber); border-color: var(--amber-deep); }
.match-options .opt.wrong { background: #F5D8D0; border-color: #B33A2B; }
.match-options .opt .swatch {
  width: 36px; height: 36px; flex-shrink: 0;
  border: 1px solid var(--ink);
}
.match-options .opt .meta { flex: 1; }
.match-options .opt .meta .nm { font-weight: 900; font-size: 0.95rem; }
.match-options .opt .meta .st { font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.7; }

.feedback {
  margin-top: 16px;
  padding: 16px 20px;
  background: var(--ink);
  color: var(--cream);
  border-left: 4px solid var(--amber);
  font-size: 0.92rem;
  line-height: 1.5;
}
.feedback.wrong { border-left-color: #E07560; }

@media (max-width: 880px) { .match-stage { grid-template-columns: 1fr; } }

/* ============ Pairing drag ============ */
.pairing-stage { margin-top: 24px; }
.pairing-foods {
  display: flex; flex-wrap: wrap; gap: 12px;
  padding: 24px; background: var(--cream-2); border: 1px solid var(--line);
  margin-bottom: 24px; min-height: 100px;
  align-items: center;
}
.pairing-foods .food {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--cream); border: 1px solid var(--ink);
  font-weight: 500; font-size: 0.9rem;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.pairing-foods .food.dragging { opacity: 0.4; }
.pairing-foods .food.active { background: var(--amber); border-color: var(--amber-deep); }
.pairing-foods.over { background: var(--cream-3); border-style: dashed; }
.pairing-foods .food .e { font-size: 1.1rem; }

.pairing-targets {
  display: grid;
  /* Lock to 1×6 on narrow screens, 2×3 once we have room — avoids
     awkward 3-column orphan rows. */
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
@media (min-width: 560px) {
  .pairing-targets { grid-template-columns: 1fr 1fr; }
}
.pairing-target {
  background: var(--cream);
  padding: 18px;
  min-height: 160px;
  display: flex; flex-direction: column; gap: 10px;
  transition: background 140ms;
}
.pairing-target.over { background: var(--cream-2); }
.pairing-target.right { background: rgba(250, 189, 103, 0.25); }
.pairing-target.wrong { background: rgba(179, 58, 43, 0.12); }
.pairing-target .head { display: flex; align-items: center; gap: 10px; }
.pairing-target .head .swatch { width: 18px; height: 18px; border: 1px solid var(--ink); }
.pairing-target .head .nm { font-weight: 900; font-size: 0.85rem; }
.pairing-target .drops { display: flex; flex-wrap: wrap; gap: 6px; }
.pairing-target .drops .placed {
  padding: 6px 10px; font-size: 0.78rem; font-weight: 500;
  border: 1px solid var(--ink); background: var(--cream);
}
.pairing-target .drops .placed.right { background: var(--amber); }
.pairing-target .drops .placed.wrong { background: #F5D8D0; border-color: #B33A2B; }
.pairing-target .drops .placed { cursor: grab; user-select: none; touch-action: none; transition: transform 120ms; }
.pairing-target .drops .placed:hover { transform: translateY(-1px); }
.pairing-target .drops .placed.active { outline: 2px solid var(--amber-deep); outline-offset: 2px; }

/* ============ Quiz ============ */
.quiz-card { background: var(--cream-2); border: 1px solid var(--line); padding: clamp(24px, 4vw, 40px); }
.quiz-card .qnum { font-size: 0.72rem; letter-spacing: 0.32em; text-transform: uppercase; opacity: 0.7; margin-bottom: 16px; }
.quiz-card .qtext { font-weight: 900; font-size: clamp(1.4rem, 2.4vw, 2rem); line-height: 1.2; letter-spacing: -0.01em; max-width: 32ch; }
.quiz-options { margin-top: 28px; display: grid; gap: 10px; }
.quiz-option {
  text-align: left; padding: 16px 20px;
  border: 1px solid var(--line); background: var(--cream);
  font-size: 0.95rem; font-weight: 500;
  display: flex; align-items: center; gap: 14px;
  transition: background 140ms, border-color 140ms;
  cursor: pointer;
}
.quiz-option:hover { background: var(--cream-2); border-color: var(--ink); }
.quiz-option .key {
  width: 28px; height: 28px; border: 1.5px solid var(--ink); border-radius: 50%;
  display: grid; place-items: center; font-weight: 900; font-size: 0.75rem;
  flex-shrink: 0;
}
.quiz-option.right { background: var(--amber); border-color: var(--amber-deep); }
.quiz-option.wrong { background: #F5D8D0; border-color: #B33A2B; }
.quiz-option.disabled { cursor: default; pointer-events: none; }

/* ============ Completion ============ */
.cert {
  background: var(--ink); color: var(--cream); padding: clamp(32px, 6vw, 80px);
  position: relative; overflow: hidden;
  border: 1px solid var(--ink);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.cert::before, .cert::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(244,241,233,0.18);
  pointer-events: none;
}
.cert::before { inset: 12px; }
.cert::after { inset: 24px; border-color: rgba(244,241,233,0.08); }
.cert .seal {
  width: 84px; height: 84px;
  background: var(--amber);
  border-radius: 50%;
  display: grid; place-items: center;
  position: relative; z-index: 2;
}
.cert h1 { font-size: clamp(2.4rem, 5vw, 4rem); position: relative; z-index: 2; }
.cert .stamp { font-size: 0.7rem; letter-spacing: 0.32em; text-transform: uppercase; opacity: 0.7; position: relative; z-index: 2; }
.cert .score-row {
  display: flex; gap: 32px; justify-content: center; flex-wrap: wrap;
  border-top: 1px solid rgba(244,241,233,0.18);
  border-bottom: 1px solid rgba(244,241,233,0.18);
  padding: 18px 0; min-width: min(420px, 90%);
  position: relative; z-index: 2;
}
.cert .score-row .stat .num { font-size: 2.4rem; }
.cert .score-row .stat .lbl { opacity: 0.6; }
.cert .actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; position: relative; z-index: 2; }
.cert .actions .btn { color: var(--cream); border-color: var(--cream); }
.cert .actions .btn:hover { background: var(--amber); color: var(--ink); border-color: var(--amber); }
.cert .actions .btn.amber { background: var(--amber); color: var(--ink); border-color: var(--amber); }

/* ============ Beer wall summary card on intro ============ */
.intro-list {
  margin-top: 36px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px; background: var(--line); border: 1px solid var(--line);
}
@media (min-width: 560px) {
  .intro-list { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 880px) {
  .intro-list { grid-template-columns: repeat(3, 1fr); }
}
.intro-list .item { background: var(--cream); padding: 18px 20px; }
.intro-list .item .num { font-size: 0.7rem; letter-spacing: 0.32em; opacity: 0.6; }
.intro-list .item .nm { font-weight: 900; font-size: 1.05rem; margin-top: 8px; }
.intro-list .item .st { font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.7; margin-top: 4px; }

/* Visited beers on the intro grid become clickable shortcuts back to that page.
   The visual cue is intentionally subtle: a small amber dot + "Visited" tag in
   the eyebrow row, an arrow that fades in on hover, and a quiet background lift. */
.intro-list .item.visited {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  position: relative;
  border: 0;
  background: var(--cream);
  transition: background 160ms ease, transform 160ms ease;
}
.intro-list .item.visited::before {
  content: "";
  position: absolute;
  inset: 0;
  border-left: 2px solid var(--amber-deep);
  pointer-events: none;
  opacity: 0.85;
}
.intro-list .item.visited:hover {
  background: var(--cream-2);
}
.intro-list .item.visited .num {
  display: flex;
  align-items: center;
  gap: 8px;
}
.intro-list .item.visited .revisit-arrow {
  display: inline-block;
  margin-left: 4px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
  color: var(--amber-deep);
  font-weight: 700;
}
.intro-list .item.visited:hover .revisit-arrow,
.intro-list .item.visited:focus-visible .revisit-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ============ Index page ============ */
.menu-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(46,45,50,0.6);
  display: grid; place-items: end stretch;
  animation: fade 180ms ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.menu-panel {
  width: min(540px, 100%);
  height: 100%;
  background: var(--cream);
  padding: 24px;
  display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto;
  animation: slideIn 240ms cubic-bezier(0.32, 0.72, 0, 1);
  margin-left: auto;
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.menu-panel h3 { font-size: 0.78rem; letter-spacing: 0.32em; text-transform: uppercase; opacity: 0.7; margin: 16px 0 4px; font-weight: 500; }
.menu-link {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: transparent; text-align: left;
  font-weight: 500;
  font-size: 0.95rem;
}
.menu-link:hover { background: var(--cream-2); }
.menu-link.active { background: var(--ink); color: var(--cream); }
.menu-link .lbl-num { font-weight: 900; font-size: 0.72rem; letter-spacing: 0.2em; opacity: 0.6; width: 32px; }
.menu-link .ck {
  margin-left: auto;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--amber); color: var(--ink);
  display: grid; place-items: center; font-size: 0.7rem; font-weight: 900;
}
.menu-close {
  align-self: flex-end;
  padding: 8px 14px; border: 1px solid var(--ink);
  font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 500;
}

/* fade in screens */
.screen-enter {
  animation: rise 360ms cubic-bezier(0.2, 0.7, 0.1, 1);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* small */
@media (max-width: 640px) {
  .topbar .crumbs { display: none; }
  .topbar .menu-btn { padding: 8px 12px; font-size: 0.7rem; }
  .topbar { padding: 10px 14px; }
  .page { padding-bottom: 80px; }
  .nav-row { flex-wrap: wrap; }
  .nav-row .btn { flex: 1; justify-content: center; }
}
