/* ------------------------------------------------------------------
   Bonk HEN 14.00 · design tokens
   Palette sampled directly from the project avatar:
     mint #86E8DE (background) · yellow #FEFD67 (shirt) · brown #8F5D17 (hair)
     cream #F7D3A6 (skin) · near-black #14181A (outlines)
   Contrast measured: ink on mint 12.4:1, ink on yellow 16.6:1,
   ink on paper 17.9:1, muted on mint 6.7:1, brown on paper 5.6:1.
   Brown stays on paper or at large sizes; it is 3.9:1 on mint.
------------------------------------------------------------------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  /* colour */
  --mint: #86e8de;
  --mint-tint: #d8f6f1;
  --mint-line: #5ec6bb;
  --paper: #ffffff;
  --ink: #14181a;
  --ink-muted: #2e4a46;
  --yellow: #fefd67;
  --yellow-deep: #f2e84a;
  --brown: #8f5d17;
  --cream: #f7d3a6;
  --green: #0e6b57;
  --red: #8c1c1c;

  /* type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --fs-label: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-body: 1.0625rem;
  --fs-lead: 1.1875rem;
  --fs-h3: 1.1875rem;
  --fs-h2: 1.5625rem;
  --fs-h1: clamp(2.125rem, 1.4rem + 3vw, 3.25rem);
  --lh-body: 1.65;
  --lh-tight: 1.15;
  --track-display: -0.025em;

  /* space, 4px rhythm */
  --s-1: 0.25rem;
  --s0: 0.5rem;
  --s1: 0.75rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2rem;
  --s5: 3rem;
  --s6: 4.5rem;

  /* shape + motion */
  --r-card: 12px;
  --r-ctl: 8px;
  --r-pill: 999px;
  --hair: 1.5px;
  --edge: 2px;
  --lift-1: 3px 3px 0 rgba(20, 24, 26, 0.14);
  --lift-2: 5px 5px 0 rgba(20, 24, 26, 0.16);
  --t: 180ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --measure: 68ch;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--mint);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--yellow);
  color: var(--ink);
  padding: var(--s1) var(--s2);
  border: var(--edge) solid var(--ink);
  border-radius: var(--r-ctl);
  z-index: 20;
}
.skip:focus { left: var(--s2); top: var(--s2); }

.shell { max-width: 52rem; margin: 0 auto; padding: 0 var(--s2) var(--s6); }

/* ---------------------------------------------------------------- masthead */

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--mint);
  border-bottom: var(--edge) solid var(--ink);
}

.masthead-in {
  max-width: 52rem;
  margin: 0 auto;
  padding: var(--s1) var(--s2);
  display: flex;
  align-items: center;
  gap: var(--s1);
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 0.6875rem; text-decoration: none; }
.brand img { width: 40px; height: 41px; border: var(--edge) solid var(--ink); border-radius: 10px; display: block; }
.brand b { font-size: 0.9375rem; letter-spacing: -0.01em; display: block; line-height: 1.25; }
.brand span { font-size: var(--fs-label); color: var(--ink-muted); letter-spacing: 0.02em; display: block; }

.nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 2px; }

.nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.5rem;
  min-height: 44px;
  border-radius: var(--r-ctl);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.nav a:hover { background: var(--yellow); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--mint-tint); }

/* ---------------------------------------------------------------- headings */

h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-display);
  font-weight: 700;
  margin: var(--s5) 0 var(--s2);
  max-width: 24ch;
}

h2 {
  font-size: var(--fs-h2);
  line-height: 1.25;
  letter-spacing: -0.018em;
  font-weight: 650;
  margin: var(--s5) 0 var(--s1);
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  counter-increment: sec;
}

h2::before {
  content: counter(sec, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  background: var(--mint-tint);
  border: var(--hair) solid var(--mint-line);
  border-radius: var(--r-pill);
  padding: 0.1875rem 0.5rem;
  flex: none;
  transform: translateY(-0.25em);
}

body { counter-reset: sec; }

h3 {
  font-size: var(--fs-h3);
  line-height: 1.3;
  letter-spacing: -0.012em;
  font-weight: 620;
  margin: var(--s4) 0 var(--s0);
}

h3 code { font-size: 0.9375rem; }

p { margin: var(--s2) 0; max-width: var(--measure); }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-muted); max-width: 62ch; margin-top: var(--s1); }
ul, ol { padding-left: 1.25rem; max-width: var(--measure); }
li { margin: 0.375rem 0; }
li::marker { color: var(--ink-muted); }

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { background: var(--yellow); }

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

small, .fine { font-size: var(--fs-sm); color: var(--ink-muted); }
hr { border: 0; border-top: var(--hair) solid var(--mint-line); margin: var(--s4) 0; }

/* ---------------------------------------------------------------- surfaces */

.panel {
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: var(--r-card);
  box-shadow: var(--lift-1);
  padding: var(--s3);
  margin: var(--s3) 0;
}

.panel--cta { background: var(--yellow); box-shadow: var(--lift-2); }
.panel--flat { box-shadow: none; background: transparent; border-color: var(--mint-line); }
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

.notice {
  display: flex;
  gap: var(--s1);
  align-items: flex-start;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-left: 6px solid var(--brown);
  border-radius: var(--r-card);
  padding: var(--s2) var(--s3);
  margin: var(--s3) 0;
}
.notice--stop { border-left-color: var(--red); }
.notice--ok { border-left-color: var(--green); }
.notice svg { flex: none; margin-top: 3px; }
.notice p { margin: 0; }

.pill-row { display: flex; flex-wrap: wrap; gap: 0.4375rem; margin: var(--s3) 0 0; }

.pill {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  padding: 0.3125rem 0.625rem;
  border: var(--hair) solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--paper);
  white-space: nowrap;
}

.tag {
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border-radius: var(--r-pill);
  padding: 0.1875rem 0.5625rem;
}

/* ---------------------------------------------------------------- tables */

.table-wrap {
  margin: var(--s3) 0;
  overflow-x: auto;
  border: var(--edge) solid var(--ink);
  border-radius: var(--r-card);
  background: var(--paper);
  box-shadow: var(--lift-1);
  -webkit-overflow-scrolling: touch;
}

table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); line-height: 1.5; }

caption {
  text-align: left;
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: var(--s2) var(--s3) 0;
  caption-side: top;
}

thead th {
  text-align: left;
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--mint-tint);
  padding: 0.6875rem var(--s2);
  border-bottom: var(--edge) solid var(--ink);
  white-space: nowrap;
}

tbody th { text-align: left; font-weight: 600; }

td, tbody th { padding: 0.6875rem var(--s2); border-bottom: var(--hair) solid rgba(20, 24, 26, 0.12); vertical-align: top; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody tr:hover { background: rgba(134, 232, 222, 0.16); }

.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 0.8125rem; }
.hash { font-family: var(--mono); font-size: 0.75rem; line-height: 1.45; word-break: break-all; color: var(--ink-muted); }
.cell-title { font-weight: 600; color: var(--ink); }
.cell-sub { display: block; font-size: var(--fs-label); color: var(--ink-muted); font-weight: 400; }
code.inline, td code { font-family: var(--mono); font-size: 0.8125rem; background: var(--mint-tint); border-radius: 4px; padding: 0.0625rem 0.3125rem; }

/* ---------------------------------------------------------------- code */

pre {
  background: var(--ink);
  color: var(--mint-tint);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  padding: var(--s2) var(--s3);
  border-radius: var(--r-card);
  border: var(--edge) solid var(--ink);
  box-shadow: var(--lift-1);
  overflow-x: auto;
  margin: var(--s3) 0;
}
pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
kbd {
  font-family: var(--mono);
  font-size: 0.8125rem;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 0.0625rem 0.4375rem;
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.0625rem;
  min-height: 44px;
  background: var(--yellow);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 650;
  letter-spacing: -0.005em;
  border: var(--edge) solid var(--ink);
  border-radius: var(--r-ctl);
  box-shadow: var(--lift-1);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}
.btn:hover { background: var(--yellow-deep); transform: translate(-1px, -1px); box-shadow: var(--lift-2); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(20, 24, 26, 0.16); }
.btn--ghost { background: var(--paper); }
.btn--ghost:hover { background: var(--mint-tint); }
.btn svg { flex: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--s1); margin: var(--s3) 0; }

/* ---------------------------------------------------------------- forms */

.field { margin: var(--s3) 0; }
.field label { display: block; font-size: var(--fs-sm); font-weight: 620; margin-bottom: 0.375rem; }
.field .hint { display: block; font-size: var(--fs-label); color: var(--ink-muted); margin-top: 0.375rem; }

input[type="text"], select, textarea, input[type="file"] {
  width: 100%;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--ink);
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: var(--r-ctl);
  padding: 0.625rem 0.75rem;
  min-height: 44px;
}
textarea { min-height: 6.5rem; line-height: 1.55; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--yellow-deep); outline-offset: 1px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.25rem; }

.status { margin-top: var(--s2); font-size: var(--fs-sm); font-weight: 600; min-height: 1.5rem; }
.status--ok { color: var(--green); }
.status--err { color: var(--red); }

/* ---------------------------------------------------------------- footer */

.colophon {
  margin-top: var(--s6);
  padding-top: var(--s3);
  border-top: var(--edge) solid var(--ink);
  font-size: var(--fs-sm);
  color: var(--ink-muted);
}
.colophon p { margin: 0.375rem 0; }
.colophon a { color: var(--ink-muted); }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 40rem) {
  body { font-size: 1rem; }
  h1 { margin-top: var(--s4); }
  .nav { margin-left: 0; width: 100%; }
  .panel, .notice { padding: var(--s2); }
  thead th, td, tbody th { padding: 0.5625rem 0.6875rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .btn:hover, .btn:active { transform: none; }
}

@media print {
  .masthead, .btn-row, .skip { display: none; }
  body { background: #fff; }
  .panel, .table-wrap, pre { box-shadow: none; }
}
