/*
 * Stop's website, in the app's visual language (Stop/Features/Shared/Theme.swift): warm cream paper, chunky
 * rounded type, dark-brown outlines and "game pieces" standing on a hard bottom edge. Self-contained: no web
 * fonts, no scripts, no third-party anything.
 */

:root {
  --bg: #FFF4E2;
  --bg-deep: #FFE3B8;
  --surface: #FFFDF8;
  --sunken: #F8ECDA;
  --text: #2B140D;
  --text-2: #6B4E42;
  --accent: #C8360F;
  --accent-fill: #C8360F;
  --accent-edge: #7A1C04;
  --accent-tint: #FFECE1;
  --yellow: #FFC93C;
  --teal: #08706A;
  --teal-fill: #3CC2B3;
  --orange: #FF9A52;
  --purple: #7C5CD6;
  --outline: #3A1A12;
  --edge: #3A1A12;
  --ink: #3A1A12;
  --divider: #EAD8C0;
  --ray: #FFB347;
  --ray-gap: #FFD98A;
  --focus: #C8360F;

  --radius-card: 22px;
  --radius-control: 18px;
  --radius-tile: 12px;
  --stroke: 2px;
  --stroke-bold: 2.5px;
  --depth: 4px;

  --font: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C1410;
    --bg-deep: #2A1A12;
    --surface: #2B201A;
    --sunken: #231A15;
    --text: #FFF3E3;
    --text-2: #D2BCAC;
    --accent: #FF7F57;
    --accent-fill: #D23C14;
    --accent-edge: #5E1504;
    --accent-tint: #45231A;
    --yellow: #F2B92E;
    --teal: #5BD1C4;
    --teal-fill: #2FA797;
    --outline: #7C5E4D;
    --edge: #080403;
    --divider: #3D2F27;
    --ray: #B8410F;
    --ray-gap: #7A2A0C;
    --focus: #FF9B7A;
  }
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Belt and braces for .hero's clip: nothing may scroll the page sideways; only the screenshot row does. */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.page-home {
  background:
    linear-gradient(180deg, var(--bg) 0, var(--bg) 60%, var(--bg-deep) 100%) fixed;
}

img { max-width: 100%; height: auto; }

a {
  color: var(--accent);
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 3px; }

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

h1, h2, h3 {
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 700px) { .wrap { padding: 0 32px; } }

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

.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--yellow);
  color: var(--ink);
  border: var(--stroke) solid var(--ink);
  border-radius: var(--radius-control);
  box-shadow: 0 var(--depth) 0 var(--edge);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Pieces ---------- */

.card {
  background: var(--surface);
  border: var(--stroke) solid var(--outline);
  border-radius: var(--radius-card);
  box-shadow: 0 var(--depth) 0 var(--edge);
}

.tile {
  display: inline-grid;
  place-items: center;
  border: var(--stroke-bold) solid var(--ink);
  border-radius: var(--radius-tile);
  box-shadow: 0 var(--depth) 0 var(--ink);
  font-weight: 900;
  line-height: 1;
}
.tile--red    { background: var(--accent-fill); color: #fff; }
.tile--yellow { background: #FFC93C; color: var(--ink); }
.tile--teal   { background: #3CC2B3; color: var(--ink); }
.tile--orange { background: #FF9A52; color: var(--ink); }
.tile--purple { background: #7C5CD6; color: #fff; }

/* A yellow label with a speech-bubble tail, like "Players (4)" and "Rules" in the app. */
.tag, .pill {
  position: relative;
  display: inline-block;
  margin: 0;
  padding: 4px 14px;
  background: var(--yellow);
  color: var(--ink);
  border: var(--stroke) solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--ink);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: 0;
}
.tag::before, .tag::after, .doc h2::before, .doc h2::after {
  content: "";
  position: absolute;
  clip-path: polygon(30% 0, 100% 0, 0 100%);
}
/* The tail's dark outline, then its yellow fill on top, hiding the label's border where they join. */
.tag::before, .doc h2::before {
  left: 8px;
  bottom: -13px;
  width: 17px;
  height: 14px;
  background: var(--ink);
}
.tag::after, .doc h2::after {
  left: 12px;
  bottom: -6px;
  width: 11px;
  height: 8px;
  background: var(--yellow);
}

.pill {
  font-size: 0.95rem;
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
}
.pill:hover { transform: translateY(1px); box-shadow: 0 2px 0 var(--ink); }
.pill:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }

.icon-tile {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: var(--stroke-bold) solid var(--ink);
  border-radius: var(--radius-tile);
  box-shadow: 0 3px 0 var(--ink);
}
.icon-tile svg {
  width: 26px; height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-tile circle { fill: currentColor; stroke: none; }
.icon-tile--teal   { background: #3CC2B3; color: var(--ink); }
.icon-tile--purple { background: #7C5CD6; color: #fff; }
.icon-tile--yellow { background: #FFC93C; color: var(--ink); }
.icon-tile--orange { background: #FF9A52; color: var(--ink); }

/* Big red display headings with a dark edge, like the App Store screenshot captions. */
.display {
  margin: 0 0 28px;
  color: var(--accent-fill);
  font-size: clamp(2.1rem, 6.5vw, 3.2rem);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 3px 0 var(--accent-edge);
}
@media (prefers-color-scheme: dark) {
  .display { color: var(--accent); text-shadow: 0 3px 0 #5E1504; }
}

/* ---------- Header and footer ---------- */

.site-header {
  position: relative;
  z-index: 2;
  padding: 14px 0;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 900;
}
.brand__icon {
  width: 40px;
  height: 40px;
  border: var(--stroke) solid var(--ink);
  border-radius: 11px;
  box-shadow: 0 3px 0 var(--edge);
  transform: rotate(-4deg);
}

.site-footer {
  margin-top: 64px;
  padding: 40px 0 48px;
  background: var(--sunken);
  border-top: var(--stroke) solid var(--outline);
  color: var(--text-2);
  font-size: 0.95rem;
}
.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
}
.site-footer__links a { color: var(--text); text-decoration: none; }
.site-footer__links a:hover { color: var(--accent); text-decoration: underline; }
.site-footer__note { margin: 0; }

.mini-tiles { display: flex; gap: 6px; }
.mini-tiles .tile {
  width: 34px;
  height: 34px;
  border-width: var(--stroke);
  border-radius: 9px;
  box-shadow: 0 3px 0 var(--ink);
  font-size: 1.15rem;
}
.mini-tiles .tile:nth-child(odd) { transform: rotate(-5deg); }
.mini-tiles .tile:nth-child(even) { transform: rotate(4deg) translateY(2px); }

/* ---------- Home: hero ---------- */

/* The sunburst reaches past the screen's edges on phones (its rim is transparent anyway). Clip it here, not only
   on html/body: iOS Safari still lets a finger pan into overflow that is clipped only at the root. */
.hero { padding: 8px 0 24px; overflow-x: clip; }
.hero__inner {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}
@media (min-width: 860px) {
  .hero { padding: 24px 0 40px; }
  .hero__inner {
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    justify-items: start;
    text-align: left;
    gap: 32px;
  }
  .hero__art { order: 2; justify-self: center; }
}

.hero__art {
  position: relative;
  width: min(78vw, 400px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.sunburst {
  position: absolute;
  inset: -22%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, var(--ray) 0deg 10deg, var(--ray-gap) 10deg 20deg);
  -webkit-mask-image: radial-gradient(circle closest-side, #000 18%, rgba(0, 0, 0, 0.55) 55%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 18%, rgba(0, 0, 0, 0.55) 55%, transparent 100%);
  opacity: 0.9;
}

.hero__icon {
  position: relative;
  width: 62%;
  border: 3px solid var(--ink);
  border-radius: 23%;
  box-shadow: 0 7px 0 var(--edge);
  transform: rotate(-6deg);
}

.confetti {
  position: absolute;
  width: 16px;
  height: 22px;
  border: var(--stroke) solid var(--ink);
  border-radius: 5px;
}
.confetti.c1 { top: 6%;  left: 14%; background: #3CC2B3; transform: rotate(-24deg); }
.confetti.c2 { top: 12%; right: 10%; background: #FFC93C; border-radius: 50%; width: 18px; height: 18px; }
.confetti.c3 { top: 46%; left: 0;   background: #FF9A52; transform: rotate(18deg); }
.confetti.c4 { bottom: 8%; left: 12%; background: #7C5CD6; border-radius: 50%; width: 15px; height: 15px; }
.confetti.c5 { bottom: 4%; right: 18%; background: #C8360F; transform: rotate(-35deg); }
.confetti.c6 { top: 38%; right: 0;  background: #3CC2B3; border-radius: 50%; width: 14px; height: 14px; }
.confetti.c7 { top: 0;   left: 52%; background: #FFF1D6; transform: rotate(40deg); width: 12px; height: 20px; }
.confetti.c8 { bottom: 22%; right: 2%; background: #FFC93C; transform: rotate(-12deg); width: 12px; height: 24px; }

.logo-tiles {
  display: flex;
  justify-content: center;
  gap: clamp(6px, 1.6vw, 12px);
  margin: 0 0 22px;
}
@media (min-width: 860px) {
  .logo-tiles { justify-content: flex-start; }
}
.logo-tiles .tile {
  width: clamp(58px, 15vw, 84px);
  height: clamp(58px, 15vw, 84px);
  border-width: 3px;
  border-radius: clamp(14px, 3.4vw, 20px);
  box-shadow: 0 6px 0 var(--ink);
  font-size: clamp(2.2rem, 9.5vw, 3.4rem);
}
.logo-tiles .tile:nth-of-type(1) { transform: rotate(-7deg); }
.logo-tiles .tile:nth-of-type(2) { transform: rotate(4deg) translateY(-6px); }
.logo-tiles .tile:nth-of-type(3) { transform: rotate(-3deg) translateY(3px); }
.logo-tiles .tile:nth-of-type(4) { transform: rotate(6deg) translateY(-4px); }

.hero__tagline {
  margin: 0 0 12px;
  max-width: 20ch;
  font-size: clamp(1.75rem, 6.4vw, 2.7rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.hero__sub {
  margin: 0 0 22px;
  max-width: 34ch;
  color: var(--text-2);
  font-size: 1.15rem;
  font-weight: 600;
}
.hero__cta { margin: 0; }

.store-badge {
  display: inline-block;
  border-radius: 12px;
  line-height: 0;
  transition: transform 0.15s ease;
}
.store-badge img { height: 58px; width: auto; display: block; }
.store-badge:hover { transform: translateY(-2px); }

/* ---------- Home: screenshots ---------- */

.shots { padding: 8px 0 24px; }
.shots__track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  padding: 10px 16px 26px;
  scrollbar-width: thin;
  scrollbar-color: var(--outline) transparent;
}
.shots__track:focus-visible { outline-offset: -3px; border-radius: 0; }
.shots__track img {
  flex: none;
  width: min(62vw, 250px);
  scroll-snap-align: center;
  border: var(--stroke-bold) solid var(--outline);
  border-radius: var(--radius-card);
  box-shadow: 0 6px 0 var(--edge);
  background: var(--surface);
}
.shots__track img:nth-child(odd) { transform: rotate(-1.2deg); }
.shots__track img:nth-child(even) { transform: rotate(1.2deg) translateY(6px); }
@media (min-width: 700px) {
  /* Line the first screenshot up with the page's column, and let the rest run off to the right. */
  .shots__track {
    --inset: max(32px, calc((100vw - 1080px) / 2 + 32px));
    padding-inline: var(--inset);
    scroll-padding: 0 var(--inset);
  }
  .shots__track img { scroll-snap-align: start; }
}

/* ---------- Home: sections ---------- */

.section { padding: 40px 0 8px; }

.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
}
@media (min-width: 700px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .steps .step:last-child { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .steps { grid-template-columns: repeat(6, 1fr); }
  .steps .step { grid-column: span 2; }
  .steps .step:nth-child(4) { grid-column: 1 / span 2; }
  .steps .step:last-child { grid-column: span 4; }
}

.step {
  counter-increment: step;
  position: relative;
  padding: 18px 18px 18px 78px;
  min-height: 88px;
  font-size: 1.05rem;
}
.step::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 18px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: var(--stroke-bold) solid var(--ink);
  border-radius: var(--radius-tile);
  box-shadow: 0 var(--depth) 0 var(--ink);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}
.step:nth-child(1)::before { background: #FFC93C; color: var(--ink); transform: rotate(-4deg); }
.step:nth-child(2)::before { background: #3CC2B3; color: var(--ink); transform: rotate(3deg); }
.step:nth-child(3)::before { background: #FF9A52; color: var(--ink); transform: rotate(-3deg); }
.step:nth-child(4)::before { background: #fff; color: var(--accent-fill); transform: rotate(4deg); }
.step:nth-child(5)::before { background: #7C5CD6; color: #fff; transform: rotate(-3deg); }
.step strong { font-weight: 900; }

.step--stop {
  background: var(--accent-fill);
  border-color: var(--accent-edge);
  box-shadow: 0 var(--depth) 0 var(--accent-edge);
  color: #fff;
}
.step--stop::before { border-color: var(--accent-edge); box-shadow: 0 var(--depth) 0 var(--accent-edge); }
.step--stop strong { font-size: 1.25em; letter-spacing: 0.02em; }

.after-steps {
  margin: 28px auto 0;
  max-width: 44ch;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-2);
}

.features__grid {
  display: grid;
  gap: 22px;
}
@media (min-width: 800px) {
  .features__grid { grid-template-columns: repeat(2, 1fr); }
}

.feature { padding: 22px 22px 8px; }
.feature__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.feature p { margin: 0 0 14px; }
.feature a { overflow-wrap: anywhere; }

.final-cta { padding-top: 48px; }
.final-cta__inner { display: grid; place-items: center; }

/* ---------- Documents (privacy policy) ---------- */

.doc {
  max-width: 760px;
  margin: 8px auto 0;
}
.doc__card { padding: 28px 22px 16px; }
@media (min-width: 700px) { .doc__card { padding: 40px 44px 24px; } }

.doc h1 {
  margin: 0 0 8px;
  color: var(--accent-fill);
  font-size: clamp(2rem, 6vw, 2.8rem);
  text-shadow: 0 3px 0 var(--accent-edge);
}
@media (prefers-color-scheme: dark) {
  .doc h1 { color: var(--accent); text-shadow: 0 3px 0 #5E1504; }
}
.doc h1 + p { margin-top: 0; color: var(--text-2); }
.doc h2 {
  position: relative;
  display: inline-block;
  margin: 34px 0 14px;
  padding: 3px 13px;
  background: var(--yellow);
  color: var(--ink);
  border: var(--stroke) solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--ink);
  font-size: 1.05rem;
  letter-spacing: 0;
}
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 10px; }
.doc li::marker { color: var(--accent); }
.doc strong { font-weight: 800; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .sunburst { animation: spin 90s linear infinite; }
  .confetti { animation: bob 4.5s ease-in-out infinite alternate; }
  .confetti.c2, .confetti.c5, .confetti.c8 { animation-duration: 5.5s; animation-delay: -2s; }
  .confetti.c3, .confetti.c6 { animation-duration: 3.8s; animation-delay: -1s; }
  .hero__icon { animation: wobble 6s ease-in-out infinite alternate; }
  .pill, .store-badge { transition: transform 0.12s ease, box-shadow 0.12s ease; }
}
@media (prefers-reduced-motion: reduce) {
  .store-badge, .pill { transition: none; }
  .store-badge:hover, .pill:hover, .pill:active { transform: none; }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob {
  from { translate: 0 0; }
  to { translate: 0 -10px; }
}
@keyframes wobble {
  from { transform: rotate(-6deg); }
  to { transform: rotate(-2deg) translateY(-4px); }
}

/* ---------- Print ---------- */

@media print {
  .site-header, .site-footer, .hero__art, .shots, .skip-link { display: none; }
  .card { box-shadow: none; }
}
