/*
 * The tilegrab.fun website (2026-11-18), served by the Worker (sitePages.ts).
 * The world is DESIGN.md's "Lamp in the Vault"; the art is the app's own files.
 */
@font-face { font-family: Archivo; font-weight: 500; font-display: swap; src: url(/site/archivo-500.ttf) format("truetype"); }
@font-face { font-family: Archivo; font-weight: 700; font-display: swap; src: url(/site/archivo-700.ttf) format("truetype"); }
@font-face { font-family: Archivo; font-weight: 800; font-display: swap; src: url(/site/archivo-800.ttf) format("truetype"); }
@font-face { font-family: Archivo; font-weight: 900; font-display: swap; src: url(/site/archivo-900.ttf) format("truetype"); }

:root {
  color-scheme: dark;
  --vault: #05121F;
  --ground: #041D42;
  --sky: #0C3784;
  --sky-hi: #1E5BC4;
  --rim: #2A6DC7;
  --plate: #0B2957;
  --stone: #173A61;
  --stone-lo: #102740;
  --well: #031533;
  --edge: rgba(130, 193, 243, .22);
  --edge-hi: rgba(160, 210, 255, .38);
  --chalk: #F2F8FF;
  --body: #C9DDF1;
  --dim: #9FC2E4;
  --gold: #D9A93C;
  --gold-hi: #F6E3A6;
  --action: #F6CB5A;
  --action-ink: #3A2606;
  --cream: #EADAB4;
  --tile-ink: #241E16;
  --mineral: #35E1FF;
  --mineral-text: #7FE8DB;
  --rose: #FF8FB4;
  --rose-text: #FFB8CF;
  --ember: #FF7A1A;
  --seat: 0 1px 2px rgba(2, 9, 18, .75);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --wrap: 1180px;
  --gut: clamp(16px, 4vw, 40px);
  --xw: 1;
}

* { box-sizing: border-box; }
::selection { background: var(--gold); color: var(--action-ink); }
html { background: var(--vault); scrollbar-color: #2A4E7C var(--vault); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; color: var(--body); background: var(--vault);
  font: 500 1.0625rem/1.6 Archivo, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--gold-hi); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #fff3c8; }
:focus-visible { outline: 2px solid var(--mineral); outline-offset: 4px; border-radius: 10px; }
[id] { scroll-margin-top: 88px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gut) * 2); margin: 0 auto; padding: 0 var(--gut); }

/* ------------------------------------------------------------------ type */
h1, h2, h3 { margin: 0; color: var(--chalk); font-weight: 800; text-wrap: balance; text-shadow: var(--seat); }
h1 { font-size: clamp(2.5rem, 6.2vw, 5.1rem); line-height: .98; letter-spacing: -.035em; font-weight: 900; }
h2 { font-size: clamp(2rem, 4.2vw, 3.35rem); line-height: 1.14; letter-spacing: -.02em; }
h3 { font-size: clamp(1.2rem, 1.8vw, 1.45rem); line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; text-wrap: pretty; max-width: 62ch; }
.lede { font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.5; color: var(--chalk); opacity: .92; }
.caps { font-weight: 800; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.stack > * + * { margin-top: 1rem; }

/* --------------------------------------------------------------- buttons */
/* The game's own painted slabs, three-slice so the caps stay round. */
.slab {
  --h: 60px;
  position: relative; display: inline-grid; place-items: center; height: var(--h);
  min-width: 220px; padding: 0 30px calc(var(--h) * .07); border: 0; cursor: pointer;
  font: 800 .95rem/1.1 Archivo, system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; text-align: center; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .42));
  transition: transform 160ms var(--ease), filter 160ms var(--ease);
}
/* Tracking leaves a gap after the last letter; indent by the same to centre the ink. */
.slab, .slab > span { text-indent: .1em; }
.slab small { text-indent: .18em; display: block; font-size: .62rem; letter-spacing: .18em; opacity: .78; margin-bottom: 2px; }
/* The "long" slab art: its right end is shaded far more softly than the short
   slab's, so a label reads centred. Caps keep the art's own 88:317 shape. */
.slab { --cap: calc(var(--h) * .278); }
.slab.gold { color: var(--action-ink);
  background: url(/site/long-gold-btn-l.webp) left top / var(--cap) 100% no-repeat,
    url(/site/long-gold-btn-r.webp) right top / var(--cap) 100% no-repeat,
    url(/site/long-gold-btn-m.webp) center top / calc(100% - 2 * var(--cap) + 2px) 100% no-repeat; }
.slab.blue { color: #C3DEF8;
  background: url(/site/long-blue-btn-l.webp) left top / var(--cap) 100% no-repeat,
    url(/site/long-blue-btn-r.webp) right top / var(--cap) 100% no-repeat,
    url(/site/long-blue-btn-m.webp) center top / calc(100% - 2 * var(--cap) + 2px) 100% no-repeat; }
.slab:hover { color: inherit; transform: translateY(-2px); filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .48)) brightness(1.06); }
.slab.gold:hover { color: var(--action-ink); }
.slab.blue:hover { color: #E4F1FF; }
.slab:active { transform: translateY(2px); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .4)) brightness(.95); transition-duration: 80ms; }
.slab[disabled] { opacity: .4; pointer-events: none; }
.slab[aria-disabled="true"] { opacity: .62; cursor: default; pointer-events: none; }
.slab.sm { --h: 46px; min-width: 0; padding: 0 22px calc(var(--h) * .07); font-size: .78rem; }
.slab .ico { width: 18px; height: 18px; margin-right: 10px; flex: none; }
.slab > span { display: grid; justify-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: center; }
.note { font-size: .9rem; color: var(--dim); }

/* ----------------------------------------------------------------- tiles */
.tile {
  /* Seated as the match seats it: the letter's line centred at 48.5% of the
     tile (the face sits above the painted lip), points in the lower right. */
  position: relative; display: inline-block; flex: none; text-align: center; vertical-align: top;
  width: var(--t, 54px); height: calc(var(--t, 54px) * 211 / 209); padding: calc(var(--t, 54px) * .225) 0 0;
  background: url(/site/tile.webp) center / 100% 100% no-repeat;
  color: var(--tile-ink); font-weight: 800; font-size: calc(var(--t, 54px) * .52); line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .45)); user-select: none;
}
.tile i { position: absolute; right: 11%; bottom: 12%; font-style: normal; font-weight: 700; line-height: 1; color: rgba(36, 30, 22, .78); font-size: calc(var(--t, 54px) * .19); }

/* ------------------------------------------------------------------- nav */
.top { position: sticky; top: 0; z-index: 50; }
.top::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(4, 22, 52, .62); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 1px 0 rgba(130, 193, 243, .14); opacity: var(--navbg, 0); transition: opacity 240ms var(--ease); }
.top.scrolled { --navbg: 1; }
@media (prefers-reduced-transparency: reduce) { .top::before { background: #061a3a; backdrop-filter: none; } }
.top .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; height: 76px; }
.top .wrap > .slab { justify-self: end; }
.top .home { justify-self: start; display: block; border-radius: 10px; line-height: 0; }
.top .home img { width: 118px; filter: drop-shadow(0 5px 10px rgba(0, 0, 0, .5)); }
.top nav { display: flex; align-items: center; gap: 2px; }
.top nav a { display: block; line-height: 1.2; padding: 10px 13px; border-radius: 10px; color: var(--chalk); text-decoration: none;
  font-weight: 700; font-size: .92rem; text-shadow: var(--seat); transition: color 160ms var(--ease), background 160ms var(--ease); }
.top nav a:hover { color: var(--gold-hi); background: rgba(130, 193, 243, .08); }
.top nav a[aria-current="page"] { color: var(--gold-hi); }
.top .slab { --h: 46px; min-width: 0; padding: 0 22px calc(var(--h) * .07); font-size: .78rem; }
.menu-btn { display: none; margin-left: auto; width: 46px; height: 46px; border: 0; border-radius: 12px; background: rgba(130, 193, 243, .1);
  color: var(--chalk); cursor: pointer; place-items: center; }
.menu-btn svg { width: 22px; height: 22px; }

@media (max-width: 960px) {
  .top nav { display: none; position: absolute; top: 76px; left: 0; right: 0; flex-direction: column; gap: 0;
    padding: 8px var(--gut) 18px; background: rgba(4, 22, 52, .97); box-shadow: 0 18px 30px rgba(0, 0, 0, .4); }
  .top nav a { padding: 14px 4px; font-size: 1.05rem; border-bottom: 1px solid rgba(130, 193, 243, .1); border-radius: 0; }
  .top.open nav { display: flex; }
  .top.open { --navbg: 1; }
  .menu-btn { display: grid; }
  .top .wrap { display: flex; gap: 12px; }
  .top .wrap > .slab { margin-left: 0; }
  .top .slab { order: 3; }
}
@media (max-width: 420px) { .top .slab { padding: 0 16px calc(var(--h) * .07); font-size: .72rem; letter-spacing: .06em; } .top .home img { width: 96px; } }

/* ---------------------------------------------------------------- footer */
footer { border-top: 1px solid var(--edge); padding: 48px 0 40px; color: var(--dim); font-size: .92rem; background: #030c17; }
footer .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
footer img { width: 120px; margin-bottom: 14px; }
footer h4 { margin: 0 0 12px; color: var(--chalk); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
footer a { color: var(--dim); text-decoration: none; }
footer a:hover { color: var(--chalk); text-decoration: underline; }
footer .legal { margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(130, 193, 243, .1); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: .85rem; }
@media (max-width: 760px) { footer .cols { grid-template-columns: 1fr 1fr; } footer .cols > :first-child { grid-column: 1 / -1; } }

/* --------------------------------------------------------- inner pages */
/* Runs up under the nav like the home hero (margin-top -76px = the nav's height), so the
   nav reads the same on every page: clear over blue until the page scrolls. 2026-11-18. */
.page-head { position: relative; margin-top: -76px; padding: 140px 0 48px; overflow: hidden;
  background: radial-gradient(90% 120% at 80% -10%, rgba(42, 109, 199, .55), rgba(12, 55, 132, .25) 45%, transparent 75%), var(--ground); }
.page-head h1 { font-size: clamp(2.3rem, 5vw, 4rem); line-height: 1.08; letter-spacing: -.025em; }
.page-head .lede { margin-top: 18px; }
.page-body { padding: 56px 0 96px; background: linear-gradient(var(--ground), var(--vault) 520px); }

/* Prototype-only marker so nobody mistakes a placeholder for the real thing. */
.proto-flag { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 176, 32, .12); color: #FFD27A; font-size: .78rem; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255, 176, 32, .35); }
