/* Reparlo landing — "Red pencil" direction (docs/design/Site.dc.html).
   One marked-up transcript: a mono rail on the left carries the session clock, the words sit
   in one measure, and a teacher's red pencil is the only colour.
   No inline styles anywhere: the CSP is style-src 'self'. */

/* ---------- Fonts (self-hosted, copied into /fonts by scripts/build.mjs) ---------- */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/newsreader-latin-opsz-normal.woff2?v=1") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/newsreader-latin-opsz-italic.woff2?v=1") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2?v=1") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2?v=1") format("woff2");
}
@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/caveat-latin-500-normal.woff2?v=1") format("woff2");
}
@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/caveat-latin-600-normal.woff2?v=1") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --paper: #f5f6f3;
  --ink: #1b1d1a;
  --pencil: #c8322b;
  --pencil-soft: #e0493f;
  --muted: #6b6f68;
  --struck: #8a8e86;
  --rule: #d9dcd5;
  --screen: #3a3e39;
  --white: #ffffff;
  --serif: "Newsreader", Georgia, serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --hand: "Caveat", "Segoe Print", cursive;
  --gutter: 32px;
  --rail: minmax(64px, 88px);
  --rail-gap: 24px;
  color-scheme: light;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
a {
  color: var(--ink);
}
a:hover {
  color: var(--pencil);
}
a:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--pencil);
  outline-offset: 3px;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
h2 {
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.15;
}
p {
  margin: 0;
}
svg {
  display: block;
}
.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 10;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 14px;
}
.skip:focus {
  top: 8px;
  color: var(--paper);
}

/* ---------- Vocabulary from the design ---------- */
.mono {
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  line-height: 1.6;
}
.mono-red {
  color: var(--pencil);
}
.pencil {
  font-family: var(--hand);
  color: var(--pencil);
  font-weight: 600;
}
.strike {
  text-decoration: line-through;
  text-decoration-color: var(--pencil);
  text-decoration-thickness: 3px;
  color: var(--struck);
}
.ins {
  position: relative;
  display: inline-block;
}
.ins > .pencil {
  position: absolute;
  left: 0;
  top: -0.95em;
  white-space: nowrap;
  font-size: 0.62em;
  line-height: 1;
  transform: rotate(-3deg);
}
.ins-tail > .pencil {
  left: 0.2em;
}
.nowrap {
  white-space: nowrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  text-align: center;
}
.btn:hover {
  background: var(--pencil);
  border-color: var(--pencil);
  color: var(--paper);
}
.btn-small {
  min-height: 42px;
  padding: 0 18px;
}
.hatch {
  background: repeating-linear-gradient(135deg, var(--pencil) 0 2px, transparent 2px 7px);
}
.measure {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.row {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: var(--rail-gap);
  align-items: baseline;
}
.text {
  max-width: 60ch;
  font-size: 19px;
}
.lede {
  max-width: 60ch;
  font-size: 22px;
  line-height: 1.5;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.cta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.navlink {
  text-decoration: none;
  color: var(--ink);
}

/* ---------- Running head ---------- */
.head {
  border-bottom: 2px solid var(--ink);
}
.head-inner {
  padding-top: 22px;
  padding-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.wordmark {
  text-decoration: none;
  font-size: 26px;
  font-weight: 500;
  font-style: italic;
  line-height: 1.2;
}
.nav {
  display: flex;
  align-items: center;
  gap: 10px 22px;
  flex-wrap: wrap;
}

/* ---------- Sections ---------- */
.section {
  padding-bottom: 80px;
}
.hero {
  padding-top: 72px;
  padding-bottom: 64px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.hero h1 {
  font-size: clamp(38px, 5.6vw, 72px);
  line-height: 1.22;
}
.hero-note {
  font-size: 34px;
  line-height: 1.1;
  transform: rotate(-1.5deg);
  max-width: 26ch;
}
.hero-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 60ch;
}
h2.italic {
  font-style: italic;
}
h2.sentence {
  font-size: clamp(30px, 4.2vw, 54px);
  line-height: 1.25;
}

/* three moments */
.moments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 28px 40px;
  border-top: 2px solid var(--ink);
  padding-top: 24px;
  margin: 0;
  padding-left: 0;
  list-style: none;
}
.moments li {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.moments .say {
  font-size: 24px;
  line-height: 1.25;
}

/* score sheet */
.sheet {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 28px 40px;
  border-top: 2px solid var(--ink);
  padding-top: 28px;
}
.skill {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skill-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.skill-name {
  font-size: 24px;
}
.score {
  font-size: 30px;
  line-height: 1.1;
}
.bar {
  height: 14px;
  border: 1.5px solid var(--ink);
  position: relative;
}
.bar > .hatch {
  position: absolute;
  inset: 0;
}
.w64 {
  width: 64%;
}
.w72 {
  width: 72%;
}
.w81 {
  width: 81%;
}
.w88 {
  width: 88%;
}

/* replay */
.frames {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 20px;
}
.frames figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.frame {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.frame svg {
  width: 70%;
  height: auto;
}
.frame-you {
  background: var(--ink);
}
.frame-double {
  background: var(--white);
  border: 2px solid var(--ink);
}
.frame-note {
  position: absolute;
  right: 16px;
  top: 12px;
  font-size: 28px;
  line-height: 1.1;
  transform: rotate(4deg);
}

/* free */
.ledger {
  max-width: 60ch;
  border-top: 2px solid var(--ink);
  display: flex;
  flex-direction: column;
  margin: 0;
}
.ledger > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 22px;
}
.ledger > div:last-child {
  border-bottom: 0;
}
.ledger dt,
.ledger dd {
  margin: 0;
}
.ledger dd {
  font-size: 30px;
  line-height: 1.1;
  text-align: right;
  flex-shrink: 0;
}

/* privacy footnote */
.privacy-section {
  padding-bottom: 64px;
}
.footnote {
  font-size: 22px;
  max-width: 60ch;
  border-top: 2px solid var(--pencil);
  padding-top: 18px;
}

/* founder */
.founder-section {
  padding-bottom: 88px;
}
.founder {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 60ch;
}
.founder-line {
  font-size: 32px;
  line-height: 1.15;
  transform: rotate(-1deg);
}

/* footer */
.foot {
  border-top: 2px solid var(--ink);
}
.foot-inner {
  padding-top: 24px;
  padding-bottom: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.foot nav {
  display: flex;
  gap: 8px 20px;
  flex-wrap: wrap;
}

/* ---------- Legal pages ---------- */
.legal {
  padding-top: 56px;
  padding-bottom: 88px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.legal h1 {
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.15;
  font-style: italic;
}
.draft {
  border: 2px solid var(--pencil);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 68ch;
}
.draft strong {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 15px;
  color: var(--pencil);
  letter-spacing: 0.02em;
}
.draft p {
  font-size: 17px;
}
.legal-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 68ch;
}
.legal-section h2 {
  font-size: clamp(24px, 2.6vw, 30px);
  line-height: 1.2;
}
.legal-section ul {
  margin: 0;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.confirm {
  font-family: var(--hand);
  font-weight: 600;
  color: var(--pencil);
  font-size: 1.15em;
  white-space: nowrap;
}

/* longer bracketed placeholders must wrap at phone width */
.confirm.wrap {
  white-space: normal;
}

/* ---------- 404 ---------- */
.lost {
  padding-top: 72px;
  padding-bottom: 96px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.lost h1 {
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.25;
}

/* ---------- Phone (the design's 390px board) ---------- */
@media (max-width: 640px) {
  :root {
    --gutter: 16px;
    --rail: 62px;
    --rail-gap: 10px;
  }
  body {
    font-size: 18px;
  }
  .mono {
    font-size: 12px;
  }
  .row > .mono {
    font-size: 11px;
    overflow-wrap: normal;
  }
  .head-inner {
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .nav {
    gap: 8px 16px;
  }
  .hero {
    padding-top: 48px;
    padding-bottom: 48px;
    gap: 32px;
  }
  /* Room above each line for pencilled insertions once the sentence wraps. */
  .hero h1 {
    font-size: 34px;
    line-height: 1.5;
  }
  h2.sentence,
  .lost h1 {
    line-height: 1.5;
  }
  /* The tail insertion sits at the line's end; anchor it right so it never runs off-screen. */
  .ins-tail > .pencil {
    left: auto;
    right: 0;
  }
  .hero-note {
    font-size: 30px;
  }
  .lede,
  .footnote,
  .ledger > div {
    font-size: 19px;
  }
  .ledger dd {
    font-size: 26px;
  }
  .moments .say,
  .skill-name {
    font-size: 21px;
  }
  .founder-line {
    font-size: 28px;
  }
  .section {
    padding-bottom: 64px;
  }
  .btn {
    padding: 0 20px;
  }
  .btn-small {
    padding: 0 14px;
  }
}

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

@media print {
  .head nav,
  .skip {
    display: none;
  }
  body {
    background: var(--white);
  }
}
