/* Wonder Hammer website. Colors, type and shapes follow DESIGN.md (the game's design system). */
/* The game's own typefaces, served from this site (Latin WOFF2 subsets: web/tools/make_fonts.py; OFL, licenses in fonts/) */
@font-face { font-family: "Alegreya Sans"; font-weight: 500; font-display: swap; src: url("../fonts/alegreya-sans-500.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 700; font-display: swap; src: url("../fonts/alegreya-sans-700.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 800; font-display: swap; src: url("../fonts/alegreya-sans-800.woff2") format("woff2"); }
@font-face { font-family: "Cinzel"; font-weight: 400 900; font-display: swap; src: url("../fonts/cinzel.woff2") format("woff2"); }
/* Layout: the game's landing scene on top (sky, horizon), then one stone-paved column of game objects:
   a playable site-prep board, the ten build stages, the Pick To Build wall, the modes. One look, like the game (no dark mode). */
:root {
  --paving: #F3D08A; --paving-line: #E2B76A;
  --ink: #33261A; --ink-strong: #4B2814; --ink-muted: #6B4A31;
  --surface: #FFF4DC; --surface-raised: #F3E3C2; --surface-inset: #F7DFAA;
  --edge: #633716; --side: #BD7425; --shadow: rgba(75, 40, 20, .28);
  --gold: #FFD166; --gold-active: #E3A23A; --night: #1A3847; --night-edge: #E3A23A;
  --tile: #FFFAF0; --tile-covered: #C3BBB0; --tile-covered-side: #816B52; --cream: #FFF8E9;
  --ui: "Alegreya Sans", "Trebuchet MS", "Segoe UI", sans-serif;
  --display: "Cinzel", "Times New Roman", serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px)); --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paving); color: var(--ink); font: 500 18px/1.5 var(--ui); }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
h2 { font: 800 clamp(28px, 5vw, 38px)/1.1 var(--ui); color: var(--ink-strong); text-wrap: balance; }
h3 { font: 800 21px/1.2 var(--ui); color: var(--ink-strong); }
.wrap { max-width: 1040px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.lede { max-width: 56ch; color: var(--ink-muted); font-weight: 700; }
:focus-visible { outline: 3px solid var(--night); outline-offset: 3px; }

/* buttons: rounded rectangle, thin edge, short shadow (the landing page's depth) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 26px;
  border: 2px solid var(--edge); border-radius: 18px; background: var(--surface-raised); color: var(--ink-strong);
  font: 800 20px/1 var(--ui); letter-spacing: .02em; text-decoration: none; cursor: pointer;
  box-shadow: 0 5px 0 var(--edge); transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--edge); }
.btn.gold { background: var(--gold); }
.btn.gold:hover { background: #FFDA80; }

/* hero = the landing scene */
.hero { position: relative; background: #2E9BF0 url(../img/bg.webp) center 34% / cover no-repeat; }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 90px; background: linear-gradient(transparent, var(--paving)); }
.hero .wrap { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 22px; padding-block: 18px 150px; }
.bar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.bar img { width: 52px; height: 52px; border-radius: 13px; border: 2px solid var(--edge); box-shadow: 0 4px 0 var(--shadow); }
.bar nav { display: flex; gap: 8px; }
.bar nav a { padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 2px solid var(--edge); color: var(--ink-strong);
  font-weight: 800; text-decoration: none; box-shadow: 0 4px 0 var(--shadow); }
.heromain { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); align-items: center; gap: 12px 32px; margin-top: clamp(4px, 3vw, 36px); }
.herotext { display: flex; flex-direction: column; gap: 20px; grid-column: 1; grid-row: 1; }
.emblem { grid-column: 2; grid-row: 1; width: 100%; height: auto; transform: rotate(6deg); filter: drop-shadow(0 14px 14px rgba(26, 56, 71, .4)); }
.recipe { display: flex; align-items: center; gap: 8px; }
.recipe span { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 22%; background: var(--tile); border: 2px solid var(--edge); box-shadow: 0 5px 0 var(--side), 2px 8px 0 var(--shadow); }
.recipe span img { width: 76%; height: auto; }
.recipe b { color: var(--cream); font-size: 20px; text-shadow: 0 2px 0 var(--ink-strong); margin-inline: 4px; }
.recipe span.result { width: 104px; background: var(--gold); box-shadow: 0 5px 0 var(--edge), 2px 8px 0 var(--shadow); border-radius: 16px; }
.recipe span.result img { width: 88%; }
.hero h1 { font: 800 clamp(52px, 11vw, 104px)/.95 var(--ui); color: var(--cream);
  text-shadow: 0 4px 0 var(--ink-strong), 0 9px 18px rgba(26, 56, 71, .35); letter-spacing: -.01em; }
.hero .tag { max-width: 22ch; font: 800 clamp(22px, 3.6vw, 30px)/1.2 var(--ui); color: var(--cream); text-shadow: 0 2px 0 var(--ink-strong); }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.store { display: inline-flex; flex-direction: column; justify-content: center; min-height: 56px; padding: 6px 18px; border-radius: 18px;
  background: var(--night); border: 2px solid var(--night-edge); color: var(--cream); font: 800 18px/1.1 var(--ui); }
.store small { font: 700 13px/1.2 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }

main { display: flex; flex-direction: column; gap: clamp(56px, 9vw, 96px); padding-block: 0 80px; }
section > .wrap { display: flex; flex-direction: column; gap: 18px; }

/* playable level */
#play { margin-top: -110px; position: relative; z-index: 2; }
section > .wrap.playgrid { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 32px; align-items: start; }
.game { position: relative; border: 2px solid var(--edge); border-radius: 24px; background: var(--surface); overflow: hidden;
  box-shadow: 0 6px 0 var(--edge), 0 18px 30px var(--shadow); }
.scene { position: relative; aspect-ratio: 720 / 400; background: #2E8FEA url(../img/site.webp) center bottom / cover; }
.wonder { position: absolute; right: 2%; bottom: 7%; width: 56%; height: auto; filter: drop-shadow(0 4px 3px rgba(75, 40, 20, .35)); }
@keyframes pop { 0% { transform: translateY(6px) scale(.94); } 100% { transform: none; } }
.chip { position: absolute; top: 3.5%; display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 12px;
  font: 800 14px/1.2 var(--ui); letter-spacing: .08em; }
.chip.stage { right: 3%; background: var(--surface); border: 2px solid var(--edge); color: var(--ink-strong); }
.chip.next { left: 3%; background: var(--night); border: 2px solid var(--night-edge); color: var(--gold); }
.chip.next img { width: 26px; height: 26px; }
.crew { position: absolute; left: 2%; bottom: 0; width: 44%; display: flex; align-items: flex-end; }
.worker { position: relative; flex: 1; min-width: 0; }
.worker.in { animation: walk .35s ease-out; }
@keyframes walk { 0% { transform: translateX(-40%); opacity: 0; } 100% { transform: none; opacity: 1; } }
.worker > img { display: block; width: 100%; height: auto; }
.order { position: absolute; left: 50%; bottom: 2%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 3px 6px 5px; border-radius: 12px; background: var(--surface); border: 2px solid var(--edge); box-shadow: 0 3px 0 var(--shadow); }
.order img { width: clamp(26px, 6.5vw, 38px); height: auto; display: block; }
.pips { display: flex; gap: 3px; }
.pips i { width: 9px; height: 9px; border-radius: 3px; border: 1.5px solid var(--edge); background: var(--surface-raised); }
.pips i.on { background: var(--gold-active); }

.tray { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-inset); border-block: 2px solid var(--edge); }
.tray b { font: 800 14px/1 var(--ui); letter-spacing: .1em; color: var(--ink-muted); }
.dock { display: flex; gap: 8px; }
.dock span { width: clamp(44px, 12vw, 58px); aspect-ratio: 1; border-radius: 13px; border: 2px dashed var(--side); background: var(--surface);
  display: grid; place-items: center; }
.dock span.full { border-style: solid; border-color: var(--edge); background: var(--tile); box-shadow: 0 3px 0 var(--side); }
.dock span.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.dock img { width: 78%; height: auto; }
.orders { margin-left: auto; font: 800 16px/1 var(--ui); color: var(--ink-strong); font-variant-numeric: tabular-nums; }

.boardpad { padding: 14px 12px 20px; background: linear-gradient(#EFD9A6, #E9CC8E); }
.board { position: relative; aspect-ratio: 7 / 4; }
.tile { position: absolute; width: calc(100% / 7); height: 25%; padding: 3px 3px 7px; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tile .face { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 22%; background: var(--tile);
  border: 2px solid var(--edge); box-shadow: 0 5px 0 var(--side), 2px 8px 0 var(--shadow); transition: transform .08s; }
.tile img { width: 76%; height: auto; pointer-events: none; }
.tile:not(.covered):hover .face { transform: translateY(-2px); }
.tile.covered { cursor: default; }
.tile.covered .face { background: var(--tile-covered); box-shadow: 0 5px 0 var(--tile-covered-side), 2px 8px 0 var(--shadow); }
.tile.covered img { filter: brightness(.62) saturate(.5); }
.tile.no .face { animation: shake .3s; }
.fly { position: fixed; z-index: 50; pointer-events: none; display: grid; place-items: center; border-radius: 22%; background: var(--tile); border: 2px solid var(--edge); }
.fly img { width: 76%; }
.hint { min-height: 3em; padding: 10px 16px 14px; background: var(--surface); border-top: 2px solid var(--edge); font-weight: 700; color: var(--ink-strong); }

.won { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px; text-align: center; background: rgba(26, 56, 71, .82); color: var(--cream); }
.won img.hammer { width: 120px; transform-origin: 20% 85%; animation: strike .7s cubic-bezier(.5, 0, .9, .4) both; }
@keyframes strike { 0% { transform: rotate(-70deg) translateY(-30px); } 80% { transform: rotate(18deg); } 100% { transform: rotate(8deg); } }
.won strong { font: 900 clamp(30px, 8vw, 46px)/1 var(--display); letter-spacing: .04em; color: var(--gold); text-shadow: 0 3px 0 var(--ink-strong); }
.won p { max-width: 30ch; font-weight: 700; }

.howto { display: flex; flex-direction: column; gap: 20px; padding-top: 110px; }
.howto ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.howto li { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 14px; align-items: center; }
.howto li > span { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 22%; background: var(--tile); border: 2px solid var(--edge); box-shadow: 0 5px 0 var(--side); }
.howto li img { width: 74%; height: auto; }
.howto li p { color: var(--ink); }

/* ten stages */
.stages { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; align-items: center; }
.stagebox { border-radius: 24px; border: 2px solid var(--edge); background: #2E8FEA url(../img/site.webp) center bottom / cover; box-shadow: 0 6px 0 var(--edge); padding: 8% 4% 4%; }
.stagebox img { display: block; width: 100%; height: auto; }
.scrub { display: flex; flex-direction: column; gap: 14px; }
.scrub label { font: 800 22px/1 var(--ui); color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.scrub input { width: 100%; height: 44px; accent-color: var(--side); cursor: pointer; }

/* Pick To Build wall */
.civ { display: flex; flex-direction: column; gap: 10px; }
.civ h3 { font-size: 16px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); }
#civs { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; border-radius: 18px; border: 2px solid var(--edge); background: var(--surface); overflow: hidden; box-shadow: 0 5px 0 var(--edge); }
.card div { aspect-ratio: 4 / 3; display: grid; place-items: end center; padding: 10px 8px 6px; background: linear-gradient(#8FD0FF, #DDF1FF 62%, #F1D694 62%); }
.card img { max-height: 100%; width: auto; }
.card p { padding: 8px 8px 10px; font: 800 15px/1.2 var(--ui); color: var(--ink-strong); border-top: 2px solid var(--edge); flex: 1; overflow-wrap: anywhere; }

/* modes */
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px 32px; }
.mode { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.medal { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--gold); border: 3px solid var(--edge); box-shadow: 0 5px 0 var(--edge); }
.medal img { width: 56%; height: auto; }
.icon { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 20px; background: var(--surface); border: 2px solid var(--edge); box-shadow: 0 5px 0 var(--edge); }
.icon img { width: 58%; height: auto; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badges img { width: 54px; height: 54px; }

footer { background: var(--ink-strong); color: var(--surface-raised); }
footer .wrap { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, 1.6fr) minmax(0, .8fr); gap: 28px 32px; padding-block: 36px 28px; }
footer a { color: var(--gold); font-weight: 700; overflow-wrap: anywhere; }
footer nav { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
footer .fh { font: 800 14px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: #D9C39B; margin-bottom: 4px; }
.fbrand { display: flex; align-items: center; gap: 12px; align-self: start; }
.fbrand img { width: 56px; height: 56px; }
.fbrand p { display: flex; flex-direction: column; }
.fbrand b { font: 800 24px/1.1 var(--ui); color: var(--cream); }
.fbrand span { color: #D9C39B; font-weight: 700; }
footer small { grid-column: 1 / -1; padding-top: 18px; border-top: 2px solid rgba(255, 244, 220, .16); font-size: 15px; color: #D9C39B; }
@media (max-width: 720px) { footer .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fbrand, footer nav:nth-of-type(2) { grid-column: 1 / -1; } footer nav:nth-of-type(2) { order: 3; } footer small { order: 4; } }


/* motion: one hammer strike on load, a looping "tap 3, build" strip, feedback inside the level, the stages building themselves */
.emblem { transform-origin: 30% 80%; animation: drop .9s cubic-bezier(.5, 0, .8, .4) both, bob 4.5s ease-in-out 1s infinite; }
@keyframes drop { 0% { transform: translateY(-70px) rotate(-60deg); } 70% { transform: rotate(16deg); } 84% { transform: rotate(1deg); } 100% { transform: rotate(6deg); } }
@keyframes bob { 0%, 100% { transform: rotate(6deg); } 50% { transform: rotate(3deg) translateY(-9px); } }
.hero h1 { animation: thud .5s .62s backwards; }
@keyframes thud { 0% { transform: translateY(-8px) scale(1.05); } 45% { transform: translateY(4px) scale(.985); } 100% { transform: none; } }
.recipe span { animation: press 4s infinite; }
.recipe span:nth-child(1) { animation-delay: 1.4s; } .recipe span:nth-child(2) { animation-delay: 1.75s; } .recipe span:nth-child(3) { animation-delay: 2.1s; }
@keyframes press { 0%, 9%, 100% { transform: none; } 4% { transform: translateY(5px) scale(.93); } }
.recipe b { animation: point 4s 2.5s infinite; }
@keyframes point { 0%, 12%, 100% { transform: none; } 6% { transform: translateX(6px); } }
.recipe span.result { animation: rise 4s 2.75s infinite; }
@keyframes rise { 0%, 16%, 100% { transform: none; } 5% { transform: scale(1.14) rotate(-3deg); } 10% { transform: scale(.98); } }
.tile.want .face { animation: nudge 1.5s ease-in-out infinite; }
@keyframes nudge { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-5px); box-shadow: 0 10px 0 var(--side), 2px 13px 0 var(--shadow); } }
.pips i.on { animation: pip .3s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes pip { 0% { transform: scale(.3); } 100% { transform: none; } }
.pop { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.ghost { position: absolute; left: 0; bottom: 0; width: 100%; pointer-events: none; }
.dust { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #F4E3BC; pointer-events: none; }
.won strong { animation: stamp .35s .6s cubic-bezier(.3, 1.5, .5, 1) backwards; }
@keyframes stamp { 0% { transform: scale(1.7); opacity: 0; } 100% { transform: none; opacity: 1; } }
.won p, .won .btn { animation: fadeup .4s .9s backwards; }
@keyframes fadeup { 0% { transform: translateY(10px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.card { transition: transform .14s, box-shadow .14s; }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 0 var(--edge); }
.card:hover img { transform: scale(1.06); } .card img { transition: transform .2s; }

@media (max-width: 820px) {
  section > .wrap.playgrid, .stages { grid-template-columns: minmax(0, 1fr); }
  .howto { padding-top: 0; }
  .heromain { grid-template-columns: minmax(0, 1fr); }
  .emblem { grid-column: 1; grid-row: 1; width: min(52vw, 230px); margin-bottom: -6px; }
  .herotext { grid-row: 2; }
  .bar nav a:not(.keep) { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* document pages (privacy.html, delete-account.html): one readable sheet on the paving */
.docbar { background: var(--ink-strong); }
.docbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.docbar a { color: var(--gold); font-weight: 800; }
.docbar .home { display: inline-flex; align-items: center; gap: 10px; color: var(--cream); font: 800 22px/1 var(--ui); text-decoration: none; }
.docbar .home img { width: 44px; height: 44px; }
.docpage main { display: block; padding-block: 28px 64px; }
.doc { max-width: 760px; margin: 0 auto; padding: clamp(20px, 5vw, 44px); background: var(--surface); border: 2px solid var(--edge); border-radius: 24px;
  box-shadow: 0 6px 0 var(--edge); display: flex; flex-direction: column; gap: 14px; }
.doc.wide { max-width: 1040px; }
.doc h1 { font: 800 clamp(34px, 6vw, 48px)/1.05 var(--ui); color: var(--ink-strong); }
.doc h2 { font-size: clamp(24px, 4vw, 28px); margin-top: 18px; }
.doc h3 { font-size: 19px; margin-top: 6px; }
.doc p, .doc li { max-width: 68ch; }
.doc ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.doc a { color: var(--ink-strong); font-weight: 700; }
.doc .meta { color: var(--ink-muted); font-weight: 700; }
.draft { padding: 10px 14px; border-radius: 14px; background: var(--gold); border: 2px solid var(--edge); font-weight: 800; color: var(--ink-strong); }
mark.todo { background: var(--gold); color: var(--ink-strong); padding: 0 6px; border-radius: 6px; font-weight: 800; }
mark.todo::before { content: "["; } mark.todo::after { content: "]"; }
.steps { list-style: none; counter-reset: step; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: 10px; max-width: none; }
.steps li p::before { content: counter(step); display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 8px; border-radius: 50%;
  background: var(--gold); border: 2px solid var(--edge); font-weight: 800; color: var(--ink-strong); }
.shot { position: relative; border: 2px solid var(--edge); border-radius: 18px; overflow: hidden; box-shadow: 0 5px 0 var(--edge); }
.shot img { display: block; width: 100%; height: auto; }
.shot i { position: absolute; border: 4px solid #E0352B; border-radius: 14px; box-shadow: 0 0 0 3px var(--cream); animation: ring 1.6s ease-in-out infinite; }
@keyframes ring { 0%, 100% { transform: none; } 50% { transform: scale(1.06); } }
.twocol { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 32px; }
.twocol section { display: flex; flex-direction: column; gap: 10px; }

/* press kit (press.html) */
.btn.small { min-height: 44px; padding: 0 16px; font-size: 16px; border-radius: 14px; box-shadow: 0 4px 0 var(--edge); }
.facts { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 18px; }
.facts dt { font-weight: 800; color: var(--ink-muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 260px)); gap: 20px; }
.files figure { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.thumb { display: grid; place-items: center; border: 2px solid var(--edge); border-radius: 18px; overflow: hidden; background: var(--surface-inset); box-shadow: 0 5px 0 var(--edge); }
.thumb img { display: block; width: 100%; height: auto; }
.thumb.plain { padding: 12%; background: repeating-conic-gradient(#F3E3C2 0 25%, #FFF4DC 0 50%) 0 0 / 28px 28px; }
.files figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.files figcaption b { flex-basis: 100%; font-size: 19px; color: var(--ink-strong); }
.files figcaption span { flex-basis: 100%; color: var(--ink-muted); font-weight: 700; margin-top: -6px; }
