/* Speed Puzzle website. One stylesheet for every page; no third-party requests. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("fonts/dm-mono-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

/* Layout: one 1080px column; the hero pairs the pitch with a running timer card on a faint jigsaw grid. */
:root {
  --paper: #f6f5fb;
  --surface: #ffffff;
  --ink: #221f33;
  --muted: #5d596f;
  --line: #e2dfee;
  --violet: #6a5aaf;
  --violet-soft: #ece9f8;
  --sage: #4f8a6c;
  --sage-soft: #e3f0e8;
  --gold: #c98a12;
  --gold-soft: #fbefd4;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(34, 31, 51, .06), 0 12px 32px -12px rgba(34, 31, 51, .18);

  --font-display: "Bricolage Grotesque", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-clock: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: .875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(2.1rem, 1.4rem + 3vw, 3.4rem);
  --clock: clamp(3rem, 2rem + 5vw, 4.6rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14121d;
    --surface: #1e1b2b;
    --ink: #eeecf6;
    --muted: #a7a3b9;
    --line: #2f2b42;
    --violet: #a89ae6;
    --violet-soft: #2a2542;
    --sage: #88c4a5;
    --sage-soft: #1d3329;
    --gold: #f2b84a;
    --gold-soft: #3a2f17;
    --on-accent: #14121d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #14121d;
  --surface: #1e1b2b;
  --ink: #eeecf6;
  --muted: #a7a3b9;
  --line: #2f2b42;
  --violet: #a89ae6;
  --violet-soft: #2a2542;
  --sage: #88c4a5;
  --sage-soft: #1d3329;
  --gold: #f2b84a;
  --gold-soft: #3a2f17;
  --on-accent: #14121d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--font-body);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--violet); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; text-wrap: balance; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }

.wrap { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: 20px; }

/* Header */
.site-header { padding-block: 20px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 var(--step-1)/1 var(--font-display); }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.nav { display: flex; gap: 20px; font-size: var(--step--1); font-weight: 600; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* Hero */
.hero { position: relative; padding-block: 40px 72px; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-color: var(--line);
  -webkit-mask: url("jigsaw-grid.svg") 0 0 / 96px 96px, linear-gradient(to bottom, #000, transparent 85%);
  -webkit-mask-composite: source-in;
  mask: url("jigsaw-grid.svg") 0 0 / 96px 96px, linear-gradient(to bottom, #000, transparent 85%);
  mask-composite: intersect;
  pointer-events: none;
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.eyebrow { font-size: var(--step--1); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sage); }
.hero h1 { font-size: var(--step-3); font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--violet); }
.lede { font-size: var(--step-1); color: var(--muted); max-width: 34ch; line-height: 1.5; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.store-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 14px;
  background: var(--ink); color: var(--paper);
  font-weight: 600; text-decoration: none; line-height: 1.2;
}
.store-badge:hover { opacity: .88; }
.store-badge small { display: block; font-size: .75rem; font-weight: 500; opacity: .75; }
.store-badge svg { width: 22px; height: 22px; flex: none; }
.cta-note { font-size: var(--step--1); color: var(--muted); }

/* Timer card */
/* The hopping piece stands on the card's top edge, feet just inside it. */
.timer-card {
  position: relative;
  margin-top: 100px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid; gap: 18px;
  min-width: 0;
}
.hero-piece { position: absolute; width: 150px; height: 150px; top: -121px; right: 14px; }
.timer-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: var(--step--1); color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 8px; color: var(--sage); font-weight: 700; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.puzzle-name { font: 700 var(--step-1)/1.25 var(--font-display); }
.puzzle-meta { font-size: var(--step--1); color: var(--muted); }
.clock {
  font: 500 var(--clock)/1 var(--font-clock);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  color: var(--ink);
}
.clock .tenths { color: var(--muted); font-size: .55em; }
.splits { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.splits li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--violet-soft); font-size: var(--step--1); }
.splits li.pending { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.splits .t { font-family: var(--font-clock); font-variant-numeric: tabular-nums; }
.splits .best { color: var(--sage); font-weight: 600; margin-left: 6px; }
.timer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.timer-actions span { text-align: center; padding: 12px; border-radius: 14px; font-weight: 700; font-size: var(--step--1); }
.timer-actions .pause { background: var(--violet-soft); color: var(--violet); }
.timer-actions .finish { background: var(--sage); color: var(--on-accent); }

/* Sections */
.section { padding-block: 72px; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 10px; margin-bottom: 36px; max-width: 42rem; }
.section-head h2 { font-size: var(--step-2); font-weight: 750; }
.section-head p { color: var(--muted); }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.mode { border-radius: 24px; padding: 28px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.mode.relaxed { background: var(--sage-soft); }
.mode.compete { background: var(--violet-soft); }
.mode-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.mode-top img { width: 112px; height: 112px; flex: none; margin-block: -12px -4px; }
.mode-head { display: grid; gap: 10px; }
.mode h3 { font-size: var(--step-1); font-weight: 700; }
.mode .readout { font: 500 var(--step-2)/1 var(--font-clock); font-variant-numeric: tabular-nums; }
.mode.relaxed .readout { color: var(--sage); }
.mode.compete .readout { color: var(--violet); }
.mode ul { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 32px; }
.feature { display: grid; gap: 8px; align-content: start; min-width: 0; }
.feature img { width: 120px; height: 120px; margin-bottom: 4px; }
.feature h3 { font-size: var(--step-1); font-weight: 700; }
.feature p { color: var(--muted); }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip { font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--ink); }

.private { background: var(--ink); color: var(--paper); border-radius: 28px; padding: 40px; display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.private img { width: 120px; height: 120px; }
.private h2 { font-size: var(--step-2); }
.private p { opacity: .8; margin-top: 8px; }
.private a { color: inherit; }

.coming { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; background: var(--gold-soft); border-radius: 28px; padding: 32px 40px; }
.coming img { width: 170px; height: 160px; }
.coming > div { display: grid; gap: 10px; min-width: 0; }
.coming h2 { font-size: var(--step-2); }
.coming .eyebrow { color: var(--gold); }

.mode-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 6px; font-size: var(--step--1); color: var(--muted); }
.mode { scroll-margin-top: 24px; }
.private .private-cta { opacity: 1; margin-top: 16px; }
.private .button { background: var(--paper); color: var(--ink); }

/* Plain pages (support, privacy) */
.page { padding-block: 32px 80px; }
.page .wrap { max-width: 760px; display: grid; gap: 28px; }
.page h1 { font-size: var(--step-3); font-weight: 800; }
.page .lede { max-width: none; }
.prose { display: grid; gap: 14px; }
.prose h2 { font-size: var(--step-1); font-weight: 700; margin-top: 18px; }
.prose ul { margin: 0; padding-left: 1.2em; }
.updated { font-size: var(--step--1); color: var(--muted); }

.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 24px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.contact-card { position: relative; }
.contact-piece { position: absolute; top: -40px; right: 16px; width: 96px; height: 96px; }
.contact-card h2 { font-size: var(--step-1); }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.email { font: 500 var(--step-1)/1.2 var(--font-clock); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; user-select: all; }
.button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px;
  background: var(--violet); color: var(--on-accent);
  font: 700 var(--step--1)/1 var(--font-body); text-decoration: none; border: 0; cursor: pointer;
}
.button.ghost { background: var(--violet-soft); color: var(--violet); }

.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0 20px; }
.faq summary { cursor: pointer; padding-block: 16px; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 500 1.3rem/1 var(--font-clock); color: var(--violet); }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding-bottom: 18px; color: var(--muted); display: grid; gap: 10px; }

/* Blog */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.post-card { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; padding: 20px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.post-card:hover h2 { color: var(--violet); }
.post-card img { width: 88px; height: 88px; }
.post-card > div { display: grid; gap: 6px; min-width: 0; }
.post-card time, .page .eyebrow time { font-size: var(--step--1); color: var(--muted); font-weight: 600; letter-spacing: normal; text-transform: none; }
.post-card h2 { font-size: var(--step-1); font-weight: 700; }
.post-card p { color: var(--muted); }
.page .eyebrow a { color: inherit; text-decoration: none; }
.post-hero { width: 140px; height: 140px; }
.post-cta { margin-top: 18px; }
.post-back { font-size: var(--step--1); font-weight: 600; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 32px 48px; font-size: var(--step--1); color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a { color: var(--muted); }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 36px; }
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .modes, .features { grid-template-columns: 1fr; }
  .private, .coming { grid-template-columns: 1fr; padding: 28px; }
  .section { padding-block: 56px; }
  .nav { gap: 16px; }
  .post-card { grid-template-columns: 1fr; gap: 12px; }
  .post-card img { width: 64px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .live::before { animation: none; }
}
