/* Nonogram: Cozy Picture Cross — site styles.
   Palette is taken from the app's own asset catalog and its icon, nothing invented:
   Surface #F7F6F3 · LaunchBackground #F6F2E8 · BoardBackground #D2CDC4 · ClueText #292826
   AccentColor #4D9850 · icon canopy #52A153 · icon trunk #AA7A3E · CellFilled #2E231B */

:root {
  --paper:      #F7F6F3;
  --paper-warm: #F6F2E8;
  --board:      #D2CDC4;
  --rule:       #DDD9D1;
  --ink:        #292826;
  --ink-soft:   #6B685F;
  --leaf:       #4D9850;
  --leaf-lit:   #52A153;
  --leaf-deep:  #3C7A3F;
  --bark:       #AA7A3E;
  --cell:       #FAF9F6;
  --filled:     #2E231B;

  --display: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --text: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1rem, 5vw, 2.5rem);
  --measure: 62ch;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display { font-family: var(--display); font-weight: 600; line-height: 1.08; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(2.3rem, 1.5rem + 3.4vw, 4rem); }
h2 { font-size: clamp(1.75rem, 1.3rem + 1.9vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem); }
p { margin: 0 0 1rem; max-width: var(--measure); }
a { color: var(--leaf-deep); }

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

.wrap { width: min(1120px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.lede { font-size: clamp(1.05rem, 1rem + 0.45vw, 1.25rem); color: var(--ink-soft); }

/* ── the grid rule: a row of small squares, echoing the board ───────────── */
.gridrule { height: 8px; background-image: linear-gradient(90deg, var(--board) 0 8px, transparent 8px 16px); background-size: 16px 8px; opacity: .8; }

/* ── nav ────────────────────────────────────────────────────────────────── */
header.nav { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--rule); }
.nav-in { display: flex; align-items: center; gap: .85rem; min-height: 68px; }
.mark { width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto; box-shadow: 0 1px 3px rgb(41 40 38 / .18); }
.wordmark { font-family: var(--display); font-weight: 600; font-size: 1.05rem; white-space: nowrap; letter-spacing: -0.01em; }
.wordmark span { color: var(--ink-soft); font-weight: 500; }
.nav-in .btn { margin-left: auto; }
@media (max-width: 30rem) { .wordmark { font-size: .95rem; } .wordmark span { display: none; } }

/* ── buttons ────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-family: var(--display); font-weight: 500; font-size: 1rem; padding: .7rem 1.4rem; border-radius: 999px; border: 1px solid transparent; text-decoration: none; cursor: pointer; transition: background-color .18s ease, color .18s ease, border-color .18s ease; }
.btn-primary { background: var(--leaf); color: #fff; box-shadow: 0 1px 2px rgb(41 40 38 / .16); }
.btn-primary:hover { background: var(--leaf-deep); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--board); }
.btn-quiet:hover { border-color: var(--ink-soft); }
.btn-sm { padding: .45rem 1rem; font-size: .9rem; }

/* ── hero ───────────────────────────────────────────────────────────────── */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3.5rem); }
.hero-in { display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 62rem) { .hero-in { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.hero h1 { margin-bottom: 1.1rem; }
.hero .lede { margin-bottom: 1.6rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.promise { margin-top: 1.9rem; padding-top: 1.3rem; border-top: 1px solid var(--rule); font-size: .97rem; color: var(--ink-soft); max-width: 46ch; }
.promise b { color: var(--ink); font-weight: 700; }

/* ── the playable puzzle ────────────────────────────────────────────────── */
.play { background: var(--paper-warm); border: 1px solid var(--rule); border-radius: 22px; padding: clamp(1rem, 3vw, 1.6rem); }
.play-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.play-head .t { font-family: var(--display); font-weight: 500; font-size: .95rem; }
.play-head .s { font-size: .84rem; color: var(--ink-soft); }

.puz { --n: 6; --gap: 3px; display: grid; grid-template-columns: auto 1fr; gap: var(--gap); font-family: var(--display); font-variant-numeric: tabular-nums; user-select: none; }
.puz .corner { }
.puz .cols, .puz .rows, .puz .cells { display: grid; gap: var(--gap); }
.puz .cols { grid-template-columns: repeat(var(--n), 1fr); }
.puz .rows { grid-template-rows: repeat(var(--n), 1fr); }
.puz .cells { grid-template-columns: repeat(var(--n), 1fr); }
.puz .clue { background: var(--board); border-radius: 7px; display: flex; align-items: center; justify-content: center; color: var(--ink); font-size: clamp(.7rem, 1.9vw, .95rem); font-weight: 500; line-height: 1.12; }
.puz .cols .clue { flex-direction: column; padding: .45rem .2rem; min-height: 3.1em; justify-content: flex-end; }
.puz .rows .clue { flex-direction: row; gap: .35em; padding: .2rem .5rem; justify-content: flex-end; min-width: 2.6em; }
.puz .cell { aspect-ratio: 1; border-radius: 7px; background: var(--cell); border: 0; padding: 0; cursor: pointer; position: relative; transition: background-color .14s ease; }
.puz .cell:hover { background: #F0EEE8; }
.puz .cell[data-s="1"] { background: var(--filled); }
.puz .cell[data-s="1"]:hover { background: #40322a; }
.puz .cell[data-s="2"]::after { content: ""; position: absolute; inset: 26%; background:
  linear-gradient(45deg, transparent 43%, var(--ink-soft) 43% 57%, transparent 57%),
  linear-gradient(-45deg, transparent 43%, var(--ink-soft) 43% 57%, transparent 57%); }
.puz.solved .cell { cursor: default; transition: background-color .5s ease; }
.puz.solved .cell[data-c="g"] { background: var(--leaf-lit); }
.puz.solved .cell[data-c="b"] { background: var(--bark); }
.puz.solved .cell[data-c=""] { background: var(--cell); }
.puz.solved .cell[data-s="2"]::after { opacity: 0; transition: opacity .35s ease; }

.play-foot { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.play-foot .hint { font-size: .84rem; color: var(--ink-soft); margin: 0; }
.reveal-name { font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--leaf-deep); margin: 0; }
[hidden] { display: none !important; }

/* ── sections ───────────────────────────────────────────────────────────── */
section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
section.warm { background: var(--paper-warm); border-block: 1px solid var(--rule); }
.section-head { max-width: 40ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head p { margin-top: .85rem; }

/* alternating feature rows */
.feat { display: grid; gap: clamp(1.75rem, 5vw, 3.5rem); align-items: center; grid-template-columns: 1fr; }
.feat + .feat { margin-top: clamp(2.75rem, 6vw, 4.25rem); }
@media (min-width: 58rem) {
  .feat { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .feat.flip .feat-copy { order: 2; }
}
.feat-copy p { margin-top: .9rem; }
.feat-copy h3 { margin-bottom: 0; }
.feat-note { margin-top: 1.1rem; padding-left: .9rem; border-left: 2px solid var(--board); font-size: .93rem; color: var(--ink-soft); }

/* ── iPhone bezel: BEZEL ONLY plus the island, because these captures carry
      no status bar of their own (verified by looking). Never a second one. ── */
.phone { width: min(272px, 76vw); margin-inline: auto; background: #1B1A18; border-radius: 44px; padding: 9px; box-shadow: 0 18px 44px -18px rgb(41 40 38 / .45), 0 0 0 1px rgb(41 40 38 / .12); }
.phone .screen { position: relative; border-radius: 36px; overflow: hidden; background: var(--paper); }
.phone .screen img { display: block; width: 100%; height: auto; }
.phone .island { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 31%; height: 22px; background: #131211; border-radius: 999px; }
.phone.tablet { width: min(392px, 86vw); border-radius: 26px; padding: 11px; }
.phone.tablet .screen { border-radius: 16px; }
.phone.tablet .island { display: none; }

/* ── how it works: three real board states, not numbered markers ────────── */
.steps { display: grid; gap: clamp(1.5rem, 4vw, 2.5rem); grid-template-columns: 1fr; }
@media (min-width: 46rem) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.step p { font-size: .96rem; color: var(--ink-soft); margin: 0; }
.mini { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; width: 132px; margin-bottom: 1.1rem; }
.mini i { aspect-ratio: 1; border-radius: 4px; background: var(--cell); border: 1px solid var(--rule); }
.mini i.f { background: var(--filled); border-color: var(--filled); }
.mini i.g { background: var(--leaf-lit); border-color: var(--leaf-lit); }
.mini i.b { background: var(--bark); border-color: var(--bark); }

/* ── facts strip ────────────────────────────────────────────────────────── */
.facts { display: grid; gap: 1.5rem; grid-template-columns: 1fr; border-top: 1px solid var(--rule); padding-top: 1.75rem; }
@media (min-width: 46rem) { .facts { grid-template-columns: repeat(3, 1fr); } }
.fact .k { font-family: var(--display); font-weight: 600; font-size: 1.5rem; display: block; }
.fact .v { font-size: .93rem; color: var(--ink-soft); }

/* ── FAQ ────────────────────────────────────────────────────────────────── */
.faq { max-width: 68ch; }
.faq details { border-bottom: 1px solid var(--rule); padding: .35rem 0; }
.faq summary { font-family: var(--display); font-weight: 500; font-size: 1.05rem; padding: .85rem 0; cursor: pointer; list-style: none; display: flex; align-items: center; gap: .75rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: ""; width: 12px; height: 12px; flex: 0 0 auto; border-radius: 3px; background: var(--board); transition: background-color .18s ease; }
.faq details[open] summary::before { background: var(--leaf); }
.faq details p { margin: 0 0 1rem; color: var(--ink-soft); font-size: .97rem; }

/* ── CTA + footer ───────────────────────────────────────────────────────── */
.cta { text-align: center; }
.cta h2 { margin-bottom: 1rem; }
.cta p { margin-inline: auto; }
footer { background: var(--paper-warm); border-top: 1px solid var(--rule); padding: clamp(2.5rem, 5vw, 3.5rem) 0 2.5rem; font-size: .93rem; }
.foot-grid { display: grid; gap: 1.75rem; grid-template-columns: 1fr; }
@media (min-width: 46rem) { .foot-grid { grid-template-columns: 2fr 1fr 1fr; } }
footer h4 { font-family: var(--display); font-weight: 600; font-size: .95rem; margin: 0 0 .6rem; }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: .35rem; }
footer a { color: var(--ink-soft); text-decoration: none; }
footer a:hover { color: var(--ink); text-decoration: underline; }
.colophon { margin-top: 2.25rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); color: var(--ink-soft); font-size: .86rem; }
.colophon p { max-width: none; margin: 0 0 .35rem; }

/* ── legal pages ────────────────────────────────────────────────────────── */
.legal { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 7vw, 5rem); }
.legal .doc { max-width: 72ch; }
.legal h1 { margin-bottom: .5rem; }
.legal .updated { color: var(--ink-soft); font-size: .92rem; margin-bottom: 2.5rem; }
.legal h2 { font-size: clamp(1.3rem, 1.15rem + .6vw, 1.6rem); margin: 2.75rem 0 .85rem; }
.legal h3 { font-size: 1.08rem; margin: 1.75rem 0 .5rem; }
.legal ul { padding-left: 1.2rem; margin: 0 0 1rem; }
.legal li { margin-bottom: .45rem; max-width: var(--measure); }
.legal table { border-collapse: collapse; width: 100%; margin: 0 0 1.5rem; font-size: .93rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: .6rem .7rem; border-bottom: 1px solid var(--rule); }
.legal th { font-family: var(--display); font-weight: 600; background: var(--paper-warm); }
@media (max-width: 48rem) {
  .legal table, .legal tbody, .legal tr, .legal td { display: block; width: 100%; }
  .legal thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .legal tr { border: 1px solid var(--rule); border-radius: 12px; padding: .35rem .25rem; margin-bottom: .9rem; background: var(--paper-warm); }
  .legal td { border-bottom: 0; padding: .45rem .75rem; }
  .legal td + td { border-top: 1px solid var(--rule); }
  .legal td::before { content: attr(data-l); display: block; font-family: var(--display); font-weight: 600; font-size: .78rem; color: var(--ink-soft); margin-bottom: .15rem; }
}

.back { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--ink-soft); font-size: .92rem; margin-bottom: 1.75rem; }
.back:hover { color: var(--ink); }
