/* kibitzer.dev. Fonts are self-hosted (SIL Open Font License; see fonts/README).
   The idea: a commentator's sheet. Ink on cool paper, red pencil in the margin for what went wrong,
   a highlighter on the move that caused it. */
@font-face { font-family: "Bricolage"; src: url("/fonts/bricolage.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-italic.woff2") format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Mono"; src: url("/fonts/atkinson-mono.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }

:root {
  --paper: #f1f3f6;
  --sheet: #fbfcfd;
  --ink: #18202e;
  --graphite: #5b6473;
  --rule: #d3d9e1;
  --highlight: #f3da4b;
  --highlight-ink: #18202e;
  --pencil: #b42a1f;
  --link: #1f4fa3;
  --focus: #1f4fa3;
  --shadow: 0 1px 0 #d3d9e1, 0 18px 40px -24px rgba(24, 32, 46, 0.35);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12161d; --sheet: #1a1f28; --ink: #e5e9ef; --graphite: #9aa3b1; --rule: #2e3542;
    --highlight: #6b5a12; --highlight-ink: #fff6cc; --pencil: #ff8a7a; --link: #8fb4ff; --focus: #8fb4ff;
    --shadow: 0 0 0 1px #2e3542;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12161d; --sheet: #1a1f28; --ink: #e5e9ef; --graphite: #9aa3b1; --rule: #2e3542;
  --highlight: #6b5a12; --highlight-ink: #fff6cc; --pencil: #ff8a7a; --link: #8fb4ff; --focus: #8fb4ff;
  --shadow: 0 0 0 1px #2e3542;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.6 "Atkinson", system-ui, sans-serif;
  font-kerning: normal;
}
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
code, pre, kbd { font-family: "Atkinson Mono", ui-monospace, monospace; font-size: 0.9em; }
p code, li code, td code { white-space: nowrap; background: var(--sheet); border: 1px solid var(--rule); border-radius: 3px; padding: 0.05em 0.3em; }
h1, h2, h3 { font-family: "Bricolage", "Atkinson", sans-serif; font-weight: 700; line-height: 1.08; letter-spacing: -0.015em; margin: 0; }
h2 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.5rem); letter-spacing: -0.025em; margin-bottom: 0.6em; }
h3 { font-size: 1.2rem; line-height: 1.25; letter-spacing: 0; margin: 1.6em 0 0.4em; }
p { margin: 0 0 1em; }
b, strong { font-weight: 700; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.prose { max-width: 64ch; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--sheet); padding: 6px 10px; z-index: 2; }

/* Masthead */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; padding-top: 20px; padding-bottom: 20px; flex-wrap: wrap; }
.mark { font-family: "Bricolage", sans-serif; font-weight: 800; font-size: 1.5rem; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.mark span { color: var(--pencil); }
.top nav { display: flex; gap: 6px 20px; flex-wrap: wrap; align-items: center; font-size: 0.98rem; }
.top nav a { color: var(--ink); text-decoration: none; border-bottom: 3px solid transparent; }
.top nav a:hover { text-decoration: underline; }
.top nav a.nav-cta { font-weight: 700; border-bottom: 3px solid var(--highlight); }

.button { display: inline-block; padding: 11px 18px; border-radius: 6px; font-weight: 700; text-decoration: none; border: 2px solid var(--ink); color: var(--ink); }
.button.primary { background: var(--ink); color: var(--paper); }
.button:hover { text-decoration: underline; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* Hero: the promise on the left, the Monday report it describes on the right */
.hero { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 64px; padding-top: 36px; padding-bottom: 80px; align-items: start; }
.hero h1 { font-size: clamp(2.4rem, 1.3rem + 3.9vw, 4.3rem); line-height: 1.0; letter-spacing: -0.035em; margin-bottom: 0.45em; text-wrap: balance; }
.lede { font-size: 1.2rem; line-height: 1.55; max-width: 38ch; }
.for { color: var(--graphite); max-width: 42ch; }

/* The Monday report: a sheet with the commentator's marks hanging in its left margin */
.monday { margin: 8px 0 0 2.6rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: 3px; box-shadow: var(--shadow); padding: 0 24px 18px; position: relative; }
.envelope { border-bottom: 2px solid var(--ink); padding: 14px 0 10px; margin-bottom: 14px; font-size: 0.95rem; }
.envelope p { margin: 0; display: grid; grid-template-columns: 4.6em minmax(0, 1fr); gap: 8px; }
.envelope .k { color: var(--graphite); }
.envelope strong { font-family: "Bricolage", sans-serif; font-size: 1.08rem; line-height: 1.3; }
.first { font-size: 1.05rem; line-height: 1.45; margin-bottom: 8px; }
.journeys { list-style: none; margin: 0; padding: 0; }
.journeys li { position: relative; padding: 12px 0 10px; border-top: 1px solid var(--rule); }
.journeys h3 { margin: 0 0 2px; font-size: 1.02rem; line-height: 1.3; }
.journeys p { margin: 0; font-size: 0.96rem; color: var(--graphite); }
.journeys b { color: var(--ink); }
.journeys .stuck b, .journeys .stumble b { color: var(--pencil); }
.journeys .note { position: absolute; right: calc(100% + 24px + 0.7rem); top: 8px; font-family: "Bricolage", sans-serif; font-weight: 800; font-size: 1.7rem; line-height: 1; color: var(--pencil); white-space: nowrap; }
.journeys .stumble h3 mark, .journeys .stuck h3 mark { background: none; }
.monday figcaption { border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 4px; color: var(--graphite); font-size: 0.85rem; line-height: 1.45; }
.monday figcaption b { color: var(--pencil); font-family: "Bricolage", sans-serif; }

/* Sections */
section.band { padding: 72px 0; border-top: 1px solid var(--rule); }
.cols { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; align-items: start; }

/* One finding, up close */
.evidence { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 40px; margin-top: 28px; align-items: start; }
.pair { margin: 0; display: grid; gap: 22px; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 3px; background: #fff; }
/* A pencil ring around “Lyon · Modifier” in the before shot (coordinates in % of the 941x385 crop). */
.shot .frame { position: relative; }
.shot .ring { position: absolute; left: 43.4%; top: 15.6%; width: 13.4%; height: 9.4%; border: 2px solid var(--pencil); border-radius: 50%; transform: rotate(-3deg); pointer-events: none; }
.pencil { color: var(--pencil); font-size: 0.95rem; margin: 8px 0 0; padding-left: 14px; border-left: 3px solid var(--pencil); }

/* The game record */
.record { margin: 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: 3px; padding: 18px 20px 16px; }
.record header { display: flex; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 6px; }
.record header strong { font-family: "Bricolage", sans-serif; font-size: 1.05rem; }
.record header span { color: var(--graphite); font-size: 0.92rem; }
.task { font-style: italic; color: var(--graphite); font-size: 0.96rem; margin: 10px 0 8px; }
.moves { list-style: none; margin: 0; padding: 0; counter-reset: move; }
.moves li { display: grid; grid-template-columns: 1.8em minmax(0, 1fr) 7.5em; gap: 0 10px; padding: 7px 0; border-bottom: 1px solid var(--rule); counter-increment: move; align-items: baseline; }
.moves li::before { content: counter(move) "."; font-family: "Atkinson Mono", monospace; color: var(--graphite); font-size: 0.9rem; text-align: right; }
.moves .act { font-family: "Atkinson Mono", monospace; font-size: 0.88rem; overflow-wrap: anywhere; }
.moves .why { display: block; font-family: "Atkinson", sans-serif; font-size: 0.92rem; color: var(--graphite); margin-top: 2px; }
.moves .glyph { font-family: "Bricolage", sans-serif; font-weight: 800; color: var(--pencil); font-size: 1.05rem; }
.moves li:not(:has(.margin)) .act { grid-column: 2 / span 2; }
.moves .margin { font-size: 0.86rem; line-height: 1.35; color: var(--pencil); grid-column: 3; }
.moves li.milestone .margin { color: var(--graphite); }
.moves li.stuck .act mark { background: var(--highlight); color: var(--highlight-ink); padding: 0 0.15em; }
.legend { color: var(--graphite); font-size: 0.85rem; margin: 10px 0 0; }

/* The issue, as filed */
.issue { margin: 40px 0 0; max-width: 72ch; background: var(--sheet); border: 1px solid var(--rule); border-left: 4px solid var(--pencil); border-radius: 3px; padding: 16px 22px 6px; }
.issue-where { color: var(--graphite); font-size: 0.9rem; margin: 0 0 6px; }
.issue h3 { margin: 0 0 12px; font-size: 1.2rem; }
.issue p { font-size: 0.98rem; }

/* How it works: a real sequence, so it is numbered by when it happens */
.flow { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.flow li { border-top: 3px solid var(--ink); padding-top: 14px; }
.flow .when { font-family: "Bricolage", sans-serif; font-weight: 700; color: var(--pencil); margin: 0 0 4px; }
.flow h3 { margin: 0 0 8px; }
.flow p { color: var(--ink); }

/* Where it stands */
.honest { margin: 0; max-width: 64ch; }
.honest dt { font-family: "Bricolage", sans-serif; font-weight: 700; font-size: 1.12rem; margin-top: 18px; }
.honest dt:first-child { margin-top: 4px; }
.honest dd { margin: 4px 0 0; }

/* Early access */
section.join { background: var(--sheet); border-top: 3px solid var(--ink); }
section.join .signup { margin-top: 0; background: var(--paper); }

footer.foot { border-top: 1px solid var(--rule); padding: 28px 0 48px; color: var(--graphite); font-size: 0.93rem; }
footer.foot p { max-width: 72ch; }

/* Tables (reports index) */
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 700; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.limits { padding-left: 1.1em; max-width: 66ch; }
.limits li { margin-bottom: 0.6em; }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 12px; padding-bottom: 56px; }
  .cols, .evidence { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .flow { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  /* The nav gets its own full row under the mark, spread across it, instead of wrapping one link. */
  .top nav { width: 100%; justify-content: space-between; gap: 4px 10px; font-size: 0.92rem; }
  .monday { margin-left: 1.9rem; padding: 0 14px 14px; }
  .journeys .note { right: calc(100% + 14px + 0.45rem); font-size: 1.35rem; }
  .envelope p { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .envelope p + p { margin-top: 6px; }
  .record { padding: 14px 14px 12px; }
  .moves li { grid-template-columns: 1.6em minmax(0, 1fr); }
  .moves .margin { grid-column: 2; margin-top: 4px; }
  .issue { padding: 14px 16px 4px; }
  section.band { padding: 48px 0; }
}

/* Plain pages: privacy, waitlist results, reports index */
main.plain { padding-top: 24px; padding-bottom: 72px; }
main.plain h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); margin-bottom: 0.4em; }
main.plain h2 { font-size: 1.45rem; margin: 1.6em 0 0.5em; }
.back { margin-top: 2em; }

/* Waitlist */
.signup { margin: 1.6em 0 1.8em; padding: 18px 20px 6px; background: var(--sheet); border: 1px solid var(--rule); border-left: 4px solid var(--ink); border-radius: 4px; }
.signup h3 { margin: 0 0 0.3em; }
form.waitlist label { display: block; font-weight: 700; margin-bottom: 6px; }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; }
.field-row input { flex: 1 1 16em; min-width: 0; font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--graphite); border-radius: 6px; padding: 9px 12px; }
section.join .field-row input { background: var(--sheet); }
.field-row input:focus-visible { border-color: var(--focus); }
.field-row input[aria-invalid="true"] { border-color: var(--pencil); }
button.button { font: inherit; font-weight: 700; cursor: pointer; background: transparent; }
button.button.primary { background: var(--ink); }
button.button:disabled { opacity: 0.7; cursor: progress; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fine { color: var(--graphite); font-size: 0.9rem; margin-top: 10px; }
.form-error { color: var(--pencil); font-weight: 700; }
.form-error[hidden] { display: none; }
.joined, .keep { margin: 1em 0; }
.joined:focus { outline: none; }
.link { font-family: "Atkinson Mono", ui-monospace, monospace; font-size: 0.9rem; overflow-wrap: anywhere; background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 8px 10px; }
main.plain .link { background: var(--sheet); }
.copied { color: var(--graphite); font-size: 0.9rem; margin-left: 6px; }
