:root {
  color-scheme: light dark;
  --page: #EBEEE5;
  --surface: #FAFBF6;
  --ink: #202A20;
  --secondary: #505C4C;
  --accent: #386418;
  --preview: #E4E9DA;
  --border: #A8B49B;
  --bevel: #fff;
  --bevel-shadow: #CDD5C3;
  --action: #0964D8;
  --texture: rgba(56, 100, 24, .035);
  --panel: #F6EBD7;
  --game-accent: #87500A;
  --games-border: #B69A6A;
  --games-bevel: #FFFDF8;
  --games-bevel-shadow: #E6D2AE;
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--page);
  background-image: linear-gradient(90deg, var(--texture) 1px, transparent 1px), linear-gradient(var(--texture) 1px, transparent 1px);
  background-size: 42px 28px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 1.55;
}
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--action); outline-offset: 4px; }
.skip-link {
  position: absolute;
  z-index: 5;
  top: .75rem;
  left: .75rem;
  padding: .6rem .8rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
.page-shell { width: min(100% - 48px, 1120px); margin-inline: auto; }
.site-header {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.identity { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.identity img { display: block; width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 23%; }
.identity span { display: grid; line-height: 1.3; }
.identity strong { font-size: 16px; }
.identity small { color: var(--secondary); font-size: 12px; }
.header-link { min-height: 44px; display: inline-flex; align-items: center; padding: 0 6px; font-size: 14px; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  align-items: center;
  gap: clamp(30px, 5vw, 64px);
  padding: 42px 0 48px;
}
.hero-copy { max-width: 550px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
h1 { max-width: 17ch; margin: 0; font-size: clamp(42px, 4.2vw, 54px); line-height: 1.08; letter-spacing: -.065em; font-weight: 750; }
h1 span { display: block; }
.intro { max-width: 45ch; margin: 21px 0 22px; color: var(--secondary); font-size: 16px; line-height: 1.65; }
.app-store-badge { display: block; width: max-content; min-height: 54px; margin: 14px 0; line-height: 0; }
.app-store-badge img { display: block; width: 160px; height: auto; }
.app-store-badge:hover { opacity: .82; }
.download-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; max-width: 100%; }
.download-group .app-store-badge { flex: 0 0 160px; margin: 12px 0; }
.qr-download { width: 140px; display: grid; justify-items: center; gap: 4px; margin: 0; }
.qr-link { display: block; width: 140px; height: 140px; overflow: hidden; background: #fff; border: 1px solid var(--border); line-height: 0; }
.qr-link img { display: block; width: 100%; height: 100%; }
.qr-download figcaption { color: var(--secondary); font-size: 11px; line-height: 1.3; text-align: center; }
.home-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  padding: 8px 18px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: inset 0 2px var(--bevel), inset 0 -3px var(--bevel-shadow);
  font-size: 14px;
  text-decoration: none;
}
.home-link:hover { background: var(--preview); }
.hero-previews { width: 100%; max-width: 372px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: clamp(12px, 2vw, 22px); justify-self: center; }
.phone-card { min-width: 0; margin: 0; }
.phone-card-offset { margin-top: 28px; }
.phone-window {
  position: relative;
  overflow: hidden;
  aspect-ratio: 501 / 1066;
  background: var(--preview);
  border: 1px solid var(--border);
  border-radius: 16% / 8.5%;
  box-shadow: 0 2px 0 var(--bevel), 0 6px 0 var(--bevel-shadow), 0 16px 30px rgba(32,42,32,.13);
}
.phone-crop { position: absolute; top: -21.76%; left: -13.77%; display: block; width: 127.345%; height: 130.019%; max-width: none; }
.phone-card figcaption, .gameplay-card figcaption { margin-top: 9px; color: var(--secondary); font-size: 11px; text-align: center; }
.capabilities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.capabilities article { min-width: 0; padding: 20px 24px 22px; }
.capabilities article:first-child { padding-left: 0; }
.capabilities article + article { border-left: 1px solid var(--border); }
.capabilities h2 { margin: 0 0 7px; font-size: 16px; line-height: 1.35; }
.capabilities p:last-child { margin: 0; color: var(--secondary); font-size: 12px; line-height: 1.65; }
.capabilities .eyebrow { margin-bottom: 7px; }
.games-section {
  margin: 38px 0 26px;
  padding: clamp(22px, 4vw, 42px);
  background: var(--panel);
  border: 1px solid var(--games-border);
  box-shadow: inset 0 2px var(--games-bevel), inset 0 -4px var(--games-bevel-shadow);
}
.games-section .eyebrow, .game-list strong { color: var(--game-accent); }
.games-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .58fr); align-items: center; gap: clamp(28px, 5vw, 58px); }
.games-copy h2, .premium-note h2 { margin: 0; font-size: clamp(25px, 3vw, 34px); line-height: 1.18; letter-spacing: -.04em; }
.games-intro { max-width: 64ch; margin: 13px 0 19px; color: var(--secondary); font-size: 13px; line-height: 1.65; }
.game-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; margin: 0; padding: 0; list-style: none; }
.game-list li { min-width: 0; display: grid; align-content: start; gap: 3px; padding: 11px 0; border-top: 1px solid var(--games-border); }
.game-list strong { font-size: 12px; line-height: 1.35; }
.game-list span { color: var(--secondary); font-size: 11px; line-height: 1.45; }
.gameplay-card { width: 100%; max-width: 315px; justify-self: center; margin: 0; }
.gameplay-window {
  position: relative;
  overflow: hidden;
  aspect-ratio: 478 / 594;
  background: #253248;
  border: 1px solid var(--games-border);
  box-shadow: 0 2px 0 var(--games-bevel), 0 6px 0 var(--games-bevel-shadow), 0 15px 26px rgba(32,42,32,.15);
}
.gameplay-crop { position: absolute; top: -53.704%; left: -16.736%; display: block; width: 133.473%; height: 233.333%; max-width: none; }
.premium-note { max-width: 900px; margin: 0 auto 30px; padding: 0 0 22px; border-bottom: 1px solid var(--border); }
.premium-note .eyebrow { margin-bottom: 8px; }
.premium-note h2 { font-size: 20px; }
.premium-note p:last-child { max-width: 100ch; margin: 8px 0 0; color: var(--secondary); font-size: 12px; line-height: 1.65; }
.site-footer { padding: 18px 0 22px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: 13px; }
.disclaimer { max-width: 85ch; margin: 12px 0 5px; color: var(--secondary); font-size: 11px; line-height: 1.6; }
.copyright { margin: 0; color: var(--secondary); font-size: 11px; }
.error-shell { min-height: 100svh; display: flex; flex-direction: column; }
.error-main { flex: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 64px 0 96px; }
.error-main h1 { max-width: 14ch; }
.error-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; }
.text-link { font-size: 14px; }

@media (max-width: 800px) {
  .page-shell { width: min(100% - 36px, 620px); }
  .site-header { min-height: 80px; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 36px 0 38px; }
  .hero-copy { max-width: 550px; }
  h1 { max-width: 17ch; font-size: clamp(36px, 8.6vw, 48px); }
  .intro { margin: 17px 0 18px; font-size: 15px; }
  .hero-previews { max-width: 360px; gap: 14px; }
  .phone-card-offset { margin-top: 25px; }
  .capabilities { grid-template-columns: 1fr; }
  .capabilities article, .capabilities article:first-child { padding: 15px 0 16px; }
  .capabilities article + article { border-left: 0; border-top: 1px solid var(--border); }
  .capabilities h2 { font-size: 15px; }
  .capabilities p:last-child { font-size: 12px; }
  .games-section { margin-top: 29px; padding: 22px; }
  .games-layout { grid-template-columns: 1fr; gap: 23px; }
  .game-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gameplay-card { max-width: 280px; }
  .premium-note { margin-bottom: 24px; }
}
@media (max-width: 360px) {
  .page-shell { width: calc(100% - 28px); }
  .identity { gap: 9px; }
  .identity img { width: 42px; height: 42px; }
  .hero { padding-top: 32px; }
  h1 { font-size: clamp(30px, 9.8vw, 36px); }
  .hero-previews { gap: 10px; }
  .phone-card-offset { margin-top: 19px; }
  .games-section { padding: 18px; }
  .game-list { column-gap: 12px; }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #131A13;
    --surface: #293326;
    --ink: #FFFFFF;
    --secondary: #BDC4B8;
    --accent: #94D64D;
    --preview: #222B20;
    --border: #090F09;
    --bevel: #47533F;
    --bevel-shadow: #1B2518;
    --texture: rgba(148, 214, 77, .035);
    --panel: #402F1F;
    --game-accent: #FFC24F;
    --games-border: #8E704B;
    --games-bevel: #674B2F;
    --games-bevel-shadow: #2C1D10;
  }
  .phone-window { box-shadow: 0 2px 0 var(--bevel), 0 6px 0 var(--bevel-shadow), 0 16px 30px rgba(0,0,0,.28); }
  .gameplay-window { box-shadow: 0 2px 0 var(--games-bevel), 0 6px 0 var(--games-bevel-shadow), 0 16px 30px rgba(0,0,0,.28); }
}
@media (prefers-reduced-motion: no-preference) {
  .home-link, .header-link, .footer-links a, .app-store-badge { transition: background-color .15s ease, color .15s ease, opacity .15s ease; }
}
