/* Wordsearch MD site. Graph paper, a navy pen, and highlighter marks.
   Keep the focus ring, the skip link and the three-width check (npm run shots). */
:root {
  --paper: #fbfbf7;
  --grid: #dfe7f4;
  --ink: #101a33;
  --muted: #4a5573;
  --line: #c9d3e8;
  --yellow: #ffe14d;
  --pink: #ff9cc8;
  --mint: #93e8c4;
  --blue: #2c55e8;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --text: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 1180px;
  --cell: 28px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font: 400 17px/1.6 var(--text);
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: .2em; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.04; margin: 0; letter-spacing: -.02em; text-wrap: balance; }
h2 { font-size: clamp(32px, 4.6vw, 52px); }
h3 { font-size: 21px; letter-spacing: -.01em; }
p { margin: 0; }
code, pre { font-family: var(--mono); font-size: 14px; }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -64px; z-index: 20; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* highlighter marks */
mark { color: inherit; padding: .02em .16em; margin: 0 -.04em; border-radius: .28em; background: linear-gradient(transparent 6%, var(--yellow) 6%, var(--yellow) 94%, transparent 94%); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
mark.pink { background: linear-gradient(transparent 6%, var(--pink) 6%, var(--pink) 94%, transparent 94%); }
mark.mint { background: linear-gradient(transparent 6%, var(--mint) 6%, var(--mint) 94%, transparent 94%); }

/* header */
.top { position: relative; z-index: 5; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; flex-wrap: wrap; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 800 20px/1 var(--display); letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.wordmark img { width: 32px; height: 32px; border-radius: 8px; }
.nav { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav a { display: flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav a:hover { background: var(--yellow); }

/* hero */
.hero { padding: clamp(28px, 5vw, 64px) 0 clamp(48px, 7vw, 96px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.eyebrow { display: inline-block; font: 500 13px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--paper); padding: 9px 13px; border-radius: 999px; margin-bottom: 22px; }
.hero h1 { font-size: clamp(40px, 6vw, 80px); line-height: 1.0; letter-spacing: -.03em; }
.lede { margin-top: 24px; max-width: 34em; font-size: clamp(18px, 1.6vw, 21px); color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-block; padding: 14px 24px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 700; text-decoration: none; border: 2.5px solid var(--ink); box-shadow: 4px 4px 0 var(--yellow); transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--yellow); }
.btn { min-height: 48px; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--yellow); }
.btn-quiet:active { box-shadow: 1px 1px 0 var(--line); }
.btn-quiet { background: #fff; color: var(--ink); box-shadow: 4px 4px 0 var(--line); }
.btn-quiet:hover { box-shadow: 6px 6px 0 var(--line); }
.one-liner { margin-top: 26px; max-width: 100%; }
.one-liner code { display: block; background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }

.fan { position: relative; aspect-ratio: 1 / 1.08; min-width: 0; }
.fan a { position: absolute; display: block; width: 54%; background: #fff; border-radius: 6px; box-shadow: 0 2px 4px rgba(16,26,51,.14), 0 26px 50px rgba(16,26,51,.22); transition: transform .25s; }
.fan img { width: 100%; border-radius: 6px; }
.fan .f1 { left: 0; top: 14%; transform: rotate(-7deg); z-index: 1; }
.fan .f2 { right: 0; top: 0; transform: rotate(6deg); z-index: 2; }
.fan .f3 { left: 20%; top: 30%; transform: rotate(-1.5deg); z-index: 3; }
.fan a:hover { transform: translateY(-8px) rotate(0); z-index: 4; }

/* chips */
.chips { border-block: 2.5px solid var(--ink); background: var(--yellow); }
.chips ul { display: flex; flex-wrap: wrap; gap: 8px 30px; justify-content: center; list-style: none; margin: 0; padding: 16px 0; font: 700 16px/1.3 var(--display); letter-spacing: -.005em; }
.chips li::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 10px; background: var(--ink); border-radius: 50%; vertical-align: .05em; }

section.block { padding: clamp(56px, 8vw, 104px) 0; }
.sec-head { max-width: 40em; margin-bottom: clamp(28px, 4vw, 48px); }
.sec-head p { margin-top: 14px; color: var(--muted); font-size: 19px; }

/* how it works */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { position: relative; background: #fff; border: 2.5px solid var(--ink); border-radius: 22px; padding: 26px 24px 24px; box-shadow: 6px 6px 0 var(--ink); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--yellow); border: 2.5px solid var(--ink); font: 800 22px/1 var(--display); }
.step:nth-child(2)::before { background: var(--pink); }
.step:nth-child(3)::before { background: var(--mint); }
.step p { color: var(--muted); }
.step pre { margin: 0; background: var(--ink); color: #e9efff; border-radius: 12px; padding: 14px 16px; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.step pre b { color: var(--yellow); font-weight: 500; }
.minis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: auto; }
.minis img { border-radius: 4px; border: 1.5px solid var(--ink); box-shadow: 0 6px 14px rgba(16,26,51,.18); }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: auto; }
.duo img { border-radius: 5px; border: 1.5px solid var(--ink); box-shadow: 0 8px 18px rgba(16,26,51,.2); }
.duo figure { margin: 0; }
.duo figcaption { margin-top: 8px; font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: center; }

/* themes */
.band { background: var(--ink); color: #eef2ff; }
.band .sec-head p { color: #b6c1e2; }
.band mark { color: var(--ink); }
.themes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 26px 22px; margin: 0; padding: 0; list-style: none; }
.themes figure { margin: 0; }
.pair { position: relative; display: block; padding: 0 16% 0 0; }
.pair .p1 { position: relative; z-index: 2; border-radius: 5px; box-shadow: 0 2px 4px rgba(0,0,0,.4), 0 18px 34px rgba(0,0,0,.45); background: #fff; }
.pair .p2 { position: absolute; z-index: 1; right: 0; top: 4%; width: 84%; border-radius: 5px; transform: rotate(5deg); background: #fff; box-shadow: 0 10px 22px rgba(0,0,0,.4); transition: transform .25s; }
.pair:hover .p2 { transform: rotate(9deg) translateX(6%); }
.themes figcaption { margin-top: 16px; font-size: 15px; line-height: 1.45; color: #b6c1e2; }
.themes figcaption b { display: block; font: 800 24px/1.1 var(--display); letter-spacing: -.02em; color: #fff; margin-bottom: 4px; }
.themes figcaption a { color: var(--yellow); }

/* examples */
.examples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; list-style: none; margin: 0; padding: 0; }
.ex { background: #fff; border: 2.5px solid var(--ink); border-radius: 18px; padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; transition: transform .12s, box-shadow .12s; }
.ex:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.ex .tag { font: 500 13px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ex h3 { font-size: 22px; }
.ex p { color: var(--muted); font-size: 15.5px; }
.ex a.go { margin-top: auto; display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.note { margin-top: 22px; color: var(--muted); font-size: 15px; }

/* install */
.install { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.install > div { min-width: 0; }
.install h3 { margin-bottom: 10px; }
.install pre { margin: 0; background: var(--ink); color: #e9efff; border-radius: 14px; padding: 16px 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.6; border: 2.5px solid var(--ink); box-shadow: 5px 5px 0 var(--yellow); }

/* footer */
.foot { border-top: 2.5px solid var(--ink); background: #fff; padding: 36px 0 44px; font-size: 15px; }
.foot-row { display: grid; gap: 12px; }
.foot .wordmark { font-size: 18px; }
.foot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 18px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* 404 */
.lost { display: flex; align-items: center; padding: clamp(60px, 12vw, 140px) 0; }
.lost .wrap { width: min(var(--wrap), 100% - 40px); }
.lost h1 { font-size: clamp(40px, 7vw, 84px); margin-bottom: 18px; }

@media (max-width: 1060px) {
  .themes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .examples { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .fan { max-width: 560px; width: 100%; margin: 0 auto; }
  .steps, .install { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --cell: 22px; }
  body { font-size: 16px; }
  .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 14px; }
  .examples { grid-template-columns: 1fr; }
  .themes figcaption b { font-size: 20px; }
  .step { box-shadow: 4px 4px 0 var(--ink); }
  .chips ul { gap: 6px 18px; font-size: 14.5px; }
  .nav a { padding: 7px 10px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
