@font-face { font-family: "Familjen Grotesk"; font-weight: 400 700; font-display: swap; src: url(/fonts/FamiljenGrotesk-Variable.woff2) format("woff2"); }
:root {
  --display: "Familjen Grotesk", var(--font);
  --surface: light-dark(oklch(99% 0.004 var(--h)), oklch(21% 0.014 var(--h)));
  --line: light-dark(oklch(85% 0.012 var(--h)), oklch(32% 0.016 var(--h)));
  --grid: light-dark(oklch(88% 0.012 var(--h)), oklch(30% 0.016 var(--h)));
  --glow: light-dark(oklch(92% 0.045 var(--h)), oklch(30% 0.05 var(--h)));
  --shadow: light-dark(0 1px 2px oklch(20% 0.02 var(--h) / .06), 0 1px 2px oklch(0% 0 0 / .5));
}
html { background: var(--bg); }
body { place-items: start center; position: relative; isolation: isolate; }
/* atmosphere: one soft wash in the page hue behind the hero, a faint horizon line lower down */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60rem 28rem at 50% -6rem, var(--glow), transparent 70%),
    radial-gradient(40rem 20rem at 50% 62%, color-mix(in oklch, var(--glow) 45%, transparent), transparent 70%); }
main { width: min(100%, 56rem); padding-block: .25rem 3rem; text-align: center; }
[hidden] { display: none !important; }

/* top bar: app name left, network status + menu right */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 0 0 2.25rem; }
.bar .site { font-family: var(--display); font-weight: 600; text-decoration: none; font-size: 1.0625rem; }
.bar .site span { color: var(--muted); font-weight: 400; }
.bar .right { display: flex; align-items: center; gap: 1.25rem; }
.live { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--display); font-weight: 600; font-size: 1.0625rem; }
.live i { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
.live small { font-family: var(--font); font-weight: 400; color: var(--muted); font-size: .9375rem; }
.menu-btn { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.menu-btn b { display: block; height: 2px; background: var(--fg); border-radius: 1px; }

h1 { font-family: var(--display); font-weight: 600; font-size: clamp(2rem, 1.5rem + 2.5vw, 3.25rem); line-height: 1.05; margin: 0 0 1.5rem; letter-spacing: -.01em; }

.ask { display: inline-flex; align-items: flex-end; gap: 1.25rem; flex-wrap: wrap; justify-content: center; }
.codewrap { position: relative; font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: clamp(4rem, 3rem + 6vw, 7rem); line-height: 1; letter-spacing: -.02em; width: 3.4ch; border-bottom: 3px solid var(--fg); }
.codewrap input { position: absolute; inset: 0; width: 100%; font: inherit; letter-spacing: inherit; text-align: center; padding: .05em 0 0;
  border: 0; background: none; color: transparent; caret-color: var(--fg); outline-offset: 6px; }
.codewrap input::placeholder { color: var(--muted); opacity: .35; }
.digits { display: flex; justify-content: center; padding: .05em 0 0; min-height: 1em; pointer-events: none; }
.ask button { font-family: var(--display); font-weight: 600; font-size: 1.125rem; background: var(--fg); color: var(--bg); border: 0; border-radius: 8px;
  padding: .7rem 1.4rem; min-height: 48px; margin-bottom: .5rem; transition: transform .12s ease, opacity .12s ease; }
.ask button:hover { opacity: .88; } .ask button:active { transform: scale(.97); }
.paste { margin: 1rem 0 0; font-size: 1rem; color: var(--muted); }
.paste summary { display: inline; cursor: pointer; }
.paste summary span { text-decoration: underline; text-underline-offset: .15em; }
.paste summary::before { content: "+"; font-family: var(--display); font-weight: 700; margin-right: .4rem; }
.paste[open] summary::before { content: "–"; }
.paste textarea { max-width: 36rem; margin: .75rem auto 0; }

/* the instrument */
.panel { position: relative; margin: 3rem auto 0; max-width: 52rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow), inset 0 1px 0 color-mix(in oklch, var(--bg) 60%, white 40%); padding: 1.25rem 1.5rem 1.5rem; text-align: left;
  background-image: radial-gradient(var(--grid) 1px, transparent 1.2px); background-size: 22px 22px; background-position: 11px 11px; }
@media (prefers-color-scheme: dark) { .panel { box-shadow: var(--shadow), inset 0 1px 0 oklch(100% 0 0 / .05); } }
.panel::before, .panel::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--fg); opacity: .5; }
.panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.panel::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }
.panel .row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: .9375rem; color: var(--muted); margin-bottom: .75rem; }
.panel .row b { font-family: var(--display); font-weight: 600; color: var(--fg); font-size: 1.0625rem; }
.panel .row .ray { font-family: var(--mono); font-size: .875rem; }
.fig svg { width: 100%; height: auto; display: block; overflow: visible; }
.fig .link { stroke: var(--line); stroke-width: 3; fill: none; stroke-linecap: round; }
.fig .flow { stroke: var(--fg); stroke-width: 3; fill: none; stroke-linecap: round; stroke-dasharray: 3 30; opacity: .55; }
.fig .ticks { stroke: var(--line); stroke-width: 1.5; }
.fig .ring { fill: none; stroke: var(--line); stroke-width: 1.5; }
.fig .node { fill: var(--surface); stroke: var(--fg); stroke-width: 3; cursor: pointer; transition: transform .2s ease; transform-box: fill-box; transform-origin: center; }
.fig .node:hover { transform: scale(1.15); }
.fig .lbl { font-family: var(--display); font-weight: 600; font-size: 20px; fill: var(--fg); }
.fig .sub { font-family: var(--font); font-size: 13px; fill: var(--muted); }
.fig .mark { font-family: var(--display); font-weight: 700; font-size: 22px; opacity: 0; transform-box: fill-box; transform-origin: center; }
.fig .dot { fill: var(--fg); }
.v .node.ok { stroke: var(--ok); fill: var(--ok); }
.v .node.bad { stroke: var(--down); stroke-width: 3.5; }
.v .link.ok { stroke: var(--fg); }
.v .link.bad { stroke: var(--down); stroke-dasharray: 7 7; }
.v .flow.bad { display: none; }
.v .mark { opacity: 1; animation: pop .35s cubic-bezier(.2,.7,.2,1) both; }
.v .mark.ok { fill: var(--ok); } .v .mark.bad { fill: var(--down); }
.v .lbl.bad { fill: var(--down); }
.v .ring.bad { stroke: var(--down); opacity: .35; }
@keyframes pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }

.verdict { font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem); line-height: 1.15; margin: 2rem 0 1.75rem; text-wrap: balance;
  animation: rise .5s .2s cubic-bezier(.2,.7,.2,1) both; }
.verdict .not { color: var(--muted); font-weight: 400; }
@keyframes rise { from { opacity: 0; transform: translateY(.5rem); } to { opacity: 1; transform: none; } }

/* page: /error — the instrument, the verdict, the cards. Tokens from base.css; tool-specific below. */
/* verdict block: statement, cause + wait, live check, actions — no accordions */
.result { max-width: 46rem; margin: 2rem auto 0; text-align: center; animation: rise .5s .15s cubic-bezier(.2,.7,.2,1) both; }
.verdict { font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem); line-height: 1.25; margin: 0 0 .6rem; text-wrap: balance; }
.verdict .not { color: var(--muted); font-weight: 400; }
.cause { font-size: 1.125rem; margin: 0 auto; max-width: 40rem; text-wrap: pretty; }
.cause b { font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: .6rem; margin: 1.1rem auto 0; padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .9375rem; }
.check i { width: 8px; height: 8px; border-radius: 50%; background: var(--down); flex: none; }
.check .host { font-family: var(--mono); font-size: .875rem; overflow-wrap: normal; }
@media (max-width: 640px) { .check { display: flex; flex-wrap: wrap; justify-content: center; text-align: center; border-radius: 12px; } }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin: 1.5rem 0 0; }
.actions button { font-family: var(--display); font-weight: 600; font-size: 1rem; min-height: 44px; padding: .55rem 1.1rem; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg); transition: border-color .15s ease, transform .12s ease; }
.actions button:hover { border-color: var(--fg); } .actions button:active { transform: scale(.98); }
.actions button.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
@keyframes rise { from { opacity: 0; transform: translateY(.5rem); } to { opacity: 1; transform: none; } }

/* overlay card for instructions */
dialog.card { margin: auto; width: min(100% - 2rem, 34rem); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--fg); padding: 1.5rem 1.75rem 1.75rem; text-align: left; box-shadow: 0 12px 32px oklch(10% 0.02 220 / .18); }
dialog.card::backdrop { background: oklch(10% 0.02 220 / .35); backdrop-filter: blur(3px); }
.card .head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.card h2 { font-family: var(--display); font-weight: 600; font-size: 1.375rem; margin: 0; }
.card .close { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--fg); font-size: 1.125rem; cursor: pointer; flex: none; }
.card ol { margin: 0; padding-left: 1.4rem; counter-reset: s; list-style: none; }
.card ol li { position: relative; padding: .55rem 0 .55rem .25rem; border-top: 1px solid var(--line); font-family: var(--display); font-weight: 600; font-size: 1.0625rem; }
.card ol li::before { counter-increment: s; content: counter(s); position: absolute; left: -1.4rem; top: .6rem; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.card ol li small { display: block; font-family: var(--font); font-weight: 400; color: var(--muted); font-size: .9375rem; margin-top: .1rem; }
.card ol li:last-child { border-bottom: 1px solid var(--line); }
.card .foot { margin: 1rem 0 0; font-size: .9375rem; color: var(--muted); }
.card .foot a { color: var(--fg); }

/* browse: the panel turns into that party's code grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .5rem; margin-top: .25rem; }
.grid a { display: block; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); text-decoration: none; transition: border-color .15s ease; }
.grid a:hover { border-color: var(--fg); }
.grid b { font-family: var(--display); font-weight: 700; font-size: 1.25rem; display: block; font-variant-numeric: tabular-nums; }
.grid small { display: block; color: var(--muted); font-size: .8125rem; line-height: 1.3; }
.panel .back { font: inherit; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .15em; }

/* idle entry points under the panel */
.entry { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 1.25rem auto 0; max-width: 46rem; }
.entry a { font-size: .9375rem; padding: .45rem .85rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: var(--surface); color: var(--fg); }
.entry a:hover { border-color: var(--fg); }

/* slim nav in the bar */
.bar nav { display: flex; gap: 1.25rem; font-family: var(--display); font-weight: 600; font-size: 1rem; }
.bar nav a { text-decoration: none; color: var(--muted); white-space: nowrap; } .bar nav a:hover, .bar nav a[aria-current] { color: var(--fg); }

footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .9375rem; color: var(--muted); text-align: center; }
footer a { margin: 0 .6rem; }

@media (max-width: 640px) {
  .bar { flex-wrap: wrap; margin-bottom: 1.75rem; }
  .bar .right { width: 100%; justify-content: space-between; flex-wrap: wrap; row-gap: .5rem; } .bar nav { gap: 1rem; }
  .live { white-space: nowrap; font-size: 1rem; } .live small { display: none; }
  .panel { margin-top: 2rem; padding: 1rem 1rem 1.25rem; }
  .panel .row { flex-direction: column; gap: .2rem; align-items: flex-start; }
  .fig svg { max-width: 22rem; margin: 0 auto; }
  .fig .lbl { font-size: 22px; }
}
@media (prefers-reduced-motion: no-preference) {
  .live i { animation: pulse 2.4s ease-out infinite; }
  @keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--ok) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 10px transparent; } }
  .fig .flow { animation: flow 1.8s linear infinite; }
  @keyframes flow { from { stroke-dashoffset: 33; } to { stroke-dashoffset: 0; } }
  .v .link.bad { animation: march 1.6s linear infinite; }
  @keyframes march { from { stroke-dashoffset: 28; } to { stroke-dashoffset: 0; } }
}
@media (prefers-reduced-motion: reduce) { .verdict, .v .mark { animation: none !important; } .fig .flow { display: none; } }

/* guides + text pages */
.prose { text-align: left; max-width: 40rem; margin: 0 auto; }
.prose h1 { text-align: left; font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem); }
.prose h2 { font-family: var(--display); font-weight: 600; font-size: 1.25rem; margin: 2rem 0 .5rem; }
.prose p, .prose li { font-size: 1.0625rem; }
.prose .kicker { color: var(--muted); margin: 0 0 1.5rem; }
.prose .box { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 1rem 1.25rem; margin: 1.5rem 0; }
.prose .box b { font-family: var(--display); }
.guides { list-style: none; padding: 0; margin: 1rem auto 0; max-width: 44rem; text-align: left; border-top: 1px solid var(--line); }
.guides li { border-bottom: 1px solid var(--line); }
.guides a { display: block; padding: 1rem .25rem; text-decoration: none; }
.guides a:hover b { text-decoration: underline; text-underline-offset: .15em; }
.guides b { font-family: var(--display); font-weight: 600; font-size: 1.25rem; display: block; }
.guides small { display: block; color: var(--muted); font-size: .9375rem; margin-top: .15rem; }
.all { max-width: 52rem; margin: 3.5rem auto 0; text-align: left; }
.all h2 { font-family: var(--display); font-weight: 600; font-size: 1.125rem; margin: 1.5rem 0 .5rem; }
.all h2 small { color: var(--muted); font-family: var(--font); font-weight: 400; font-size: .9375rem; margin-left: .5rem; }
.h1-code { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem); }
.bar .live.warn i { background: var(--warn); } .bar .live.down i { background: var(--down); }
/* "off" = not reached: the parties beyond the failure stay quiet */
.v .link.off { stroke: var(--line); } .v .flow.off, .v .flow.bad { display: none; }
.v .node.off { stroke: var(--muted); } .v .lbl.off { fill: var(--muted); } .v .mark.off { fill: var(--muted); }
.v .node.ok { stroke: var(--ok); fill: var(--ok); }
