/* dazgames.app — one stylesheet, system fonts only, no third-party files. */

:root {
  --page: #FFFFFF;
  --text: #22343B;
  --ink: #023C4E;      /* MVP Sudoku Dark Teal */
  --muted: #4F6168;
  --rule: #D5DCDE;
  --board: #F8F4EC;    /* MVP Sudoku Warm Ivory */
  --line: #B9C6CA;
  --line-strong: #023C4E;
  --gold: #D4A017;     /* MVP Sudoku Gold */
  --related: rgba(2, 60, 78, 0.12);
  --target: rgba(212, 160, 23, 0.15);

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0E1B20;
    --text: #E2E8EA;
    --ink: #8FCBDD;
    --muted: #A9B7BC;
    --rule: #29393F;
    --board: #15262C;
    --line: #3B4E55;
    --line-strong: #8FCBDD;
    --gold: #E3B53C;
    --related: rgba(143, 203, 221, 0.13);
    --target: rgba(227, 181, 60, 0.18);
  }
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--page); padding: 0.5rem 0.75rem; z-index: 10;
}
.skip:focus { top: 0.75rem; }

.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 40rem) { .wrap { padding: 0 1.5rem; } }
.narrow > * { max-width: var(--measure); }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--rule); }
.site-footer { border-top: 1px solid var(--rule); margin-top: 4rem; color: var(--muted); font-size: 0.9375rem; }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 1rem; padding-bottom: 1rem; }
.site-footer p { margin: 0; }

.brand {
  color: var(--ink); font-weight: 700; letter-spacing: 0.08em;
  text-decoration: none; font-size: 0.9375rem;
}
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.nav a { text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; }
.site-footer .nav a { color: var(--muted); }
/* On a phone the header's links share one row under the brand. */
@media (max-width: 39.99rem) {
  .site-header .nav { width: 100%; justify-content: space-between; gap: 0.25rem 0.75rem; font-size: 0.9375rem; }
}
@media (max-width: 23.99rem) {
  .site-header .nav { gap: 0.25rem 0.5rem; font-size: 0.875rem; }
}

/* Type */
h1, h2 { color: var(--ink); line-height: 1.2; }
h1 { font-size: 2rem; font-weight: 700; margin: 2.5rem 0 1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; font-weight: 650; margin: 2.25rem 0 0.75rem; }
p, ul { margin: 0 0 1rem; }
ul { padding-inline-start: 1.25rem; }   /* the bullet's side follows the page's direction */
li { margin-bottom: 0.4rem; }
.lede { font-size: 1.1875rem; color: var(--text); max-width: 34rem; }

/* Home: hero */
.hero {
  display: grid; gap: 2rem; align-items: center;
  padding: 2.5rem 0 1rem;
}
@media (min-width: 48rem) {
  .hero { grid-template-columns: 1fr minmax(18rem, 22.5rem); gap: 3rem; padding-top: 4rem; }
}
.hero h1 { font-size: clamp(2.5rem, 7vw, 3.75rem); margin: 0 0 1rem; letter-spacing: -0.02em; }
.hero .lede { margin: 0; }
.hero .hero-more { margin: 1.25rem 0 0; font-weight: 600; }

.hint-demo { margin: 0; width: 100%; max-width: 22.5rem; }
.board {
  display: grid; grid-template-columns: repeat(9, 1fr);
  aspect-ratio: 1 / 1; width: 100%;
  background: var(--board);
  border: 2px solid var(--line-strong);
}
.cell {
  display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  color: var(--ink); font-size: clamp(1rem, 4.6vw, 1.375rem); font-weight: 500;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.cell:nth-child(9n) { border-right: 0; }
.cell:nth-child(n+73) { border-bottom: 0; }
.cell.edge-r { border-right: 2px solid var(--line-strong); }
.cell.edge-b { border-bottom: 2px solid var(--line-strong); }
.cell.related { background: var(--related); }
.cell.target { background: var(--target); box-shadow: inset 0 0 0 2px var(--gold); }
.hint-demo figcaption { margin-top: 0.875rem; font-size: 0.9375rem; color: var(--muted); }
.hint-demo figcaption strong { color: var(--text); }

/* Home: features */
.features h2, .about h2 { margin-top: 3.5rem; }
.features dl { margin: 0; display: grid; gap: 1.5rem 3rem; }
@media (min-width: 48rem) { .features dl { grid-template-columns: 1fr 1fr; } }
.features dt { font-weight: 650; color: var(--ink); margin-bottom: 0.25rem; }
.features dd { margin: 0; max-width: 30rem; }
.about p { max-width: var(--measure); }

/* Support */
.email-cta { font-size: 1.375rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.contact { margin: 0; display: grid; gap: 1rem; }
.contact div { display: grid; gap: 0.125rem; }
@media (min-width: 32rem) { .contact div { grid-template-columns: 7rem 1fr; } }
.contact dt { color: var(--muted); }
.contact dd { margin: 0; }
address { font-style: normal; }

/* How to play: each picture above its text on a phone, beside it on a
   wide screen. Two pictures sit side by side when there is room. */
.howto > .lede { max-width: var(--measure); }
.step {
  display: grid; gap: 1.5rem;
  margin-top: 2.5rem; padding-top: 2.5rem; border-top: 1px solid var(--rule);
}
.step-text { max-width: var(--measure); }
.step-text h2 { margin-top: 0; }
.step-text ul + h2 { margin-top: 2rem; }
.shots { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.shots .shot { display: block; position: relative; width: 100%; max-width: 17.5rem; }
.shots img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--rule); border-radius: 0.75rem;
}
@media (min-width: 48rem) {
  .step { grid-template-columns: auto minmax(0, 1fr); gap: 2.5rem; align-items: start; }
  .shots { flex-wrap: nowrap; justify-content: flex-start; }
  .shots .shot { width: clamp(10rem, 24vw, 18rem); }
}

/* Themes: each theme's light and dark pictures side by side, one theme a
   row on a phone, two or more on wider screens. */
.themes > .lede { max-width: var(--measure); }
.theme-group h2 { margin-top: 3rem; }
.theme-grid {
  display: grid; gap: 2rem 2.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
}
.theme-card h3 {
  color: var(--ink); font-size: 1.0625rem; font-weight: 650; line-height: 1.3;
  margin: 0 0 0.625rem;
}
.theme-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.theme-pair figure { margin: 0; }
.theme-pair img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--rule); border-radius: 0.5rem;
}
.theme-pair figcaption { margin-top: 0.375rem; font-size: 0.875rem; color: var(--muted); text-align: center; }
.theme-pair { position: relative; }

/* Larger view: tapping a picture (How to play) or a theme's pair (Themes)
   opens it in the browser's own pop-up, the HTML popover attribute, with no
   script. The pop-up closes with its ✕ button, a tap outside it, or Esc.
   A browser without popover support drops every rule naming :popover-open,
   so there the pop-ups and the buttons that open them stay hidden and the
   page looks and works as it did before. */
.zoom, .viewer { display: none; }
@supports selector(:popover-open) {
  .zoom {
    display: block; position: absolute; inset: 0; width: 100%; height: 100%;
    margin: 0; padding: 0; border: 0; border-radius: 0.75rem;
    background: transparent; cursor: zoom-in;
  }
  .zoom:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
}
.viewer:popover-open {
  display: flex; flex-direction: column;
  max-width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem);
  padding: 0.75rem 1rem 1rem; overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--rule); border-radius: 0.75rem;
  background: var(--page); color: var(--text);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.35);
}
.viewer::backdrop { background: rgba(0, 0, 0, 0.6); }
.viewer-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 0.75rem;
}
.viewer-title { margin: 0; color: var(--ink); font-size: 1.125rem; font-weight: 650; line-height: 1.3; }
.viewer-close {
  flex: none; width: 2.75rem; height: 2.75rem; margin: 0; padding: 0;
  border: 1px solid var(--rule); border-radius: 50%;
  background: var(--page); color: var(--ink);
  font: inherit; font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.viewer-close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.viewer figure { margin: 0; }
.viewer img { display: block; height: auto; border: 1px solid var(--rule); border-radius: 0.5rem; }
.viewer figcaption { margin-top: 0.375rem; font-size: 0.875rem; color: var(--muted); text-align: center; }
/* Themes: the pair as large as the screen allows, one above the other on a
   phone (the pop-up scrolls), side by side on wider screens. The theme
   pictures are 480 × 653. */
.viewer-pair { display: flex; flex-direction: column; gap: 1rem; }
.viewer-pair img { width: calc(100vw - 3.5rem); }
@media (min-width: 40rem) {
  .viewer-pair { flex-direction: row; }
  .viewer-pair img { width: min(calc((100vw - 4.5rem) / 2), calc((100dvh - 8.5rem) * 480 / 653)); }
}
/* How to play: one picture, as large as the screen allows. */
.viewer-one img { width: auto; max-width: calc(100vw - 3.5rem); max-height: calc(100dvh - 6.5rem); }

/* Policy and Terms */
/* The language option, top right of every legal page: "Language" in the
   page's own language, opening the same page in every app language. The
   browser's own <details>, no script: tap the word to open or close it.
   On a phone it shares the first row with the brand, the menu below; on a
   wider screen it comes after the menu. */
.lang-pick { position: relative; font-size: 0.9375rem; }
.lang-pick summary { cursor: pointer; color: var(--ink); list-style: none; padding: 0.25rem 0; }
.lang-pick summary::-webkit-details-marker { display: none; }
.lang-pick summary::after { content: " \25BE"; }
.lang-pick[open] summary::after { content: " \25B4"; }
.lang-pick summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.lang-pick nav {
  position: absolute; right: 0; top: 100%; z-index: 20; min-width: 12rem;
  margin-top: 0.25rem; padding: 0.375rem 0;
  background: var(--page); border: 1px solid var(--rule); border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.25);
}
.lang-pick ul { list-style: none; margin: 0; padding: 0; }
.lang-pick li { margin: 0; }
.lang-pick a { display: block; padding: 0.4rem 1rem; text-decoration: none; }
/* Each name lines up with the list, whichever way its own script runs:
   the link sits in its row like a word, not as a block of its own. */
.lang-pick a { display: inline-block; }
.lang-pick a:hover { text-decoration: underline; }
.lang-pick a[aria-current="page"] { font-weight: 700; }
.lang-pick a[aria-current="page"]::after { content: " \2713"; }
@media (min-width: 40rem) {
  .site-header .lang-pick + .nav { margin-left: auto; }
  .site-header .lang-pick { order: 1; }
}
/* Arabic and Hebrew: the email, the phone number and each address line
   read left to right (build.py wraps each in <bdi dir="ltr">) and stay
   on one line, so the phone number is never split at its hyphen. */
.doc bdi { white-space: nowrap; }
.doc h1 { margin-bottom: 0.5rem; }
.doc .doc-sub { margin-bottom: 0.25rem; }
.doc .doc-date { color: var(--muted); margin-bottom: 2rem; }
.doc h2 { scroll-margin-top: 1rem; }

@media print {
  .site-header .nav, .site-footer .nav, .skip, .lang-pick { display: none; }
  body { font-size: 11pt; }
  a { color: inherit; }
}
