/* ============================================================
   Oxford Social — Oxford Road, Manchester
   Design v4: strict monochrome built around the line-art crest
   (assets/img/logo-full.png). DARK is the default; light
   moments are deliberate via .theme-light. Components consume
   ONLY the contextual -c tokens so they read correctly in both
   contexts. .theme-dark is kept as a harmless alias.
   ============================================================ */

:root {
  /* brand — v4 mono */
  --black:   #101010;   /* page background — warm near-black */
  --black-2: #171716;   /* alternate dark band */
  --paper:   #f4f1ea;   /* light moments only (QR cards, print) */
  /* contextual tokens — components consume ONLY these */
  --bg-c:     var(--black);
  --bg-alt-c: var(--black-2);
  --ink-c:    #f2efe8;  /* warm white — matches the logo line work */
  --muted-c:  #a19b90;
  --line-c:   rgba(242,239,232,0.16);
  --accent-c: #f2efe8;  /* mono: accent IS the ink; hierarchy via size/opacity */
  --ok:  #7da77b;
  --bad: #c96b5a;
  --radius: 2px;
  --maxw: 1100px;
  --nav-h: 76px;
}

.theme-light {
  --bg-c: var(--paper);
  --bg-alt-c: #ebe7de;
  --ink-c: #121212;
  --muted-c: #6c675e;
  --line-c: rgba(18,18,18,0.16);
  --accent-c: #121212;
  background: var(--bg-c);
  color: var(--ink-c);
}

/* Dark is now the default — .theme-dark is a harmless alias
   (pages still carry the class on hero/footer/bands). */
.theme-dark {
  background: var(--bg-c);
  color: var(--ink-c);
}

/* Grain — dark bands only (see DESIGN-V3 §7 / V4 §3) */
.grain,
.page-hero {
  position: relative;
}
.grain::before,
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-c);
  color: var(--ink-c);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* clear the solid fixed nav */
  padding-top: var(--nav-h);
  /* clip, not hidden: hidden turns body into a scroll container, which
     breaks fixed-nav painting on some mobile browsers */
  overflow-x: clip;
}

h1, h2, h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: normal;
}

a { color: inherit; text-decoration: none; }

/* ===== LOGO IMAGE (assets/img/logo-crest.png — true transparent PNG;
   logo-full.png keeps the black bg for og:image/social cards) ===== */
.logo-img { display: inline-block; }
.hero__logo {
  display: block;
  width: min(520px, 78vw);
  height: auto;
  margin: 0 auto;
}
.footer__logo {
  display: block;
  width: 200px;
  max-width: 60vw;
  height: auto;
  margin: 0 auto;
}

/* ===== TEXT WORDMARK (nav, QR print cards, small/light contexts —
   v4 lockup: "SOCIAL" flanked by rules, matching the crest) ===== */
.wordmark {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  text-align: center;
  color: inherit;
}
.wordmark__oxford {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 500;
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 0.30em;
  margin-right: -0.30em;
}
.wordmark__social {
  display: flex;
  align-items: center;
  gap: 0.85em;
  font-family: "Inter", sans-serif;
  font-weight: 300;
  font-size: 0.34em;
  text-transform: uppercase;
  letter-spacing: 0.58em;
  margin-right: -0.58em;
  margin-top: 0.62em;
}
.wordmark__social::before,
.wordmark__social::after {
  content: "";
  width: 2.4em;
  height: 1px;
  background: currentColor;
  opacity: 0.9;
}

/* ===== EYEBROW / LABELS ===== */
.eyebrow {
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent-c);
  font-weight: 500;
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--accent-c);
  vertical-align: middle;
  margin-right: 0.9rem;
}
.eyebrow__num {
  color: var(--muted-c);
  margin-right: 0.6em;
}

.muted { color: var(--muted-c); }

/* ===== NAV (dark, hairline bottom) ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 70; /* above the games FAB (60) and the nav scrim (65) */
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.2rem, 5vw, 3rem);
  background: var(--bg-c);
  border-bottom: 1px solid var(--line-c);
}
.nav .wordmark { font-size: 1.25rem; color: var(--ink-c); }
.nav__links { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.2rem); }
.nav__links a {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-c);
  transition: color 0.2s ease;
}
.nav__links a:hover { color: var(--ink-c); }
.nav__links a[aria-current="page"] { color: var(--ink-c); }
.nav__cta {
  border: 1px solid var(--ink-c);
  padding: 0.5rem 1.05rem;
  border-radius: 2px;
  color: var(--ink-c) !important;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.nav__cta:hover { background: var(--ink-c); color: var(--bg-c) !important; }

/* Nav: scrolled / open states — subtle, still solid */
.nav.is-scrolled,
.nav.is-open {
  border-bottom-color: rgba(242,239,232,0.28);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* Nav: mobile hamburger (visible < 880px) */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 38px;
  padding: 0 10px;
  background: none;
  border: 1px solid var(--line-c);
  border-radius: 2px;
  cursor: pointer;
}
.nav__toggle span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--ink-c);
  transition: transform 0.32s cubic-bezier(0.22, 0.8, 0.26, 1), opacity 0.2s ease;
}
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 879px) {
  .nav__toggle { display: inline-flex; }

  /* Animated dropdown: always rendered, height driven by main.js
     (0 → measured px → auto), links stagger in. */
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    background: var(--bg-c);
    border-bottom: 1px solid var(--line-c);
    height: 0;
    overflow: hidden;
    visibility: hidden;
    transition:
      height 0.48s cubic-bezier(0.22, 0.8, 0.26, 1),
      visibility 0s linear 0.48s;
  }
  .nav.is-open .nav__links {
    visibility: visible;
    transition: height 0.48s cubic-bezier(0.22, 0.8, 0.26, 1);
  }
  .nav__links a {
    font-size: 0.8rem;
    padding: 0.95rem clamp(1.2rem, 5vw, 3rem);
    border-bottom: 1px solid var(--line-c);
    opacity: 0;
    transform: translateY(-10px);
    transition:
      opacity 0.26s ease,
      transform 0.32s cubic-bezier(0.22, 0.8, 0.26, 1),
      color 0.2s ease;
  }
  .nav__links a:first-child { margin-top: 0.4rem; }
  .nav__links a:last-child { border-bottom: 0; }
  .nav.is-open .nav__links a { opacity: 1; transform: none; }
  .nav.is-open .nav__links a:nth-child(1) { transition-delay: 0.07s; }
  .nav.is-open .nav__links a:nth-child(2) { transition-delay: 0.12s; }
  .nav.is-open .nav__links a:nth-child(3) { transition-delay: 0.17s; }
  .nav.is-open .nav__links a:nth-child(4) { transition-delay: 0.22s; }
  .nav.is-open .nav__links a:nth-child(5) { transition-delay: 0.27s; }
  .nav__links .nav__cta {
    margin: 0.8rem clamp(1.2rem, 5vw, 3rem) 1.1rem;
    padding: 0.75rem 1.05rem;
    text-align: center;
    border-bottom: 1px solid var(--ink-c);
  }

  /* Page scrim behind the open dropdown (injected by main.js). */
  .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(8, 6, 14, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
  }
  body.nav-open .nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Desktop: inline links — neutralise any mobile inline height left by
   main.js when the viewport crosses the breakpoint. */
@media (min-width: 880px) {
  .nav__links {
    height: auto !important;
    overflow: visible;
    visibility: visible;
  }
  .nav-scrim { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nav__links,
  .nav__links a,
  .nav-scrim { transition: none !important; }
}

/* ===== HERO (homepage — dark band, crest logo over ambient video) ===== */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(86vh - var(--nav-h));
  padding: clamp(4rem, 9vw, 7rem) 1.5rem;
}
/* Ambient video layer: mono-graded footage under a scrim that melts
   into the page black at the bottom. Stacking: video (0) → scrim →
   grain (1) → content (2). */
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(16, 16, 16, 0.66) 0%,
    rgba(16, 16, 16, 0.56) 42%,
    rgba(16, 16, 16, 0.84) 80%,
    var(--black) 100%
  );
}
.hero.grain::before { z-index: 1; }

.hero__inner { position: relative; z-index: 2; max-width: 820px; }
.hero__title {
  font-size: clamp(3rem, 9vw, 6.2rem);
  font-weight: 600;
  margin: 0;
}
.hero__rule {
  width: 48px;
  height: 1px;
  background: var(--accent-c);
  margin: clamp(1.8rem, 4vw, 2.6rem) auto;
}
.hero__tagline {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  color: var(--ink-c);
}
.hero__sub {
  margin: 0.9rem auto 0;
  max-width: 560px;
  color: var(--muted-c);
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
}
.hero__status {
  margin-top: 2.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted-c);
}
.hero__status strong { color: var(--ink-c); font-weight: 500; }
.hero__actions {
  margin-top: 2.6rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
  /* UA reset baked in — works on both <a> and <button> */
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  background: none;
  font: inherit;
  cursor: pointer;
  /* variant baseline */
  display: inline-block;
  padding: 0.95rem 2rem;
  border-radius: 2px;
  font-family: "Inter", sans-serif;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn--primary { background: var(--ink-c); color: var(--bg-c); }
.btn--primary:hover { background: transparent; border-color: var(--ink-c); color: var(--ink-c); }
.btn--ghost { border-color: var(--line-c); color: var(--ink-c); }
.btn--ghost:hover { border-color: var(--ink-c); color: var(--ink-c); }

/* ===== SECTIONS ===== */
.section { padding: clamp(4rem, 10vw, 8rem) clamp(1.2rem, 5vw, 3rem); }
.section--alt { background: var(--bg-alt-c); }
.section__grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 5fr 7fr;   /* asymmetric editorial grid */
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.section__head { max-width: 560px; }
.section__head--center { max-width: 640px; margin: 0 auto 3rem; text-align: center; }
.section h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); margin-bottom: 1.2rem; }
.section__body p { color: var(--muted-c); margin-bottom: 1rem; }
.section__more { text-align: center; margin-top: 2.8rem; }

.info { list-style: none; margin: 1.6rem 0 1rem; }
.info li {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line-c);
  color: var(--ink-c);
}
.info li span {
  min-width: 90px;
  color: var(--muted-c);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  padding-top: 0.3rem;
}

/* ===== CARDS (editorial — hairline top rule, no boxes) ===== */
.cards {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}
.card {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line-c);
  border-radius: 0;
  padding: 1.4rem 0 0;
  transition: border-color 0.3s ease;
}
.card:hover { border-top-color: var(--ink-c); }
.card h3 { font-size: 1.5rem; margin-bottom: 0.6rem; color: var(--ink-c); }
.card p { color: var(--muted-c); font-size: 0.97rem; }

.card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
.card__date {
  color: var(--ink-c);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
}
.card__price { margin-top: 0.9rem; color: var(--ink-c); font-size: 0.9rem; }
.card > .badge { margin-bottom: 0.9rem; }

/* ===== EVENTS PREVIEW (homepage — hairline list rows) ===== */
.evlist {
  max-width: var(--maxw);
  margin: 0 auto;
  border-top: 1px solid var(--line-c);
}
.evrow {
  display: grid;
  grid-template-columns: 5.2rem minmax(0, 1fr) auto auto;
  gap: 1.6rem;
  align-items: center;
  padding: 1.7rem 0;
  border-bottom: 1px solid var(--line-c);
}
.evrow__date { line-height: 1; }
.evrow__day {
  display: block;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 500;
  font-size: 2.3rem;
  color: var(--ink-c);
}
.evrow__month {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted-c);
}
.evrow__title { font-size: 1.35rem; margin-bottom: 0.25rem; color: var(--ink-c); }
.evrow__desc { color: var(--muted-c); font-size: 0.95rem; }
.evrow__price {
  color: var(--ink-c);
  font-size: 0.85rem;
  white-space: nowrap;
}
.evrow__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}
.evrow__link {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted-c);
  white-space: nowrap;
  transition: color 0.2s ease;
}
.evrow__link:hover { color: var(--ink-c); }

@media (max-width: 640px) {
  .evrow { grid-template-columns: 4rem minmax(0, 1fr); gap: 0.8rem 1.2rem; }
  .evrow__meta { grid-column: 2; flex-direction: row; align-items: center; }
  .evrow__link { grid-column: 2; }
}

/* ===== ORDER-AT-TABLE STEPS (numbered, editorial) ===== */
.steps {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  text-align: left;
}
.step {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line-c);
  border-radius: 0;
  padding: 1.4rem 0 0;
}
.step__num {
  display: block;
  width: auto;
  height: auto;
  border: 0;
  margin-bottom: 0.9rem;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--ink-c);
}
.step h3 { font-size: 1.4rem; margin-bottom: 0.45rem; color: var(--ink-c); }
.step p { color: var(--muted-c); font-size: 0.95rem; }

/* ===== MAP (grayscale inside a hairline frame — do NOT invert) ===== */
.map {
  border: 1px solid var(--line-c);
  border-radius: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(1) contrast(1.05) brightness(0.92); }

/* ===== MAILING LIST / CTA (compact centred band) ===== */
.section--cta {
  background: var(--bg-alt-c);
  border-top: 1px solid var(--line-c);
  text-align: center;
}
.cta { max-width: 620px; margin: 0 auto; }
.cta h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); margin-bottom: 0.8rem; }
.signup {
  display: flex;
  gap: 0.6rem;
  margin: 2rem auto 0.8rem;
  max-width: 460px;
}
.signup input {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 1rem;
  border-radius: 2px;
  border: 1px solid var(--line-c);
  background: var(--bg-c);
  color: var(--ink-c);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}
.signup input::placeholder { color: var(--muted-c); }
.signup input:focus {
  outline: none;
  border-color: var(--ink-c);
  box-shadow: inset 0 0 0 1px var(--ink-c);
}
.signup__msg { min-height: 1.4rem; font-size: 0.9rem; color: var(--ink-c); }
.signup__msg--bad { color: var(--bad); }
@media (max-width: 480px) {
  .signup { flex-direction: column; }
  .signup .btn { width: 100%; }
}

.socials {
  margin-top: 2.2rem;
  display: flex;
  gap: 1.8rem;
  justify-content: center;
}
.socials a {
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-c);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.socials a:hover { color: var(--ink-c); border-color: var(--ink-c); }

/* ===== FOOTER (dark band — crest logo above the links) ===== */
.footer {
  text-align: center;
  padding: clamp(5rem, 9vw, 7rem) 1.5rem 3rem;
  color: var(--muted-c);
}
.footer .logo-img { margin-bottom: 1.4rem; }
.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem 1.8rem;
  margin: 1.5rem 0 0.6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-c);
}
.footer__links a {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-c);
  transition: color 0.2s ease;
}
.footer__links a:hover { color: var(--ink-c); }
.footer__small { font-size: 0.8rem; margin-top: 0.7rem; }
.footer__small a { color: var(--ink-c); }
.footer__legal { margin-top: 1.2rem; color: var(--muted-c); opacity: 0.8; }

/* ===== REVEAL ON SCROLL ===== */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 820px) {
  .section__grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   GLOBAL COMPONENTS (site v2) — shared by every page.
   Page-specific styles live in css/<page>.css, loaded after this.
   ============================================================ */

/* ----- Page hero (subpages — dark band with grain) ----- */
.page-hero {
  display: flex;
  align-items: flex-end;
  padding: clamp(5rem, 10vw, 8rem) clamp(1.2rem, 5vw, 3rem);
  background: var(--bg-c);
  border-bottom: 1px solid var(--line-c);
}
.page-hero__inner { width: 100%; max-width: var(--maxw); margin: 0 auto; }
.page-hero h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); margin: 0.2rem 0 0; }
.page-hero h1::after {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  background: var(--accent-c);
  margin-top: 1.4rem;
}
.page-hero__lede { max-width: 580px; margin-top: 1.2rem; color: var(--muted-c); }

/* ----- Forms ----- */
.form { max-width: 640px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-c);
  font-weight: 500;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 2px;
  border: 1px solid var(--line-c);
  background: var(--bg-c);
  color: var(--ink-c);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--muted-c); }
.field select option { background: var(--bg-c); color: var(--ink-c); }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink-c);
  box-shadow: inset 0 0 0 1px var(--ink-c);
}
.field__hint { font-size: 0.8rem; color: var(--muted-c); min-height: 1.1em; }
.field--error input,
.field--error select,
.field--error textarea { border-color: var(--bad); }
.field--error input:focus,
.field--error select:focus,
.field--error textarea:focus { box-shadow: inset 0 0 0 1px var(--bad); }
.field--error label,
.field--error .field__hint { color: var(--bad); }

/* ----- Notices (inline result banners) ----- */
.notice {
  border: 1px solid var(--line-c);
  border-radius: 2px;
  background: rgba(242, 239, 232, 0.05);
  padding: 1.1rem 1.3rem;
  font-size: 0.95rem;
  color: var(--ink-c);
}
.notice--ok { border-color: rgba(125, 167, 123, 0.55); background: rgba(125, 167, 123, 0.07); }
.notice--bad { border-color: rgba(201, 107, 90, 0.55); background: rgba(201, 107, 90, 0.07); }

/* ----- Badges (outlined small-caps chips) ----- */
.badge {
  display: inline-block;
  padding: 0.24rem 0.65rem;
  border-radius: 2px;
  border: 1px solid var(--line-c);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-c);
  white-space: nowrap;
}
/* mono: the old "gold" emphasis chip is now full-ink outlined */
.badge--gold {
  color: var(--ink-c);
  border-color: var(--ink-c);
  background: transparent;
}

/* ----- Tabs (underline style) ----- */
.tabs {
  display: flex;
  gap: 0.2rem;
  border-bottom: 1px solid var(--line-c);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-c);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.tab:hover { color: var(--ink-c); }
.tab.is-active,
.tab[aria-selected="true"] { color: var(--ink-c); border-bottom-color: var(--ink-c); }

/* ----- Data table (staff) ----- */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tbl th {
  text-align: left;
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-c);
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line-c);
}
.tbl td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line-c);
  color: var(--ink-c);
  vertical-align: top;
}
.tbl tr:hover td { background: rgba(242, 239, 232, 0.04); }

/* ----- Modal ----- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(0, 0, 0, 0.65);
}
.modal[hidden] { display: none; }
.modal__panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: min(86vh, 720px);
  overflow-y: auto;
  background: var(--bg-alt-c);
  color: var(--ink-c);
  border: 1px solid var(--line-c);
  border-radius: 2px;
  padding: 2rem 1.8rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.modal__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 36px;
  height: 36px;
  border-radius: 2px;
  border: 1px solid var(--line-c);
  background: none;
  color: var(--muted-c);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.modal__close:hover { color: var(--ink-c); border-color: var(--ink-c); }

/* ----- Toast (shown/hidden by window.OXSO.toast) — inverted mono pill ----- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.6rem;
  transform: translate(-50%, 12px);
  z-index: 120;
  max-width: min(92vw, 480px);
  padding: 0.8rem 1.5rem;
  border-radius: 2px;
  border: 1px solid var(--ink-c);
  background: var(--ink-c);
  color: var(--bg-c);
  font-size: 0.9rem;
  text-align: center;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ----- Quantity stepper (rectangular) ----- */
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-c);
  border-radius: 2px;
  overflow: hidden;
}
.qty button {
  appearance: none;
  background: none;
  border: 0;
  width: 34px;
  height: 34px;
  color: var(--ink-c);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
}
.qty button:hover { opacity: 0.7; }
.qty__count {
  min-width: 2ch;
  padding: 0 0.2rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--ink-c);
  font-variant-numeric: tabular-nums;
}

/* ----- Skeleton shimmer (loading states, hairline tones) ----- */
.skel {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line-c);
  min-height: 1em;
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(242, 239, 232, 0.14), transparent);
  transform: translateX(-100%);
  animation: skel-shimmer 1.4s infinite;
}
@keyframes skel-shimmer { to { transform: translateX(100%); } }

/* ----- Focus visibility (a11y) ----- */
.btn:focus-visible,
.nav__toggle:focus-visible,
.tab:focus-visible,
.modal__close:focus-visible,
.qty button:focus-visible {
  outline: 2px solid var(--ink-c);
  outline-offset: 2px;
}

/* ----- Honeypot field — visually hidden, still in the DOM for bots ----- */
.hp {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ============================================================
   GAMES — bar games hub (js/games.js, every public page).
   A floating die button opens a modal with "Flick the Dice"
   and "Most Likely To". All markup is injected at runtime;
   everything here consumes only the contextual -c tokens.
   The .die/.die__cube/.die__face/.die__pip classes are reused
   from the old homepage dice section — JS drives the
   translate/rotate transforms.
   ============================================================ */

/* ----- Floating action button ----- */
.games-fab {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 60; /* above page content, below modals (100) */
  width: 60px;
  height: 60px;
  padding: 0;
  border: 1px solid var(--line-c);
  border-radius: 50%;
  background: var(--ink-c);
  color: var(--bg-c);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: opacity 0.2s ease;
}
.games-fab svg { width: 26px; height: 26px; display: block; }
.games-fab:hover { opacity: 0.85; }
.games-fab:focus-visible {
  outline: 2px solid var(--ink-c);
  outline-offset: 3px;
}
/* order.html: clear the fixed cart bar when it's visible
   (js/games.js toggles this off the #cartBar hidden attribute). */
.games-fab--raised {
  bottom: calc(96px + env(safe-area-inset-bottom, 0px) + 14px);
}

/* ----- Modal: bottom sheet on small screens, centred ≥640px ----- */
.games-modal {
  align-items: flex-end;
  padding: 0;
}
.games-modal__panel {
  max-width: none;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  padding: 2.4rem 1.4rem 2rem;
}
@media (min-width: 640px) {
  .games-modal { align-items: center; padding: 1.2rem; }
  .games-modal__panel {
    max-width: 480px;
    border: 1px solid var(--line-c);
    padding: 2.4rem 2rem 2.2rem;
  }
}
body.games-modal-open { overflow: hidden; }

.games-back {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  width: 36px;
  height: 36px;
  border-radius: 2px;
  border: 1px solid var(--line-c);
  background: none;
  color: var(--muted-c);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.games-back:hover { color: var(--ink-c); border-color: var(--ink-c); }
.games-back:focus-visible {
  outline: 2px solid var(--ink-c);
  outline-offset: 2px;
}

/* ----- Views + shared text ----- */
.games-view { text-align: center; }
.games-eyebrow { margin-bottom: 0.9rem; }
.games-title {
  font-size: clamp(1.6rem, 5.4vw, 2rem);
  color: var(--ink-c);
}
.games-title:focus,
.games-prompt:focus { outline: none; }
.games-sub {
  margin-top: 0.8rem;
  color: var(--muted-c);
  font-size: 0.92rem;
}
.games-hint {
  margin-top: 1rem;
  color: var(--muted-c);
  font-size: 0.85rem;
}
.games-actions {
  margin-top: 1.3rem;
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}
.games-result {
  margin-top: 1.1rem;
  min-height: 1.9rem;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--ink-c);
}

/* ----- Game menu (two hairline-card buttons) ----- */
.games-choice {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1.6rem;
}
/* explicit display beats the UA [hidden] rule — restore it */
.games-choice[hidden] { display: none; }
.games-choicebtn {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 1px solid var(--line-c);
  border-radius: var(--radius);
  padding: 1.15rem 1.3rem;
  text-align: left;
  color: var(--ink-c);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.games-choicebtn:hover { border-color: var(--ink-c); }
.games-choicebtn__name {
  display: block;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.35rem;
  line-height: 1.15;
}
.games-choicebtn__sub {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted-c);
  font-size: 0.85rem;
}

/* ----- Player-count chips ----- */
.games-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1.5rem;
}
.games-chip {
  appearance: none;
  -webkit-appearance: none;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line-c);
  border-radius: var(--radius);
  background: none;
  color: var(--ink-c);
  font: inherit;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.games-chip:hover { border-color: var(--ink-c); }

/* ----- Dice stage (walled arena inside the panel) ----- */
.games-stage {
  --die-size: clamp(56px, 18vw, 64px);
  position: relative;
  height: clamp(190px, 52vw, 240px);
  margin-top: 1.4rem;
  border: 1px solid var(--line-c);
  border-radius: var(--radius);
  background: var(--bg-c); /* inset against the alt-band panel */
  perspective: 1100px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}
.games-stage:focus-visible {
  outline: 2px solid var(--ink-c);
  outline-offset: 2px;
}
.games-stage.is-locked .die { cursor: default; }

/* ----- Scoreboard ----- */
.games-board {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line-c);
  text-align: left;
}
.games-board li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.2rem;
  border-bottom: 1px solid var(--line-c);
  color: var(--muted-c);
  font-size: 0.95rem;
}
.games-board li.is-lowest { color: var(--ink-c); }
.games-board li.is-lowest .games-board__who { font-weight: 500; }
.games-board__num {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  color: inherit;
}
.games-verdict {
  margin-top: 1.4rem;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.15rem, 4vw, 1.4rem);
  color: var(--ink-c);
}
.games-flourish {
  margin-top: 0.7rem;
  color: var(--muted-c);
  font-size: 0.92rem;
}

/* ----- Most Likely To ----- */
.games-rules {
  margin: 1.4rem auto 0;
  padding: 0;
  max-width: 330px;
  list-style: none;
  counter-reset: games-rule;
  text-align: left;
}
.games-rules li {
  counter-increment: games-rule;
  display: flex;
  gap: 0.9rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-c);
  color: var(--muted-c);
  font-size: 0.92rem;
}
.games-rules li::before {
  content: "0" counter(games-rule);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.1rem;
  color: var(--ink-c);
  line-height: 1.4;
}
.games-prompt {
  margin-top: 0.4rem;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 500;
  font-size: clamp(1.5rem, 6vw, 2rem);
  line-height: 1.2;
  color: var(--ink-c);
  min-height: 4.6rem;
}
.games-counter {
  margin-top: 0.9rem;
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted-c);
}
.games-count {
  margin-top: 1rem;
  min-height: 3.4rem;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2.6rem;
  line-height: 1.2;
  color: var(--ink-c);
  font-variant-numeric: tabular-nums;
}
.games-count--point { animation: games-point 0.45s ease; }
@keyframes games-point {
  0% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}
.games-reveal {
  margin-top: 0.5rem;
  color: var(--muted-c);
  font-size: 0.92rem;
}

@media (prefers-reduced-motion: reduce) {
  .games-fab { transition: none; }
  .games-count--point { animation: none; }
}

/* ----- Dice cubes (reused from the old homepage dice section;
   warm-white faces, dark pips, per-face brightness shading) ----- */
.die {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--die-size);
  height: var(--die-size);
  cursor: grab;
  will-change: transform;
  touch-action: none;
}
.die:active { cursor: grabbing; }
.die__cube {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}
/* Short ease onto the final face once the tumble dies down —
   js/dice.js toggles this class (kept off while flying). */
.die__cube.is-settling {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.die__face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 13%;
  background: var(--ink-c);
  border-radius: var(--radius);
  backface-visibility: hidden;
}
/* Cube assembly + per-face shading (brightness only — no colors) */
.die__face--1 { transform: translateZ(calc(var(--die-size) / 2)); }
.die__face--2 { transform: rotateY(90deg) translateZ(calc(var(--die-size) / 2)); filter: brightness(0.90); }
.die__face--3 { transform: rotateX(90deg) translateZ(calc(var(--die-size) / 2)); filter: brightness(0.96); }
.die__face--4 { transform: rotateX(-90deg) translateZ(calc(var(--die-size) / 2)); filter: brightness(0.84); }
.die__face--5 { transform: rotateY(-90deg) translateZ(calc(var(--die-size) / 2)); filter: brightness(0.90); }
.die__face--6 { transform: rotateY(180deg) translateZ(calc(var(--die-size) / 2)); filter: brightness(0.80); }
.die__pip {
  place-self: center;
  width: 66%;
  height: 66%;
  border-radius: 50%;
  background: var(--bg-c);
}
@media (prefers-reduced-motion: reduce) {
  .die__cube.is-settling { transition: none; }
}

/* ============================================================
   GAMES — Traditional tab (js/games.js): chess + draughts.
   Shared 8x8 board grid, selection + legal-move markers, turn
   strip, status line and captured trays. Mono only: everything
   consumes the contextual -c tokens; hairlines, radius 2px.
   Fits the games modal at 320px viewport with no horizontal
   scroll (fluid squares ~34px there, capped at 50px).
   ============================================================ */

/* ----- Menu tab strip (reuses the site .tabs/.tab underline) ----- */
.games-tabs {
  justify-content: center;
  margin-top: 1.5rem;
}

/* ----- Shared 8x8 board ----- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: 100%;
  max-width: 400px;
  margin: 1.2rem auto 0;
  border: 1px solid var(--line-c);
  border-radius: var(--radius);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.games-sq {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;             /* light squares = panel surface */
  color: var(--ink-c);
  /* symbol-capable fonts first so phones render chess glyphs as text,
     never as colour emoji */
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols",
    "DejaVu Sans", Georgia, serif;
  font-size: clamp(19px, 7vw, 32px);   /* glyph ≈ 70% of the square */
  line-height: 1;
  /* kill double-tap-to-zoom so rapid tap-tap moves always register */
  touch-action: manipulation;
  cursor: pointer;
}
.games-sq--dark { background: var(--line-c); }  /* subtle ink tint */
/* Older mobile browsers without aspect-ratio: give squares a real height
   so the board never collapses into a strip. */
@supports not (aspect-ratio: 1) {
  .games-sq { height: clamp(34px, 11.5vw, 50px); }
}
/* Taps in the games UI must never trigger double-tap zoom. */
.games-fab,
.games-modal button,
.games-modal [role="tab"] { touch-action: manipulation; }
.games-sq:focus-visible {
  outline: 2px solid var(--ink-c);
  outline-offset: -2px;
  z-index: 1;
}
.games-sq.is-selected { box-shadow: inset 0 0 0 2px var(--ink-c); }
/* legal destination — small ink dot */
.games-sq.is-legal::after {
  content: "";
  position: absolute;
  width: 24%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink-c);
  opacity: 0.55;
  pointer-events: none;
}
/* legal capture (chess: an enemy already sits there) — thin ring */
.games-sq.is-capture::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 2px solid var(--ink-c);
  opacity: 0.6;
  pointer-events: none;
}
/* intermediate landing of a draughts multi-jump — faint dot */
.games-sq.is-step::after {
  content: "";
  position: absolute;
  width: 15%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink-c);
  opacity: 0.3;
  pointer-events: none;
}

/* ----- Draughts discs (white = filled ink, black = outlined ring;
   kings carry an inner second ring / dot) ----- */
.games-disc {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68%;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
}
.games-disc--w { background: var(--ink-c); }
.games-disc--b { border: 1.5px solid var(--ink-c); }
.games-disc--king::after {
  content: "";
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
}
.games-disc--w.games-disc--king::after { border: 1.5px solid var(--bg-alt-c); }
.games-disc--b.games-disc--king::after { background: var(--ink-c); }

/* ----- Turn strip / status line / captured trays ----- */
.games-turnstrip {
  margin-top: 1.1rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-c);
  min-height: 1.2rem;
}
.games-status {
  margin-top: 1rem;
  min-height: 1.7rem;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-c);
}
.games-tray {
  min-height: 1.4rem;
  margin-top: 0.45rem;
  color: var(--muted-c);
  font-size: 1rem;
  letter-spacing: 0.12em;
  line-height: 1.35;
}

/* ============================================================
   SCANNER (js/scanner.js) — table-QR camera scanner.
   A round scan button stacks ABOVE the games FAB and opens a
   full-screen camera overlay with a viewfinder. Mono only:
   contextual -c tokens, hairlines, radius 2px, grain on the
   dark overlay. Reduced-motion kills the scan-line + FAB
   transition. Fits < 400px with no horizontal scroll.
   ============================================================ */

/* ----- Floating scan button (stacked above .games-fab) ----- */
.scan-fab {
  position: fixed;
  right: 20px;
  /* clears the 60px games FAB (bottom 20px) + a 14px gap */
  bottom: calc(20px + 60px + 14px + env(safe-area-inset-bottom, 0px));
  z-index: 60; /* same layer as .games-fab, below the overlay */
  width: 60px;
  height: 60px;
  padding: 0;
  border: 1px solid var(--line-c);
  border-radius: 50%;
  background: var(--ink-c);
  color: var(--bg-c);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: opacity 0.2s ease;
  touch-action: manipulation;
}
.scan-fab svg { width: 26px; height: 26px; display: block; }
.scan-fab:hover { opacity: 0.85; }
.scan-fab:focus-visible {
  outline: 2px solid var(--ink-c);
  outline-offset: 3px;
}
/* order.html: clear the cart bar too — stacked one FAB + gap above
   .games-fab--raised (bottom: 96px + 14px + env). */
.scan-fab--raised {
  bottom: calc(96px + 14px + 60px + 14px + env(safe-area-inset-bottom, 0px));
}

/* ----- Full-screen overlay ----- */
.scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 110; /* above the FABs (60), at modal level (100+) */
  /* Stays dark even in .theme-light — camera legibility demands it, so this
     is the one place that reads the base --black token, not --bg-c. */
  background: var(--black);
  overflow: hidden;
}
.scan-overlay[hidden] { display: none; }
body.scan-overlay-open { overflow: hidden; }

.scan-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--black);
}
/* Dark scrim so the copy stays legible over any camera feed. */
.scan-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.62) 62%,
    rgba(0, 0, 0, 0.82) 100%
  );
  pointer-events: none;
}
/* grain::before is positioned by the shared .grain rule; sit it
   above the video but below the UI. */
.scan-overlay.grain::before { z-index: 1; opacity: 0.6; }

.scan-ui {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 20px
           calc(28px + env(safe-area-inset-bottom, 0px));
  color: var(--ink-c);
  text-align: center;
}

/* ----- Close (X) — reuses the site's close-button look ----- */
.scan-close {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 2px;
  border: 1px solid var(--line-c);
  background: color-mix(in srgb, var(--black) 55%, transparent);
  color: var(--ink-c);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  touch-action: manipulation;
}
.scan-close:hover { border-color: var(--ink-c); }
.scan-close:focus-visible {
  outline: 2px solid var(--ink-c);
  outline-offset: 2px;
}

/* ----- Viewfinder frame + corner brackets ----- */
.scan-frame {
  position: relative;
  width: min(68vw, 260px);
  aspect-ratio: 1;
  margin-bottom: 1.8rem;
}
@supports not (aspect-ratio: 1) {
  .scan-frame { height: min(68vw, 260px); }
}
.scan-corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid var(--ink-c);
}
.scan-corner--tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.scan-corner--tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.scan-corner--br { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.scan-corner--bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.scan-line {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 8%;
  height: 2px;
  background: var(--ink-c);
  opacity: 0.85;
  animation: scan-sweep 2.4s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
}
@keyframes scan-sweep {
  from { transform: translateY(0); }
  to   { transform: translateY(1050%); }
}

/* ----- Copy + status ----- */
.scan-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 30rem;
  width: 100%;
}
.scan-title {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 500;
  font-size: clamp(1.5rem, 6vw, 2rem);
  color: var(--ink-c);
}
.scan-hint {
  margin-top: 0.6rem;
  color: var(--muted-c);
  font-size: 0.95rem;
  line-height: 1.5;
}
.scan-status {
  min-height: 1.4rem;
  margin-top: 0.9rem;
  color: var(--ink-c);
  font-size: 0.92rem;
  line-height: 1.45;
}
.scan-fallback {
  margin-top: 1.4rem;
}

/* Reduced motion: no scan-line sweep, no FAB transition. */
@media (prefers-reduced-motion: reduce) {
  .scan-fab { transition: none; }
  .scan-line { animation: none; }
}
