/*
 * Broadsheet, on the web.
 *
 * The same design system the app is set in: newsprint ground, ink type, cyan
 * for anything you can touch, magenta for anything you got wrong, and the felt
 * as the one place colour runs rich. The tokens below are lifted from
 * src/theme/tokens.ts rather than eyeballed, so the site and the product
 * cannot drift apart.
 */

:root {
  --paper: #f3f2f2;
  --paper-warm: #f6f4f1;
  --surface: #eae7e7;

  --ink: #201e1d;
  --ink-body: #3a3736;
  --ink-soft: #444141;
  --ink-muted: #605d5d;

  --rule: rgba(32, 30, 29, 0.16);
  --rule-strong: #201e1d;

  /* Cyan — touchable, and correct. */
  --accent: #0088b0;
  --accent-700: #006786;
  --accent-100: #e9f8ff;

  /* Magenta — incorrect. Nothing else uses it. */
  --wrong: #d6006c;

  /* The felt. */
  --felt-top: #245446;
  --felt-mid: #1a3b31;
  --felt-deep: #133029;
  --felt-ink: #f6f4f1;
  --brass: #edbb00;
  --brass-line: rgba(237, 187, 0, 0.3);

  --measure: 34rem;
  --page: 68rem;

  --serif: 'Source Serif 4', 'Iowan Old Style', 'Palatino Linotype', Palatino,
    Georgia, 'Times New Roman', serif;
}

/*
 * The watch inverts the palette — dark ground, no paper — because watchOS
 * renders black as off pixels and a paper-white sheet at arm's length is
 * unreadable. Cyan and magenta stay, one step lighter for contrast on black.
 */
.on-felt,
.watch-section {
  --paper: var(--felt-deep);
  --ink: #f6f4f1;
  --ink-body: rgba(246, 244, 241, 0.82);
  --ink-muted: rgba(246, 244, 241, 0.55);
  --rule: rgba(246, 244, 241, 0.18);
  --accent: #3fb6da;
  --wrong: #ff4f9a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Broadsheet is newsprint. There is no dark newsprint. */
  color-scheme: light only;
}

/*
 * From the design-system bundle, and load-bearing: without it an <img> with
 * intrinsic width attributes overflows its column, the page grows wider than
 * the viewport, and every section reads flush to the left edge because the
 * whole document is scrolled sideways. That is exactly what it looked like on
 * a phone, and nothing about it is visible at desktop width.
 */
img {
  display: block;
  max-width: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-body);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

/* ── Type ─────────────────────────────────────────────────────────────── */

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  letter-spacing: -0.035em;
}
h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
}
h3 {
  font-size: 1.3rem;
}
h4 {
  font-size: 1.0625rem;
}

p {
  margin: 0 0 1rem;
  max-width: var(--measure);
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
a:hover {
  color: var(--accent-700);
}

strong {
  color: var(--ink);
  font-weight: 600;
}

/* The small-caps rubric the app prints above every figure. */
.rubric {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

.lede {
  font-size: clamp(1.125rem, 2.2vw, 1.375rem);
  color: var(--ink-soft);
  max-width: 40rem;
}

/* ── Structure ────────────────────────────────────────────────────────── */

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: clamp(3rem, 8vw, 5.5rem) 0;
  border-top: 1px solid var(--rule);
}

section:first-of-type {
  border-top: 0;
}

.felt {
  background: linear-gradient(160deg, var(--felt-top), var(--felt-deep));
  color: var(--felt-ink);
  border-top: 0;
}

.felt h2,
.felt h3 {
  color: var(--felt-ink);
}

.felt .rubric {
  color: rgba(246, 244, 241, 0.6);
}

.felt p {
  color: rgba(246, 244, 241, 0.82);
}

.felt .hairline {
  border-color: var(--brass-line);
}

/* ── Masthead ─────────────────────────────────────────────────────────── */

.masthead {
  border-bottom: 2px solid var(--rule-strong);
  background: var(--paper);
}

/*
 * Sticky only where there is room for it. On a phone the nav wraps to a second
 * line, and a two-line sticky masthead eats a third of the viewport on every
 * screen — which the simulator made obvious and a desktop browser never would.
 */
@media (min-width: 48rem) {
  .masthead {
    position: sticky;
    top: 0;
    z-index: 10;
  }
}

.masthead .wrap {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  flex-wrap: wrap;
}

.wordmark {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.masthead nav {
  display: flex;
  gap: 0.85rem 1.1rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.masthead nav a {
  font-size: 0.88rem;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}

@media (min-width: 48rem) {
  .masthead nav {
    gap: 1.25rem;
  }
  .masthead nav a {
    font-size: 0.95rem;
  }
}

.masthead nav a:hover,
.masthead nav a[aria-current='page'] {
  color: var(--accent);
}

.masthead nav a[aria-current='page'] {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

/* ── Grids ────────────────────────────────────────────────────────────── */

.cols {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  align-items: start;
}

.cols-2 {
  display: grid;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  grid-template-columns: 1fr;
  align-items: center;
}

@media (min-width: 48rem) {
  .cols-2 {
    grid-template-columns: 1fr 1fr;
  }
  .cols-2.narrow-shot {
    grid-template-columns: 1fr 1.35fr;
  }
}

/* ── Devices ──────────────────────────────────────────────────────────── */

.shot {
  display: block;
  width: 100%;
  max-width: 17rem;
  height: auto;
  border-radius: 1.75rem;
  border: 1px solid var(--rule);
  box-shadow: 0 1.5rem 3rem rgba(32, 30, 29, 0.16);
  background: var(--paper-warm);
}

.shot-wide {
  max-width: 22rem;
}

.watch-shot {
  display: block;
  width: 100%;
  max-width: 11rem;
  height: auto;
  border-radius: 2.25rem;
  border: 1px solid rgba(246, 244, 241, 0.2);
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.45);
  background: #000;
}

figure {
  margin: 0;
}

figcaption {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-top: 0.75rem;
  max-width: 24rem;
}

/* ── The rating card, as the app draws it ─────────────────────────────── */

.rating-card {
  border: 1px solid var(--rule);
  background: var(--paper-warm);
  padding: 1.5rem;
  max-width: 24rem;
}

.rating-figure {
  font-size: 3.5rem;
  font-weight: 600;
  color: var(--accent-700);
  letter-spacing: -0.04em;
  /* A line box shorter than the type crops the glyph. Learned the hard way. */
  line-height: 1.12;
}

.rating-move {
  font-size: 1rem;
  color: var(--accent);
  margin-left: 0.4rem;
}

.rating-rows {
  margin-top: 1rem;
  border-top: 1px solid var(--rule);
}

.rating-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.rating-row span:last-child {
  color: var(--ink);
  font-weight: 600;
}

/* ── Feature list ─────────────────────────────────────────────────────── */

.feature {
  padding: clamp(2rem, 5vw, 3.25rem) 0;
  border-top: 1px solid var(--rule);
}

.feature:first-child {
  border-top: 0;
  padding-top: 0;
}

/* ── Callouts ─────────────────────────────────────────────────────────── */

.note {
  border-left: 3px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin: 1.5rem 0;
}

.note.wrong {
  border-left-color: var(--wrong);
}

.note p:last-child {
  margin-bottom: 0;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

/* A row of buttons that keeps its spacing when it wraps onto two lines. */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: stretch;
  margin: 1.5rem 0 1rem;
}

.actions .button,
.actions .button-quiet {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border: 0;
}

.button:hover {
  background: var(--accent-700);
  color: #fff;
}

.button-quiet {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border: 1px solid var(--rule);
}

/* ── FAQ ──────────────────────────────────────────────────────────────── */

.faq {
  border-top: 1px solid var(--rule);
  max-width: 44rem;
}

.faq details {
  border-bottom: 1px solid var(--rule);
  padding: 0.25rem 0;
}

.faq summary {
  cursor: pointer;
  padding: 0.9rem 0;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  color: var(--accent);
  font-weight: 400;
  flex: none;
}

.faq details[open] summary::after {
  content: '−';
}

.faq details > *:not(summary) {
  margin-bottom: 1rem;
}

/* ── Rules table ──────────────────────────────────────────────────────── */

.rules {
  width: 100%;
  max-width: 34rem;
  border-collapse: collapse;
  font-size: 0.97rem;
}

.rules th,
.rules td {
  text-align: left;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.rules th {
  color: var(--ink-muted);
  font-weight: 400;
  padding-right: 1.5rem;
  white-space: nowrap;
}

.rules td {
  color: var(--ink);
  font-weight: 600;
}

/* ── Steps ────────────────────────────────────────────────────────────── */

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 40rem;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1.25rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

footer {
  border-top: 2px solid var(--rule-strong);
  padding: 2.5rem 0 4rem;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

footer nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

footer a {
  color: var(--ink-soft);
}

.hairline {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

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


/* ── Design-system components ─────────────────────────────────────────────
 *
 * Lifted from the Broadsheet bundle the Claude Design project is built on,
 * so the imported pages render exactly as drawn rather than approximately.
 */

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-4, 20px);
  padding: 15px 20px;
  flex-wrap: wrap;
}

.nav-brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  margin-right: auto;
  color: var(--ink);
}

.nav a {
  color: inherit;
  text-decoration: none;
  font-size: 14px;
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  padding: 10px 18px;
  border-radius: 2px;
}

.btn-primary {
  background: var(--accent);
  color: var(--paper);
}
.btn-primary:hover { background: #1186ac; color: var(--paper); }
.btn-primary:active { background: var(--accent-700); }

.btn-secondary { border-color: var(--rule); }
.btn-secondary:hover { background: rgba(32, 30, 29, 0.07); }

.btn-ghost { color: var(--accent); padding-inline: 5px; }
.btn-ghost:hover { background: rgba(0, 136, 176, 0.1); }


/* ── Contact form ─────────────────────────────────────────────────────────
 *
 * Styled from the design-system form classes. The form posts normally and
 * needs no JavaScript, which matters here: the site's CSP forbids scripts
 * outright, and a contact form that only works with JS would be a contact
 * form that never worked.
 */

.form {
  max-width: 34rem;
}

.field {
  margin-bottom: 1.15rem;
}

.field > label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.4rem;
}

.field .hint {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-top: 0.35rem;
  text-transform: none;
  letter-spacing: 0;
}

.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  caret-color: var(--accent);
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 2px;
}

.input:hover { border-color: rgba(32, 30, 29, 0.45); }
.input:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }

textarea.input { min-height: 11rem; resize: vertical; line-height: 1.55; }

/* The honeypot. Off-screen rather than display:none, which some bots skip. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/*
 * Only the notice the form redirected to is shown. `:target` matches the
 * element whose id is in the URL fragment, so the server says what happened by
 * choosing where to land — and no script is needed to read it.
 */
.notice { display: none; }
.notice:target { display: block; }

.notice {
  border-left: 3px solid var(--accent);
  background: var(--accent-100);
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.75rem;
  max-width: 34rem;
}

.notice.bad {
  border-left-color: var(--wrong);
  background: #fff1f4;
}

.notice p { margin: 0; max-width: none; }
