/* Crosswordy — crosswordy.app
 *
 * Palette is the app's Calm · Slate, adjusted for a screen you read at arm's length rather than
 * hold: the page ground is plain white instead of the app's paper cream, so the screenshots
 * (which are cream) sit on it as objects rather than blending into it. Neutrals carry a slight
 * slate bias toward the accent so they read as chosen rather than defaulted.
 *
 * Two families only: the system sans the app itself uses, and a monospace for labels, clue
 * numbers and anything tabular — a crossword grid is monospaced by nature, so it's the one
 * decorative choice here that the subject actually earns.
 */
:root {
  --paper: #FFFFFF;
  --well: #F4F6F8;
  --ink: #16181C;
  --body: #5A6472;
  --faint: #8D97A5;
  --rule: rgba(22, 24, 28, 0.11);
  --accent: #3C6E9F;
  --accent-ink: #FFFFFF;
  --accent-well: #EDF3F9;
  --good: #4F7A5B;
  /* A phone is a dark object in either theme, so this one deliberately doesn't invert with the
     rest of the palette — it only lightens enough to stay visible against a near-black page. */
  --bezel: #16181C;
  --bezel-edge: rgba(22, 24, 28, 0.12);
  /* Puzzle-preview cells. These can't be --paper/--ink, because those swap with the theme and a
     blocked square would come out lighter than an open one — the grid read as its own negative in
     dark mode. A block is the darker of the two in both themes, as it is in the app. */
  --cell: #FFFFFF;
  --cell-block: #16181C;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --measure: 1120px;
  --radius: 16px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0B0F14;
    --well: #131A22;
    --ink: #E9EEF4;
    --body: #97A3B2;
    --faint: #6A7685;
    --rule: rgba(233, 238, 244, 0.13);
    --accent: #7FB0DC;
    --accent-ink: #08111A;
    --accent-well: #15212D;
    --good: #6FAE81;
    --bezel: #262F3A;
    --bezel-edge: rgba(233, 238, 244, 0.16);
    --cell: #1B2431;
    --cell-block: #05080B;
  }
}

:root[data-theme="dark"] {
  --paper: #0B0F14;
  --well: #131A22;
  --ink: #E9EEF4;
  --body: #97A3B2;
  --faint: #6A7685;
  --rule: rgba(233, 238, 244, 0.13);
  --accent: #7FB0DC;
  --accent-ink: #08111A;
  --accent-well: #15212D;
  --good: #6FAE81;
  --bezel: #262F3A;
  --bezel-edge: rgba(233, 238, 244, 0.16);
  --cell: #1B2431;
  --cell-block: #05080B;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: inherit; }

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

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* A monospace label. Used for anything that names a thing rather than says it. */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---- Brand mark -------------------------------------------------------- */
/* Inline SVG rather than the PNG the site used to ship: the mark is four rounded squares, so a
   raster of it was only ever going to be a blurry 26px with its own baked-in background fighting
   the page. This one takes its colours from the theme. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.mark { width: 24px; height: 24px; flex: none; display: block; }
.mark .sq-ink { fill: var(--ink); }
.mark .sq-accent { fill: var(--accent); }

/* ---- Header ------------------------------------------------------------ */
header.site { padding: 22px 0; }
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
nav.site {
  display: flex;
  gap: 22px;
  font-size: 14px;
  font-weight: 600;
}
nav.site a { color: var(--body); text-decoration: none; }
nav.site a:hover { color: var(--ink); }
@media (max-width: 560px) {
  nav.site a.hide-sm { display: none; }
}

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 650;
  font-size: 15px;
  padding: 13px 22px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}
.btn.secondary {
  background: transparent;
  color: var(--body);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.btn.secondary:hover { color: var(--ink); }
.btn[aria-disabled="true"] { opacity: 0.6; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.note { font-size: 13px; color: var(--faint); margin: 14px 0 0; }

/* ---- Hero -------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  padding: 56px 0 72px;
}
.hero h1 {
  font-size: clamp(38px, 6.4vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 16px 0 18px;
  text-wrap: balance;
}
.hero .lede {
  font-size: 19px;
  color: var(--body);
  margin: 0 0 26px;
  max-width: 26em;
}

/* ---- Light / dark comparator ------------------------------------------- */
/* The hero's one moving part, and the only place a slider is honest: dragging it is the feature
   being described. Without JS it stays a fixed half-and-half split, which still makes the point. */
.phone {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  border-radius: 40px;
  padding: 9px;
  background: var(--bezel);
  box-shadow: 0 24px 60px rgba(11, 15, 20, 0.28), 0 0 0 1px var(--bezel-edge);
}
.compare {
  --split: 50%;
  position: relative;
  border-radius: 32px;
  overflow: hidden;
  line-height: 0;
}
.compare img {
  display: block;
  width: 100%;
  height: auto;
}
.compare .c-dark {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 var(--split));
}
/* The seam, and its grab handle. */
.compare .c-seam {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 255, 255, 0.85);
  pointer-events: none;
}
.compare .c-knob {
  position: absolute;
  top: 50%;
  left: var(--split);
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 10px rgba(11, 15, 20, 0.35);
  display: grid;
  place-items: center;
  pointer-events: none;
  color: #16181C;
}
.compare input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
.compare input[type="range"]:focus-visible ~ .c-knob {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.phone-caption {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: center;
  margin: 16px 0 0;
}

/* ---- Sections ---------------------------------------------------------- */
section { padding: 64px 0; border-top: 1px solid var(--rule); }
.section-head { max-width: 34em; margin-bottom: 40px; }
.section-head h2 {
  font-size: clamp(25px, 3.2vw, 33px);
  letter-spacing: -0.028em;
  font-weight: 780;
  margin: 12px 0 10px;
  text-wrap: balance;
}
.section-head p { color: var(--body); margin: 0; }

/* Three things, set as text. No icon chips, no card borders — the words are the content. */
.trio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 36px 40px;
}
.trio h3 {
  font-size: 18px;
  letter-spacing: -0.02em;
  margin: 10px 0 6px;
}
.trio p { margin: 0; color: var(--body); font-size: 15.5px; }

/* Screenshot strip. Alternating themes so the page keeps making the light/dark point after the
   hero has scrolled away. */
.strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 28px;
}
.strip figure { margin: 0; }
.strip img {
  display: block;
  width: 100%;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(11, 15, 20, 0.14);
}
.strip figcaption {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 14px;
}

/* ---- Plans ------------------------------------------------------------- */
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
  align-items: start;
}
.plan {
  background: var(--well);
  border-radius: var(--radius);
  padding: 26px;
}
.plan.is-plus {
  background: var(--accent-well);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.plan h3 { margin: 8px 0 4px; font-size: 19px; letter-spacing: -0.02em; }
.plan .price { font-size: 14px; color: var(--body); margin: 0 0 18px; }
.plan ul { margin: 0; padding: 0; list-style: none; }
.plan li {
  position: relative;
  padding: 7px 0 7px 24px;
  font-size: 15px;
  color: var(--body);
}
.plan li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 15px;
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--good);
  border-bottom: 2px solid var(--good);
  transform: rotate(-45deg);
}

/* ---- Prose pages (terms, privacy, support) ----------------------------- */
.prose { padding-top: 48px; padding-bottom: 80px; max-width: 44em; }
.prose h1 { font-size: clamp(30px, 5vw, 40px); letter-spacing: -0.03em; margin: 0 0 8px; }
.prose .updated { color: var(--faint); font-size: 14px; margin-bottom: 36px; font-family: var(--mono); }
.prose h2 { font-size: 20px; letter-spacing: -0.02em; margin: 36px 0 10px; }
.prose p, .prose li { color: var(--body); }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--accent); }
.prose strong { color: var(--ink); }
.callout {
  background: var(--well);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 26px 0;
}
.callout p { margin: 0; color: var(--ink); }

/* ---- Shared puzzle page ------------------------------------------------ */
.puzzle-wrap { padding-top: 40px; padding-bottom: 72px; text-align: center; }
.puzzle-title { font-size: clamp(26px, 5vw, 32px); letter-spacing: -0.03em; margin: 0 0 6px; }
.meta { font-family: var(--mono); color: var(--faint); font-size: 13px; margin: 0 0 4px; }
.fallback { color: var(--body); max-width: 30em; margin: 0 auto 24px; }

/* ---- Footer ------------------------------------------------------------ */
footer.site {
  border-top: 1px solid var(--rule);
  padding: 30px 0 56px;
  color: var(--faint);
  font-size: 14px;
}
footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  justify-content: space-between;
  align-items: center;
}
footer.site nav { display: flex; gap: 22px; }
footer.site a { color: var(--body); text-decoration: none; }
footer.site a:hover { color: var(--ink); }
footer.site .colophon { font-family: var(--mono); font-size: 12px; }

/* ---- Small screens ----------------------------------------------------- */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 32px 0 56px;
    text-align: left;
  }
  .hero .phone { max-width: 264px; }
  .hero .lede { max-width: none; }
  section { padding: 52px 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
