/* ============================================================
   WORD FINDER - design system  (wordfinder.com.au)
   Dark-fantasy temple aesthetic shared with Decode: obsidian +
   gold, cyan reserved for scores/active, parchment ink.
   Motion is one-shot only (the owner is motion-sensitive) -
   NO ambient loops, parallax, or continuous churn.
   ============================================================ */

:root {
  /* Palette (from Decode's Theme) */
  --ink:        #0d0a07;   /* deepest obsidian */
  --ink-2:      #14100b;
  --surface:    #1c160f;
  --surface-2:  #271e14;
  --line:       rgba(212,168,75,.16);
  --line-strong:rgba(212,168,75,.34);
  --gold:       #d4a84b;
  --gold-deep:  #a8792b;
  --gold-pale:  #ecd8a4;
  --cyan:       #46d3e0;   /* scores / XP - accent, used sparingly */
  --jade:       #5cba7d;   /* valid / success */
  --ember:      #e0713f;   /* danger / absent */
  --parchment:  #ede0c4;
  --parchment-dim: #b7a888;
  --parchment-faint: #7c715a;

  --serif: "Cinzel", "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --maxw: 1120px;
  --pad: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --radius-sm: 9px;

  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.75);
  --shadow-md: 0 12px 30px -14px rgba(0,0,0,.7);
  --glow-gold: 0 0 34px -8px rgba(212,168,75,.5);
  --glow-gold-soft: 0 0 20px -9px rgba(212,168,75,.42);
  --glow-cyan: 0 0 22px -6px rgba(70,211,224,.45);

  /* Reusable surfaces - engraved obsidian tiles + a faint gold sheen.
     Kept as gradients (no per-element shadow) so hundreds of result
     tiles stay cheap to paint; glow is reserved for hover/active only. */
  --tile:  linear-gradient(180deg, var(--surface-2), var(--surface));
  --sheen: linear-gradient(180deg, rgba(236,216,164,.07), rgba(236,216,164,0) 34%);
  --well:  inset 0 1px 3px rgba(0,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--parchment);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* Static obsidian field with a faint gold vignette - no motion. */
  background:
    radial-gradient(1200px 620px at 50% -8%, rgba(212,168,75,.10), transparent 60%),
    radial-gradient(900px 500px at 110% 8%, rgba(70,211,224,.05), transparent 55%),
    var(--ink);
  background-attachment: fixed;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ---- Layout ---- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: clamp(40px, 7vw, 84px); }
.section--tight { padding-block: clamp(26px, 4vw, 46px); }
.stack > * + * { margin-top: var(--stack, 1rem); }
.center { text-align: center; }
.muted { color: var(--parchment-dim); }
.hair { height: 1px; border: 0; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); margin-block: clamp(24px,5vw,44px); }

/* ---- Type ---- */
.display {
  font-family: var(--serif); font-weight: 800; line-height: 1.04; letter-spacing: .01em;
  font-size: clamp(2rem, 6.4vw, 3.9rem); color: var(--gold-pale);
  text-shadow: 0 2px 0 rgba(0,0,0,.5), 0 12px 34px rgba(0,0,0,.6);
}
h1.display { margin-bottom: .3em; }
.h2 { font-family: var(--serif); font-weight: 700; font-size: clamp(1.5rem, 3.6vw, 2.4rem); line-height: 1.12; color: var(--gold-pale); }
.h3 { font-family: var(--serif); font-weight: 700; font-size: clamp(1.15rem, 2.4vw, 1.5rem); color: var(--gold-pale); }
.eyebrow { font-family: var(--serif); font-weight: 700; letter-spacing: .3em; text-transform: uppercase; font-size: .72rem; color: var(--gold); }
.lead { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--parchment-dim); max-width: 60ch; }
p a, .prose a { color: var(--gold-pale); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
p a:hover { text-decoration-color: var(--gold); }
.prose p { margin-bottom: .9em; color: var(--parchment-dim); }
.prose h2 { margin: 1.4em 0 .5em; }

/* ---- Glyph brand mark ---- */
@font-face { font-family: "Glyphs"; src: url("/assets/Glyphs.ttf") format("truetype"); font-display: swap; }
.glyph { font-family: "Glyphs", var(--serif); }
.glyph-mark { font-family: var(--serif); font-weight: 800; letter-spacing: .16em; color: var(--gold-pale); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font-family: var(--sans); font-weight: 700; font-size: 1rem; line-height: 1;
  padding: .85rem 1.5rem; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  transition: transform .14s ease, box-shadow .2s ease, filter .2s ease, border-color .2s ease, background .2s ease;
}
.btn--gold {
  background: linear-gradient(180deg, var(--gold-pale), var(--gold) 55%, var(--gold-deep));
  color: #241803; box-shadow: var(--glow-gold), 0 8px 20px -8px rgba(0,0,0,.6);
}
.btn--gold:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 0 52px -6px rgba(212,168,75,.62), 0 12px 26px -10px rgba(0,0,0,.7); }
.btn--ghost { background: rgba(255,255,255,.03); color: var(--parchment); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--gold); transform: translateY(-2px); }
.btn--lg { padding: 1.02rem 2rem; font-size: 1.08rem; }
.btn--sm { padding: .5rem .9rem; font-size: .85rem; }
.btn--block { width: 100%; }

/* ============================================================
   NAV
   ============================================================ */
.nav { position: sticky; top: 0; z-index: 60; background: rgba(13,10,7,.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 11px; }
.nav__brand { display: flex; align-items: center; gap: 10px; }
.nav__brand img { width: 30px; height: 30px; border-radius: 7px; }
.nav__brand .glyph-mark { font-size: 1rem; }
.nav__brand small { display: block; font-size: .62rem; letter-spacing: .22em; color: var(--parchment-faint); text-transform: uppercase; font-family: var(--sans); font-weight: 600; }
.nav__links { display: flex; align-items: center; gap: clamp(10px, 2.4vw, 26px); font-weight: 600; font-size: .93rem; }
.nav__links a:not(.btn) { color: var(--parchment-dim); }
.nav__links a:not(.btn):hover { color: var(--gold-pale); }
.nav__cta { padding: .58rem 1.05rem; font-size: .9rem; }
@media (max-width: 760px) { .nav__links a:not(.btn) { display: none; } }

/* ============================================================
   HERO + TOOL
   ============================================================ */
.hero { padding-top: clamp(26px, 5vw, 52px); }
.hero__intro { max-width: 64ch; }
.breadcrumb { font-size: .82rem; color: var(--parchment-faint); margin-bottom: .8rem; }
.breadcrumb a { transition: color .14s ease; }
.breadcrumb a:hover { color: var(--gold-pale); }
.breadcrumb span:not([aria-current]) { opacity: .45; margin-inline: .35em; }
.breadcrumb [aria-current="page"] { color: var(--parchment-dim); }

/* The tool panel */
.tool {
  background: linear-gradient(180deg, rgba(39,30,20,.75), rgba(20,16,11,.9));
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: clamp(16px, 3vw, 26px);
  position: relative; overflow: hidden;
}
.tool::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .6; }
.tool__label { display: block; font-family: var(--serif); font-weight: 700; color: var(--gold-pale); font-size: 1.05rem; margin-bottom: .5rem; }
.tool__hint { font-size: .84rem; color: var(--parchment-faint); margin-top: .45rem; }

/* Big letters/rack input */
.rack {
  display: flex; align-items: center; gap: .6rem;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: .3rem .5rem .3rem 1rem; box-shadow: var(--well);
  transition: border-color .18s ease, box-shadow .22s ease;
}
.rack:focus-within { border-color: var(--gold); box-shadow: var(--well), var(--glow-gold); }
.rack input {
  flex: 1; min-width: 0; background: transparent; border: 0; color: var(--parchment);
  font-family: var(--serif); font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  font-size: clamp(1.2rem, 3.4vw, 1.7rem); padding: .55rem 0;
}
.rack input::placeholder { color: var(--parchment-faint); letter-spacing: .12em; text-transform: none; font-weight: 600; }
.rack input:focus { outline: none; }
.rack__go { flex: none; }

/* Filter row */
.filters { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .9rem; }
.field { display: flex; flex-direction: column; gap: .28rem; }
.field label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--parchment-faint); font-weight: 600; }
.field input, .field select {
  background: linear-gradient(180deg, var(--ink-2), var(--ink)); border: 1px solid var(--line); border-radius: 8px; color: var(--parchment);
  padding: .5rem .6rem; font-size: .92rem; font-family: var(--sans); min-width: 92px;
  box-shadow: var(--well); transition: border-color .16s ease, box-shadow .2s ease;
}
.field input::placeholder { color: var(--parchment-faint); }
.field input:hover, .field select:hover { border-color: var(--line-strong); }
.field input:focus, .field select:focus { outline: none; border-color: var(--gold); box-shadow: var(--well), var(--glow-gold-soft); }
.field--grow { flex: 1 1 140px; }

/* Dictionary / sort toggles */
.chiprow { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: .4em; cursor: pointer; user-select: none;
  background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 999px;
  padding: .4rem .85rem; font-size: .82rem; font-weight: 600; color: var(--parchment-dim);
  transition: border-color .15s, color .15s, background .15s, box-shadow .18s, transform .1s;
}
.chip:hover { border-color: var(--line-strong); color: var(--parchment); background: rgba(255,255,255,.05); }
.chip:active { transform: translateY(1px); }
.chip[aria-pressed="true"], .chip--on {
  border-color: var(--gold); color: var(--gold-pale);
  background: linear-gradient(180deg, rgba(212,168,75,.22), rgba(212,168,75,.08));
  box-shadow: var(--glow-gold-soft), inset 0 1px 0 rgba(236,216,164,.18);
}
.chiprow__label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--parchment-faint); font-weight: 600; margin-right: .2rem; }

/* ---- Wordle grid (green/yellow/grey) ---- */
.wgrid { display: flex; gap: .5rem; flex-wrap: wrap; }
.wtile {
  width: clamp(44px, 12vw, 58px); aspect-ratio: 1; border-radius: 9px; border: 2px solid var(--line-strong);
  background: var(--sheen), linear-gradient(180deg, var(--ink-2), var(--ink));
  color: var(--parchment); font-family: var(--serif); font-weight: 800;
  font-size: clamp(1.2rem, 4vw, 1.7rem); text-transform: uppercase; cursor: pointer; display: grid; place-items: center;
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
  transition: background .12s, border-color .12s, color .12s, box-shadow .16s, transform .08s;
}
.wtile:hover { border-color: var(--gold); }
.wtile:active { transform: scale(.96); }
.wtile:focus-visible { outline: none; border-color: var(--gold); box-shadow: var(--glow-gold); }
.wtile[data-state="absent"]  { background: linear-gradient(180deg, #322a20, #241d15); border-color: #3a3126; color: var(--parchment-faint); text-shadow: none; }
.wtile[data-state="present"] { background: linear-gradient(180deg, #c8a23a, #a2811f); border-color: var(--gold-pale); color: #241803; text-shadow: 0 1px 0 rgba(255,255,255,.28); box-shadow: var(--glow-gold-soft); }
.wtile[data-state="correct"] { background: linear-gradient(180deg, #59ad78, #3a8054); border-color: #7bd39b; color: #06220f; text-shadow: 0 1px 0 rgba(255,255,255,.28); box-shadow: 0 0 20px -8px rgba(92,186,125,.55); }
.wtile__hint { font-size: .74rem; color: var(--parchment-faint); margin-top: .5rem; }

/* ============================================================
   RESULTS
   ============================================================ */
.results { margin-top: clamp(20px, 4vw, 32px); }
/* Searching: a purely STATIC affordance - a gentle dim + inset feel.
   No spinner, no pulse, no loop (owner is motion-sensitive). */
.results.is-searching { opacity: .55; }
.results.is-searching .results__bar { opacity: .82; }
.results__bar {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .6rem;
  margin-bottom: .8rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line);
}
.results__count { font-family: var(--serif); font-weight: 700; color: var(--gold-pale); font-size: 1.15rem; }
.results__count b { color: var(--cyan); font-variant-numeric: tabular-nums; }
.results__empty { color: var(--parchment-dim); padding: 1.4rem 0; }

/* No-results wrapper - engraved plate with a rune icon + copy */
.empty-state {
  display: grid; justify-items: center; text-align: center; gap: .5rem;
  padding: clamp(1.6rem, 5vw, 2.8rem) 1.2rem; margin-top: 1rem;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background: radial-gradient(460px 190px at 50% 0%, rgba(212,168,75,.08), transparent 70%);
  color: var(--parchment-dim);
}
.empty-state::before {
  content: "◈"; font-size: 2rem; line-height: 1; color: var(--gold);
  opacity: .85; text-shadow: 0 0 22px rgba(212,168,75,.4);
}
.empty-state strong, .empty-state b { font-family: var(--serif); color: var(--gold-pale); font-weight: 700; font-size: 1.1rem; }
.empty-state p { max-width: 42ch; font-size: .95rem; }

.lengthgroup { margin-top: 1.3rem; }
/* One-shot entrance app.js adds to each group. Start state lives ONLY in the
   keyframe, so if the animation is stripped (reduced-motion) the group renders
   fully visible - never stuck hidden. */
.reveal-in { animation: wf-reveal .38s cubic-bezier(.22,.61,.36,1) both; }
@keyframes wf-reveal { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.lengthgroup__head { display: flex; align-items: center; gap: .7rem; margin-bottom: .7rem; }
.lengthgroup__head h3 { font-family: var(--serif); color: var(--gold-pale); font-size: 1.02rem; letter-spacing: .02em; }
.lengthgroup__head .rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.lengthgroup__head .n {
  font-size: .74rem; color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums;
  background: rgba(212,168,75,.1); border: 1px solid var(--line); border-radius: 999px; padding: .1em .6em;
}

/* Word results - premium engraved letter tiles */
.words { display: flex; flex-wrap: wrap; gap: .5rem; }
.word {
  --wscore: var(--cyan);
  position: relative; display: inline-flex; flex-wrap: wrap; align-items: center; gap: .5em;
  background: var(--sheen), var(--tile);
  border: 1px solid var(--line-strong); border-radius: 9px;
  padding: .5rem .72rem; cursor: pointer; text-align: left;
  font-family: var(--serif); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--parchment); font-size: 1rem; text-shadow: 0 1px 0 rgba(0,0,0,.4);
  transition: transform .12s ease, box-shadow .16s ease, border-color .12s ease, color .12s ease;
}
.word:hover { transform: translateY(-1px); border-color: var(--gold); color: var(--gold-pale); box-shadow: var(--glow-gold-soft); }
.word:active { transform: translateY(0); box-shadow: inset 0 2px 5px rgba(0,0,0,.4); }
.word:focus-visible { outline: none; border-color: var(--gold); box-shadow: var(--glow-gold); }
.word .sc {
  font-family: var(--sans); font-weight: 800; font-size: .72rem; letter-spacing: 0; text-shadow: none;
  color: var(--cyan); font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, rgba(70,211,224,.18), rgba(70,211,224,.06));
  border: 1px solid rgba(70,211,224,.28); border-radius: 6px; padding: .1em .42em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}
.word[aria-expanded="true"] {
  border-color: var(--gold); color: var(--gold-pale);
  background: linear-gradient(180deg, rgba(212,168,75,.14), var(--surface));
  box-shadow: var(--glow-gold-soft);
}
.word__def {
  flex-basis: 100%; margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--line-strong);
  font-family: var(--sans); font-weight: 400; letter-spacing: 0; text-transform: none; text-shadow: none;
  color: var(--parchment-dim); font-size: .85rem; line-height: 1.5;
}
.word__def[hidden] { display: none; }

/* Tap-to-copy: one-shot feedback (JS toggles .is-copied + injects .word__copied).
   The gold plate overlays the tile with "Copied ✓" then JS removes it. */
.word.is-copied { border-color: var(--gold); box-shadow: var(--glow-gold); }
.word__copied {
  position: absolute; inset: 0; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center; gap: .3em;
  border-radius: inherit; letter-spacing: .02em; text-transform: none; text-shadow: none;
  font-family: var(--sans); font-weight: 800; font-size: .82rem; color: #241803;
  background: linear-gradient(180deg, var(--gold-pale), var(--gold) 70%, var(--gold-deep));
  animation: wf-copied-in .16s ease both;
}
@keyframes wf-copied-in { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   CRAWLABLE WORD LISTS (SSR content for SEO)
   ============================================================ */
.wordlist { }
.wordlist__grid { columns: 3 160px; column-gap: 1.6rem; }
.wordlist__grid li { break-inside: avoid; padding: .18rem 0; color: var(--parchment-dim); font-size: .95rem; list-style: none; }
.wordlist__grid li a { display: inline-block; text-transform: capitalize; transition: color .14s ease, transform .14s ease; }
.wordlist__grid li a:hover { color: var(--gold-pale); transform: translateX(2px); }
.featured { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.featured .word { cursor: default; }
.featured .word:hover { transform: none; box-shadow: none; border-color: var(--line-strong); color: var(--parchment); }

/* ============================================================
   DECODE GAME FUNNEL  (#1 conversion priority)
   ============================================================ */
.promo {
  position: relative; overflow: hidden;
  background:
    radial-gradient(700px 300px at 12% 0%, rgba(212,168,75,.16), transparent 60%),
    linear-gradient(180deg, var(--surface), var(--ink-2));
  border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: clamp(22px, 4vw, 40px);
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(18px, 4vw, 40px); align-items: center;
}
.promo::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .55; }
.promo__eyebrow { display: inline-flex; align-items: center; gap: .5em; color: var(--gold); font-weight: 700; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; margin-bottom: .6rem; }
.promo__eyebrow img { width: 20px; height: 20px; }
.promo h2 { margin-bottom: .5rem; }
.promo p { color: var(--parchment-dim); margin-bottom: 1.1rem; max-width: 46ch; }
.promo__cta { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.promo__note { font-size: .78rem; color: var(--parchment-faint); margin-top: .8rem; }
.promo__art { position: relative; }
.promo__art img { width: 100%; border-radius: 12px; border: 1px solid var(--line-strong); box-shadow: var(--shadow-md); }
.promo__badges { display: flex; gap: .6rem; margin-top: .7rem; flex-wrap: wrap; }
.promo__points { list-style: none; display: grid; gap: .5rem; margin: .8rem 0 1.1rem; }
.promo__points li { display: flex; align-items: flex-start; gap: .55em; color: var(--parchment-dim); font-size: .95rem; }
.promo__points li::before { content: "◆"; color: var(--gold); font-size: .7em; margin-top: .35em; }
@media (max-width: 720px) { .promo { grid-template-columns: 1fr; } .promo__art { order: -1; } }

/* Compact in-results nudge (injected between result groups) */
.nudge {
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(212,168,75,.1), rgba(20,16,11,.6));
  border: 1px solid var(--line-strong); border-left: 3px solid var(--gold);
  border-radius: 10px; padding: .8rem 1rem; margin: 1.3rem 0;
}
.nudge img { width: 38px; height: 38px; border-radius: 8px; flex: none; }
.nudge__txt { flex: 1 1 200px; font-size: .92rem; color: var(--parchment); }
.nudge__txt b { color: var(--gold-pale); font-family: var(--serif); }

/* Sticky bottom CTA (static, dismissible - no motion) */
.stickybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: rgba(13,10,7,.94); backdrop-filter: blur(10px); border-top: 1px solid var(--line-strong);
  display: flex; align-items: center; gap: .8rem; padding: .6rem var(--pad);
  box-shadow: 0 -10px 30px -18px rgba(0,0,0,.9);
}
.stickybar[hidden] { display: none; }
.stickybar img { width: 34px; height: 34px; border-radius: 7px; }
.stickybar__txt { flex: 1; font-size: .9rem; line-height: 1.3; }
.stickybar__txt b { color: var(--gold-pale); font-family: var(--serif); }
.stickybar__txt small { display: block; color: var(--parchment-faint); font-size: .74rem; }
.stickybar__close { background: none; border: 0; color: var(--parchment-faint); font-size: 1.3rem; cursor: pointer; padding: .2rem .4rem; }
.stickybar__close:hover { color: var(--parchment); }
@media (min-width: 900px) { .stickybar { left: auto; right: 24px; bottom: 24px; max-width: 380px; border-radius: 14px; border: 1px solid var(--line-strong); } }

/* ============================================================
   CARDS / FEATURES / FAQ / INTERNAL LINKS
   ============================================================ */
.card { background: linear-gradient(180deg, rgba(39,30,20,.6), rgba(20,16,11,.75)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: clamp(16px,3vw,24px); }
.grid { display: grid; gap: clamp(14px, 2.6vw, 22px); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 800px) { .grid--3 { grid-template-columns: 1fr; } .grid--2 { grid-template-columns: 1fr; } }

.feature h3 { font-family: var(--serif); color: var(--gold-pale); font-size: 1.1rem; margin-bottom: .4rem; }
.feature p { color: var(--parchment-dim); font-size: .95rem; }
.feature__ico { width: 46px; height: 46px; margin-bottom: .7rem; }

/* Length / tool cross-links */
.lenlinks { display: flex; flex-wrap: wrap; gap: .5rem; }
.lenlinks a {
  background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 8px;
  padding: .5rem .8rem; font-weight: 600; font-size: .9rem; color: var(--parchment-dim);
  transition: border-color .15s, color .15s;
}
.lenlinks a:hover { border-color: var(--gold); color: var(--gold-pale); }
.lenlinks a[aria-current="page"] { border-color: var(--gold); color: var(--gold-pale); background: rgba(212,168,75,.1); }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: .3rem 0; }
.faq summary { cursor: pointer; list-style: none; padding: .9rem .2rem; font-family: var(--serif); font-weight: 700; color: var(--gold-pale); font-size: 1.04rem; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; color: var(--gold); font-weight: 700; font-size: 1.15rem; line-height: 1;
  width: 1.6em; height: 1.6em; display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: 999px; transition: border-color .15s, background .15s, color .15s;
}
.faq summary:hover { color: var(--gold); }
.faq summary:hover::after { border-color: var(--gold); background: rgba(212,168,75,.1); }
.faq details[open] summary::after { content: "\2013"; border-color: var(--gold); background: rgba(212,168,75,.12); }
.faq details[open] summary { color: var(--gold); }
.faq p { color: var(--parchment-dim); padding: 0 .2rem 1rem; font-size: .96rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--line); background: var(--ink-2); padding-block: 40px; margin-top: 40px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 26px; }
@media (max-width: 800px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer__grid { grid-template-columns: 1fr; } }
.footer__brand { display: flex; align-items: center; gap: 12px; margin-bottom: .6rem; }
.footer__brand img { width: 40px; height: 40px; border-radius: 9px; }
.footer h4 { font-family: var(--serif); color: var(--gold-pale); font-size: .95rem; margin-bottom: .7rem; letter-spacing: .04em; }
.footer ul { list-style: none; display: grid; gap: .4rem; }
.footer a { color: var(--parchment-dim); font-size: .9rem; transition: color .14s ease; }
.footer a:hover { color: var(--gold-pale); }
.footer__fine { margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.05); color: var(--parchment-faint); font-size: .8rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* Skip link for a11y */
.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: #241803; padding: .6rem 1rem; border-radius: 0 0 8px 0; font-weight: 700; z-index: 100; }
.skip:focus { left: 0; }

/* ---- Nav: promoted Decode game link ---- */
.nav__game { display: inline-flex; align-items: center; gap: .45em; color: var(--gold-pale); font-weight: 700; }
.nav__game img { width: 20px; height: 20px; filter: drop-shadow(0 0 7px rgba(212,168,75,.45)); }
.nav__game:hover { color: #fff; }

/* ---- Home "epic magic" - Decode world showcase band ---- */
.worldband {
  background:
    radial-gradient(900px 420px at 18% 0%, rgba(212,168,75,.12), transparent 60%),
    radial-gradient(700px 360px at 100% 100%, rgba(70,211,224,.06), transparent 55%),
    linear-gradient(180deg, var(--ink-2), var(--ink));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.worldband__head { max-width: 62ch; }
.worldband__head .lead { margin: .8rem 0 1.4rem; }
.gallery {
  display: flex; gap: 16px; overflow-x: auto; margin-top: 1.7rem;
  padding: 8px 4px 18px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.gallery::-webkit-scrollbar { height: 8px; }
.gallery::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
.gallery::-webkit-scrollbar-track { background: transparent; }
.gallery__item { flex: 0 0 auto; margin: 0; scroll-snap-align: start; text-align: center; }
.gallery__item img {
  height: clamp(330px, 48vw, 460px); width: auto; border-radius: 16px;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); background: var(--ink);
  transition: border-color .18s ease, box-shadow .22s ease, transform .18s ease;
}
.gallery__item:hover img, .gallery__item:focus-within img { border-color: var(--gold); box-shadow: var(--shadow-lg), var(--glow-gold-soft); transform: translateY(-2px); }
.gallery__item figcaption { margin: .55rem auto 0; font-size: .82rem; color: var(--parchment-faint); max-width: 200px; }
.worldband__foot { margin-top: .3rem; font-size: .85rem; }

/* ---- Motion: honour reduced-motion. All motion here is one-shot & response-only;
   this block strips every transition/animation and pins one-shot entrances to
   their final, fully-visible state so nothing can be left hidden or shifted. ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .reveal-in { opacity: 1 !important; transform: none !important; }
  .word__copied { opacity: 1 !important; }
}

/* ---- Cryptogram solver ---- */
.cg-input {
  width: 100%; min-height: 5.4rem; resize: vertical;
  background: var(--ink-2); color: var(--parchment);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: .85rem 1rem; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 1.02rem; letter-spacing: .06em; line-height: 1.6;
}
.cg-input:focus-visible { outline: none; border-color: var(--gold); box-shadow: var(--glow-gold); }
.cg-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: .9rem 0 .2rem; }
.cg-summary { color: var(--parchment-dim); margin: .2rem 0 1rem; }
.cg-summary b { color: var(--gold-pale); }
.cg-grid { display: grid; gap: 1.4rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 880px) { .cg-grid { grid-template-columns: 1fr 20rem; } }
.cg-word { padding: .8rem 0; border-top: 1px solid var(--line); }
.cg-word:first-child { border-top: 0; }
.cg-word__head { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; margin-bottom: .5rem; }
.cg-cipher {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1.05rem;
  letter-spacing: .16em; color: var(--gold-pale); background: var(--ink-2);
  border: 1px solid var(--line); border-radius: 7px; padding: .2rem .55rem;
}
.cg-count, .cg-solved, .cg-more, .cg-none { font-size: .82rem; color: var(--parchment-faint); }
.cg-solved { color: var(--jade); font-weight: 600; }
.cg-none { font-style: italic; }
.cg-more { align-self: center; margin-left: .3rem; }
.cg-cands { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cg-freq { background: rgba(20,16,11,.6); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.cg-freq h3 { margin: 0 0 .3rem; font-size: 1rem; color: var(--gold-pale); }
.cg-freq__hint { font-size: .84rem; color: var(--parchment-faint); margin: 0 0 .7rem; }
.cg-table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.cg-table th { text-align: left; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--parchment-faint); font-weight: 500; padding: .3rem .4rem; }
.cg-table td { padding: .3rem .4rem; border-top: 1px solid var(--line); color: var(--parchment-dim); }
.cg-table td b { color: var(--gold-pale); }
.cg-guess { color: var(--jade) !important; font-weight: 600; }
.tbl-wrap { overflow-x: auto; }

/* ---- Cryptogram maker ---- */
.mk-out { }
.mk-h { margin: 0 0 .5rem; font-size: 1.05rem; color: var(--gold-pale); }
.mk-puzzle {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: clamp(1.05rem, 2.6vw, 1.35rem); letter-spacing: .14em; line-height: 1.85;
  color: var(--parchment); background: var(--ink-2);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 1rem 1.1rem; margin: 0 0 .9rem; word-break: break-word;
}
.mk-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.mk-key { margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.mk-key h4 { margin: 0 0 .6rem; font-size: .95rem; color: var(--gold-pale); }
.mk-key__note { font-weight: 400; font-size: .78rem; color: var(--parchment-faint); margin-left: .4rem; }
.mk-pairs { display: flex; flex-wrap: wrap; gap: .4rem; }
.mk-pair {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .84rem;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 6px;
  padding: .2rem .45rem; color: var(--parchment-dim); display: inline-flex; gap: .2rem;
}
.mk-pair b { color: var(--gold-pale); }
.mk-solution { margin: .9rem 0 0; color: var(--parchment-dim); font-size: .95rem; }
.mk-solution b { color: var(--gold-pale); }

/* ---- Printable puzzle sheet ---- */
.pz__bar { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-bottom: 1.4rem; }
.pz__barnote { font-size: .85rem; color: var(--parchment-faint); }
.pz__grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .pz__grid { grid-template-columns: 1fr 1fr; } }
.pz { background: rgba(20,16,11,.55); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.pz__n { margin: 0 0 .5rem; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.pz__cipher {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .96rem;
  letter-spacing: .12em; line-height: 1.9; color: var(--parchment); margin: 0 0 .6rem; word-break: break-word;
}
.pz__hint { margin: 0; font-size: .82rem; color: var(--parchment-faint); font-style: italic; }
.pz__answers { margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.pz__list { margin: .6rem 0 0; padding-left: 1.2rem; color: var(--parchment-dim); line-height: 1.9; }
.pz__by { color: var(--parchment-faint); }

@media print {
  .nav, .stickybar, .promo, footer, .no-print, .breadcrumbs, .faq { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .pz, .mk-puzzle, .cg-input { background: #fff !important; border: 1px solid #999 !important; color: #000 !important; }
  .pz__cipher, .mk-puzzle, .pz__list, .pz__hint, .pz__n { color: #000 !important; }
  .pz__grid { grid-template-columns: 1fr 1fr !important; }
  .pz__answers { break-before: page; page-break-before: always; }
  a { color: #000 !important; text-decoration: none !important; }
}
