/* GoArcade landing. Palette from the Ur board itself: lapis, shell, carnelian, gold leaf, bitumen. */
@font-face { font-family: 'Bricolage'; src: url('/fonts/bricolage-regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url('/fonts/bricolage-bold.woff') format('woff'); font-weight: 700; font-display: swap; }

:root {
  --lapis: #12275a; --lapis-deep: #0b1a40; --lapis-hi: #1d3a78;
  --shell: #efe6d2; --shell-dim: #b9b3a3;
  --carnelian: #b8401f; --carnelian-hi: #d0532d;
  --gold: #d6b05a; --bitumen: #1b1612;
  --measure: 34rem;
  --step: clamp(1rem, .96rem + .2vw, 1.125rem);
}
* { box-sizing: border-box; }
html { background: var(--lapis); color: var(--shell); font: 400 var(--step)/1.55 'Bricolage', 'Inter', system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, dt { font-weight: 700; letter-spacing: -.015em; }
p, dd { max-width: var(--measure); }

/* ---------- header / wordmark ---------- */
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 1.5rem; padding: 1.25rem clamp(1.25rem, 5vw, 4rem); }
.wordmark { font-weight: 700; font-size: 1.5rem; letter-spacing: -.03em; text-decoration: none; }
.wordmark span { color: var(--gold); }
.wordmark.small { font-size: 1.15rem; }
.top nav { display: flex; align-items: center; gap: 1.5rem; font-size: .95rem; }
.top nav a:not(.btn) { text-decoration: none; color: var(--shell-dim); }
.top nav a:not(.btn):hover { color: var(--shell); text-decoration: underline; text-underline-offset: .3em; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr); gap: clamp(2rem, 5vw, 5rem); align-items: center;
  padding: clamp(1.5rem, 5vw, 4rem) clamp(1.25rem, 5vw, 4rem) clamp(3rem, 7vw, 6rem); }
h1 { font-size: clamp(2.4rem, 1.4rem + 4vw, 4.6rem); line-height: 1.02; margin: 0 0 1.25rem; letter-spacing: -.035em; max-width: 15ch; }
.lede { font-size: 1.15em; color: var(--shell-dim); margin: 0 0 2rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn { display: inline-flex; align-items: center; min-height: 3rem; padding: .7rem 1.25rem; border-radius: 999px; font: 700 1rem/1 'Bricolage', system-ui, sans-serif;
  text-decoration: none; color: var(--shell); background: transparent; border: 2px solid rgba(239, 230, 210, .35); cursor: pointer; transition: background-color .15s, border-color .15s; }
.btn:hover { border-color: var(--shell); }
.btn.big { min-height: 3.5rem; padding: .9rem 1.75rem; font-size: 1.125rem; }
.btn.small { min-height: 2.5rem; padding: .5rem 1.1rem; font-size: .95rem; }
.btn.primary { background: var(--carnelian); border-color: var(--carnelian); }
.btn.primary:hover { background: var(--carnelian-hi); border-color: var(--carnelian-hi); }

.assure { margin: 1rem 0 0; color: var(--shell-dim); font-size: .95rem; }
.join { margin-top: 1.75rem; }
.join summary { display: inline-block; cursor: pointer; color: var(--shell); text-decoration: underline; text-underline-offset: .3em; text-decoration-color: rgba(239, 230, 210, .4); list-style: none; }
.join summary::-webkit-details-marker { display: none; }
.join[open] summary { margin-bottom: .75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.join-row { display: flex; gap: .5rem; max-width: 22rem; }
.join input { flex: 1; min-width: 0; min-height: 3rem; padding: 0 1rem; border-radius: 999px; border: 2px solid rgba(239, 230, 210, .35); background: var(--lapis-deep);
  color: var(--shell); font: 700 1.15rem 'Bricolage', system-ui, sans-serif; letter-spacing: .3em; text-transform: uppercase; }
.join input::placeholder { color: rgba(239, 230, 210, .25); }
.live { margin: 1.5rem 0 0; color: var(--gold); font-size: .95rem; }
.live::before { content: ''; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--gold); margin-right: .55rem; vertical-align: .05em; }

/* the hero visual: the game itself. Poster image first (fast), then a muted looping video fades in over it. */
.hero-shot { position: relative; border-radius: 14px; overflow: hidden; background: var(--bitumen); aspect-ratio: 16 / 10;
  box-shadow: 0 0 0 1px rgba(214, 176, 90, .45), 0 2rem 4rem rgba(3, 8, 22, .6); }
.hero-shot img, .hero-shot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-shot video { opacity: 0; transition: opacity .8s ease; }
.hero-shot video.playing { opacity: 1; }
.hero-shot .board { display: none; }
.hero-shot.no-shot img { display: none; }
.hero-shot.no-shot { background: radial-gradient(ellipse at 50% 35%, #3a2a17 0%, #1b1612 70%); }
.hero-shot.no-shot .board { display: block; position: absolute; left: 5%; width: 90%; top: 18%; height: auto; transform: perspective(1400px) rotateX(28deg); transform-origin: 50% 60%;
  filter: drop-shadow(0 1.75rem 1.5rem rgba(0, 0, 0, .6)); }
.shot-link { position: absolute; inset: 0; border-radius: inherit; }
.shot-link:focus-visible { outline-offset: -4px; }
.shot-play { position: absolute; right: 1rem; bottom: 1rem; padding: .75rem 1.35rem; border-radius: 999px; background: var(--carnelian); color: var(--shell);
  font-weight: 700; font-size: 1.05rem; box-shadow: 0 .5rem 1.25rem rgba(0, 0, 0, .45); transition: background-color .15s; }
.shot-link:hover .shot-play, .shot-link:focus-visible .shot-play { background: var(--carnelian-hi); }
.shot-pause { position: absolute; left: .75rem; bottom: .75rem; width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: var(--shell); background: rgba(11, 26, 64, .7); }
.shot-pause[hidden] { display: none; }
.shot-pause .i-play { display: none; }
.shot-pause[aria-pressed="true"] .i-play { display: block; }
.shot-pause[aria-pressed="true"] .i-pause { display: none; }
.hop { animation: hop-x 1.5s .7s cubic-bezier(.45, 0, .3, 1) both; }
.hop-y { animation: hop-y 1.5s .7s linear both; }
.glow { fill: none; stroke: var(--gold); stroke-width: 4; opacity: 0; animation: glow 1.6s 2s ease-out both; }
@keyframes hop-x { 0%, 8% { transform: translateX(0); } 40%, 55% { transform: translateX(calc(-1 * var(--pitch))); } 88%, 100% { transform: translateX(calc(-2 * var(--pitch))); } }
@keyframes hop-y { 0%, 8% { transform: translateY(0); } 24% { transform: translateY(-38px); } 40%, 55% { transform: translateY(0); } 72% { transform: translateY(-38px); } 88%, 100% { transform: translateY(0); } }
@keyframes glow { 0% { opacity: .9; transform: scale(.8); } 100% { opacity: 0; transform: scale(1.5); } }
.glow { transform-box: fill-box; transform-origin: center; }

/* ---------- how a room works: a real sequence, so it is numbered ---------- */
.how, .rules-sec, .story { padding: clamp(3rem, 7vw, 5.5rem) clamp(1.25rem, 5vw, 4rem); }
.rules-sec { background: var(--lapis-deep); }
h2 { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.6rem); line-height: 1.1; margin: 0 0 2rem; max-width: 22ch; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.steps li { counter-increment: step; border-top: 2px solid var(--gold); padding-top: 1rem; }
.steps li::before { content: counter(step); display: block; font-weight: 700; font-size: 2.75rem; line-height: 1; color: var(--gold); margin-bottom: .75rem; }
.steps h3 { font-size: 1.25rem; margin: 0 0 .4rem; }
.steps p { margin: 0; color: var(--shell-dim); }

/* ---------- how to play ---------- */
.rules { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
.rules div { display: grid; grid-template-rows: auto auto 1fr; }
.rules div::before { content: ''; width: .9rem; height: .9rem; margin: .3rem 0 1rem .2rem; background: var(--gold); transform: rotate(45deg); }
.rules dt { font-size: 1.15rem; }
.rules dd { margin: .35rem 0 0; color: var(--shell-dim); }
.rules-cta { margin: 2.5rem 0 0; color: var(--shell-dim); }
.rules-cta a { color: var(--shell); font-weight: 700; text-underline-offset: .3em; }
.how .steps { margin-bottom: 2.5rem; }
.steps.perks li::before { content: none; }
.sec-lede { max-width: 38rem; margin: -.5rem 0 2rem; color: var(--shell-dim); font-size: 1.1rem; }

/* ---------- story ---------- */
.story { background: var(--bitumen); }
.story p { color: var(--shell-dim); }
.story p:first-of-type { color: var(--shell); }

/* ---------- footer ---------- */
.foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: .75rem 2rem; padding: 2rem clamp(1.25rem, 5vw, 4rem); background: var(--bitumen); border-top: 1px solid rgba(239, 230, 210, .1); color: var(--shell-dim); font-size: .95rem; }
.foot p { margin: 0; flex: 1; }
.foot nav a { color: var(--shell-dim); }

/* ---------- simple pages (privacy, invite) ---------- */
.page { padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 5vw, 4rem); max-width: 46rem; }
.page h1 { font-size: clamp(2rem, 1.4rem + 2.5vw, 3rem); max-width: none; }
.page h2 { font-size: 1.35rem; margin: 2.25rem 0 .5rem; }
.page p, .page li { color: var(--shell-dim); }
.page strong { color: var(--shell); }
.invite-code { font-weight: 700; font-size: clamp(2.5rem, 2rem + 3vw, 4rem); letter-spacing: .25em; color: var(--gold); margin: .5rem 0 2rem; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-shot { order: -1; }
  .shot-play { right: .6rem; bottom: .6rem; padding: .55rem 1rem; font-size: .95rem; }
  .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
}
@media (max-width: 560px) {
  .top nav { display: none; } /* the video's button and the big button below already say Play now */
  .rules { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .actions .btn { flex: 1 1 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .hop, .hop-y, .glow { animation: none; }
  .hop { transform: translateX(calc(-2 * var(--pitch))); }
}
