/* ==========================================================================
   No Fault Design — core system
   Inter for everything, an Instrument Serif italic accent, neutral greys and
   the No Fault red-orange.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('../../fonts/inter/inter-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900; 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: 'Inter';
  src: url('../../fonts/inter/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900; font-style: normal; font-display: swap;
  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: 'Bricolage Grotesque'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url('../../fonts/bricolage/bricolage-grotesque-latin-opsz-normal.woff2') format('woff2-variations');
}
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('../../fonts/jetbrains/jetbrains-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('../../fonts/jetbrains/jetbrains-mono-latin-500-normal.woff2') format('woff2'); }
@font-face {
  font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('../../fonts/instrument-serif/instrument-serif-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../../fonts/instrument-serif/instrument-serif-latin-400-normal.woff2') format('woff2');
}

:root {
  /* The No Fault brand: neutral greys, near-black type and the No Fault orange. */
  --paper: #F5F5F5;
  --paper-2: #EFEFEF;
  --paper-3: #E5E5E5;
  --card: #FFFFFF;
  --ink: #171717;
  --ink-2: #262626;
  --mute: #737373;
  --faint: #A3A3A3;
  --rule: #E5E5E5;
  --rule-2: #D4D4D4;

  --signal: #FF4D3D;
  --signal-ink: #CC3326;
  --signal-soft: #FFE4E1;
  --signal-2: #FF6A5C;
  --note: #FF7A3D;
  --note-soft: rgb(255 122 61 / .12);
  --deep: #171717;
  --wave: radial-gradient(60% 70% at 15% 100%, rgb(255 77 61 / .32), transparent 70%), radial-gradient(50% 60% at 85% 85%, rgb(255 122 61 / .26), transparent 70%), radial-gradient(70% 60% at 50% 120%, rgb(23 23 23 / .12), transparent 70%);
  --cobalt: #2F4BFF;
  --jade: #0E9F6E;
  --marigold: #F2A900;
  --rose: #F0508C;
  --violet: #7A5CFF;
  --guide: #F0508C;
  --night: #171717;      /* surfaces that stay dark in every theme: tooltips, toasts */
  --on-night: #F5F5F5;

  --ok: #0B8A5F;
  --ok-soft: #DDF1E8;
  --warn: #9A6400;
  --warn-soft: #FBEFD2;
  --bad: #CC3326;
  --bad-soft: #FBE1D8;

  --f-display: 'Bricolage Grotesque', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --f-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-xs: 4px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --shadow-1: 0 1px 0 rgb(23 23 23 / .04), 0 2px 6px -2px rgb(23 23 23 / .08);
  --shadow-2: 0 1px 0 rgb(23 23 23 / .05), 0 18px 40px -18px rgb(23 23 23 / .28);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  color-scheme: light;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  font-feature-settings: 'cv11', 'ss01';
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video, iframe { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
h1, h2, h3, h4 { color: var(--ink); font-family: var(--f-display); font-weight: 600; line-height: 1.08; letter-spacing: -.015em; text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--signal); color: #fff; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
[hidden] { display: none !important; }
.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: 12px; top: -60px; z-index: 100; background: var(--night); color: var(--on-night); padding: 10px 14px; border-radius: var(--r-sm); }
.skip:focus { top: 12px; }

/* ---------- type ---------- */
.display { font-family: var(--f-display); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; color: var(--ink); }
.serif { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.display .serif, .h1 .serif, .h2 .serif { color: var(--signal); font-size: 1.08em; letter-spacing: -.02em; }
.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: .02em; font-weight: 400; font-variant-numeric: tabular-nums; }
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--signal-ink); display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow--signal { color: var(--signal-ink); }
.h1 { font-size: clamp(2.3rem, 5vw, 4rem); letter-spacing: -.035em; line-height: 1.05; }
.h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); letter-spacing: -.03em; line-height: 1.08; }
.h3 { font-size: clamp(1.25rem, 1.8vw, 1.5rem); letter-spacing: -.02em; }
.h4 { font-size: 1.08rem; letter-spacing: -.01em; }
.lede { font-size: clamp(1.05rem, 1.3vw, 1.2rem); line-height: 1.6; color: var(--mute); max-width: 52ch; }
.muted { color: var(--mute); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.strike { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--faint); }

.prose { color: var(--ink-2); font-size: 17px; line-height: 1.7; max-width: 68ch; }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3 { margin-top: 1.8em; font-size: 1.35rem; }
.prose h3 { font-size: 1.12rem; }
.prose h3 + *, .prose h2 + * { margin-top: .6em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .4em; }
.prose ul li::marker { content: '▪  '; color: var(--signal); }
.prose code { font-family: var(--f-mono); font-size: .82em; background: var(--paper-2); padding: .15em .4em; border-radius: var(--r-xs); }
.prose blockquote { border-left: 2px solid var(--signal); padding-left: 1em; font-family: var(--f-serif); font-style: italic; font-size: 1.25em; color: var(--ink); }
.prose a { color: var(--signal-ink); }
.prose strong { color: var(--ink); font-weight: 620; }

/* ---------- layout ---------- */
.wrap { width: min(100% - var(--gutter) * 2, var(--max)); margin-inline: auto; }
.wrap--narrow { width: min(100% - var(--gutter) * 2, 880px); margin-inline: auto; }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* ---------- icons ---------- */
.i {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter;
}
.i--sm { width: 15px; height: 15px; }
.i--lg { width: 22px; height: 22px; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.logo__mark { width: 34px; height: 34px; flex: none; border-radius: 50%; }
.logo__word { font-family: var(--f-display); font-weight: 700; letter-spacing: -.02em; font-size: 19px; line-height: 1; }
.logo__word span { font-weight: 500; color: var(--ink-2); }
.logo__word sup { font-size: .5em; font-weight: 500; margin-left: 1px; vertical-align: super; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--ink); --fg: var(--paper); --bd: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: 999px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--bd);
  font-weight: 500; font-size: 15.5px; letter-spacing: -.005em; text-decoration: none; white-space: nowrap;
  transition: background-color .3s, color .3s, border-color .3s, box-shadow .3s, transform .18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn .i { transition: transform .25s var(--ease); }
.btn:hover .i--go { transform: translateX(3px); }
.btn--signal { --bg: var(--signal); --fg: #fff; --bd: var(--signal); }
.btn--signal:hover { box-shadow: 0 0 0 6px var(--signal-soft), 0 10px 40px -8px rgb(255 77 61 / .55); }
.btn--ghost { --bg: transparent; --fg: var(--ink); --bd: var(--rule-2); }
.btn--ghost:hover { --bd: var(--ink); }
/* Text that rolls up to a copy of itself on hover. */
.roll { display: inline-block; overflow: hidden; height: 1.3em; line-height: 1.3em; }
.roll > span { display: block; transition: transform .45s var(--ease); }
.btn:hover .roll > span { transform: translateY(-100%); }
.btn--paper { --bg: var(--paper); --fg: var(--ink); --bd: var(--paper); }
.btn--danger { --bg: transparent; --fg: var(--bad); --bd: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn--danger:hover { --bg: var(--bad-soft); }
.btn--sm { height: 40px; padding: 0 16px; font-size: 14px; gap: 8px; }
.btn--xs { height: 30px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn--lg { height: 54px; padding: 0 26px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--icon { width: 36px; padding: 0; }
.btn[disabled], .btn.is-loading { opacity: .55; pointer-events: none; }
.link { color: var(--ink); font-weight: 520; text-decoration: underline; text-decoration-color: var(--rule-2); }
.link:hover { text-decoration-color: var(--signal); }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 560; color: var(--ink); text-decoration: none; }
.link-arrow:hover .i { transform: translate(2px, -2px); }
.link-arrow .i { transition: transform .2s var(--ease); }

/* ---------- forms ---------- */
.field { display: grid; gap: 7px; }
.field + .field { margin-top: 18px; }
.label { font-size: 13.5px; font-weight: 600; color: var(--ink); display: flex; justify-content: space-between; gap: 10px; }
.label .hint { text-transform: none; letter-spacing: 0; color: var(--faint); font-weight: 400; }
.input, .select, .textarea {
  width: 100%; height: 48px; padding: 0 14px;
  background: var(--card); border: 1px solid var(--rule-2); border-radius: var(--r-sm);
  font-size: 16px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.textarea { height: auto; min-height: 120px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.textarea--code { font-family: var(--f-mono); font-size: 13px; min-height: 340px; line-height: 1.7; }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 8 10 12.5 14.5 8' fill='none' stroke='%23171717' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--signal-soft); background-color: #fff; }
.input--sm, .select--sm { height: 38px; font-size: 14px; padding-inline: 11px; }
.select--sm { padding-right: 34px; background-position: right 8px center; }
.field-error { color: var(--bad); font-size: 13.5px; display: flex; gap: 6px; align-items: center; }
.has-error .input, .has-error .textarea, .has-error .select { border-color: var(--bad); }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--signal); }
.file-drop {
  display: grid; place-items: center; gap: 6px; padding: 22px; text-align: center; cursor: pointer;
  border: 1px dashed var(--rule-2); border-radius: var(--r); background: var(--paper);
  transition: border-color .15s, background .15s;
}
.file-drop:hover, .file-drop.is-over { border-color: var(--signal); background: var(--signal-soft); }
.file-drop input { position: absolute; opacity: 0; pointer-events: none; width: 1px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 32px; height: 32px; border-radius: 8px; background: var(--c); border: 1px solid rgb(0 0 0 / .1); cursor: pointer; transition: transform .15s; }
.swatch input:checked + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.swatch input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 2px; }

/* ---------- chips & badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border: 1px solid var(--rule-2); border-radius: 999px; background: var(--card);
  font-family: var(--f-mono); font-size: 12px; font-weight: 500; letter-spacing: .02em; color: var(--ink-2); white-space: nowrap;
}
.chip .i { width: 13px; height: 13px; }
.chip--ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip--signal { background: var(--signal); color: #fff; border-color: var(--signal); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 5px; font-family: var(--f-mono); font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; background: var(--paper-2); color: var(--ink-2); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--bad { background: var(--bad-soft); color: var(--bad); }
.badge--info { background: #E2E6FF; color: var(--cobalt); }
.badge--plain::before { display: none; }

/* ---------- surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); }
.card--pad { padding: clamp(18px, 2.4vw, 28px); }
.card--ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.card--ink h2, .card--ink h3 { color: var(--paper); }
.frame-label {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  font-size: 14px; color: var(--mute);
}
.frame-label .i { width: 13px; height: 13px; color: var(--faint); }
.frame-label b { font-weight: 500; color: var(--ink-2); }
.rule { border: 0; border-top: 1px solid var(--rule); }
.dotgrid { background-image: none; }

/* ---------- cover art ---------- */
.cover { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: inherit; }
.cover-frame { border-radius: var(--r); overflow: hidden; background: var(--paper-2); }

/* ---------- avatar ---------- */
.avatar {
  --size: 36px;
  width: var(--size); height: var(--size); flex: none; display: inline-grid; place-items: center;
  background: var(--c, var(--ink)); color: var(--fg, var(--paper));
  border-radius: 50%; font-weight: 650; font-size: calc(var(--size) * .38); letter-spacing: 0;
}
.avatar--xs { --size: 24px; }
.avatar--sm { --size: 30px; }
.avatar--lg { --size: 56px; }
.avatar--xl { --size: 84px; }

/* ---------- progress ---------- */
.progress { --p: 0; display: flex; align-items: center; gap: 12px; }
.progress__bar { flex: 1; height: 6px; background: var(--paper-3); border-radius: 99px; overflow: hidden; }
.progress__bar i { display: block; height: 100%; width: calc(var(--p) * 1%); background: var(--signal); border-radius: inherit; transition: width .8s var(--ease); }
.progress__pct { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); min-width: 4ch; text-align: right; }
.progress--done .progress__bar i { background: var(--jade); }

/* ---------- flash ---------- */
.flashes { position: fixed; z-index: 90; left: 50%; top: 64px; transform: translateX(-50%); display: grid; gap: 8px; width: min(520px, calc(100% - 32px)); }
.flash {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px 13px 16px;
  background: var(--night); color: var(--on-night); border-radius: var(--r); box-shadow: var(--shadow-2);
  font-size: 14.5px; line-height: 1.45; animation: flash-in .5s var(--ease) both;
}
.flash .i { margin-top: 1px; color: var(--signal); }
.flash--success .i { color: #43D69E; }
.flash--error .i { color: #FF8A66; }
.flash p { flex: 1; }
.flash button { color: var(--faint); margin-left: 4px; }
.flash button:hover { color: var(--paper); }
.flash.is-leaving { animation: flash-out .3s var(--ease) both; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-14px) scale(.98); } }
@keyframes flash-out { to { opacity: 0; transform: translateY(-10px); } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
  text-align: left; font-family: var(--f-mono); font-size: 12px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase;
  color: var(--mute); padding: 12px 16px; border-bottom: 1px solid var(--rule); white-space: nowrap; background: var(--paper);
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--paper) 60%, transparent); }
.table .r { text-align: right; }
.table td.num { white-space: nowrap; }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.cell-user b { display: block; color: var(--ink); font-weight: 560; }
.cell-user span:not(.avatar) { display: block; font-size: 12.5px; color: var(--mute); }
.cell-user .avatar { flex: none; } /* the avatar is a span too — keep its own centred initials and colours */
.table a { text-decoration: none; }
.table a:hover b, .table a.link:hover { color: var(--signal-ink); }

.empty {
  display: grid; place-items: center; text-align: center; gap: 10px; padding: clamp(28px, 6vw, 56px) 20px;
  border: 1px dashed var(--rule-2); border-radius: var(--r); color: var(--mute);
}
.empty h3 { font-size: 1.15rem; }
.empty__art { width: 74px; height: 56px; margin-bottom: 4px; }

/* ---------- navbar: transparent, then a floating glass pill once you scroll ---------- */
.nav-bar { position: sticky; top: 0; z-index: 50; transition: transform .5s var(--ease); }
.nav-bar--overlay { position: fixed; left: 0; right: 0; }
.nav-bar.is-hidden:not(.is-open) { transform: translateY(-120%); }
.nav-bar__inner { height: 76px; display: flex; align-items: center; gap: 24px; transition: height .5s var(--ease), margin .5s var(--ease), padding .5s var(--ease), background-color .5s, border-color .5s, border-radius .5s; border: 1px solid transparent; }
.nav-bar.is-scrolled:not(.is-open) .nav-bar__inner {
  height: 60px; margin-top: 10px; max-width: 1080px; padding: 0 8px 0 18px; border-radius: 999px; border-color: var(--rule);
  background: rgb(255 255 255 / .92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.nav-bar__links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-bar__links a { padding: 8px 13px; border-radius: 999px; font-size: 15px; color: var(--mute); text-decoration: none; white-space: nowrap; transition: color .25s, background .25s; }
.nav-bar__links a:hover { color: var(--ink); background: rgb(23 23 23 / .05); }
.nav-bar__links a.is-active { color: var(--signal); }
.nav-bar.is-scrolled .nav-bar__links a { padding: 8px 10px; font-size: 14.5px; }
.nav-bar__end { display: flex; align-items: center; gap: 10px; }
.nav-bar__signin { font-size: 15px; color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: 999px; }
.nav-bar__signin:hover { color: var(--signal); }
.nav-bar__toggle { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--rule-2); place-items: center; color: var(--ink); }
.nav-bar__toggle .i { grid-area: 1 / 1; transition: transform .4s var(--ease), opacity .3s; }
.nav-bar__toggle .i:last-child { opacity: 0; transform: rotate(-90deg); }
.nav-bar.is-open .nav-bar__toggle .i:first-child { opacity: 0; transform: rotate(90deg); }
.nav-bar.is-open .nav-bar__toggle .i:last-child { opacity: 1; transform: none; }
.nav-bar__menu { display: none; }
@media (max-width: 1060px) {
  .nav-bar__links, .nav-bar__signin { display: none; }
  .nav-bar__end { margin-left: auto; }
  .nav-bar__toggle { display: inline-grid; }
  .nav-bar__menu {
    position: fixed; inset: 0; z-index: -1; display: flex; flex-direction: column; background: var(--paper);
    padding: 96px var(--gutter) calc(28px + env(safe-area-inset-bottom)); visibility: hidden;
    clip-path: circle(0% at calc(100% - 42px) 38px); transition: clip-path .7s var(--ease), visibility .7s;
  }
  .nav-bar.is-open .nav-bar__menu { visibility: visible; clip-path: circle(150% at calc(100% - 42px) 38px); }
  .nav-bar__menu a:not(.btn) {
    display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--rule);
    font-family: var(--f-display); font-size: clamp(30px, 9vw, 42px); font-weight: 600; letter-spacing: -.03em; color: var(--ink); text-decoration: none;
  }
  .nav-bar__menu a:not(.btn) span { font-family: var(--f-mono); font-size: 12px; font-weight: 400; letter-spacing: .06em; color: var(--faint); }
  .nav-bar__menu .row { margin-top: auto; gap: 10px; }
  .nav-bar__menu .row .btn { flex: 1; height: 52px; }
}
@media (max-width: 480px) {
  .nav-bar__inner { gap: 12px; }
  .logo__word { font-size: 17px; }
  .nav-bar__now { display: none; }
  .nav-bar__end { gap: 8px; }
  .nav-bar__end .btn { padding: 0 14px; }
}

/* ---------- account menu: person icon in the header, quick sign-in, your shortcuts ---------- */
.acct { position: relative; flex: none; }
.acct__btn {
  display: inline-flex; align-items: center; gap: 9px; height: 46px; padding: 0 12px 0 6px; border-radius: 999px;
  border: 1px solid transparent; background: none; color: var(--ink); cursor: pointer; transition: background .25s, border-color .25s;
}
.acct__btn:hover, .acct.is-open .acct__btn { background: rgb(23 23 23 / .05); }
.acct__btn:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.acct__ic { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--card); }
.acct__hi { display: grid; text-align: left; line-height: 1.2; }
.acct__hi small { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--mute); }
.acct__hi b { font-size: 14px; font-weight: 600; }
.acct__chev { width: 14px; height: 14px; color: var(--mute); transition: transform .3s var(--ease); }
.acct.is-open .acct__chev { transform: rotate(180deg); }

.acct__panel {
  position: absolute; z-index: 80; top: 100%; right: calc(var(--acct-shift, 0px) * -1); width: 340px; padding-top: 10px;
  visibility: hidden; opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .3s var(--ease), visibility .3s;
}
.acct.is-open .acct__panel { visibility: visible; opacity: 1; transform: none; }
@media (hover: hover) and (min-width: 1061px) {
  .acct--site:hover .acct__panel { visibility: visible; opacity: 1; transform: none; }
  .acct--site:hover .acct__chev { transform: rotate(180deg); }
}
.acct__card {
  max-height: calc(100dvh - var(--acct-top, 96px) - 16px); overflow: auto; overscroll-behavior: contain; padding: 8px;
  border: 1px solid var(--rule); border-radius: 20px; background: var(--card);
  box-shadow: 0 28px 60px -24px rgb(0 0 0 / .28), 0 2px 6px rgb(0 0 0 / .05);
}
.acct__me { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; margin-bottom: 6px; border-bottom: 1px solid var(--rule); }
.acct__me b, .acct__me small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct__me b { font-size: 15px; color: var(--ink); }
.acct__me small { font-size: 12.5px; color: var(--mute); }
.acct__role { padding: 4px 9px; border-radius: 999px; background: var(--paper); color: var(--mute); font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.acct__role--teacher { background: var(--signal-soft); color: var(--signal-ink); }
.acct__role--admin { background: var(--ink); color: var(--card); }
.acct__form { display: grid; gap: 10px; padding: 12px 12px 16px; margin-bottom: 6px; border-bottom: 1px solid var(--rule); }
.acct__title { margin: 0; font-family: var(--f-display); font-size: 21px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.acct__sub { margin: -4px 0 4px; font-size: 13px; line-height: 1.45; color: var(--mute); }
.acct__field { display: grid; gap: 5px; }
.acct__field span { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.acct__field .input { height: 46px; font-size: 16px; } /* 16px stops iOS zooming into the field */
.acct__form .btn { height: 48px; margin-top: 4px; }
.acct__new { margin: 2px 0 0; text-align: center; font-size: 13px; color: var(--mute); }
.acct__links a, .acct__out button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 12px;
  background: none; color: var(--ink); font: inherit; font-size: 14.5px; text-align: left; text-decoration: none; cursor: pointer; transition: background .2s;
}
.acct__links a:hover, .acct__out button:hover, .acct__links a:focus-visible, .acct__out button:focus-visible { background: var(--paper); outline: none; }
.acct__links .i { color: var(--mute); }
.acct__links span { flex: 1; min-width: 0; }
.acct__count { min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 6px; border-radius: 999px; background: var(--signal); color: #fff; font-family: var(--f-mono); font-size: 11px; font-style: normal; }
.acct__out { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--rule); }
.acct__out button { color: var(--signal-ink); }
.acct--app .acct__btn { width: 42px; height: 42px; padding: 0; justify-content: center; }
.acct--app .acct__card { max-height: calc(100dvh - var(--acct-top, 70px) - 100px); }
@media (max-width: 1060px) {
  .acct--site .acct__btn { width: 44px; height: 44px; padding: 0; justify-content: center; border-color: var(--rule-2); }
  .acct--site .acct__hi, .acct--site .acct__chev { display: none; }
  .acct--site .acct__ic { width: auto; height: auto; background: none; color: var(--ink); }
  .acct--site .avatar { --size: 34px; }
  .acct__panel { width: min(380px, calc(100vw - 24px)); }
}
@media (max-width: 480px) {
  /* logo + account + Enroll + menu must fit a 360px phone */
  .nav-bar__dash { display: none; }
  .nav-bar__inner { gap: 8px; }
  .nav-bar__end { gap: 6px; }
  .nav-bar .logo { gap: 8px; }
  .nav-bar .logo__mark { width: 30px; height: 30px; }
  .nav-bar .logo__word { font-size: 15.5px; }
  .nav-bar__end .btn { padding: 0 12px; }
  .acct--site .acct__btn, .nav-bar__toggle { width: 40px; height: 40px; }
}
@media (max-width: 374px) {
  .nav-bar .logo__word { font-size: 14.5px; }
  .nav-bar__end .btn { padding: 0 10px; }
}

/* ---------- footer ---------- */
.site-footer { position: relative; border-top: 1px solid var(--rule); padding: clamp(56px, 7vw, 72px) 0 28px; background: var(--paper); color: var(--mute); }
.site-footer__grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 30px; }
.site-footer__about { max-width: 34ch; margin-top: 16px; font-size: 15px; line-height: 1.6; }
.site-footer h4 { margin: 0 0 14px; font-family: var(--f-mono); font-size: 12px; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: 4px; font-size: 15px; }
.site-footer a { display: inline-block; padding: 4px 0; color: var(--mute); text-decoration: none; transition: color .25s; }
.site-footer a:hover { color: var(--ink); }
.site-footer .logo { display: inline-flex; padding: 0; color: var(--ink); }
.site-footer__verify { display: flex; gap: 6px; margin-top: 6px; }
.site-footer__verify .input { height: 44px; font-size: 14px; border-radius: 999px; padding-inline: 16px; }
.site-footer__verify .btn { height: 44px; width: 44px; padding: 0; flex: none; }
.dotword { display: block; width: 100%; aspect-ratio: 5 / 1; margin-top: clamp(40px, 6vw, 64px); }
.site-footer__base { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 24px; font-size: 13px; color: var(--faint); }
@media (max-width: 860px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__grid > :first-child, .site-footer__grid > :last-child { grid-column: 1 / -1; }
  .site-footer__verify { max-width: 420px; }
  .site-footer__verify .input { flex: 1; min-width: 0; }
}

/* ---------- "just enrolled" pop-up ---------- */
.enrol-toast {
  position: fixed; z-index: 40; left: max(20px, env(safe-area-inset-left)); bottom: calc(20px + env(safe-area-inset-bottom)); width: min(340px, calc(100vw - 40px));
  display: flex; align-items: center; gap: 4px; padding: 10px 8px 10px 10px; border-radius: 16px;
  background: rgb(255 255 255 / .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--rule-2); box-shadow: 0 30px 60px -30px rgb(23 23 23 / .35);
  opacity: 0; visibility: hidden; transform: translateY(calc(100% + 140px)); transition: transform .6s var(--ease), opacity .4s, visibility .6s;
}
.enrol-toast.is-in { opacity: 1; visibility: visible; transform: none; }
.enrol-toast__body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--ink-2); text-decoration: none; }
.enrol-toast__avatar { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-family: var(--f-display); font-size: 17px; font-weight: 600; background: linear-gradient(135deg, var(--signal), var(--note)) !important; }
.enrol-toast__text { display: grid; gap: 2px; min-width: 0; font-size: 13.5px; line-height: 1.35; }
.enrol-toast__text b { color: var(--ink); font-weight: 600; }
.enrol-toast__text small { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--mute); }
.enrol-toast__text small .i { width: 14px; height: 14px; color: var(--ok); }
.enrol-toast__close { flex: none; align-self: flex-start; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--faint); }
.enrol-toast__close:hover { background: var(--paper-2); color: var(--ink); }
/* A short card on the left on every screen size; it sits above the phone enrol bar. */
@media (max-width: 720px) {
  .enrol-toast { left: 12px; width: min(300px, calc(100vw - 24px)); bottom: calc(84px + env(safe-area-inset-bottom)); padding: 8px 6px 8px 8px; border-radius: 14px; }
  .enrol-toast__avatar { width: 34px; height: 34px; border-radius: 9px; font-size: 15px; }
  .enrol-toast__text { font-size: 12.5px; }
  .enrol-toast__text small { font-size: 12px; }
  .enrol-toast__close { width: 26px; height: 26px; }
}
@media (max-width: 720px) { body:not(.landing) .enrol-toast { bottom: calc(14px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .enrol-toast { transition: opacity .3s; transform: none; } }

/* ---------- headings that rise in word by word ([data-split], site.js) ---------- */
html.js .split .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .08em .14em; margin: 0 -.08em -.14em; }
html.js .split .w > span { display: inline-block; transform: translateY(108%); transition: transform 1s var(--ease); transition-delay: calc(var(--wi) * 55ms); }
html.js .split.is-in .w > span { transform: none; }

/* ---------- reveal on scroll (no libraries) ---------- */
html.js .reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .7s var(--ease) calc(var(--d, 0) * 80ms), transform .7s var(--ease) calc(var(--d, 0) * 80ms), translate .45s var(--ease), box-shadow .45s var(--ease);
}
html.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.avatar--photo { object-fit: cover; padding: 0; background: var(--paper-2); }

/* Table rows that open their link when clicked anywhere (see [data-row-link] in app.js). */
.row-link { cursor: pointer; transition: background-color .15s; }
.row-link:hover, .row-link:focus-within { background: color-mix(in srgb, var(--signal-soft) 45%, transparent); }
.row-link:hover [data-row-target] { transform: translateX(2px); }

/* Atoms keep their shape everywhere. Avatars are always perfect circles and badges, chips and dots are
   never stretched — whatever flex or grid rule the surrounding list uses. */
.avatar { flex: none !important; width: var(--size) !important; height: var(--size) !important; min-width: var(--size); aspect-ratio: 1 / 1; }
.badge, .chip, .wait, .batchdot, .tabbar__badge, .nav__count { flex: none !important; }

/* Tables → stacked cards on phones (labels come from the column headers, see site.js). The first cell is
   the row's identity (student, course…) and stays a heading; the rest become "label · value" lines. */
@media (max-width: 720px) {
  .table-wrap:has(.table--cards) { overflow: visible; }
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
  .table--cards tr { padding: 12px 14px; border-bottom: 1px solid var(--rule); }
  .table--cards tr:last-child { border-bottom: 0; }
  /* The label floats left and the cell's own content stays together on the right ("3 watched", not "3 … watched"). */
  .table--cards td { display: block; min-width: 0; padding: 5px 0; border: 0 !important; text-align: right; overflow-wrap: anywhere; }
  .table--cards td::after { content: ''; display: block; clear: both; }
  .table--cards td::before { content: attr(data-label); float: left; max-width: 45%; margin-right: 12px; padding-top: 2px; font-family: var(--f-mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--mute); text-align: left; }
  .table--cards td .progress { display: inline-flex; width: 55%; vertical-align: middle; }
  .table--cards td:first-child { display: block; padding-bottom: 8px; text-align: left; }
  .table--cards td:first-child::before, .table--cards td:not([data-label])::before, .table--cards td[data-label=""]::before { display: none; }
  .table--cards td:empty { display: none; }
  .table--cards .cell-user { min-width: 0; }
  .table--cards td.r .btn { width: 100%; justify-content: center; }
}
.nowrap { white-space: nowrap; }

/* Section labels with extra text wrap as one line of prose instead of splitting into columns. */
.frame-label { flex-wrap: wrap; row-gap: 2px; }
@media (max-width: 720px) {
  /* Notices with an action: the message gets the full width, the button sits under it. */
  .alert:has(> .btn), form.alert { flex-wrap: wrap; }
  .alert:has(> .btn) > .grow, form.alert > .grow { flex: 1 1 calc(100% - 32px); min-width: 0; }
  .alert > .btn { margin-left: 26px; }
}
@media (max-width: 720px) {
  /* Field hints sit under the label on phones instead of squeezing it. */
  .label { flex-wrap: wrap; row-gap: 2px; }
  .label .hint { flex-basis: 100%; font-size: 12.5px; }
}

/* Laptops and small desktops (1061–1279px): seven links, the account button and Enroll fit in one
   row — tighter link spacing and an icon-only account button, as on tablets. */
@media (min-width: 1061px) and (max-width: 1279px) {
  .nav-bar__inner { gap: 16px; }
  .nav-bar__links a, .nav-bar.is-scrolled .nav-bar__links a { padding: 8px 9px; font-size: 14px; }
  .acct--site .acct__btn { width: 44px; height: 44px; padding: 0; justify-content: center; border-color: var(--rule-2); }
  .acct--site .acct__hi, .acct--site .acct__chev { display: none; }
  .acct--site .acct__ic { width: auto; height: auto; background: none; color: var(--ink); }
  .acct--site .avatar { --size: 34px; }
}
