/* Portal Meter: the shared system for the landing page and the live page.
   The world is a postage meter: credit loaded once, every call franked with a signed mark, the batch sent under one
   manifest. Franking ink (Portaldot pink) on cool mail stock; in dark mode the sorting room under UV light, where the
   ink glows. Tokens first; every colour, size, radius and duration below comes from here. */
@font-face {
  font-family: "Archivo";
  src: url(fonts/archivo-latin.woff2) format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  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: "Martian Mono";
  src: url(fonts/martianmono-latin.woff2) format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-style: normal;
  font-display: swap;
  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;
}
/* metric-matched fallbacks, so the swap to the web font barely moves text */
@font-face { font-family: "Archivo Fallback"; src: local("Arial"), local("Liberation Sans"), local("Arimo"), local("Helvetica"); size-adjust: 100%; ascent-override: 88%; descent-override: 21%; line-gap-override: 0%; }
@font-face { font-family: "Mono Fallback"; src: local("Courier New"), local("Liberation Mono"), local("Cousine"), local("Menlo"); size-adjust: 104%; ascent-override: 96%; descent-override: 28%; line-gap-override: 0%; }

:root {
  /* colour: mail stock, navy ink, franking pink, postal blue */
  --bg: #f4f6f9;
  --bg-2: #e9edf3;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --line: #dce1e9;
  --line-2: #c5ccd8;
  --ink: #111a30;
  --ink-2: #34405a;
  --muted: #485267;
  --accent: #e6007a;
  --accent-hover: #c8006a;
  --accent-text: #c4006a;
  --accent-ink: #ffffff;
  --accent-soft: #fde8f2;
  --accent-line: #f1b4d2;
  --post: #1f4fd6;
  --post-soft: #e5ebfb;
  --ok: #0b7a42;
  --ok-soft: #e3f3ea;
  --bad: #c0262d;
  --bad-soft: #fcecec;
  --bar: #c5ccd8;
  --term-bg: #0e1427;
  --term-line: #232c45;
  --term-ink: #e8ebf3;
  --term-muted: #8e98b0;
  --term-accent: #ff5aa8;
  --term-ok: #4fd18b;
  --glow: 0 0 0 transparent;
  --ink-glow: none;
  --shadow: 0 1px 2px rgba(17, 26, 48, 0.05), 0 8px 24px -10px rgba(17, 26, 48, 0.14);
  --shadow-lg: 0 2px 4px rgba(17, 26, 48, 0.05), 0 30px 60px -24px rgba(17, 26, 48, 0.28);
  --grid-dot: rgba(17, 26, 48, 0.08);
  /* type */
  --display: "Archivo", "Archivo Fallback", system-ui, sans-serif;
  --sans: "Archivo", "Archivo Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Martian Mono", "Mono Fallback", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --t-12: 0.8125rem;
  --t-14: 0.875rem;
  --t-16: 1rem;
  --t-18: 1.125rem;
  --t-20: 1.25rem;
  --t-28: 1.75rem;
  --t-40: 2.5rem;
  --t-56: 3.5rem;
  /* space */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;
  /* shape: sharp, a developer tool; the meter mark is square-cornered */
  --r: 10px;
  --r-sm: 6px;
  --r-xs: 4px;
  /* motion */
  --d-1: 120ms; --d-2: 240ms; --d-3: 420ms;
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-exit: cubic-bezier(0.5, 0, 0.75, 0);
  --ease-move: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-stamp: cubic-bezier(0.12, 0.9, 0.2, 1); /* a stamp lands fast and stops dead: no overshoot */
  --gutter: 80px;
  --maxw: 1280px;
  --nav-h: 64px;
  color-scheme: light;
}
/* the sorting room under UV: the same tokens, twice (system preference, then the remembered toggle) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0d19; --bg-2: #0f1324; --surface: #121a2e; --surface-2: #161f36; --line: #232c45; --line-2: #313c5c;
    --ink: #eef1f8; --ink-2: #c4cbdc; --muted: #a4aec4;
    --accent: #ff4fa3; --accent-hover: #ff74b7; --accent-text: #ff6cb2; --accent-ink: #14040c; --accent-soft: #2a0f22; --accent-line: #6a2450;
    --post: #6f9bff; --post-soft: #16214a; --ok: #45d08a; --ok-soft: #0d2619; --bad: #ff6b6b; --bad-soft: #2b1213; --bar: #313c5c;
    --term-bg: #070a14; --term-line: #232c45;
    --glow: 0 0 22px rgba(255, 79, 163, 0.38);
    --ink-glow: 0 0 14px rgba(255, 79, 163, 0.55);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 28px -10px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.5), 0 30px 60px -24px rgba(0, 0, 0, 0.8);
    --grid-dot: rgba(238, 241, 248, 0.07);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0d19; --bg-2: #0f1324; --surface: #121a2e; --surface-2: #161f36; --line: #232c45; --line-2: #313c5c;
  --ink: #eef1f8; --ink-2: #c4cbdc; --muted: #a4aec4;
  --accent: #ff4fa3; --accent-hover: #ff74b7; --accent-text: #ff6cb2; --accent-ink: #14040c; --accent-soft: #2a0f22; --accent-line: #6a2450;
  --post: #6f9bff; --post-soft: #16214a; --ok: #45d08a; --ok-soft: #0d2619; --bad: #ff6b6b; --bad-soft: #2b1213; --bar: #313c5c;
  --term-bg: #070a14; --term-line: #232c45;
  --glow: 0 0 22px rgba(255, 79, 163, 0.38);
  --ink-glow: 0 0 14px rgba(255, 79, 163, 0.55);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 28px -10px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.5), 0 30px 60px -24px rgba(0, 0, 0, 0.8);
  --grid-dot: rgba(238, 241, 248, 0.07);
  color-scheme: dark;
}
@media (max-width: 1279px) { :root { --gutter: 48px; } }
@media (max-width: 1023px) { :root { --gutter: 32px; } }
@media (max-width: 640px) { :root { --gutter: 16px; --nav-h: 56px; } }

/* page-to-page: the header and the buy box carry across (Chromium; elsewhere a normal navigation) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 260ms; animation-timing-function: var(--ease-move); }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-16);
  line-height: 1.6;
  font-weight: 400;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 700; color: var(--ink); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
.prose a, a.link { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--accent-line); transition: text-decoration-color var(--d-1) var(--ease-move), color var(--d-1) var(--ease-move); }
.prose a:hover, a.link:hover { text-decoration-color: currentColor; }
code, kbd, .mono { font-family: var(--mono); font-size: 0.8em; font-stretch: 87.5%; font-variant-ligatures: none; letter-spacing: -0.01em; }
:not(pre) > code { background: var(--bg-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: var(--r-xs); color: var(--ink-2); overflow-wrap: anywhere; }
b, strong { font-weight: 650; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
html { scrollbar-color: var(--line-2) var(--bg); }
@media (max-width: 640px) { .hide-sm { display: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 0; top: 8px; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { width: auto; height: auto; clip-path: none; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); z-index: 40; }
.wrap { width: min(var(--maxw), 100% - 2 * var(--gutter)); margin-inline: auto; padding: 0; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- nav: fixed, opaque, one hairline */
.nav { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); view-transition-name: site-nav; }
.nav .wrap { display: flex; align-items: center; gap: var(--s-5); height: var(--nav-h); position: relative; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 750 1.125rem/1 var(--display); font-stretch: 82%; letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; color: var(--accent); flex: none; filter: drop-shadow(var(--ink-glow, 0 0 0 transparent)); }
.nav-links { display: flex; gap: 2px; margin-left: var(--s-4); }
.nav-links a { position: relative; font-size: 0.9375rem; font-weight: 500; color: var(--ink-2); padding: 8px 10px; border-radius: var(--r-xs); white-space: nowrap; transition: color var(--d-1) var(--ease-move); }
.nav-links a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 3px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform var(--d-2) var(--ease-enter); }
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: var(--s-3); }
@media (max-width: 980px) { .nav-links { display: none; } }

/* the light / dark switch: one button, remembered */
.theme-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; padding: 0;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); cursor: pointer;
  transition: border-color var(--d-1) var(--ease-move), transform var(--d-1) var(--ease-move), background-color var(--d-2) var(--ease-move);
}
.theme-btn:hover { border-color: var(--ink-2); }
.theme-btn:active { transform: scale(0.94); }
.theme-btn svg { width: 18px; height: 18px; transition: transform var(--d-3) var(--ease-enter), opacity var(--d-2) var(--ease-move); }
.theme-btn .i-moon { position: absolute; }
.theme-btn { position: relative; }
.theme-btn .i-sun { opacity: 0; transform: rotate(-90deg) scale(0.6); }
:root[data-theme="dark"] .theme-btn .i-sun { opacity: 1; transform: none; }
:root[data-theme="dark"] .theme-btn .i-moon { opacity: 0; transform: rotate(90deg) scale(0.6); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { opacity: 1; transform: none; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { opacity: 0; transform: rotate(90deg) scale(0.6); }
}
html:not(.js) .theme-btn { display: none; }

/* ---------------------------------------------------------------- buttons: a stamp: it steps down on hover and presses on click */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: var(--r-sm);
  font: 600 var(--t-16)/1 var(--sans); letter-spacing: 0; white-space: nowrap; cursor: pointer;
  border: 1px solid transparent; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--d-1) var(--ease-move), border-color var(--d-1) var(--ease-move), color var(--d-1) var(--ease-move), box-shadow var(--d-2) var(--ease-move), transform var(--d-1) var(--ease-move);
}
.btn svg { width: 18px; height: 18px; flex: none; transition: transform var(--d-2) var(--ease-enter); }
.btn:hover svg { transform: translateX(3px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 55%, #000), var(--glow); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(1px); box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 55%, #000), var(--glow); }
.btn-primary:active { transform: translateY(2px) scale(0.985); box-shadow: 0 0 0 color-mix(in srgb, var(--accent) 55%, #000); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: 0 2px 0 var(--line); }
.btn-secondary:hover { border-color: var(--ink-2); transform: translateY(1px); box-shadow: 0 1px 0 var(--line); }
.btn-secondary:active { transform: translateY(2px) scale(0.985); box-shadow: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-sm { height: 40px; padding: 0 16px; font-size: 0.9375rem; }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); }

/* small icon button (copy, pause) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none;
  border-radius: var(--r-xs); border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; padding: 0;
  transition: color var(--d-1) var(--ease-move), border-color var(--d-1) var(--ease-move), background-color var(--d-1) var(--ease-move), transform var(--d-1) var(--ease-move);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn .i-done { display: none; color: var(--ok); }
.icon-btn.copied .i-copy { display: none; }
.icon-btn.copied .i-done { display: block; }
html:not(.js) .js-only { display: none !important; }

/* ---------------------------------------------------------------- shared bits */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 500 var(--t-14)/1.2 var(--sans); color: var(--muted); }
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: var(--t-14); line-height: 1.2;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bar); flex: none; }
.dot.ok, .live .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.down .dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.hash { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.hash .h { font-family: var(--mono); font-size: 0.8125rem; font-stretch: 87.5%; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ico { width: 18px; height: 18px; flex: none; }

/* sections (the live page uses these; the landing page has its own rhythm) */
.section { padding: var(--s-9) 0; border-top: 1px solid var(--line); }
.section-head { display: grid; gap: var(--s-4); max-width: 880px; margin-bottom: var(--s-7); }
.section-head h2 { font-size: var(--t-40); line-height: 1.05; letter-spacing: -0.02em; font-stretch: 78%; text-wrap: balance; }
.section-head p { font-size: var(--t-18); line-height: 1.55; color: var(--ink-2); max-width: 64ch; }
@media (max-width: 640px) {
  .section { padding: var(--s-8) 0; }
  .section-head { margin-bottom: var(--s-6); }
  .section-head h2 { font-size: var(--t-28); line-height: 1.1; }
  .section-head p { font-size: var(--t-16); }
}

/* footer */
.foot { border-top: 1px solid var(--line); padding: var(--s-7) 0 var(--s-8); color: var(--muted); font-size: var(--t-14); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-6); align-items: center; justify-content: space-between; }
.foot .brand { font-size: 1rem; }
.foot .brand-mark { width: 22px; height: 22px; }
.foot-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.foot-links a { color: var(--ink-2); }
.foot-links a:hover { color: var(--accent-text); }

@media (prefers-reduced-motion: reduce) {
  .btn, .btn:hover, .btn:active, .icon-btn:active, .theme-btn:active { transform: none; }
  .btn:hover svg { transform: none; }
  body { transition: none; }
  .theme-btn svg, .nav-links a::after { transition: none; }
}
