/* diffcards.com: made of the product's own material. A diff (green added lines, red removed ones), the mark, one card
   you can answer, and plain text on hairlines. Ink for the one action, blue for links and the mark. Schibsted Grotesk
   and IBM Plex Mono, served from here (fonts/, SIL Open Font License). No inline styles: the CSP forbids them. */

@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('/fonts/schibsted-grotesk-latin-wght.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: optional;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-latin-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: optional;
}

:root {
  --sans: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --max: 1160px;
  --gutter: clamp(20px, 4vw, 48px);
  --section: clamp(56px, 7vw, 104px);

  --bg: #f7f8fa;
  --band: #ffffff;
  --surface: #ffffff;
  --sunk: #f3f5f8;
  --line: #e3e6ec;
  --line-2: #cfd5de;
  --text: #0d1117;
  --text-2: #4a5261;
  --text-3: #5f6775;
  --ink: #0d1117;
  --ink-text: #ffffff;
  --accent: #2563eb;
  --accent-text: #1d4ed8;
  --add: #116329;
  --add-bg: #f3fbf5;
  --add-hit: #ddf5e4;
  --add-line: #1a7f37;
  --del: #a40e26;
  --del-bg: #fff4f3;
  --del-line: #c4314b;
  --shadow: rgba(13, 17, 23, 0.32);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e13;
    --band: #11151c;
    --surface: #161b24;
    --sunk: #1b212c;
    --line: #262d39;
    --line-2: #3a4250;
    --text: #edf1f7;
    --text-2: #a9b3c4;
    --text-3: #8e98aa;
    --ink: #edf1f7;
    --ink-text: #0b0e13;
    --accent: #6c9bf5;
    --accent-text: #8fb3f8;
    --add: #6fdd9b;
    --add-bg: rgba(46, 160, 67, 0.1);
    --add-hit: rgba(46, 160, 67, 0.24);
    --add-line: #3fb950;
    --del: #ff9a91;
    --del-bg: rgba(248, 81, 73, 0.1);
    --del-line: #f85149;
    --shadow: rgba(0, 0, 0, 0.6);
  }
}

*,
*::before,
*::after {
  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;
  font: 17px/1.6 var(--sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd,
figure,
fieldset,
pre {
  margin: 0;
}

a {
  color: var(--accent-text);
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

code,
pre {
  font-family: var(--mono);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--ink-text);
  z-index: 10;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Top bar */
.top-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

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

.top-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 28px);
  font-size: 15px;
}

.top-nav a {
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
}

.top-nav a:hover {
  color: var(--text);
}

.top-nav .cta {
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

/* Buttons and links that act */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--ink-text);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: opacity 150ms ease;
}

.button:hover {
  opacity: 0.88;
}

/* The GitHub mark, drawn in the button's own colour (public/brand/github.svg as a mask). */
.button.gh::before {
  content: '';
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: url('/brand/github.svg') center / contain no-repeat;
}

.textlink {
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 4px;
}

.textlink:hover {
  text-decoration-color: currentColor;
}

.start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
}

.label,
.meta {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-3);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  padding-top: clamp(32px, 6vw, 88px);
  padding-bottom: var(--section);
}

@media (min-width: 940px) {
  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 72px;
  }
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

h1 {
  font-size: clamp(42px, 6vw, 80px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 800;
  text-wrap: balance;
}

.lead {
  max-width: 33em;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.5;
  color: var(--text-2);
}

/* The card you can answer: radio buttons, no script. Without :has() the answer simply shows. */
.try {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(18px, 2vw, 26px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow:
    0 1px 0 rgba(13, 17, 23, 0.04),
    0 14px 34px -22px var(--shadow);
}

.card-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-3);
}

.card-title {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-3);
}

.options {
  display: grid;
  gap: 8px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.card-q {
  float: left;
  width: 100%;
  margin-bottom: 6px;
  padding: 0;
  font-size: 21px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.opt {
  clear: both;
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  font-size: 15.5px;
  line-height: 1.4;
  cursor: pointer;
}

.opt:hover {
  border-color: var(--text-3);
}

.opt:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.letter {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-3);
}

.text {
  flex: 1 1 auto;
}

.mark-guess,
.mark-answer {
  display: none;
  font-family: var(--mono);
  font-size: 11.5px;
  white-space: nowrap;
}

.hint {
  font-size: 14px;
  color: var(--text-3);
}

.reveal {
  display: grid;
  gap: 12px;
}

.verdict {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-2);
}

.verdict strong {
  display: none;
  color: var(--text);
}

.quote {
  padding: 7px 12px 7px 0;
  border: 1px solid var(--add-hit);
  border-radius: 8px;
  background: var(--add-bg);
  font-size: 13.5px;
  line-height: 1.7;
  overflow-x: auto;
}

.quote .ln {
  display: inline-block;
  width: 3em;
  padding-right: 4px;
  text-align: right;
  color: var(--text-3);
  user-select: none;
}

.quote .sign {
  display: inline-block;
  width: 1.8em;
  text-align: center;
  color: var(--add);
  user-select: none;
}

.card-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  font-size: 14px;
}

.card-foot .path {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-3);
}

.card-foot a {
  font-weight: 600;
  text-decoration: none;
}

.again {
  justify-self: start;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

@supports selector(:has(*)) {
  /* The ring follows the keyboard only, not a click. */
  .opt:focus-within {
    outline: none;
  }

  .opt:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .reveal {
    display: none;
  }

  .card:has(input:checked) .reveal {
    display: grid;
  }

  .card:has(input:checked) .hint {
    display: none;
  }

  .card:has(input:checked) .opt.is-right {
    border-color: var(--add-line);
    background: var(--add-bg);
  }

  .card:has(input:checked) .opt.is-right .letter,
  .card:has(input:checked) .opt.is-right .mark-answer {
    color: var(--add);
  }

  .card:has(input:checked) .opt.is-right:not(:has(input:checked)) .mark-answer {
    display: inline;
  }

  .opt:not(.is-right):has(input:checked) {
    border-color: var(--del-line);
    background: var(--del-bg);
  }

  .opt:has(input:checked) .mark-guess {
    display: inline;
  }

  .opt:not(.is-right):has(input:checked) .letter,
  .opt:not(.is-right):has(input:checked) .mark-guess {
    color: var(--del);
  }

  .opt.is-right:has(input:checked) .mark-guess {
    color: var(--add);
  }

  .card:has(.is-right input:checked) .v-right,
  .card:has(.opt:not(.is-right) input:checked) .v-wrong {
    display: inline;
  }

  .card:has(.is-right input:checked) .v-right {
    color: var(--add);
  }
}

/* Sections */
.band {
  background: var(--band);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section {
  padding-top: var(--section);
  padding-bottom: var(--section);
}

h2 {
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 64px;
  margin-bottom: clamp(28px, 3.5vw, 48px);
}

.sec-head h2 {
  flex: 1 1 380px;
}

.sec-head p,
.sec-side p,
.closing-text p {
  max-width: 34em;
  color: var(--text-2);
}

.sec-head p {
  flex: 1 1 420px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
}

.sec-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* One merged pull request, and the cards it became */
.source {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}

@media (min-width: 960px) {
  .source {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  }
}

.pr {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.pr figcaption {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.pr-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-3);
}

.merged {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--ink-text);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pr-title {
  font-size: 17px;
  font-weight: 650;
  line-height: 1.35;
}

.add {
  color: var(--add);
}

.del {
  color: var(--del);
}

.hunk {
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
}

.rows {
  min-width: max-content;
  padding-bottom: 8px;
}

.row {
  display: flex;
}

.row code {
  white-space: pre;
  padding-right: 16px;
}

.row.file {
  justify-content: space-between;
  gap: 24px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--sunk);
  color: var(--text-2);
}

.row.hh {
  background: var(--sunk);
  color: var(--text-3);
}

.row.hh code {
  padding-left: 10px;
}

.row.a {
  background: var(--add-bg);
}

.row.a.hit {
  background: var(--add-hit);
}

.row.a.hit code {
  font-weight: 600;
}

.row.d {
  background: var(--del-bg);
}

.row.gap {
  color: var(--text-3);
}

.g {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.6em;
}

.ln {
  flex: 0 0 auto;
  width: 3.2em;
  text-align: right;
  color: var(--text-3);
  user-select: none;
}

.s {
  flex: 0 0 auto;
  width: 1.8em;
  text-align: center;
  user-select: none;
}

.row.a .s {
  color: var(--add);
}

.row.d .s {
  color: var(--del);
}

.n {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--ink-text);
  font: 600 11.5px/1 var(--mono);
}

.became {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qs {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
}

.qs li {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.qs .n {
  margin-top: 2px;
}

.q {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-weight: 650;
  line-height: 1.4;
}

.src {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-3);
}

/* What it does, as a diff */
.does {
  padding: 8px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  list-style: none;
  font-family: var(--mono);
  font-size: clamp(13.5px, 1.1vw, 15px);
  line-height: 1.6;
}

.does li {
  display: flex;
  padding: 7px 18px 7px 0;
}

.does li.add {
  background: var(--add-bg);
  color: var(--text);
}

.does li.del {
  background: var(--del-bg);
  color: var(--text);
}

.does .s {
  width: 2.6em;
  font-weight: 600;
}

.does .add .s {
  color: var(--add);
}

.does .del .s {
  color: var(--del);
}

/* What it can see */
.sees {
  display: flex;
  flex-direction: column;
}

.sees > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px 28px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.sees > div:last-child {
  border-bottom: 1px solid var(--line);
}

@media (min-width: 640px) {
  .sees > div {
    grid-template-columns: 12em minmax(0, 1fr);
  }
}

.sees dt {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.9;
  color: var(--text);
}

.sees dd {
  color: var(--text-2);
}

/* Closing: the price, the call, the film */
.closing {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

@media (min-width: 940px) {
  .closing {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.closing-text {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.closing-text .start {
  margin-top: 6px;
}

.closing-text .textlink {
  color: var(--text-2);
  font-weight: 400;
  font-size: 15px;
}

/* The film (motion/README.md): rendered dark, so its frame is dark in either scheme. */
.film-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b0e13;
}

.film-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #0b0e13;
}

.film-under {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 12px;
  color: var(--text-2);
  font-size: 15px;
}

.film-toggle {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

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

.film-toggle[hidden] {
  display: none;
}

/* Footer */
.foot {
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--text-3);
}

.foot-in {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 24px;
  padding-bottom: 36px;
}

.foot a {
  color: var(--text-2);
}

.foot nav {
  display: flex;
  gap: 20px;
}

/* Plain pages: 404, privacy, terms */
.page {
  padding-top: 56px;
  padding-bottom: 80px;
  max-width: calc(44em + 2 * var(--gutter));
}

.page h1 {
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  line-height: 1.1;
}

.page p,
.prose ul {
  margin-top: 16px;
  color: var(--text-2);
}

.prose h2 {
  margin-top: 40px;
  font-size: 1.35rem;
  letter-spacing: -0.015em;
}

.prose li + li {
  margin-top: 8px;
}

.dated {
  color: var(--text-2);
  font-size: 14px;
}
