/* ==========================================================================
   Local Kine Word Game — site styles
   Every colour below is copied from apps/mobile/constants/tokens.ts so the
   site matches the game exactly.
   ========================================================================== */

:root {
  /* appGradient — the sunset→ocean gradient on the game's full-bleed screens */
  --sky-purple:  #5B2A86;
  --magenta:     #C13584;
  --coral:       #F2704B;
  --sun:         #FBC24B;
  --ocean:       #4FBEC9;
  --seafoam:     #9EE7E4;

  /* Home screen sky/sea */
  --sky-light:   #BFE3F0;
  --sky-mid:     #7FC6D9;
  --ocean-top:   #8FD4E4;
  --ocean-deep:  #3DA6C4;

  /* Real tile — faceTop / faceMid / faceBottom / lip */
  --tile-top:    #FDEFCE;
  --tile-mid:    #F8E0A6;
  --tile-bottom: #F0CB83;
  --tile-lip:    #CA9E58;
  --tile-letter: #000000;

  /* Bonus squares */
  --ak:          #E98B6F;
  --tl:          #3E9BB5;
  --dw:          #A387CE;
  --tw:          #F2C14E;
  --glow:        #F5C842;

  /* Text */
  --ink:         #5C4326;
  --ink-soft:    rgba(92, 67, 38, 0.62);
  --cream:       #F7E7C6;
  --white:       #FFFFFF;

  --maxw: 68rem;
  --gutter: 1.25rem;
  --tile: 3.1rem;
}

@media (min-width: 48rem) {
  :root { --gutter: 2rem; --tile: 4.25rem; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: linear-gradient(180deg, var(--sky-light) 0%, var(--sky-mid) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: Overpass, system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: #1F7D96; text-underline-offset: .2em; }
a:hover { color: var(--ink); }

:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 3px; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 42rem; }

.skip { position: absolute; left: -9999px; background: var(--ink); color: var(--cream); padding: .75rem 1rem; z-index: 100; font-weight: 700; }
.skip:focus { left: var(--gutter); top: .5rem; }

/* ---------- Masthead ---------------------------------------------------- */

.masthead {
  position: sticky; top: 0; z-index: 50;
  background: rgba(191, 227, 240, .94);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--tile-lip);
}
.masthead__inner { display: flex; align-items: center; gap: 1rem; min-height: 3.5rem; flex-wrap: wrap; }

.brand {
  display: flex; align-items: center; gap: .5rem;
  font-family: Fredoka, Overpass, sans-serif; font-weight: 600; font-size: 1.0625rem;
  color: var(--ink); text-decoration: none; margin-right: auto;
}
.brand img { width: 1.9rem; height: 1.9rem; }

.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: .9375rem; font-weight: 600; }
.nav a { color: var(--ink-soft); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--coral); }

/* ---------- Tiles — built to match the game's tile exactly -------------- */

.tilerow { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; }
.tilerow + .tilerow { margin-top: .35rem; }

.tile {
  position: relative;
  width: var(--tile); height: var(--tile);
  /* Wood grain: two fine line frequencies over the tile's wood tone, so the
     spacing looks natural rather than striped. */
  background:
    repeating-linear-gradient(88deg,
      rgba(202, 158, 88, .13) 0 1px, rgba(202, 158, 88, 0) 1px 4px),
    repeating-linear-gradient(93deg,
      rgba(138, 98, 48, .07) 0 1px, rgba(138, 98, 48, 0) 1px 9px),
    linear-gradient(180deg, var(--tile-top) 0%, var(--tile-mid) 55%, var(--tile-bottom) 100%);
  color: var(--tile-letter);
  border-radius: calc(var(--tile) * .14);
  display: grid; place-items: center;
  font-family: Nunito, Overpass, sans-serif;
  font-weight: 800;
  font-size: calc(var(--tile) * .54);
  line-height: 1;
  box-shadow:
    inset 0 calc(var(--tile) * -.085) 0 var(--tile-lip),
    inset 0 2px 0 rgba(255, 255, 255, .9),
    0 3px 5px rgba(92, 67, 38, .3);
  user-select: none;
}
.tile:nth-child(odd)  { transform: rotate(-.7deg); }
.tile:nth-child(even) { transform: rotate(.7deg); }

.tile__pts {
  position: absolute;
  right: calc(var(--tile) * .1); bottom: calc(var(--tile) * .1);
  font-size: calc(var(--tile) * .21);
  font-weight: 600;
}

/* AK square — tokens.bonusAK */
.tile--ak {
  background: var(--ak);
  color: var(--white);
  font-family: Overpass, sans-serif; font-weight: 500;
  font-size: calc(var(--tile) * .33);
  letter-spacing: .03em;
  box-shadow:
    0 0 0 3px var(--glow),
    0 3px 5px rgba(92, 67, 38, .3);
}
.tile--gap { background: none; box-shadow: none; transform: none; }

/* ---------- Hero — the game's own sunset gradient ---------------------- */

.hero {
  background: linear-gradient(180deg,
    var(--sky-purple) 0%, var(--magenta) 20%, var(--coral) 42%,
    var(--sun) 62%, var(--ocean) 83%, var(--seafoam) 100%);
  padding-block: 2.75rem 3.25rem;
  text-align: center;
}
@media (min-width: 48rem) { .hero { padding-block: 4rem 4.5rem; } }

.hero__shaka { width: 5.5rem; margin: 0 auto 1.25rem; filter: drop-shadow(0 3px 8px rgba(0,0,0,.3)); }

.hero__wordmark { margin: 0 0 1.5rem; }

.hero__hook {
  font-size: 1.1875rem; line-height: 1.5;
  color: var(--white);
  text-shadow: 0 2px 10px rgba(91, 42, 134, .55);
  max-width: 34rem; margin: 0 auto 1.75rem;
  font-weight: 500;
}
@media (min-width: 48rem) { .hero__hook { font-size: 1.3125rem; } }

.hero__note {
  font-size: .9375rem; margin: 0;
  color: var(--white);
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(91, 42, 134, .55);
}

/* ---------- Store badges ----------------------------------------------- */

.stores { display: flex; gap: .875rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.25rem; }
.stores a { display: block; border-radius: .5rem; transition: transform .15s ease; }
.stores a:hover { transform: translateY(-2px); }
.stores img { height: 3.4rem; width: auto; }

/* ---------- Sections --------------------------------------------------- */

.section { padding-block: 3rem; }
@media (min-width: 48rem) { .section { padding-block: 4.25rem; } }

.section--ocean {
  background: linear-gradient(180deg, var(--ocean-top) 0%, var(--ocean-deep) 100%);
}
.section--ocean h2, .section--ocean .lede { color: var(--ink); }

h1, h2, h3 {
  font-family: Fredoka, Overpass, sans-serif; font-weight: 600;
  line-height: 1.15; margin: 0 0 .75rem; color: var(--ink);
}
h1 { font-size: clamp(2rem, 6vw, 3rem); }
h2 { font-size: clamp(1.625rem, 4vw, 2.25rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; max-width: 42rem; }
.lede { font-size: 1.125rem; color: var(--ink-soft); }

/* ---------- Difference blocks ------------------------------------------ */

.diff { display: grid; gap: 1.125rem; margin-top: 2rem; }
@media (min-width: 52rem) {
  .diff { grid-template-columns: 1.45fr 1fr; align-items: start; }
  .diff__lead { grid-row: span 2; }
}

.diff__item {
  background: rgba(255, 255, 255, .62);
  border: 2px solid rgba(202, 158, 88, .5);
  border-radius: 1.125rem; padding: 1.5rem;
}
.diff__lead {
  background: rgba(255, 255, 255, .8);
  border-color: var(--ak);
  padding: 1.75rem;
}
.diff__item p { margin-bottom: 0; }
.diff__demo { margin-bottom: 1.25rem; }
.diff__demo .tilerow { justify-content: flex-start; }

/* ---------- Screenshots ------------------------------------------------ */

.shots { display: grid; gap: 1rem; margin-top: 2rem; grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); }
.shots figure { margin: 0; }
.shots img {
  width: 100%; border-radius: 1.5rem;
  border: 3px solid var(--white);
  background: var(--ocean-top);
  aspect-ratio: 9 / 19.5; object-fit: cover;
  box-shadow: 0 6px 18px rgba(92, 67, 38, .25);
}
.shots figcaption { font-size: .875rem; color: var(--ink-soft); margin-top: .625rem; font-weight: 600; }

/* ---------- Trailer ---------------------------------------------------- */

.trailer {
  margin-top: 2rem; border-radius: 1.25rem; overflow: hidden;
  border: 3px solid var(--white);
  background: rgba(255, 255, 255, .5);
  aspect-ratio: 16 / 9; display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(92, 67, 38, .2);
}
.trailer video { width: 100%; height: 100%; object-fit: cover; }
.trailer__placeholder { color: var(--ink-soft); font-size: .9375rem; text-align: center; padding: 1.5rem; }

/* ---------- Long-form prose ------------------------------------------- */

.doc { padding-block: 2.25rem 4rem; }
.doc__sheet {
  background: rgba(255, 255, 255, .72);
  border: 2px solid rgba(202, 158, 88, .45);
  border-radius: 1.25rem;
  padding: 1.75rem var(--gutter) 2.5rem;
}
@media (min-width: 48rem) { .doc__sheet { padding: 2.5rem 3rem 3rem; } }

.doc h1 { margin-bottom: .5rem; }
.doc__meta {
  color: var(--ink-soft); font-size: .9375rem;
  margin-bottom: 2rem; padding-bottom: 1.125rem;
  border-bottom: 2px solid rgba(202, 158, 88, .4);
}
.doc h2 {
  font-size: 1.375rem; margin-top: 2.25rem; margin-bottom: .625rem;
  padding-top: 1.375rem; border-top: 1px solid rgba(202, 158, 88, .35);
}
.doc h2:first-of-type { border-top: none; padding-top: 0; margin-top: 1.75rem; }
.doc h3 { font-size: 1.0625rem; margin-top: 1.625rem; }
.doc ul, .doc ol { padding-left: 1.25rem; max-width: 42rem; }
.doc li { margin-bottom: .5rem; }
.doc strong { font-weight: 700; }

.callout {
  background: rgba(233, 139, 111, .16);
  border-left: 4px solid var(--ak);
  border-radius: 0 .5rem .5rem 0;
  padding: 1.125rem 1.25rem; margin: 1.5rem 0; max-width: 42rem;
}
.callout p:last-child { margin-bottom: 0; }

.doc__toc {
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(202, 158, 88, .45);
  border-radius: .875rem; padding: 1.125rem 1.375rem;
  margin-bottom: 2rem; max-width: 42rem;
}
.doc__toc ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 1.5rem; }
.doc__toc li { margin-bottom: .375rem; break-inside: avoid; }

/* ---------- Steps (How to Play) --------------------------------------- */

.steps { counter-reset: step; list-style: none; padding: 0; max-width: 42rem; }
.steps li {
  counter-increment: step; position: relative;
  padding-left: 3.25rem; margin-bottom: 1.5rem;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -.1rem;
  width: 2.35rem; height: 2.35rem;
  background:
    repeating-linear-gradient(88deg,
      rgba(202, 158, 88, .13) 0 1px, rgba(202, 158, 88, 0) 1px 4px),
    linear-gradient(180deg, var(--tile-top), var(--tile-bottom));
  box-shadow: inset 0 -3px 0 var(--tile-lip), 0 2px 4px rgba(92,67,38,.25);
  border-radius: .35rem;
  display: grid; place-items: center;
  font-family: Nunito, sans-serif; font-weight: 800; font-size: 1.15rem;
  color: var(--tile-letter);
}
.steps h3 { margin-bottom: .35rem; }

/* ---------- Bonus-square key ------------------------------------------ */

.key { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0; padding: 0; list-style: none; }
.key li { display: flex; align-items: center; gap: .625rem; font-weight: 600; font-size: .9375rem; }
.key span {
  width: 2.6rem; height: 2.6rem; border-radius: .35rem;
  display: grid; place-items: center;
  font-family: Overpass, sans-serif; font-weight: 500; font-size: .8125rem;
  color: var(--white);
  box-shadow: 0 2px 4px rgba(92, 67, 38, .25);
}
.key .k-ak { background: var(--ak); }
.key .k-tl { background: var(--tl); }
.key .k-dw { background: var(--dw); }
.key .k-tw { background: var(--tw); color: var(--ink); }

/* ---------- Legal index cards ----------------------------------------- */

.docgrid { display: grid; gap: 1rem; margin-top: 2rem; }
@media (min-width: 42rem) { .docgrid { grid-template-columns: repeat(3, 1fr); } }
.docgrid a {
  display: block; text-decoration: none;
  background: rgba(255, 255, 255, .72);
  border: 2px solid rgba(202, 158, 88, .5);
  border-radius: 1.125rem; padding: 1.5rem; color: var(--ink);
}
.docgrid a:hover { border-color: var(--coral); background: rgba(255, 255, 255, .92); }
.docgrid h3 { margin-bottom: .375rem; }
.docgrid p { font-size: .9375rem; margin: 0; color: var(--ink-soft); }

/* ---------- Socials --------------------------------------------------- */

.socials { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.socials a {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(255, 255, 255, .75);
  border: 2px solid rgba(202, 158, 88, .5);
  border-radius: 999px; padding: .5rem 1.125rem;
  color: var(--ink); text-decoration: none; font-size: .9375rem; font-weight: 700;
}
.socials a:hover { background: var(--white); border-color: var(--coral); }
.socials svg { width: 1.125rem; height: 1.125rem; fill: currentColor; }

/* ---------- Footer ---------------------------------------------------- */

.footer {
  background: linear-gradient(180deg, var(--ocean) 0%, var(--seafoam) 100%);
  border-top: 3px solid var(--white);
  padding-block: 2.5rem; font-size: .9375rem; color: var(--ink);
}
.footer__inner { display: grid; gap: 1.5rem; }
@media (min-width: 42rem) { .footer__inner { grid-template-columns: 1fr auto; align-items: start; } }
.footer a { color: var(--ink); text-decoration: none; font-weight: 600; }
.footer a:hover { text-decoration: underline; }
.footer__links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer p { margin: 0 0 .375rem; max-width: 32rem; }
