/* Arrow Splash website. Colours, type, radii and motion come from brand/tokens.json (brand v3.2).
   One stylesheet for every page. No web fonts: SF Pro Rounded on Apple devices, the system font elsewhere. */

:root {
  color-scheme: light dark;

  /* UI tokens, light ("Cream") */
  --ground: #F9F4EA;
  --surface: #FFFEFA;
  --text: #171717;
  --text-muted: #5A574D;
  --outline: #171717;
  --outline-w: 2px;
  --divider: rgba(23, 23, 23, 0.10);
  --frame: #171717;
  --tile-empty: #EDE7DC;
  --primary: #187A45;
  --on-primary: #FFFEFA;
  --win: #C73E0A;
  --danger: #C8102E;
  --star: #FFB627;
  --badge: #171717;
  --on-badge: #F9F4EA;
  --scrim: rgba(23, 23, 23, 0.45);
  --lift: 0 6px 0 rgba(23, 23, 23, 0.12);

  /* Paint: never changes between themes */
  --orange: #FF6B1A;
  --teal: #14BFAE;
  --yellow: #FFB627;
  --pink: #FF8FB3;
  --indigo: #3448C5;
  --green: #22A05C;
  --on-paint: #171717;

  /* Type */
  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;

  /* Space */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --gutter: 16px;
  --max: 1120px;

  /* Shape */
  --r-sm: 10px; --r-md: 16px; --r-frame: 20px; --r-lg: 24px; --r-pill: 999px;

  /* Motion */
  --ease-slide: cubic-bezier(.3, 0, .2, 1);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* UI tokens, dark ("Ink") */
    --ground: #171717;
    --surface: #24221F;
    --text: #F9F4EA;
    --text-muted: #B8B2A4;
    --outline: #4A463F;
    --outline-w: 1px;
    --divider: rgba(247, 241, 230, 0.12);
    --frame: #1F2336;
    --tile-empty: #3C3933;
    --primary: #2EAA68;
    --on-primary: #171717;
    --win: #FF7A2E;
    --danger: #F0524A;
    --scrim: rgba(0, 0, 0, 0.60);
    --lift: 0 6px 0 rgba(0, 0, 0, 0.40);
  }
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--orange); }

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

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 10;
  padding: var(--s2) var(--s4);
  background: var(--surface); border: var(--outline-w) solid var(--outline); border-radius: var(--r-sm);
  font-weight: 700;
}
.skip:focus { top: var(--s2); }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

.overline {
  margin: 0 0 var(--s2);
  font-size: 13px; line-height: 16px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Header ---------- */

.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  min-height: 76px;
}
.logo-link { display: inline-flex; align-items: center; min-height: 44px; border-radius: var(--r-sm); }
.logo-link img { height: 44px; width: auto; }
.site-nav ul { display: flex; gap: var(--s1); list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3);
  border-radius: var(--r-pill); font-weight: 700; text-decoration: none;
}
.site-nav a:hover { background: var(--tile-empty); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 0 0 var(--outline-w) var(--outline); }
.home .site-header .wrap { justify-content: flex-end; }

/* ---------- Hero ---------- */

.hero { padding: var(--s4) 0 var(--s8); }
.hero .wrap { display: grid; gap: var(--s8); align-items: center; }
@media (min-width: 900px) {
  .hero { padding: var(--s4) 0 72px; }
  .hero .wrap { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 56px; }
}

.hero-lockup { margin: 0 0 var(--s6); }
.hero-lockup img { width: min(100%, 360px); height: auto; aspect-ratio: 500 / 200; }

.tagline {
  margin: 0;
  font-size: clamp(46px, 9vw, 92px);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.tagline span { display: block; }
.lede {
  max-width: 34ch;
  margin: var(--s6) 0 var(--s8);
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.45;
  color: var(--text-muted);
}
.lede strong { color: var(--text); font-weight: 700; }

/* App Store button. Live once {{APP_STORE_URL}} is filled in; until then it reads "Coming soon". */
.store {
  display: inline-flex; align-items: center; gap: var(--s3);
  min-height: 56px; padding: 0 var(--s6);
  border-radius: var(--r-md);
  background: var(--text); color: var(--ground);
  font-weight: 700; font-size: 17px; text-decoration: none;
  transition: transform 120ms var(--ease-out);
}
.store:active { transform: scale(0.96); }
.store svg { width: 22px; height: 22px; flex: none; }
.store .soon { display: none; }
.store:not([href]), .store[href*="{{"] {
  background: var(--surface); color: var(--text);
  box-shadow: inset 0 0 0 var(--outline-w) var(--outline);
  pointer-events: none;
}
.store:not([href]) .live, .store[href*="{{"] .live { display: none; }
.store:not([href]) .soon, .store[href*="{{"] .soon { display: inline; }
@media (max-width: 380px) {
  .store { gap: var(--s2); padding: 0 var(--s4); font-size: 15px; }
  .hero-lockup img { width: min(100%, 280px); }
}
.store-note { margin: var(--s3) 0 0; font-size: 13px; line-height: 18px; color: var(--text-muted); }

/* ---------- The playable board (the page's one loud thing) ---------- */

.play {
  position: relative;
  justify-self: center;
  width: 100%; max-width: 440px;
  padding: var(--s5) var(--s3);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 var(--outline-w) var(--outline);
  overflow: hidden;
}
@media (min-width: 400px) { .play { padding: var(--s6); } }

.play-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.play-title { margin: 0; font-size: 20px; line-height: 25px; font-weight: 700; }
.play-sub { margin: 2px 0 0; font-size: 13px; line-height: 18px; color: var(--text-muted); }
.hearts { display: flex; gap: 6px; padding-top: 2px; }
.hearts svg { width: 24px; height: 24px; color: var(--danger); }
.hearts .lost .fill { fill: none; }

.board-wrap { display: grid; place-items: center; padding: var(--s6) 0 var(--s4); }

.board {
  /* At 320 px wide this still gives 44 px tiles: (320 - 2*16 gutter - 2*12 card - 4*6 gaps - 2*10 frame) / 5. */
  --g: 6px;
  --t: clamp(44px, calc((100vw - 2 * var(--gutter) - 24px - 4 * var(--g) - 20px) / 5), 58px);
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, var(--t));
  grid-auto-rows: var(--t);
  gap: var(--g);
}
.cell { position: relative; }
.cell.tile::before {
  /* Each tile carries its own patch of ink frame; neighbours overlap, so the frame follows the board's shape. */
  content: ""; position: absolute; inset: -10px; z-index: 0;
  background: var(--frame);
}
.cell.hub { background: var(--frame); margin: -10px; }
.cell.tile.tl::before { border-top-left-radius: var(--r-frame); }
.cell.tile.tr::before { border-top-right-radius: var(--r-frame); }
.cell.tile.bl::before { border-bottom-left-radius: var(--r-frame); }
.cell.tile.br::before { border-bottom-right-radius: var(--r-frame); }

.base, .arrow {
  position: absolute; inset: 0; z-index: 1;
  border-radius: 22%;
}
.base { background: var(--tile-empty); transition: background-color 180ms var(--ease-slide); }

.arrow {
  z-index: 2;
  display: grid; place-items: center;
  width: 100%; height: 100%;
  margin: 0; padding: 0; border: 0;
  background: var(--paint);
  color: var(--on-paint);
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms var(--ease-out);
}
.arrow svg { width: 52%; height: 52%; transform: rotate(var(--rot)); }
.arrow:active { transform: scale(0.92); }
.arrow:focus-visible { outline: 3px solid var(--ground); outline-offset: 0; box-shadow: 0 0 0 6px var(--text); }

.arrow.gone {
  pointer-events: none;
  transform: translate(var(--dx), var(--dy));
  opacity: 0;
  transition:
    transform var(--dur) var(--ease-slide),
    opacity 120ms linear calc(var(--dur) - 120ms);
  z-index: 3;
}
.arrow.blocked { animation: shake 320ms var(--ease-slide); box-shadow: 0 0 0 3px var(--danger); }
@keyframes shake {
  0%, 100% { translate: 0 0; }
  20% { translate: -5px 0; }
  40% { translate: 5px 0; }
  60% { translate: -3px 0; }
  80% { translate: 3px 0; }
}

.board.done { animation: done 900ms var(--ease-out); }
@keyframes done {
  0% { transform: scale(1); }
  30% { transform: scale(0.96); }
  65% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.play-status {
  min-height: 24px; margin: 0; text-align: center;
  font-size: 15px; line-height: 22px; color: var(--text-muted);
}
.play-status strong { color: var(--text); }
.play-again {
  display: flex; justify-content: center; margin-top: var(--s3);
}
.play-again[hidden] { display: flex; visibility: hidden; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s5);
  border: 0; border-radius: var(--r-md);
  font: inherit; font-weight: 700; font-size: 17px;
  cursor: pointer;
  transition: transform 120ms var(--ease-out);
}
.btn:active { transform: scale(0.94); }
.btn-secondary { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 var(--outline-w) var(--outline); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn svg { width: 18px; height: 18px; }

.sheet {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-items: end stretch;
  background: var(--scrim);
}
.sheet[hidden] { display: none; }
.sheet-card {
  margin: var(--s3);
  padding: var(--s5);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 var(--outline-w) var(--outline);
  text-align: center;
  animation: sheet-in 360ms var(--ease-out);
}
.sheet-card h3 { margin: 0 0 var(--s4); font-size: 20px; line-height: 25px; }
.sheet-card .btn { width: 100%; min-height: 56px; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Features ---------- */

.section { padding: 56px 0; }
.section-title {
  margin: 0 0 var(--s8);
  font-size: clamp(30px, 4.4vw, 44px); line-height: 1.05; font-weight: 800; letter-spacing: -0.02em;
  max-width: 24ch; text-wrap: balance;
}

.features {
  display: grid; gap: var(--s4);
  margin: 0; padding: 0; list-style: none;
}
@media (min-width: 720px) { .features { grid-template-columns: 1fr 1fr; gap: var(--s5); } }
.feature {
  display: grid; grid-template-columns: 56px 1fr; gap: var(--s4); align-items: start;
  padding: var(--s5);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 var(--outline-w) var(--outline);
}
.feature h3 { margin: 2px 0 var(--s1); font-size: 20px; line-height: 25px; font-weight: 700; }
.feature p { margin: 0; color: var(--text-muted); }
.icon-tile { width: 56px; height: 56px; }

/* ---------- Screens ---------- */

.screens {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 62vw);
  gap: var(--s5);
  margin: 0 calc(-1 * var(--gutter));
  padding: var(--s1) var(--gutter) var(--s4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  list-style: none;
}
@media (min-width: 900px) {
  .screens { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); grid-auto-columns: auto; overflow: visible; margin: 0; padding: 0; }
}
.screen { scroll-snap-align: start; margin: 0; }
.phone {
  padding: 7px;
  background: var(--frame);
  border-radius: 34px;
}
.phone img {
  width: 100%; height: auto; aspect-ratio: 540 / 1173;
  border-radius: 27px;
  background: var(--tile-empty);
}
.screen figcaption { margin-top: var(--s3); font-weight: 700; font-size: 15px; line-height: 21px; }
.screen figcaption span { display: block; font-weight: 500; color: var(--text-muted); }

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

.site-footer { padding: var(--s8) 0 48px; margin-top: var(--s8); border-top: 1px solid var(--divider); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4); }
.paints { display: flex; gap: 6px; }
.paints i { width: 18px; height: 18px; border-radius: 22%; }
.paints i:nth-child(1) { background: var(--orange); }
.paints i:nth-child(2) { background: var(--teal); }
.paints i:nth-child(3) { background: var(--yellow); }
.paints i:nth-child(4) { background: var(--pink); }
.paints i:nth-child(5) { background: var(--indigo); }
.paints i:nth-child(6) { background: var(--green); }
.credit { margin: 0; font-size: 13px; line-height: 18px; color: var(--text-muted); }
.footer-links { display: flex; gap: var(--s1); list-style: none; margin: 0; padding: 0; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s2); font-weight: 700; font-size: 15px; }
.footer-start { display: flex; align-items: center; gap: var(--s4); }

/* ---------- Text pages: privacy, support, 404 ---------- */

.page { padding: var(--s6) 0 var(--s8); }
.page .wrap { max-width: 760px; }
.page h1 {
  margin: 0 0 var(--s3);
  font-size: clamp(36px, 7vw, 56px); line-height: 1.02; font-weight: 800; letter-spacing: -0.02em;
}
.page .meta { margin: 0 0 var(--s8); font-size: 15px; color: var(--text-muted); }
.page h2 { margin: 48px 0 var(--s3); font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; }
.page h3 { margin: var(--s6) 0 var(--s2); font-size: 20px; line-height: 25px; font-weight: 700; }
.page p, .page li { max-width: 62ch; }
.page p { margin: 0 0 var(--s4); }
.page ul, .page ol { padding-left: 1.3em; margin: 0 0 var(--s4); }
.page li { margin-bottom: var(--s2); }

.callout {
  margin: 0 0 var(--s8);
  padding: var(--s5);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 var(--outline-w) var(--outline);
}
.callout p:last-child { margin-bottom: 0; }
.callout .big { font-size: 20px; line-height: 1.4; font-weight: 700; }

.toc { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; padding: 0; margin: 0 0 var(--s4); }
.toc a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4);
  border-radius: var(--r-pill); background: var(--surface);
  box-shadow: inset 0 0 0 var(--outline-w) var(--outline);
  font-weight: 700; font-size: 15px; text-decoration: none;
}

.pieces { list-style: none; padding: 0 !important; }
.pieces li { display: grid; grid-template-columns: 48px 1fr; gap: var(--s4); align-items: start; margin-bottom: var(--s4); }
.pieces .icon-tile { width: 48px; height: 48px; }
.pieces strong { display: block; }

kbd, .path {
  font: inherit; font-weight: 700;
  padding: 1px 6px; border-radius: 6px;
  background: var(--tile-empty);
  white-space: nowrap;
}

.mail-btn { margin-top: var(--s2); }
.btn-ink { background: var(--text); color: var(--ground); text-decoration: none; min-height: 56px; }

/* Placeholders still to be filled in: shown clearly, and invisible to this rule once replaced. */
[data-fill*="{{"],
a[href*="{{"]:not(.store) {
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(255, 182, 39, 0.35);
  outline: 2px dashed var(--win);
  outline-offset: 1px;
  font-weight: 700;
}

.lost-page { padding: 48px 0 var(--s8); text-align: left; }
.lost-page .board-mini { width: 120px; height: 120px; margin-bottom: var(--s6); }

/* ---------- Reduce Motion: every slide, shake and effect becomes a 150ms fade ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
  .arrow.gone { transform: none; transition: opacity 150ms linear; }
  .arrow.blocked { animation: none; }
  .board.done { animation: none; }
  .base { transition-duration: 150ms; transition-delay: 0ms !important; }
  .store, .btn, .arrow { transition: none; }
  .store:active, .btn:active, .arrow:active { transform: none; }
  .sheet-card { animation: none; }
}
