/* Just Crosswords website. Design language: "graph paper and ink", mirrored
   from mobile/src/theme/tokens.ts (light palette; the site, like the puzzle,
   never themes). Paper surfaces, ink panels for brand moments, four accents
   with one job each: spruce acts, clay sells, marigold highlights, slate
   informs. Round things are interface, square things are puzzle. */

:root {
  --paper: #F1F2F4;
  --surface: #FFFFFF;
  --ink: #181B21;
  --ink-soft: #2A2E36;
  --text: #1E2127;
  --text-muted: #6A7077;
  --hairline: #E2E4E8;
  --hairline-on-ink: rgba(255, 255, 255, 0.14);
  --paper-on-ink: #F4F5F7;
  --muted-on-ink: rgba(244, 245, 247, 0.62);

  --spruce-100: #DCEAE4;
  --spruce-300: #8FB9A9;
  --spruce-500: #1E6E5A;
  --spruce-700: #175342;
  --clay-100: #F7D9CD;
  --clay-500: #D75A37;
  --clay-700: #A93E22;
  --marigold-100: #FAE9C8;
  --marigold-500: #E8A32E;
  --marigold-700: #B57C1B;
  --slate-50: #E9EFF5;
  --slate-100: #D6E1EC;
  --slate-500: #34618C;
  --slate-700: #264A6B;

  --font-display: 'Bricolage Grotesque', 'Avenir Next', sans-serif;
  --font-body: 'Hanken Grotesk', 'Helvetica Neue', sans-serif;

  --radius-card: 20px;
  --radius-control: 14px;
  --radius-pill: 999px;
  --radius-cell: 3px;

  --shadow-card: 0 1px 2px rgba(24, 27, 33, 0.06);
  --shadow-raised: 0 2px 8px rgba(24, 27, 33, 0.10);

  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  /* Graph paper: a faint square grid over paper. */
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 28px 28px;
}

a { color: var(--slate-500); }
a:hover { color: var(--slate-700); }

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap-narrow { max-width: 560px; }

/* ---------------------------------------------------------------- header */

.site-header {
  padding: 18px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.wordmark:hover { color: var(--text); }

/* The app icon, app-store rounding via CSS (the source PNG is square). */
.logomark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}

.logomark-lg {
  width: 64px;
  height: 64px;
  border-radius: 15px;
  display: block;
  margin: 0 auto 12px;
  box-shadow: var(--shadow-raised);
}

.header-link {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

/* ------------------------------------------------------------------ type */

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--spruce-500);
  margin: 0 0 10px;
}

.on-ink .eyebrow { color: var(--marigold-500); }

h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
}

h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.25;
  margin: 0 0 6px;
}

p { margin: 0 0 14px; }

.muted { color: var(--text-muted); }
.on-ink .muted { color: var(--muted-on-ink); }

.tabular { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform 80ms ease, background-color 120ms ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.98); }
.btn svg { flex-shrink: 0; }

.btn-primary { background: var(--spruce-500); color: #fff; }
.btn-primary:hover { background: var(--spruce-700); color: #fff; }

.btn-store { background: var(--paper-on-ink); color: var(--ink); }
.btn-store:hover { background: #fff; color: var(--ink); }

.btn-store-quiet {
  background: var(--surface);
  color: var(--text);
  border-color: var(--hairline);
}
.btn-store-quiet:hover { background: var(--slate-50); color: var(--text); }

.btn small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.7;
  text-align: left;
  line-height: 1.1;
}

.btn .btn-store-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  font-size: 15px;
}

/* The visitor's platform (set on <body> by site.js) leads the row. */
.store-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

@media (min-width: 700px) {
  .store-row { flex-direction: row; align-items: center; justify-content: center; }
}

body[data-platform='android'] .store-row { flex-direction: column-reverse; }
@media (min-width: 700px) {
  body[data-platform='android'] .store-row { flex-direction: row-reverse; }
}

/* ----------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 22px;
}

.panel-ink {
  background: var(--ink);
  color: var(--paper-on-ink);
  border-radius: var(--radius-card);
}

/* ------------------------------------------------------- crossword cells */

/* Anything that belongs to the puzzle stays square and never themes. */
.cw {
  display: grid;
  gap: 3px;
  --cell: 36px;
}

.cw .cell {
  width: var(--cell);
  height: var(--cell);
  background: #FFFFFF;
  border-radius: var(--radius-cell);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: calc(var(--cell) * 0.52);
  color: var(--ink);
  opacity: 0;
  transform: scale(0.85);
  animation: cell-in 320ms cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
  animation-delay: var(--d, 0ms);
}

.cw .cell .num {
  position: absolute;
  top: 2px;
  left: 4px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: calc(var(--cell) * 0.22);
  color: var(--text-muted);
}

.cw .cell.hl { background: var(--marigold-100); }

@keyframes cell-in {
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .cw .cell { animation: none; opacity: 1; transform: none; }
}

/* ----------------------------------------------------------------- stars */

.stars { display: inline-flex; gap: 4px; }
.stars svg { width: 26px; height: 26px; }
.stars .lit { fill: var(--marigold-500); }
.stars .dim { fill: var(--slate-100); }

/* ---------------------------------------------------------------- footer */

.site-footer {
  padding: 34px 0 44px;
  font-size: 14px;
  color: var(--text-muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-items: center;
}

/* ------------------------------------------------------------ link pages */

.linkpage-main { padding: 10px 0 50px; }

.result-card { padding: 28px 24px; text-align: center; }

.result-card .who {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 4px 0 2px;
  overflow-wrap: anywhere;
}

.result-time {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 52px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin: 14px 0 8px;
}

.statlist {
  margin: 18px 0 4px;
  border-top: 1px solid var(--hairline);
}

.statlist .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--hairline);
}

.statlist .label { color: var(--text-muted); font-size: 14px; }

.statlist .value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-pill);
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
}

.cta-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.divider-label {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  margin: 22px 0 12px;
}

.divider-label::before,
.divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

/* The pitch shown to link recipients without the app: the focus story
   leads, the puzzles back it up, the deal closes (MARKETING.md). */
.pitch-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.pitch {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 410px;
  margin: 0 auto 18px;
}

.qr-card {
  margin-top: 16px;
  padding: 18px;
  text-align: center;
}

.qr-card img, .qr-card svg { width: 168px; height: 168px; display: block; margin: 0 auto 10px; }

/* ------------------------------------------------------------- screenshots */

/* On phones the screenshots ride in a swipeable, edge-to-edge carousel
   (the negative margins undo the wrap gutter; the padding restores it as
   scroll inset). Desktop lays all three side by side. */
.shots {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin-left: -20px;
  margin-right: -20px;
  padding: 4px 20px 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.shots::-webkit-scrollbar { display: none; }

/* Each screenshot sits in an ink phone shell: the bezel is the padding,
   the screen corner radius tracks the shell's. */
.phone {
  background: var(--ink);
  border-radius: 50px;
  padding: 12px;
  box-shadow: var(--shadow-raised);
  flex: 0 0 min(72vw, 270px);
  scroll-snap-align: center;
}

@media (min-width: 700px) {
  .shots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: visible;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
  }
  .phone { width: 100%; }
}

.shot {
  width: 100%;
  height: auto;
  border-radius: 38px;
  display: block;
}

/* --------------------------------------------------------------- features */

.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 700px) {
  .features { grid-template-columns: repeat(3, 1fr); }
}

.feature .tile {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-cell);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
}

.feature p { margin: 0; color: var(--text-muted); font-size: 14.5px; }

/* ----------------------------------------------------------------- misc */

/* Vertical rhythm only: .section shares elements with .wrap, whose gutter
   the padding shorthand would clobber. */
.section { padding-top: 34px; padding-bottom: 34px; }

@media (min-width: 700px) {
  .section { padding-top: 48px; padding-bottom: 48px; }
  h1 { font-size: 52px; }
}

.pricebox {
  text-align: center;
  padding: 34px 24px;
}

.price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 56px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--clay-500);
  margin: 6px 0 4px;
}

.hidden { display: none !important; }
