@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #141413;
  --paper: #FAFAF7;
  --sheet: #FFFFFF;
  --red: #D93A1A;
  --on-red: #FFFFFF;
  --muted: #6B6B66;
  --line: rgba(20, 20, 19, 0.12);
  --line-strong: rgba(20, 20, 19, 0.24);
  --tint: rgba(20, 20, 19, 0.04);

  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 3px;
  --gutter: 24px;
  --max: 1120px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --space: clamp(80px, 11vw, 136px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #FAFAF7;
    --paper: #141413;
    --sheet: #1C1C1B;
    --muted: #A3A39D;
    --line: rgba(250, 250, 247, 0.12);
    --line-strong: rgba(250, 250, 247, 0.26);
    --tint: rgba(250, 250, 247, 0.05);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }

h1, h2, h3 { font-weight: 500; text-wrap: balance; }
h1 {
  font-size: clamp(40px, 5.6vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.032em;
}
h2 {
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.025em;
}
h3 {
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
p { text-wrap: pretty; }

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

/* Skip link */
.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
}
.skip:focus { top: 12px; }

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

/* Links: underline draws on hover */
.link {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 1px;
}
.nav-links .link, .foot-links .link { background-size: 0 1px; }
@media (hover: hover) and (pointer: fine) {
  .nav-links .link, .foot-links .link { transition: background-size 220ms var(--ease-out); }
  .nav-links .link:hover, .foot-links .link:hover { background-size: 100% 1px; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--red); color: var(--on-red); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 15px; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: #C2310F; }
  .btn-ghost:hover { border-color: var(--ink); }
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-row {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}
.logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
}
.logo svg { height: 22px; width: auto; display: block; }
.nav nav { margin-left: auto; }
.nav-links { display: flex; gap: 28px; font-size: 15px; color: var(--muted); }
.nav-links a { display: inline-block; padding-block: 12px 2px; background-position: 0 calc(100% - 0px); }
.nav-links a:hover { color: var(--ink); }

/* Hero */
.hero { padding-block: clamp(56px, 9vw, 112px) clamp(72px, 10vw, 128px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 24px;
}
.lede {
  margin-top: 24px;
  font-size: clamp(18px, 1.6vw, 20px);
  line-height: 1.5;
  color: var(--muted);
  max-width: 34em;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 36px;
}
.fine { font-size: 14px; color: var(--muted); }
.hero-copy .fine { margin-top: 16px; }

/* The sheet: a marked-up page */
.sheet {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: clamp(24px, 3vw, 36px);
  box-shadow: 0 1px 0 var(--line), 0 24px 48px -32px rgba(20, 20, 19, 0.18);
}
.sheet-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.rules { display: grid; gap: 6px; }
.rule {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 2px;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.3;
  border: 1px solid var(--line-strong);
}
.rule-1 { background: var(--red); border-color: var(--red); color: var(--on-red); width: 100%; }
.rule-2 { width: 88%; }
.rule-3 { width: 70%; }
.rule-n { font-family: var(--mono); font-size: 13px; opacity: 0.75; font-weight: 400; }
.sheet-rule { height: 1px; background: var(--line); margin: 28px 0; }
.score {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.score li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 3px solid var(--ink);
  font-size: 14px;
  color: var(--muted);
}
.score b { font-weight: 500; font-size: 22px; color: var(--ink); letter-spacing: -0.02em; }
.sheet-foot { margin-top: 28px; font-size: 14px; color: var(--muted); line-height: 1.5; }

/* Sections */
.band {
  padding-block: var(--space);
  border-top: 1px solid var(--line);
}
.head { max-width: 680px; margin-bottom: clamp(40px, 5vw, 64px); }
.sub { margin-top: 16px; color: var(--muted); font-size: 18px; line-height: 1.55; max-width: 36em; }
.sub + .sub { margin-top: 12px; }

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

/* Deliverable */
.parts { display: grid; counter-reset: part; border-top: 1px solid var(--line); }
.parts li {
  display: grid;
  grid-template-columns: 32px 120px minmax(0, 1fr);
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: part;
}
.parts li::before {
  content: counter(part, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  padding-top: 3px;
}
.parts b { font-weight: 500; }
.parts span { color: var(--muted); }

.entry {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: clamp(24px, 3vw, 32px);
}
.fields { display: grid; }
.fields div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.fields dt { font-family: var(--mono); font-size: 13px; padding-top: 2px; }
.fields dd { color: var(--muted); }
.fields div:first-child dt { color: var(--red); }

/* Checks */
.areas {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--ink);
}
.area { padding: 20px 24px 0 0; }
.area + .area { padding-left: 24px; border-left: 1px solid var(--line); }
.area h3 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}
.area h3 span { font-family: var(--mono); font-size: 13px; color: var(--muted); font-weight: 400; }
.area li {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
}
.steps li { border-top: 1px solid var(--ink); padding-top: 20px; }
.step-n { display: block; font-family: var(--mono); font-size: 13px; color: var(--red); margin-bottom: 20px; }
.steps h3 { margin-bottom: 10px; }
.steps p { color: var(--muted); font-size: 16px; }
#order .actions { margin-top: clamp(40px, 5vw, 64px); }

/* Free: the one ink band */
.band-ink { background: var(--ink); color: var(--paper); border-top: 0; }
.band-ink .sub, .band-ink .fine { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.band-ink :focus-visible { outline-color: var(--paper); }
.free-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: end;
}
.free-actions { display: grid; gap: 16px; justify-items: start; }

/* About */
.ledger { border-top: 1px solid var(--ink); }
.ledger div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.ledger dt { color: var(--muted); }
.ledger dd {
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.ledger .ledger-note { border-bottom: 0; }
.ledger .ledger-note dt, .ledger .ledger-note dd {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  padding: 14px 0;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
@media (hover: hover) and (pointer: fine) {
  .faq summary { transition: color 160ms ease; }
  .faq summary:hover { color: var(--red); }
}
.faq summary::after {
  content: "";
  flex: none;
  width: 11px;
  height: 11px;
  background:
    linear-gradient(currentColor, currentColor) center / 11px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 11px no-repeat;
  transition: transform 200ms var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { padding: 0 0 20px; color: var(--muted); max-width: 36em; }

/* Close */
.close {
  padding-block: var(--space);
  border-top: 1px solid var(--line);
  text-align: center;
}
.close h2 { font-size: clamp(36px, 5vw, 60px); letter-spacing: -0.03em; }
.close .actions { justify-content: center; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding-block: 32px; }
.foot-row { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 24px; font-size: 15px; }
.foot-links a { display: inline-block; padding-block: 12px 2px; }
.foot .fine { margin-left: auto; }

/* Entrance: once, on load */
@media (prefers-reduced-motion: no-preference) {
  [data-enter] { animation: enter 600ms var(--ease-out) both; }
  [data-enter]:nth-child(2) { animation-delay: 60ms; }
  [data-enter]:nth-child(3) { animation-delay: 120ms; }
  [data-enter]:nth-child(4) { animation-delay: 180ms; }
  [data-enter]:nth-child(5) { animation-delay: 240ms; }
  .sheet { animation: enter 700ms var(--ease-out) 120ms both; }
  .rule { animation: mark 700ms var(--ease-out) both; }
  .rule-1 { animation-delay: 420ms; }
  .rule-2 { animation-delay: 500ms; }
  .rule-3 { animation-delay: 580ms; }
  .score li { animation: enter 500ms var(--ease-out) both; }
  .score li:nth-child(1) { animation-delay: 680ms; }
  .score li:nth-child(2) { animation-delay: 720ms; }
  .score li:nth-child(3) { animation-delay: 760ms; }
  .score li:nth-child(4) { animation-delay: 800ms; }
}
@keyframes enter {
  from { opacity: 0; transform: translateY(10px); }
}
@keyframes mark {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

/* Tablet */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav nav { display: none; }
  .nav .btn { margin-left: auto; }
  .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .area:nth-child(3) { padding-left: 0; border-left: 0; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
}

@media (max-width: 860px) {
  .hero-grid, .split, .free-grid { grid-template-columns: minmax(0, 1fr); }
  .free-grid { align-items: start; }
}

/* Phone */
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .logo svg { height: 20px; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn { width: 100%; }
  #order .actions { align-items: center; }
  .free-actions { justify-items: stretch; }
  .free-actions .btn { width: 100%; }
  .rule-2, .rule-3 { width: 100%; }
  .score { grid-template-columns: repeat(2, 1fr); row-gap: 16px; }
  .parts li { grid-template-columns: 28px minmax(0, 1fr); }
  .parts li span { grid-column: 2; }
  .fields div { grid-template-columns: 80px minmax(0, 1fr); }
  .areas, .steps { grid-template-columns: minmax(0, 1fr); }
  .area, .area + .area { padding: 20px 0 0; border-left: 0; }
  .area + .area { border-top: 1px solid var(--ink); }
  .areas { row-gap: 32px; }
  .foot-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .foot .fine { margin-left: 0; }
}
