/* Shared styles for every page. Home-page sections live in home.css. */
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url(/assets/fonts/instrument-sans.woff2) format("woff2");
}

:root {
  /* Colour: one blue carries the brand; neutrals are tinted toward it. Amber marks finished work. */
  --bg: oklch(0.985 0.004 258);
  --surface: oklch(0.998 0.002 258);
  --surface-2: oklch(0.962 0.009 258);
  --text: oklch(0.23 0.035 264);
  --muted: oklch(0.46 0.03 262);
  --line: oklch(0.9 0.012 258);
  --accent: oklch(0.5 0.21 264);
  --accent-hover: oklch(0.44 0.21 264);
  --accent-text: oklch(0.99 0.005 258);
  --accent-soft: oklch(0.95 0.03 262);
  --field: oklch(0.36 0.17 266);          /* the blue field: header, hero, closing band */
  --field-text: oklch(0.985 0.008 258);
  --field-muted: oklch(0.88 0.04 262);
  --field-line: oklch(0.47 0.15 266);
  --amber: oklch(0.8 0.14 78);
  --ok: oklch(0.43 0.11 155); --ok-bg: oklch(0.95 0.035 155);
  --err: oklch(0.45 0.16 27); --err-bg: oklch(0.95 0.03 27);
  --info-bg: oklch(0.955 0.008 258);

  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-micro: 140ms;
  --dur-state: 240ms;
  --dur-enter: 560ms;
  --stagger: 60ms;

  --radius: 10px;
  --radius-lg: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.17 0.02 264);
    --surface: oklch(0.21 0.025 264);
    --surface-2: oklch(0.24 0.028 264);
    --text: oklch(0.94 0.008 258);
    --muted: oklch(0.73 0.022 260);
    --line: oklch(0.31 0.028 264);
    --accent: oklch(0.74 0.13 262);
    --accent-hover: oklch(0.8 0.11 262);
    --accent-text: oklch(0.18 0.05 266);
    --accent-soft: oklch(0.27 0.06 264);
    --field: oklch(0.31 0.15 266);
    --field-line: oklch(0.42 0.14 266);
    --ok: oklch(0.8 0.13 155); --ok-bg: oklch(0.26 0.04 155);
    --err: oklch(0.8 0.11 27); --err-bg: oklch(0.27 0.05 27);
    --info-bg: oklch(0.25 0.025 264);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--sans); -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); color: var(--text); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header: the blue field starts here on every page. */
header.site { background: var(--field); color: var(--field-text); }
header.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
header.site :focus-visible { outline-color: var(--field-text); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; color: var(--field-text); text-decoration: none; letter-spacing: -0.01em; }
.brand svg { width: 26px; height: 26px; color: var(--field-text); }
nav.main ul { display: flex; flex-wrap: wrap; gap: 4px 22px; list-style: none; margin: 0; padding: 0; }
nav.main a { color: var(--field-muted); text-decoration: none; padding: 6px 0; transition: color var(--dur-micro) ease; }
nav.main a[aria-current="page"] { color: var(--field-text); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
@media (hover: hover) { nav.main a:hover { color: var(--field-text); } }

main { padding: 56px 0 80px; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5vw, 3rem); font-stretch: 84%; font-weight: 650; line-height: 1.08; margin: 0 0 16px; letter-spacing: -0.02em; }
h2 { font-size: 1.55rem; font-stretch: 90%; font-weight: 650; line-height: 1.2; margin: 56px 0 12px; letter-spacing: -0.012em; scroll-margin-top: 24px; }
h3 { font-size: 1.08rem; font-weight: 650; margin: 0 0 6px; }
p { margin: 0 0 14px; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 40em; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.btn {
  font: inherit; font-weight: 550; display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; min-height: 44px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none; cursor: pointer; touch-action: manipulation;
  transition: background-color var(--dur-micro) ease, border-color var(--dur-micro) ease, transform var(--dur-micro) var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: .6; cursor: default; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 650; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { border-color: var(--accent); }
  .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
}

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; }
.card p:last-child { margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .97rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .88rem; }
tbody th { color: var(--text); font-size: inherit; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

details { border-bottom: 1px solid var(--line); padding: 14px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; color: var(--muted); max-width: 62ch; }

.stack { display: grid; gap: 14px; max-width: 420px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; white-space: nowrap; }
input[type=text], input[type=email], input[type=number] {
  font: inherit; width: 100%; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); min-height: 44px;
  transition: border-color var(--dur-micro) ease;
}
input:focus-visible { border-color: var(--accent); }
.msg { padding: 10px 14px; border-radius: var(--radius); margin: 10px 0 0; }
.msg-ok { background: var(--ok-bg); color: var(--ok); }
.msg-error { background: var(--err-bg); color: var(--err); }
.msg-info { background: var(--info-bg); color: var(--text); }
.balances { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.balances dt { color: var(--muted); font-size: .88rem; }
.balances dd { margin: 0; font-size: 1.7rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.packs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-bottom: 16px; }
.pack { display: grid; gap: 2px; text-align: left; justify-content: start; }
.pack strong { font-size: 1.2rem; }
.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.inline .field { flex: 1 1 180px; max-width: 260px; }
code.big { font: 700 1.6rem var(--mono); letter-spacing: .08em; background: var(--info-bg); padding: 6px 14px; border-radius: var(--radius); display: inline-block; }

footer.site { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: .92rem; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
footer.site a { color: var(--muted); }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
}
