/* NAADI Engineering's websites: naadi.engineering and naadi.systems.
   The look is the NAADI Design System: warm frosted glass over a peach-to-grey wash, one night
   card on each page, Sora for every word. The colours are copied from its tokens.json.
   Light and dark: Auto follows the device. theme.js sets data-theme before the page is drawn. */

@font-face {
  font-family: "Sora";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("fonts/sora-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("fonts/sora-latin.woff2") format("woff2");
  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;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;
  --wash-warm: #e4b69d;
  --wash-soft: #e8c8ac;
  --wash-cool: #bbbbbb;
  --glass: #ffffff59;
  --glass-raised: #ffffff9e;
  --glass-edge: #ffffffb8;
  --surface: #fdffff;
  --surface-sunken: #f5f5f5;
  --ink: #151e2f;
  --ink-muted: #544b4c;
  --hairline: #151e2f1f;
  --control-border: #7a6f70;
  --focus: #151e2f;
  --action: #1a1a1a;
  --on-action: #ffffff;
  --amber: #eb9955;
  --on-amber: #1a1a1a;
  --mauve: #b88899;
  --ember: #ce6239;
  --ember-text: #8a3415;
  --track: #d4cec9;
  --night: #1a1a1a;
  --night-glow: #804e26;
  --night-edge: #ffffff1f;
  --on-night: #ffffff;
  --on-night-muted: #b8aea7;
  --verified: #0b5c68;
  --denied: #8f1f2b;
  --caution: #6e4a00;
  --shadow-card: 0 8px 32px #6b4a3424;
  --shadow-night: 0 24px 48px #2a1a1040;

  --font-sans: "Sora", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-7: 30px; --space-8: 40px;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 24px; --radius-xl: 32px; --radius-full: 999px;
  --blur-glass: 24px;
  --motion-control: 120ms;
}

/* Dark, chosen by the person, or by the device when the choice is Auto. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --wash-warm: #3b2a20;
  --wash-soft: #2a211d;
  --wash-cool: #131316;
  --glass: #ffffff0d;
  --glass-raised: #ffffff17;
  --glass-edge: #ffffff2b;
  --surface: #26242a;
  --surface-sunken: #1c1b1f;
  --ink: #f5efe9;
  --ink-muted: #c9bdb5;
  --hairline: #ffffff1f;
  --control-border: #a0958f;
  --focus: #f7c08c;
  --action: #f5efe9;
  --on-action: #1a1a1a;
  --mauve: #c99aab;
  --ember: #e47f52;
  --ember-text: #f4ad83;
  --track: #ffffff24;
  --night: #0e0d0f;
  --night-edge: #ffffff29;
  --verified: #7fd4e0;
  --denied: #ffa79c;
  --caution: #f2c46b;
  --shadow-card: 0 8px 32px #00000059;
  --shadow-night: 0 24px 48px #00000080;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --wash-warm: #3b2a20;
    --wash-soft: #2a211d;
    --wash-cool: #131316;
    --glass: #ffffff0d;
    --glass-raised: #ffffff17;
    --glass-edge: #ffffff2b;
    --surface: #26242a;
    --surface-sunken: #1c1b1f;
    --ink: #f5efe9;
    --ink-muted: #c9bdb5;
    --hairline: #ffffff1f;
    --control-border: #a0958f;
    --focus: #f7c08c;
    --action: #f5efe9;
    --on-action: #1a1a1a;
    --mauve: #c99aab;
    --ember: #e47f52;
    --ember-text: #f4ad83;
    --track: #ffffff24;
    --night: #0e0d0f;
    --night-edge: #ffffff29;
    --verified: #7fd4e0;
    --denied: #ffa79c;
    --caution: #f2c46b;
    --shadow-card: 0 8px 32px #00000059;
    --shadow-night: 0 24px 48px #00000080;
  }
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--space-6); }
body {
  margin: 0;
  min-height: 100vh;
  font: 400 15px/24px var(--font-sans);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background:
    radial-gradient(60% 50% at 0% 0%, var(--wash-warm), transparent 70%),
    radial-gradient(50% 40% at 85% 12%, var(--wash-soft), transparent 70%),
    var(--wash-cool);
  background-attachment: fixed;
}
h1, h2, h3, h4 { margin: 0; font-weight: 500; text-wrap: balance; }
h1 { font-size: 46px; line-height: 52px; letter-spacing: -0.02em; }
h2 { font-size: 24px; line-height: 32px; letter-spacing: -0.01em; }
h3 { font-size: 16px; line-height: 24px; font-weight: 600; }
h4 { font-size: 15px; line-height: 24px; font-weight: 600; }
p { margin: 0; }
h1 + p, h2 + p, h2 + ul, h2 + dl { margin-top: var(--space-3); }
h1 + .lead { margin-top: var(--space-4); }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.night :focus-visible { outline-color: var(--on-night); }
code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--surface-sunken);
  overflow-wrap: anywhere;
}
.muted { color: var(--ink-muted); }

.skip {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--action);
  color: var(--on-action);
}
.skip:focus { top: var(--space-4); }

/* ---------- Frame ---------- */

.wrap { width: 100%; max-width: 68rem; margin: 0 auto; padding-inline: var(--space-4); }
.top {
  position: sticky;
  top: var(--space-3);
  z-index: 5;
  margin-top: var(--space-3);
}
.top-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  background: var(--glass-raised);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(var(--blur-glass));
  backdrop-filter: blur(var(--blur-glass));
}
.logo { display: inline-flex; align-items: center; gap: var(--space-3); text-decoration: none; flex: none; }
.logo svg { display: block; height: 36px; width: auto; }
.logo-stop-1 { stop-color: var(--mauve); }
.logo-stop-2 { stop-color: var(--amber); }
.logo-stop-3 { stop-color: var(--ember); }
.logo-ink { fill: var(--ink); }
.logo-word { font-size: 14px; font-weight: 500; color: var(--ink-muted); }
.nav { display: flex; gap: var(--space-1); margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--hairline); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); }

/* The theme switch: Auto, Light, Dark. It shows only when scripts run. */
.theme { display: none; flex: none; gap: 2px; padding: 3px; border-radius: var(--radius-full); background: var(--hairline); }
.js .theme { display: inline-flex; }
.theme button {
  min-width: 44px;
  min-height: 38px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-full);
  background: none;
  color: var(--ink-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.theme button[aria-pressed="true"] { background: var(--surface); color: var(--ink); }

main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); padding-block: var(--space-8) var(--space-6); }

/* ---------- Surfaces ---------- */

.glass {
  border-radius: var(--radius-lg);
  background: var(--glass-raised);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(var(--blur-glass));
  backdrop-filter: blur(var(--blur-glass));
  padding: var(--space-7);
}
.night {
  border-radius: var(--radius-lg);
  background: radial-gradient(70% 90% at 100% 0%, var(--night-glow), transparent 60%), var(--night);
  color: var(--on-night);
  border: 1px solid var(--night-edge);
  box-shadow: var(--shadow-night);
  padding: var(--space-7);
}
.night .muted, .night p { color: var(--on-night-muted); }
.night strong, .night h2, .night h3 { color: var(--on-night); }
@media (prefers-reduced-transparency: reduce) {
  .glass, .top-bar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.overline { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ember-text); margin-bottom: var(--space-2); }
.night .overline { color: var(--amber); }
.lead { font-size: 18px; line-height: 30px; color: var(--ink-muted); max-width: 42rem; }
.stack > * + * { margin-top: var(--space-3); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-full);
  background: var(--action);
  color: var(--on-action);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity var(--motion-control);
}
.pill:hover { opacity: .88; }
.pill-quiet { background: var(--surface); color: var(--ink); border: 1px solid var(--hairline); }
.pill-amber { background: var(--amber); color: var(--on-amber); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }

.grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card { padding: var(--space-6); }
.card h3 { margin-bottom: var(--space-2); }
.card p { color: var(--ink-muted); }
.card .art { width: 56px; height: 56px; margin-bottom: var(--space-4); }
.card .art svg { display: block; width: 100%; height: 100%; }
a.card { display: block; text-decoration: none; transition: transform var(--motion-control); }
a.card:hover h3 { text-decoration: underline; text-underline-offset: 3px; }

.list-rows { list-style: none; margin: var(--space-4) 0 0; padding: 0; }
.list-rows li { display: flex; gap: var(--space-4); align-items: baseline; padding: var(--space-3) 0; border-top: 1px solid var(--hairline); }
.night .list-rows li { border-color: var(--night-edge); }
.list-rows strong { flex: none; min-width: 8rem; font-weight: 600; }

.partners-more { margin-top: var(--space-4); }
.hero { padding-block: var(--space-8); }
.facts { margin: var(--space-4) 0 0; }
.facts div { display: grid; grid-template-columns: 12rem 1fr; gap: var(--space-4); padding: var(--space-3) 0; border-top: 1px solid var(--hairline); }
.facts dt { color: var(--ink-muted); }
.facts dd { margin: 0; }

/* ---------- Footer ---------- */

.foot { padding-block: var(--space-6) var(--space-8); }
.foot-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-5) var(--space-6); }
.foot-card p, .foot-card a { font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: var(--space-4); }

/* ---------- Knowledgebase ---------- */

.kb { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.kb-side { position: sticky; top: 96px; padding: var(--space-5); max-height: calc(100vh - 112px); overflow: auto; }
.kb-side h2 { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-muted); margin-bottom: var(--space-2); }
.kb-side ol { list-style: none; margin: 0; padding: 0; }
.kb-side a { display: block; padding: 6px var(--space-3); border-radius: var(--radius-sm); font-size: 14px; color: var(--ink-muted); text-decoration: none; }
.kb-side a:hover { background: var(--hairline); color: var(--ink); }
.kb-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); min-width: 0; }
.kb-section { scroll-margin-top: 96px; }
.kb-section > h2 { margin-bottom: var(--space-4); }
.kb-section > * + * { margin-top: var(--space-4); }
.kb-section h3 { margin-top: var(--space-6); }
.kb-section p, .kb-section li { max-width: 46rem; }
.kb-section ul, .kb-section ol { padding-left: var(--space-5); }
.kb-section li + li { margin-top: var(--space-2); }
.simple {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.simple .n-art { width: 88px; flex: none; }
.simple .n-art svg { display: block; width: 100%; height: auto; }
.simple-label { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ember-text); }
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 21px; }
th, td { text-align: left; vertical-align: top; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--hairline); }
thead th { border-top: 0; font-weight: 600; color: var(--ink-muted); font-size: 13px; }
.pager { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }

@media (max-width: 860px) {
  .kb { grid-template-columns: minmax(0, 1fr); }
  .kb-side { position: static; max-height: none; }
}
@media (max-width: 720px) {
  .logo-word { display: none; }
  .top-bar { flex-wrap: wrap; border-radius: var(--radius-lg); padding: var(--space-2) var(--space-3); }
  .nav { order: 3; width: 100%; margin-left: 0; }
  .theme { margin-left: auto; }
}
@media (max-width: 560px) {
  h1 { font-size: 34px; line-height: 40px; }
  .glass, .night { padding: var(--space-6) var(--space-5); }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .list-rows li { flex-direction: column; gap: 2px; }
  .simple { flex-direction: column; align-items: flex-start; }
  .top { position: static; }
}

/* ---------- Pictures (from the NAADI Design System's components.css) ---------- */

.a-amber { fill: var(--amber); }
.a-mauve { fill: var(--mauve); }
.a-ember { fill: var(--ember); }
.a-soft { fill: var(--track); }
.a-dark { fill: var(--action); }
.a-stroke, .a-stroke-dark, .a-stroke-wide, .a-stroke-green { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.a-stroke { stroke: var(--ink-muted); }
.a-stroke-dark { stroke: var(--action); }
.a-stroke-wide { stroke: var(--action); stroke-width: 5; }
.a-stroke-green { stroke: var(--verified); stroke-width: 4; }
.a-paper { fill: var(--surface); }
.a-verified { fill: var(--verified); }
.a-denied { fill: var(--denied); }
.a-caution { fill: var(--caution); }
.a-dark-group { fill: var(--action); }
.a-stroke-amber, .a-stroke-ember, .a-stroke-paper, .a-line, .a-slash, .a-slash-under { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.a-stroke-amber { stroke: var(--amber); stroke-width: 5; }
.a-stroke-ember { stroke: var(--ember); stroke-width: 5; }
.a-stroke-paper { stroke: var(--surface); stroke-width: 6; }
.a-line { stroke: var(--action); stroke-width: 2.5; }
.a-slash { stroke: var(--denied); stroke-width: 6; }
.a-slash-under { stroke: var(--surface); stroke-width: 12; }

.n-diagram { --d-line: 1.5px; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; container-type: inline-size; }
.n-diagram-art { border-radius: var(--radius-md); background: var(--surface); padding: var(--space-3); }
.n-diagram svg { display: block; width: 100%; height: auto; }
.n-diagram .d-narrow { display: none; max-width: 440px; margin-inline: auto; }
.n-diagram .d-round { max-width: 540px; margin-inline: auto; }
@container (max-width: 560px) {
  .n-diagram .d-wide { display: none; }
  .n-diagram .d-narrow { display: block; }
  .n-diagram-art { padding: var(--space-2); }
}
.n-diagram-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.n-diagram figcaption { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.n-diagram text { font-family: var(--font-sans); text-anchor: middle; fill: var(--ink); }
.n-diagram .d-start { text-anchor: start; }
.n-diagram .d-title { font-size: 15px; font-weight: 600; }
.n-diagram .d-sub { font-size: 12.5px; fill: var(--ink-muted); }
.n-diagram .d-step { font-size: 12.5px; font-weight: 600; fill: var(--ember-text); }
.n-diagram .d-zone-title { font-size: 14px; font-weight: 600; text-anchor: start; }
.n-diagram .d-actor { font-size: 13.5px; font-weight: 600; }
.n-diagram .d-actor-small { font-size: 11px; }
.n-diagram .d-say { font-size: 13px; font-weight: 500; paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.n-diagram .d-say-you { font-weight: 600; fill: var(--ember-text); }
.n-diagram .d-say-no { font-weight: 600; fill: var(--denied); }
.n-diagram .d-tag { font-size: 12.5px; font-weight: 600; fill: var(--on-amber); }
.n-diagram .d-gate-text { font-size: 12.5px; font-weight: 600; }
.n-diagram .d-end { text-anchor: end; }
.d-zone-amber { fill: color-mix(in srgb, var(--amber) 16%, var(--surface)); }
.d-zone-mauve { fill: color-mix(in srgb, var(--mauve) 20%, var(--surface)); }
.d-zone-ember { fill: color-mix(in srgb, var(--ember) 14%, var(--surface)); }
.d-zone-plain { fill: color-mix(in srgb, var(--track) 34%, var(--surface)); }
.d-tile { fill: var(--surface); }
.d-tile-plain { fill: color-mix(in srgb, var(--track) 34%, var(--surface)); }
.d-tile-amber { fill: color-mix(in srgb, var(--amber) 30%, var(--surface)); }
.d-tile-mauve { fill: color-mix(in srgb, var(--mauve) 34%, var(--surface)); }
.d-tile-ember { fill: color-mix(in srgb, var(--ember) 26%, var(--surface)); }
.d-planned { fill: none; stroke: var(--control-border); stroke-width: var(--d-line); stroke-dasharray: 7 6; }
.d-disc { fill: color-mix(in srgb, var(--track) 42%, var(--surface)); }
.d-disc-amber { fill: color-mix(in srgb, var(--amber) 30%, var(--surface)); }
.d-disc-mauve { fill: color-mix(in srgb, var(--mauve) 36%, var(--surface)); }
.d-disc-ember { fill: color-mix(in srgb, var(--ember) 28%, var(--surface)); }
.d-link { fill: none; stroke: var(--control-border); stroke-width: var(--d-line); stroke-linecap: round; }
.d-link-planned { stroke-dasharray: 5 5; }
.d-link-you { stroke: var(--ember); }
.d-link-no { stroke: var(--denied); }
.d-head { fill: var(--control-border); stroke: var(--control-border); stroke-width: var(--d-line); stroke-linejoin: round; }
.d-head-you { fill: var(--ember); stroke: var(--ember); }
.d-head-no { fill: var(--denied); stroke: var(--denied); }
.d-lane { fill: none; stroke: var(--track); stroke-width: var(--d-line); stroke-linecap: round; }
.d-self { fill: color-mix(in srgb, var(--mauve) 26%, var(--surface)); }
.d-gate { fill: var(--surface); stroke: var(--control-border); stroke-width: var(--d-line); }
.d-band { fill: color-mix(in srgb, var(--amber) 24%, var(--surface)); }
.d-dot { fill: var(--ember); stroke: var(--surface); stroke-width: var(--d-line); }
.d-ring { fill: none; stroke: var(--ember); stroke-width: var(--d-line); }
.d-frame { fill: none; stroke: var(--action); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.d-floor { fill: none; stroke: var(--track); stroke-width: 4; stroke-linecap: round; }
.d-string { fill: none; stroke: var(--ink-muted); stroke-width: var(--d-line); }
.d-ghost { fill: none; stroke: var(--control-border); stroke-width: var(--d-line); stroke-dasharray: 5 5; }
.d-screen { fill: color-mix(in srgb, var(--track) 34%, var(--surface)); }

/* Moving parts sit on top of a finished drawing, so hiding them loses nothing. They stay
   hidden until the person presses Play, and always when the device asks for less motion. */
.d-motion { display: none; }
.motion-on .d-motion { display: inline; }
.play {
  display: none;
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--ink-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  flex: none;
}
.js .play { display: inline-flex; align-items: center; }
@media (prefers-reduced-motion: reduce) {
  .motion-on .d-motion, .js .play { display: none; }
  * { transition: none !important; }
}

/* ---------- Paper ---------- */

@media print {
  body { background: #fff; color: #000; }
  .top, .theme, .play, .skip, .kb-side { display: none !important; }
  .glass, .night { box-shadow: none; border: 1px solid #ccc; background: #fff; color: #000; -webkit-backdrop-filter: none; backdrop-filter: none; break-inside: avoid; }
  .night p, .night .muted, .night strong, .night h2, .night h3 { color: #000; }
  .kb { display: block; }
  a { text-decoration: none; }
}
