/* polygap.app — the game's own look, carried onto the web: warm paper, pencil ink, serif italic
   headings, one teal accent. The tokens are the phone app's (mobile/styles.css), Classic and Dark.
   No external fonts, scripts or images. */
:root {
  --bg: #FAF8F4;
  --surface: #FFFFFF;
  --ink: #24252B;
  --muted: #5B5D65;
  --line: #E4E1D9;
  --line-strong: #CBC6BB;
  --accent: #0F766E;
  --accent-ink: #0B5952;
  --accent-weak: #E7F3F1;
  --sheet: #FFFFFF;
  --pencil: #2E3038;            /* the app's pencil, rgb(46, 48, 56) */
  --grid: rgba(64, 124, 176, 0.11);
  --grid-major: rgba(64, 124, 176, 0.24);
  --shadow: rgba(30, 25, 15, 0.05);
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141519;
    --surface: #1E2026;
    --ink: #ECEAE4;
    --muted: #A6A8B0;
    --line: #30333B;
    --line-strong: #4A4E59;
    --accent: #52C8BA;
    --accent-ink: #84DCD1;
    --accent-weak: #18332F;
    --sheet: #1B1D22;
    --pencil: #E8E5DC;          /* Dark's light pencil, rgb(232, 229, 220) */
    --grid: rgba(120, 150, 205, 0.12);
    --grid-major: rgba(120, 150, 205, 0.26);
    --shadow: rgba(0, 0, 0, 0.3);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.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 {
  position: absolute; left: 16px; top: -100px; z-index: 10; padding: 10px 14px;
  background: var(--surface); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 10px;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 16px; }
.prose { max-width: 680px; }

/* header: the icon and the name, then two links */
.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--ink); text-decoration: none;
  font: italic 600 23px/1 var(--serif); letter-spacing: 0.01em;
}
.brand img { width: 32px; height: 32px; border-radius: 7px; box-shadow: 0 0 0 1px var(--line); }
.site-nav ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 10px;
  color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none;
}
.site-nav a:hover { background: var(--accent-weak); color: var(--accent-ink); }
.site-nav a[aria-current="page"] { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 6px; }

/* headings: the app's serif italic */
h1, h2, h3 { font-family: var(--serif); font-style: italic; font-weight: 600; letter-spacing: 0.005em; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(34px, 8vw, 46px); margin: 40px 0 8px; }
h2 { font-size: 27px; margin: 0 0 14px; }
h3 { font-size: 21px; margin: 0 0 4px; }

/* the landing page */
.hero { padding: 48px 0 24px; text-align: center; }
.hero .app-icon {
  display: block; width: 136px; height: 136px; margin: 0 auto 18px;
  border-radius: 30px; /* about the iPhone's corner at this size */
  box-shadow: 0 0 0 1px var(--line), 0 14px 30px -16px rgba(40, 30, 10, 0.45);
}
.hero h1 { font-size: clamp(48px, 13vw, 68px); margin: 0 0 6px; }
.lede { margin: 0 auto; max-width: 34ch; font-size: 21px; line-height: 1.4; text-wrap: balance; }
.lede-sub { margin: 8px auto 0; color: var(--muted); font-size: 17px; }
.soon {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px;
  margin: 24px 0 0; padding: 10px 18px; border: 1.5px dashed var(--line-strong); border-radius: 12px;
  color: var(--ink); font-size: 16px;
}
.soon strong { font-weight: 700; }
.soon span { color: var(--muted); }

section.block { padding: 36px 0; border-top: 1px solid var(--line); }
section.block > p.intro { margin: -6px 0 20px; color: var(--muted); }

/* How to play: three pictures, as in the app's tutorial */
.steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; }
.steps figure { display: grid; grid-template-columns: 116px 1fr; align-items: center; gap: 14px; margin: 0; }
.steps .caption { margin: 0; }
.steps .caption::before {
  content: counter(step); display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 8px;
  border: 1.5px solid var(--ink); border-radius: 50%; font: 600 15px/1 var(--serif); vertical-align: 1px;
}
.steps .caption strong { font-weight: 650; }
.rule-line { margin: 18px 0 0; font-family: var(--serif); font-style: italic; font-size: 19px; }

/* a goal card (plain, like the app's) and a sheet of graph paper */
.card, .paper {
  position: relative; display: block; width: 100%; aspect-ratio: 1;
  color: var(--pencil); overflow: hidden;
}
.card { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; }
.card .count {
  position: absolute; right: 9px; bottom: 5px; margin: 0;
  font: italic 700 21px/1 var(--serif); color: var(--ink);
}
.paper {
  background-color: var(--sheet);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
  background-position: -1px -1px;
  border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 1px 1px rgba(40, 30, 10, 0.04), 0 10px 24px -14px rgba(40, 30, 10, 0.22);
}
.paper.made { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.made-mark {
  display: inline-block; width: 22px; height: 22px; padding: 4px; margin: 0 2px 0 4px; vertical-align: -5px;
  border-radius: 50%; background: var(--accent); color: #FFFFFF;
}
@media (prefers-color-scheme: dark) { .made-mark { color: #0E1A19; } } /* as the app's Dark check */
.pencil { display: block; width: 100%; height: 100%; }

/* A look inside: the app's screens. On a phone, a row you swipe through (it scrolls on its own, never
   the page); on wider screens, all eight in a grid. */
.shots {
  margin: 0 -16px; padding: 4px 16px 14px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding: 0 16px;
  -webkit-overflow-scrolling: touch;
}
.shots:focus-visible { outline-offset: -2px; border-radius: 12px; }
.shots ul {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(58vw, 230px); gap: 14px;
  margin: 0; padding: 0; list-style: none;
}
.shots li { scroll-snap-align: start; }
.shots figure { margin: 0; }
.shots img {
  display: block; width: 100%; height: auto; border-radius: 18px;
  border: 1px solid var(--line-strong); background: var(--sheet);
  box-shadow: 0 1px 1px rgba(40, 30, 10, 0.04), 0 12px 26px -16px rgba(40, 30, 10, 0.35);
}
.shots figcaption { margin: 10px 2px 0; font: italic 600 17px/1.3 var(--serif); text-align: center; }

/* the modes, with the app's tab icons */
.modes { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.modes li {
  display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start;
  padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 1px 2px var(--shadow);
}
.mode-icon {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--line-strong); border-radius: 10px; color: var(--accent-ink);
}
.modes p { margin: 0; color: var(--muted); }

/* no ads, no tracking */
.promise {
  padding: 22px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 1px 2px var(--shadow);
}
.promise h2 { margin-bottom: 8px; }
.promise p { margin: 0; }
.promise p + p { margin-top: 10px; }

/* the policy and support pages */
.page { padding-top: 8px; padding-bottom: 40px; } /* keeps .wrap's side gutters */
.page .meta { margin: 0 0 24px; color: var(--muted); }
.page h2 { font-size: 24px; margin: 36px 0 8px; }
.page h3 { font-size: 19px; margin: 24px 0 4px; }
.page p, .page li { margin: 0 0 12px; }
.page ul, .page ol { padding-left: 24px; margin: 0 0 12px; }
.page li { padding-left: 2px; }
.page .summary {
  margin: 0 0 8px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: 10px;
}
.page .summary p { margin: 0; }
.page .summary p + p { margin-top: 8px; }
.contact-line { font-size: 19px; }
.points { border-collapse: collapse; margin: 4px 0 14px; min-width: 0; }
.points th, .points td { padding: 7px 14px 7px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.points th { font-weight: 600; }
.points td.n { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 404 */
.lost { padding-top: 48px; padding-bottom: 56px; text-align: center; }
.lost .paper { width: 180px; margin: 0 auto 24px; }
.lost h1 { margin: 0 0 8px; }
.lost p { margin: 0 0 8px; }

/* footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 8px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding-top: 14px; padding-bottom: 28px; }
.site-foot ul { display: flex; flex-wrap: wrap; gap: 0 4px; margin: 0; padding: 0; list-style: none; }
.site-foot a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--ink); }
.site-foot ul li:first-child a { padding-left: 0; }
.site-foot p { margin: 0; color: var(--muted); font-size: 15px; }

/* wider screens */
@media (min-width: 640px) {
  .hero { padding: 64px 0 40px; }
  .hero .app-icon { width: 160px; height: 160px; border-radius: 36px; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
  .steps figure { grid-template-columns: 1fr; align-items: start; gap: 12px; }
  .modes { grid-template-columns: 1fr 1fr; }
  section.block { padding: 48px 0; }
  .promise { padding: 28px 28px; }
}
@media (min-width: 760px) {
  .shots { margin: 0; padding: 4px 0 0; overflow: visible; }
  .shots ul { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; }
  .shots figcaption { font-size: 16px; }
}
@media (min-width: 900px) {
  .page h2 { font-size: 26px; }
}

@media (prefers-reduced-motion: no-preference) {
  .site-nav a, a { transition: background-color 0.15s ease, color 0.15s ease; }
}

@media print {
  .skip, .site-nav { display: none; }
  body { background: #FFFFFF; color: #000000; }
}
