/* ===================================================================
   THEME: swap these to re-skin (Concept D "patchwork quilt" by default).
   Region colors were tuned for deuteranopia/protanopia/tritanopia
   separation (see ../puzzle-branding.md). Patterns carry meaning too.
   =================================================================== */
:root {
  --bg: #EFE8DA;          /* linen table */
  --paper: #FBF7EE;       /* cards */
  --ink: #3A2F2A;         /* text + region borders */
  --ink-soft: #6B5F57;
  --accent: #5778AF;      /* denim: primary buttons */
  --accent-ink: #FFFDF0;
  --accent-2: #994E02;    /* rust: small highlights */
  --line: rgba(58, 47, 42, .16);

  --fabric-1: #5778AF; /* Denim    */
  --fabric-2: #D7921D; /* Mustard  */
  --fabric-3: #828C69; /* Sage     */
  --fabric-4: #994E02; /* Rust     */
  --fabric-5: #A6C0DC; /* Chambray */
  --fabric-6: #D3BC9C; /* Linen    */
  --fabric-7: #675D66; /* Ash plum */
  --fabric-8: #333431; /* Charcoal */
  --fabric-9: #FFFDF0; /* Muslin   */

  --marker: #8A5A33;      /* wooden button */
  --marker-hi: #C58E59;
  --marker-rim: #F4E9BD;  /* light rim keeps >=3:1 contrast on dark patches */
  --marker-edge: #3A2F2A;
  --thread: #F4E9BD;
  --stitch: #3A2F2A;
  --stitch-under: rgba(255, 253, 240, .85);
  --focus: #FFFDF0;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-ui: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #24201D; --paper: #2E2925; --ink: #F1E8D8; --ink-soft: #C8BBAA; --line: rgba(241,232,216,.16); --accent: #7F9DD0; --accent-ink: #1A1714; --stitch: #1E1A17; }
}

@font-face { font-family: 'Fraunces'; src: url(assets/fonts/fraunces-var.woff2) format('woff2'); font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url(assets/fonts/atkinson-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url(assets/fonts/atkinson-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--font-ui);
  background-image: repeating-linear-gradient(0deg, rgba(58,47,42,.025) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(58,47,42,.02) 0 1px, transparent 1px 4px);
}
h1, h2, h3, .h2 { font-family: var(--font-display); font-weight: 650; line-height: 1.12; letter-spacing: -.01em; margin: 0 0 .4em; }
a { color: inherit; }
.muted { color: var(--ink-soft); font-weight: 400; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; background: var(--paper); padding: 8px 12px; border-radius: 8px; z-index: 10; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- nav ---------- */
.nav { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; max-width: 1120px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 22px var(--font-display); }
.logo-btn { width: 32px; height: 32px; }
.pill { text-decoration: none; font-weight: 700; font-size: 15px; padding: 8px 14px; border-radius: 999px; border: 2px dashed var(--ink); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 12px 20px; border-radius: 14px; font: 700 16px var(--font-ui); text-decoration: none; cursor: pointer; border: 2px solid var(--ink); transition: transform .08s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 3px 0 var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border-style: dashed; }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 15px; }
.btn.wide { width: 100%; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 8px; }

/* ---------- hero ---------- */
.hero { max-width: 1120px; margin: 0 auto; padding: 8px 18px 40px; display: grid; gap: 28px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 13px; font-weight: 700; color: var(--accent-2); margin: 10px 0 8px; }
@media (prefers-color-scheme: dark) { .eyebrow { color: #E0A15A; } }
h1 { font-size: clamp(34px, 8.5vw, 58px); }
h1 .soft { display: block; font-size: .56em; font-weight: 500; color: var(--ink-soft); margin-top: .35em; line-height: 1.25; }
.lede { font-size: 18px; max-width: 34em; }
.ticks { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; font-size: 15px; }
.ticks li::before { content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, var(--marker-hi), var(--marker)); box-shadow: 0 0 0 2px var(--marker-rim); }

/* ---------- play card ---------- */
.play-card { background: var(--paper); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(58,47,42,.45); border: 1px solid var(--line); scroll-margin-top: 12px; }
.play-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.play-head h2 { font-size: 24px; margin: 0; }
.rules { margin: 4px 0 12px; font-size: 15px; color: var(--ink-soft); }
.timer { font: 700 15px var(--font-ui); font-variant-numeric: tabular-nums; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; user-select: none; }
.timer.hidden-time { color: transparent; text-shadow: 0 0 8px var(--ink-soft); }

.board-wrap { padding: 6px; background: #E7DCC6; border-radius: 14px; border: 2px dashed rgba(58,47,42,.45); }
@media (prefers-color-scheme: dark) { .board-wrap { background: #3A332D; } }
.board { --n: 6; display: grid; grid-template-columns: repeat(var(--n), 1fr); aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 8px; overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.board.gray { filter: grayscale(1) contrast(1.05); }
.cell { position: relative; border: 0; padding: 0; margin: 0; cursor: pointer; min-width: 0; min-height: 0; aspect-ratio: 1;
  background-color: var(--c); box-shadow: inset 0 0 0 .5px rgba(58,47,42,.28); -webkit-tap-highlight-color: transparent; }
.cell.bt { border-top: 3px solid #3A2F2A; } .cell.bl { border-left: 3px solid #3A2F2A; }
.cell:focus-visible { outline: 3px solid var(--focus); outline-offset: -5px; z-index: 2; }
.cell svg { position: absolute; inset: 12%; width: 76%; height: 76%; pointer-events: none; }
.cell .mk-x svg { inset: 18%; width: 64%; height: 64%; }
.cell .lt { position: absolute; left: 4px; top: 2px; font: 700 12px var(--font-ui); color: #FFFDF0; text-shadow: 0 0 3px #000, 0 0 1px #000; display: none; pointer-events: none; }
.board.letters .cell .lt { display: block; }
.cell.placed svg { filter: drop-shadow(0 2px 1px rgba(0,0,0,.35)); animation: sew .18s ease-out; }
@keyframes sew { from { transform: scale(.6); opacity: .3; } to { transform: scale(1); opacity: 1; } }
.cell.clash::after { content: '!'; position: absolute; right: 3px; top: 1px; font: 700 13px var(--font-ui); width: 17px; height: 17px; line-height: 17px; text-align: center; border-radius: 50%; background: #FFFDF0; color: #8B1E0E; box-shadow: 0 0 0 2px #8B1E0E; }
.cell.clash svg { outline: 3px dashed #FFFDF0; outline-offset: -2px; border-radius: 50%; }
.cell.focus { box-shadow: inset 0 0 0 3px #FFFDF0, inset 0 0 0 5px #3A2F2A; z-index: 1; }
.cell.kill::before { content: ''; position: absolute; inset: 34%; border-radius: 50%; border: 3px dotted #FFFDF0; box-shadow: 0 0 0 1px #3A2F2A; }
.cell.target::before { content: ''; position: absolute; inset: 20%; border-radius: 50%; border: 3px dashed #FFFDF0; box-shadow: 0 0 0 1.5px #3A2F2A, inset 0 0 0 1.5px #3A2F2A; }
.board.done .cell { cursor: default; }

.howto { font-size: 14px; color: var(--ink-soft); margin: 10px 2px 8px; }
.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tool { min-height: 46px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); font: 700 14px var(--font-ui); cursor: pointer; padding: 6px 4px; }
.tool small { display: block; font-weight: 400; font-size: 11px; color: var(--ink-soft); }
.tool:hover { border-color: var(--ink-soft); }
.hint { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--bg); border-left: 5px solid var(--accent); font-size: 15px; }
.hint .hint-tag { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin-bottom: 2px; }
.hint .hint-act { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.hint button { font: 700 14px var(--font-ui); border-radius: 10px; padding: 6px 12px; border: 2px dashed var(--ink); background: transparent; color: var(--ink); cursor: pointer; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 14px; }
.toggles input { accent-color: var(--accent); width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }
.solved { margin-top: 12px; padding: 14px; border-radius: 12px; border: 2px dashed var(--ink); background: color-mix(in srgb, var(--fabric-5) 30%, var(--paper)); }
.solved-title { font: 700 20px var(--font-display); margin: 0 0 4px; }
.solved p { margin: 0 0 4px; }

/* ---------- sections ---------- */
.section { max-width: 1120px; margin: 0 auto; padding: 40px 18px; }
.h2 { font-size: clamp(28px, 6vw, 40px); }
.h2 em { font-style: italic; color: var(--accent-2); }
@media (prefers-color-scheme: dark) { .h2 em { color: #E0A15A; } }
.sub { color: var(--ink-soft); margin: 0 0 20px; max-width: 40em; }

.compare { border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.compare .row { display: grid; grid-template-columns: 1fr; border-top: 1px dashed var(--line); }
.compare .row:first-child { border-top: 0; }
.compare .row > span { padding: 12px 16px; }
.compare .row > span:first-child { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: rgba(153,78,2,.55); text-decoration-thickness: 2px; font-size: 15px; padding-bottom: 0; }
.compare .row > span:last-child { padding-top: 4px; }
.compare .row.head { display: none; }

.features { display: grid; gap: 14px; }
.features article { background: var(--paper); border-radius: var(--radius); padding: 18px; border: 1px solid var(--line); position: relative; overflow: hidden; }
.features article::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; }
.features article:nth-child(1)::before { background: var(--fabric-1); } .features article:nth-child(2)::before { background: var(--fabric-2); }
.features article:nth-child(3)::before { background: var(--fabric-3); } .features article:nth-child(4)::before { background: var(--fabric-4); }
.features article:nth-child(5)::before { background: var(--fabric-5); } .features article:nth-child(6)::before { background: var(--fabric-7); }
.features h3 { font-size: 21px; } .features p { margin: 0; color: var(--ink-soft); }

.plans { display: grid; gap: 14px; }
.plan { background: var(--paper); border-radius: var(--radius); padding: 20px; border: 2px solid var(--line); }
.plan.featured { border: 3px solid var(--accent); box-shadow: 0 4px 0 var(--ink); }
.plan h3 { font-size: 22px; margin: 0; }
.price { font: 700 40px var(--font-display); margin: 6px 0 10px; }
.price small { font: 400 16px var(--font-ui); color: var(--ink-soft); }
.plan ul { margin: 0; padding-left: 20px; } .plan li { margin: 4px 0; }
.promise { margin-top: 18px; padding: 18px 20px; border-radius: var(--radius); border: 2px dashed var(--ink); }
.promise h3 { font-size: 22px; } .promise ol { margin: 0; padding-left: 22px; } .promise li { margin: 4px 0; }

.signup { display: grid; gap: 22px; }
.wl { background: var(--paper); border-radius: var(--radius); padding: 20px; border: 2px solid var(--ink); }
.field { display: block; border: 0; padding: 0; margin: 0 0 16px; }
.field > span, .field legend { display: block; font-weight: 700; margin-bottom: 6px; }
.field legend small { font-weight: 400; color: var(--ink-soft); }
input[type=email] { width: 100%; min-height: 50px; font: 17px var(--font-ui); padding: 10px 14px; border-radius: 12px; border: 2px solid var(--ink-soft); background: var(--bg); color: var(--ink); }
input[type=email]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.chip { display: inline-flex; align-items: center; gap: 6px; margin: 0 6px 8px 0; padding: 8px 12px; border-radius: 999px; border: 2px solid var(--line); font-size: 15px; cursor: pointer; background: var(--bg); }
.chip:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--bg)); }
.chip input { accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fine { font-size: 13px; color: var(--ink-soft); margin: 10px 0 0; }
.form-msg { font-weight: 700; margin: 8px 0 0; min-height: 1.2em; }
.form-msg.err { color: #A3341A; } @media (prefers-color-scheme: dark) { .form-msg.err { color: #F09A80; } }
.founder { background: var(--paper); border-radius: var(--radius); padding: 20px; border: 2px dashed var(--ink); align-self: start; }
.founder h3 { font-size: 22px; }

.faq details { background: var(--paper); border-radius: 14px; padding: 14px 18px; margin-bottom: 10px; border: 1px solid var(--line); }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { margin: 8px 0 0; color: var(--ink-soft); }
.foot { text-align: center; padding: 30px 18px 50px; font-size: 14px; }

/* ---------- desktop ---------- */
@media (min-width: 760px) {
  .compare .row { grid-template-columns: 1fr 1.2fr; }
  .compare .row.head { display: grid; font-weight: 700; background: var(--bg); }
  .compare .row.head span:first-child { text-decoration: none; color: var(--ink-soft); padding-bottom: 12px; }
  .compare .row > span:first-child { padding-bottom: 12px; }
  .compare .row > span:last-child { padding-top: 12px; border-left: 1px dashed var(--line); }
  .features { grid-template-columns: repeat(3, 1fr); }
  .plans { grid-template-columns: 1fr 1fr; }
  .signup { grid-template-columns: 1.3fr 1fr; }
  .signup > .h2, .signup > .sub { grid-column: 1 / -1; margin-bottom: 0; }
}
@media (min-width: 960px) {
  .hero { grid-template-columns: 1fr 440px; align-items: center; padding-top: 30px; padding-bottom: 60px; }
  .play-card { padding: 20px; }
}
