/* Xenticorp.net — shared styles
   Palette pulled from the Xenticorp Tag Logo (Canva). Edit the :root tokens to retheme. */

:root {
  --bg: #111111;
  --bg-raised: #181818;
  --bg-panel: #1c1c1c;
  --line: #2a2a2a;
  --text: #ffffff;
  --text-dim: #a8a8a8;
  --yellow: #ffd60a;   /* bolt / radiation symbol */
  --green: #1e5a3c;    /* "CORP" */
  --green-bright: #2f8a5b;
  --rust: #a8531a;     /* "ENGINEERING" */
  /* Color jobs: yellow = actions (buttons, links to act on), green = live / glow / circuit traces,
     rust = danger + the tagline. Surfaces stay neutral gray. */
  --live: #3db87a;                       /* bright brand green: glows, traces, "on" states */
  --live-soft: rgba(61, 184, 122, .12);
  --live-glow: rgba(61, 184, 122, .38);
  --action-glow: rgba(255, 214, 10, .28);
  --nav-h: 68px;
  --radius: 8px;
  --font-display: "Anton", "Archivo Black", Impact, "Arial Narrow", sans-serif;
  --font-body: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* `hidden` must win over display rules like .dash__grid { display: grid }. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  position: relative;   /* the circuit background below is laid over the whole page, so a full-page screenshot has it everywhere */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- Navbar (Browserbase-style: sticky, blurred, dropdown flyouts) ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(17, 17, 17, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: 1200px; height: 100%; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 32px;
}
.nav__logo { display: flex; align-items: center; flex-shrink: 0; }
.nav__logo img { height: 40px; width: 40px; object-fit: contain; }
.nav__links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav__item { position: relative; }
.nav__link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  background: none; border: 0;
  font-size: 0.92rem; font-weight: 500; color: var(--text-dim);
  transition: color .15s, background .15s;
}
.nav__link:hover, .nav__item.is-open > .nav__link { color: var(--text); background: rgba(255,255,255,.06); }
.nav__chev { width: 10px; height: 10px; transition: transform .2s; }
.nav__item.is-open .nav__chev { transform: rotate(180deg); }

.nav__flyout {
  position: absolute; top: calc(100% + 10px); left: 0;
  min-width: 420px; padding: 14px;
  background: var(--bg-panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.nav__item.is-open .nav__flyout { opacity: 1; visibility: visible; transform: translateY(0); }
.nav__flyout-label {
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--yellow); padding: 4px 10px 8px;
}
.flyout-item {
  display: block; padding: 10px; border-radius: 8px;
  transition: background .15s;
}
.flyout-item:hover { background: rgba(255,255,255,.05); }
.flyout-item__title { font-weight: 600; font-size: .92rem; display: flex; align-items: center; gap: 8px; }
.flyout-item__desc { font-size: .8rem; color: var(--text-dim); }
.flyout-item.is-soon { opacity: .55; pointer-events: none; }
/* Projects menu: columns of at most 5 projects (site/build.py shows up to 10), then "All projects"
   across the bottom. Columns narrow on smaller screens so the menu never runs off the right edge. */
.nav__flyout { width: max-content; max-width: calc(100vw - 140px); }
.nav__flyout-grid { display: grid; grid-template-rows: repeat(5, auto); grid-auto-flow: column; grid-auto-columns: minmax(0, 392px); column-gap: 6px; }
.flyout-item--all { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; }
.badge-soon {
  font-size: .6rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; background: var(--rust); color: #fff;
}

.nav__spacer { flex: 1; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 8px; border: 1px solid transparent;
  font-size: .9rem; font-weight: 700; transition: transform .12s, background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--yellow); color: #111; }
.btn--primary:hover { background: #ffe14d; }
.btn--ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--text-dim); }
.btn--danger { background: var(--rust); color: #fff; }
.btn--danger:hover { background: #c0631f; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 14px; height: 14px; }

.nav__burger {
  display: none; width: 42px; height: 42px; border-radius: 8px;
  background: none; border: 1px solid var(--line); align-items: center; justify-content: center;
}
.nav__burger span, .nav__burger span::before, .nav__burger span::after {
  display: block; width: 18px; height: 2px; background: var(--text); position: relative; content: "";
  transition: transform .2s, top .2s, background .2s;
}
.nav__burger span::before { position: absolute; top: -6px; }
.nav__burger span::after  { position: absolute; top: 6px; }
.nav.is-menu-open .nav__burger span { background: transparent; }
.nav.is-menu-open .nav__burger span::before { top: 0; transform: rotate(45deg); }
.nav.is-menu-open .nav__burger span::after  { top: 0; transform: rotate(-45deg); }

@media (max-width: 820px) {
  .nav__inner { gap: 12px; }
  .nav__burger { display: inline-flex; margin-left: auto; }
  .nav__cta-desktop { display: none; }
  .nav__links {
    /* Explicit height: .nav's backdrop-filter makes it the containing block for this fixed
       element, so top/bottom would size it to the 68px bar instead of the screen. */
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    height: calc(100vh - var(--nav-h)); height: calc(100dvh - var(--nav-h));
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px 20px 28px; background: var(--bg); overflow-y: auto;
    /* Revealed with clip-path instead of sliding in from off-screen: an element parked past the
       right edge makes the whole page scroll sideways on phones. Hidden = not focusable either. */
    clip-path: inset(0 0 0 100%); visibility: hidden;
    transition: clip-path .25s, visibility 0s .25s;
  }
  .nav.is-menu-open .nav__links { clip-path: inset(0); visibility: visible; transition: clip-path .25s; }
  .nav__link { width: 100%; justify-content: space-between; padding: 14px 6px; font-size: 1.05rem; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav__flyout {
    position: static; min-width: 0; padding: 0 0 8px; border: 0; box-shadow: none; background: none;
    max-height: 0; overflow: hidden; opacity: 1; visibility: visible; transform: none; transition: max-height .25s;
  }
  .nav__item.is-open .nav__flyout { max-height: 1600px; }
  .nav__flyout { width: auto; max-width: none; }
  .nav__flyout-grid { display: block; }
  .nav__mobile-cta { display: block; margin-top: 20px; }
  .nav__mobile-cta .btn { width: 100%; justify-content: center; padding: 14px; }
}
@media (min-width: 821px) { .nav__mobile-cta { display: none; } }

/* ---------- Hero: tag logo fills the viewport ---------- */
.hero {
  position: relative;
  height: calc(100vh - var(--nav-h));
  height: calc(100svh - var(--nav-h));
  /* capped: a screenshot tool that captures the whole page by making the window as tall as the page must not make this as tall as the page */
  height: min(calc(100svh - var(--nav-h)), 820px);
  min-height: 420px;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  overflow: hidden;
}
.hero__logo {
  width: 100%; height: 100%;
  object-fit: contain;
  max-width: 1600px;
}
.hero__scroll {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; color: var(--text-dim);
}
.hero__scroll svg { width: 18px; height: 18px; color: var(--yellow); animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .hero__scroll svg { animation: none; } html { scroll-behavior: auto; } }

/* ---------- Sections ---------- */
.section { max-width: 920px; margin: 0 auto; padding: 96px 24px; }
.eyebrow { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--yellow); margin-bottom: 14px; }
.h-display {
  font-family: var(--font-display);
  font-weight: 400; text-transform: uppercase; letter-spacing: .01em;
  font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.02; margin-bottom: 28px;
}
.h-display .accent-green { color: var(--green-bright); }
.h-display .accent-rust { color: var(--rust); }
.lead { color: var(--text-dim); font-size: 1.05rem; max-width: 62ch; }
.about { display: grid; gap: 18px; }
.about__intro { font-size: clamp(1.2rem, 2.4vw, 1.45rem); font-weight: 600; line-height: 1.45; max-width: 40ch; }
.about a, .lead a { color: var(--text); text-decoration: underline; text-decoration-color: var(--green-bright); text-underline-offset: 3px; }
.about a:hover, .lead a:hover { text-decoration-color: var(--yellow); }
/* The team (homepage About): one card per person, side by side from 640 px (reuses .contact-grid + .card). */
.team__title { font-weight: 700; font-size: 1.15rem; margin-top: 44px; }
.team { margin-top: 16px; }
.team__card { display: grid; gap: 10px; align-content: start; min-width: 0; }
.team__head { display: flex; align-items: center; gap: 14px; }
.team__avatar {
  display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--live); color: var(--green-bright); font-weight: 700; font-size: 1.15rem;
  box-shadow: 0 0 14px -4px var(--live-glow);
}
.team__name { font-weight: 700; font-size: 1.1rem; }
.team__tag { font-size: .84rem; color: var(--text-dim); overflow-wrap: anywhere; }
.team__role { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--yellow); }
.team__bio { color: var(--text-dim); }
.placeholder-box {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 28px; color: var(--text-dim); background: var(--bg-raised);
}
.placeholder-box strong { color: var(--yellow); }
.notice {
  margin-top: 20px; max-width: 62ch; padding: 12px 16px; border-radius: 8px;
  border: 1px solid var(--line); border-left: 3px solid var(--yellow);
  background: var(--bg-raised); color: var(--text-dim); font-size: .9rem;
}
.notice strong { color: var(--text); }

/* ---------- Contact cards (homepage) ---------- */
#contact { padding-top: 40px; }
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 28px; }
@media (min-width: 640px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-card {
  display: grid; gap: 6px; align-content: start; min-width: 0;
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; color: var(--text); text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.contact-card:hover { border-color: var(--green-bright); transform: translateY(-2px); }
.contact-card:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.contact-card__icon { width: 28px; height: 28px; color: var(--green-bright); margin-bottom: 8px; }
.contact-card__label { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text-dim); }
.contact-card__value { font-weight: 700; font-size: 1.1rem; overflow-wrap: anywhere; }
.contact-card__cta { font-size: .84rem; color: var(--text-dim); margin-top: 6px; }
.contact-card:hover .contact-card__cta { color: var(--yellow); }
@media (prefers-reduced-motion: reduce) { .contact-card { transition: none; } .contact-card:hover { transform: none; } }

/* ---------- 404 page ---------- */
.notfound { text-align: center; padding-top: 96px; }
.notfound__code {
  font-family: var(--font-display); font-weight: 400; line-height: .9;
  font-size: clamp(6rem, 22vw, 11rem); color: var(--yellow); margin-bottom: 12px;
}
.notfound .h-display { font-size: clamp(1.8rem, 5vw, 2.8rem); margin-bottom: 16px; }
.notfound .lead { margin: 0 auto; }
.notfound .page__actions { justify-content: center; }
.notfound__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 40px; font-size: .9rem; }
.notfound__links a { color: var(--text-dim); text-decoration: underline; text-decoration-color: var(--green-bright); text-underline-offset: 3px; }
.notfound__links a:hover { color: var(--text); text-decoration-color: var(--yellow); }

.footer {
  border-top: 1px solid var(--line);
  padding: 28px 24px; text-align: center;
  font-size: .78rem; color: var(--text-dim);
}
.footer em { color: var(--rust); font-style: normal; }

/* ---------- Dashboard ---------- */
.dash { max-width: 1100px; margin: 0 auto; padding: 56px 24px 96px; }
.dash__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.dash__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.refresh { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-dim); }
.refresh select, .update__branch select, .sched__form select, .rip__drive select, .rip__ready select {
  font: inherit; color: var(--text); background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; cursor: pointer;
}
.refresh select:focus-visible, .update__branch select:focus-visible, .sched__form select:focus-visible, .rip__drive select:focus-visible, .rip__ready select:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.dash__section {
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: .02em;
  font-size: 1.5rem; margin: 48px 0 16px;
}
.dash__head + .dash__section { margin-top: 0; }
/* Fold a section away (assets/sections.js): the heading becomes a button with an arrow, like Obsidian. */
.sec-toggle {
  display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; text-align: left;
}
.sec-toggle:focus-visible { outline: 2px solid var(--yellow); outline-offset: 4px; border-radius: 4px; }
.sec-toggle__arrow { width: 18px; height: 18px; flex: none; color: var(--text-dim); transform: rotate(90deg); transition: transform .15s; }
.sec-toggle:hover .sec-toggle__arrow { color: var(--live); }
.dash__section.is-folded .sec-toggle__arrow, .card.is-folded .sec-toggle__arrow { transform: none; }
.sec-toggle--card { gap: 6px; }
.sec-toggle--card .sec-toggle__arrow { width: 16px; height: 16px; }
.card.is-folded { padding-bottom: 18px; }
.is-folded-away { display: none !important; }
@media (prefers-reduced-motion: reduce) { .sec-toggle__arrow { transition: none; } }
.card__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 12px; }
.card__link { font-size: .8rem; color: var(--text-dim); white-space: nowrap; text-decoration: underline; text-decoration-color: var(--green-bright); text-underline-offset: 3px; }
.card__link:hover { color: var(--text); text-decoration-color: var(--yellow); }
#svc-note { margin-top: 12px; }
.dash__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card {
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.card__title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.card__desc { font-size: .84rem; color: var(--text-dim); margin-bottom: 18px; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-dim); }
.lamp { width: 10px; height: 10px; border-radius: 50%; background: #444; box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
.lamp.is-on { background: var(--green-bright); box-shadow: 0 0 10px var(--green-bright); }
.lamp.is-warn { background: var(--yellow); box-shadow: 0 0 10px color-mix(in srgb, var(--yellow) 60%, transparent); }
.lamp.is-bad { background: var(--rust); box-shadow: 0 0 10px var(--rust); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin-top: 16px; font-size: .8rem; }
.facts dt { color: var(--text-dim); }
.facts dd { color: var(--text); overflow-wrap: anywhere; }

/* toggle switch */
.toggle {
  position: relative; width: 56px; height: 30px; flex-shrink: 0;
  border-radius: 999px; background: #2b2b2b; border: 1px solid var(--line);
  transition: background .2s, border-color .2s;
}
.toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #777; transition: transform .2s, background .2s;
}
.toggle[aria-checked="true"] { background: var(--green); border-color: var(--green-bright); }
.toggle[aria-checked="true"]::after { transform: translateX(26px); background: var(--yellow); }
.toggle:disabled { opacity: .5; cursor: wait; }
/* A switch for something destructive: rust instead of green while it's on */
.toggle--danger[aria-checked="true"] { background: var(--rust); border-color: #e07a3a; }
.toggle:focus-visible, .btn:focus-visible, .nav__link:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.note { margin-top: 14px; font-size: .74rem; color: var(--rust); letter-spacing: .04em; }
.note--ok { color: var(--live); }  /* a confirmation (Accounts page), not an error */

/* dashboard stat cards + meters. Fill color carries severity, the track is a dim step of the same hue. */
.stat { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.stat__value { font-size: 2.4rem; font-weight: 700; line-height: 1; }
.stat__flag { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.stat__sub { margin-top: 10px; font-size: .78rem; color: var(--text-dim); }
.meter {
  --fill: var(--green-bright);
  height: 8px; border-radius: 999px; overflow: hidden;
  background: color-mix(in srgb, var(--fill) 22%, var(--bg-raised));
}
.meter > span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--fill); transition: width .4s; }
.meter[data-level="warn"] { --fill: var(--yellow); }
.meter[data-level="crit"] { --fill: var(--rust); }
.disks { list-style: none; display: grid; gap: 18px; }
.disk__head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: .84rem; }
.disk__label { font-weight: 600; }
.disk__pct { color: var(--text-dim); }
.disk .stat__sub { margin-top: 6px; }
.disk--missing .disk__label { color: var(--text-dim); }
.disk--missing .disk__pct { color: #e07a3a; }
@media (prefers-reduced-motion: reduce) { .meter > span { transition: none; } }

/* ---------- Project pages (e.g. Ripnamer) ---------- */
.page { max-width: 920px; margin: 0 auto; padding: 72px 24px 96px; }
.page__hero { margin-bottom: 56px; }
.page__hero .h-display { margin-bottom: 18px; }
.page__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tag { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-dim); }
.tag--updated { color: var(--live); border-color: color-mix(in srgb, var(--live) 60%, transparent); }
.tag--status { color: var(--yellow); border-color: color-mix(in srgb, var(--yellow) 55%, transparent); }  /* e.g. "In development" */
.tag--hold { color: #e07a3a; border-color: color-mix(in srgb, var(--rust) 80%, transparent); }  /* on-hold: "Development hell" */
.page h2.h-sub { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: 1.9rem; margin: 56px 0 18px; }
.steps { list-style: none; counter-reset: step; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: flex; gap: 16px; background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.steps li::before { content: counter(step); flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--yellow); color: #111; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.steps strong { display: block; margin-bottom: 2px; }
.steps span { color: var(--text-dim); font-size: .92rem; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } }
.code-block { background: #0c0c0c; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .8rem; line-height: 1.7; color: var(--text-dim); overflow-x: auto; white-space: pre; }
.code-block__label { display: block; font-family: var(--font-body); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--yellow); margin-bottom: 8px; white-space: normal; }
.code-block .good { color: var(--green-bright); }
.page .placeholder-box { margin-top: 14px; }
.shot { margin-top: 14px; }
.shot a {
  display: block; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--bg-panel); transition: border-color .15s;
}
.shot a:hover { border-color: var(--green-bright); }
.shot a:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { margin-top: 10px; font-size: .84rem; color: var(--text-dim); }
/* Several screenshots/photos side by side (Proton Pack). Same .shot figures, just in a grid. */
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin-top: 14px; }
.shot-grid .shot { margin-top: 0; min-width: 0; }
/* Same-size frames; the whole photo shows inside (photos range from square to very tall). */
.shot-grid .shot img { aspect-ratio: 3 / 4; object-fit: contain; background: #0b0b0b; }
.shot-grid--cad .shot img { background: #fff; }   /* CAD renders sit on white */
/* A tall hero photo: cap its height so the page doesn't start with a wall of image. */
.shot--hero { margin-top: 28px; }
.shot--hero a { background: #0b0b0b; }
.shot--hero img { width: auto; max-width: 100%; max-height: min(70vh, 640px); margin: 0 auto; }   /* capped: see the hero's note about full-page screenshots */

/* Spacing the project pages used to set inline (Markdown pages can't): a paragraph after a code block,
   a paragraph introducing a table, code block or comparison, and a list right after a table. */
.page .code-block + .lead { margin-top: 16px; }
.page .lead:has(+ .spec-wrap), .page .lead:has(+ .compare), .page .lead:has(+ .code-block) { margin-bottom: 16px; }
.page .spec-wrap + .bullets { margin-top: 16px; }

/* Inline SVG block diagrams on project pages. */
.diagram { margin-top: 24px; padding: 20px; background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius); }
.diagram svg { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto; font-family: var(--font-body); }
.diagram figcaption { margin-top: 12px; font-size: .84rem; color: var(--text-dim); text-align: center; }
.diagram__box rect { fill: var(--bg-raised); stroke: var(--line); stroke-width: 1.5; }
.diagram__box--live rect { stroke: var(--live); filter: drop-shadow(0 0 6px var(--live-glow)); }
.diagram__box text { fill: var(--text); font-size: 13px; font-weight: 600; text-anchor: middle; }
.diagram__box .diagram__sub { fill: var(--text-dim); font-size: 11.5px; font-weight: 500; }
.diagram__link line { stroke: var(--live); stroke-width: 1.8; }
.diagram__head { fill: var(--live); }
.diagram__label { fill: var(--yellow); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; text-anchor: middle; }
.diagram__note { fill: var(--text-dim); font-size: 11.5px; text-anchor: middle; }
@media (max-width: 560px) { .diagram { padding: 14px 8px; } }
/* Wide pipeline figures (X4 page): a desktop drawing, and a taller one for phones. Boxes are raised;
   running ones glow green like live parts elsewhere. */
.diagram--wide svg { max-width: none; color: var(--text); }
.diagram--wide .dg-box { fill: var(--bg-raised); }
.diagram--wide .dg-box--live { stroke: var(--live); filter: drop-shadow(0 0 5px var(--live-glow)); }
.diagram__mob { display: none; }
.diagram__mob svg { max-width: 420px; }
@media (max-width: 700px) { .diagram__desk { display: none; } .diagram__mob { display: block; } }
.btn__sub { font-weight: 500; font-size: .78rem; opacity: .7; }
.dl-links { margin-top: 14px; font-size: .82rem; color: var(--text-dim); }
.dl-links a, .dl-notes a, .footer__credit a { color: var(--text); text-decoration: underline; text-decoration-color: var(--green-bright); text-underline-offset: 3px; }
.dl-links a:hover, .dl-notes a:hover, .footer__credit a:hover { text-decoration-color: var(--yellow); }
.dl-notes { list-style: disc; padding-left: 1.2em; margin-top: 12px; display: grid; gap: 4px; max-width: 70ch; font-size: .84rem; color: var(--text-dim); }
.dl-notes li { min-width: 0; }
.dl-notes li::marker { color: var(--green-bright); }
.dl-notes strong { color: var(--text); }
/* Commands wrap instead of scrolling sideways (the Linux file name is long). */
.dl-notes code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .78rem; color: var(--text); background: #0c0c0c; border: 1px solid var(--line); border-radius: 4px; display: block; margin-top: 4px; padding: 6px 8px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.footer__credit { margin-top: 8px; }

/* ---------- Status-grouped project pages (X4) ---------- */
.pill {
  display: inline-block; font-size: .66rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-dim); white-space: nowrap;
}
.pill--live { color: var(--green-bright); border-color: var(--green-bright); }
.pill--planned { color: var(--yellow); border-color: color-mix(in srgb, var(--yellow) 55%, transparent); }
.pill--bad { color: #e07a3a; border-color: color-mix(in srgb, var(--rust) 80%, transparent); }
.pill--danger { color: #fff; background: var(--rust); border-color: var(--rust); }
.status-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; font-size: .8rem; color: var(--text-dim); }
.status-group { margin-top: 72px; }
.status-group__head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 4px; }
.page .status-group__head h2.h-sub { margin: 0; }
.page h3.h-sub3 { font-size: 1.1rem; font-weight: 700; margin: 40px 0 14px; }
.spec-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-panel); overflow: hidden; }
.spec { width: 100%; border-collapse: collapse; font-size: .92rem; }
.spec th, .spec td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0; }
.spec th { width: 30%; font-weight: 600; color: var(--text); }
.spec td { color: var(--text-dim); overflow-wrap: anywhere; }
.spec td strong { color: var(--text); font-weight: 600; }
.bullets { list-style: disc; padding-left: 1.2em; display: grid; gap: 8px; max-width: 70ch; color: var(--text-dim); }
.bullets li::marker { color: var(--green-bright); }
.page .notice { max-width: none; }
@media (max-width: 560px) {
  .spec th, .spec td { display: block; width: auto; padding: 0 14px; border: 0; }
  .spec th { padding-top: 12px; }
  .spec td { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .spec tr:last-child td { border-bottom: 0; }
}

/* ---------- Dashboard login ---------- */
.login { max-width: 420px; }
.login .nav__logo { display: inline-block; margin-bottom: 32px; }
.login__form { display: grid; gap: 12px; }
.imp__music { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 10px 0; }  /* Importer card: album name + file picker */
.imp__music .input { min-width: 0; max-width: 420px; box-sizing: border-box; }
.imp__music input[type=file] { min-width: 0; max-width: 100%; color: var(--text-dim); font: inherit; }
.login__form .note { margin-top: 0; }
/* Two-factor setup (login page and Accounts page): the QR code on a white quiet zone (scanners need the contrast),
   then the key and the recovery codes in code blocks that wrap instead of scrolling. */
.qr { width: 216px; max-width: 100%; border-radius: 8px; overflow: hidden; background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
.code-block--wrap { white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: visible; color: var(--text); font-size: .9rem; letter-spacing: .06em; }
.login__bot { min-height: 65px; }  /* Turnstile's widget, so the button doesn't jump when it loads */
.login__link { justify-self: start; font-size: .76rem; color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; }
.login__link:hover { color: var(--text); }
/* Password field with a show/hide eye inside it (every dashboard password field, added by pw-eye.js). */
.pw-field { position: relative; min-width: 0; }
.keys__form .pw-field { flex: 1 1 220px; }
.keys__form .pw-field .input { width: 100%; padding-right: 48px; }  /* beats .keys__form .input below */
.pw-field .input { padding-right: 48px; }
.pw-field .input::-ms-reveal { display: none; }  /* Edge's own eye: ours replaces it */
.pw-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center;
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text-dim); cursor: pointer;
}
.pw-toggle:hover { color: var(--text); }
.pw-toggle:focus-visible { outline: 2px solid var(--yellow); outline-offset: 0; }
.pw-toggle svg { width: 20px; height: 20px; }
.pw-toggle .pw-eye-off, .pw-toggle[aria-pressed="true"] .pw-eye { display: none; }
.pw-toggle[aria-pressed="true"] .pw-eye-off { display: block; }
.input {
  width: 100%; padding: 12px 14px; border-radius: 8px; font: inherit; color: var(--text);
  background: var(--bg-raised); border: 1px solid var(--line);
}
.input:focus { outline: 2px solid var(--yellow); outline-offset: 1px; border-color: transparent; }

/* ---------- Dashboard update card ---------- */
.update__commit { font-size: .84rem; overflow-wrap: anywhere; }
.imp__run { margin: 4px 0 10px; max-width: 70ch; }
.imp__run .meter { margin: 8px 0 6px; }
.imp__file { font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
.imp__code { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); max-width: 70ch; }
.imp__code-label { font-size: .66rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px; }
/* Importer card: status, then what's on the drive, then settings + code. Wide screens put the drive list
   in a right-hand column next to the other two. */
.imp__cols { display: grid; gap: 22px; grid-template-areas: "status" "media" "rest"; }
.imp__status { grid-area: status; min-width: 0; }
.imp__media { grid-area: media; min-width: 0; }
.imp__rest { grid-area: rest; min-width: 0; }
.imp__rest > .imp__code:first-child { margin-top: 0; }
@media (min-width: 1100px) {
  .imp__cols { grid-template-columns: minmax(0, 70ch) minmax(300px, 1fr); grid-template-rows: auto 1fr;
               grid-template-areas: "status media" "rest media"; column-gap: 36px; align-items: start; }
  /* The drive list runs the full height of the card: the column stretches to the rows beside it, its
     content is taken out of the flow (so a long list can't make the card taller) and the list scrolls. */
  .imp__media { align-self: stretch; position: relative; min-height: 420px; border-left: 1px solid var(--line); }
  .imp__media-inner { position: absolute; inset: 0 0 0 28px; display: flex; flex-direction: column; }
  .imp__media-inner .imp__list { flex: 1 1 auto; min-height: 0; max-height: none; }
  .imp__media-inner .imp__row-actions { display: flex; gap: 6px; }
.imp__item.is-editing { grid-template-columns: auto minmax(0, 1fr); }
.imp__rename { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.imp__rename-input { flex: 1 1 180px; min-width: 0; background: transparent; color: inherit; font: inherit; font-size: .88rem;
                     font-weight: 600; border: 1px solid var(--yellow); border-radius: 8px; padding: 5px 9px; }
.imp__rename-err { flex-basis: 100%; margin: 0; font-size: .74rem; color: #e07a3a; }
.imp__review-actions { flex-shrink: 0; }
}
.imp__media-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.imp__media-head .imp__code-label { margin-bottom: 0; }
.imp__review-intro { margin: 10px 0 0; font-size: .85rem; color: var(--yellow); }
.imp__media-tools { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.imp__media-tools input { flex: 1 1 140px; min-width: 0; background: transparent; color: inherit; font: inherit; font-size: .85rem;
                          border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.imp__small { padding: 5px 10px; font-size: .75rem; }
.imp__list { list-style: none; margin: 12px 0 0; padding: 0; max-height: 62vh; overflow-y: auto; }
.imp__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
             padding: 9px 2px; border-top: 1px solid var(--line); }
.imp__item:first-child { border-top: 0; }
.imp__group { padding: 14px 2px 6px; font-size: .66rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
              color: var(--text-dim); }
.imp__group:first-child { padding-top: 2px; }
.imp__group.is-warn { color: #e07a3a; }
.imp__group + .imp__item { border-top: 0; }
.imp__item[data-state="no_space"] .imp__item-state { color: #e07a3a; }
.imp__kind { font-size: .6rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim);
             border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; min-width: 54px; text-align: center; }
.imp__item-name { font-weight: 600; font-size: .88rem; overflow-wrap: anywhere; }
.imp__item-state { font-size: .72rem; color: var(--text-dim); white-space: nowrap; }
.imp__item[data-state="rejected"] .imp__item-name { text-decoration: line-through; opacity: .5; }
.imp__item[data-state="rejected"] .imp__kind, .imp__item[data-state="in_library"] { opacity: .55; }
.imp__item[data-state="copying"] .imp__item-state { color: var(--yellow); }
.imp__item[data-state="done"] .imp__item-state { color: var(--green-bright); }
.imp__item[data-state="failed"] .imp__item-state { color: #e07a3a; }
.imp__review-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.imp__settings { display: grid; gap: 14px; margin-bottom: 10px; }
.imp__settings .status-row.is-muted > div, .imp__settings .status-row.is-off > div { opacity: .55; }
.imp__tidy-state { margin: 8px 0 0; font-size: .85rem; }
.imp__tidy-state.is-bad { color: #e07a3a; }
.imp__tidy-list { margin-top: 8px; font-size: .8rem; }
.imp__tidy-list summary { cursor: pointer; color: var(--text-dim); }
.imp__tidy-list ul { margin: 6px 0 0 18px; max-height: 240px; overflow-y: auto; overflow-wrap: anywhere; }
.imp__tidy-list li.is-dim { color: var(--text-dim); }
.imp__tidy-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.imp__sub-setting { margin-left: 18px; padding-left: 14px; border-left: 2px solid var(--line); }
/* Power card, scheduled restart: day, time and how often on one wrapping row, then Save */
.sched__form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 10px; font-size: .84rem; }
.sched__form select { max-width: 100%; min-width: 0; }
.sched__form .input { width: auto; padding: 8px 10px; color-scheme: dark; }
.sched__form select:disabled, .sched__form .input:disabled, .rip__drive select:disabled, .rip__ready select:disabled { opacity: .5; cursor: default; }
.update__branch { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: .8rem; color: var(--text-dim); }
.update__branch select { flex: 1; min-width: 0; }
.update__branch select:disabled, .update__fetch:disabled { opacity: .5; cursor: default; }
.update__fetch { padding: 7px 12px; font-size: 1rem; line-height: 1; }
.imp__failed { margin: 6px 0 0 18px; font-size: .8rem; color: #e07a3a; overflow-wrap: anywhere; }
/* Jellyfin section: connected users + now playing lists. */
.jf-list { display: grid; gap: 14px; list-style: none; }
.jf-list li { min-width: 0; }
.jf-list .meter { margin: 6px 0 4px; }
.jf-item__title { font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
.jf-list .stat__sub { overflow-wrap: anywhere; }

/* Dev copy only (DASHBOARD_MODE=dev). */
.dev-banner {
  margin-bottom: 24px; padding: 10px 14px; border-radius: 8px; font-size: .84rem;
  background: color-mix(in srgb, var(--yellow) 14%, transparent); border: 1px solid var(--yellow); color: var(--text);
}
.dev-banner strong { color: var(--yellow); letter-spacing: .12em; }
#up-desc code { font-size: .8rem; color: var(--text); }
.update__btn { margin-top: 12px; }
.update__btn:disabled { opacity: .5; cursor: wait; }
.upd__row { max-width: none; }
.upd__row .status-row > div { min-width: 0; }
.upd__row .pills { margin-bottom: 6px; }
.upd__install { line-height: 1.7; }
.upd__results { list-style: none; margin: 12px 0 0; padding: 0; font-size: .8rem; color: var(--text-dim); }
.upd__results li { padding: 3px 0; overflow-wrap: anywhere; }
.update__log { margin-top: 14px; font-size: .78rem; color: var(--text-dim); }
.update__log summary { cursor: pointer; }
.update__log pre {
  margin-top: 8px; max-height: 240px; overflow: auto; padding: 10px 12px; border-radius: 8px;
  background: var(--bg-raised); border: 1px solid var(--line); white-space: pre-wrap; font-size: .72rem;
}

/* =====================================================================================
   Design touches (site + dashboard): circuit traces, corner brackets, trace lines,
   // titles, glow = live, hover lift, refresh flash, scroll reveal.
   ===================================================================================== */

/* Circuit traces behind every page (assets/circuit.svg as a mask, painted in --live). */
body::before {
  /* absolute, not fixed: a fixed layer only covers the first screen in a full-page screenshot (it scrolls with the page, which the
     repeating pattern hides) */
  content: ""; position: absolute; inset: 0; min-height: 100vh; z-index: -1; pointer-events: none;
  background: var(--live); opacity: .085;
  -webkit-mask: url(circuit.svg) 0 0 / 200px 200px repeat;
          mask: url(circuit.svg) 0 0 / 200px 200px repeat;
}

/* Corner brackets: top-left + bottom-right of every card. */
.card, .contact-card, .project-card { position: relative; }
.card::before, .card::after,
.contact-card::before, .contact-card::after,
.project-card::before, .project-card::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border: 0 solid var(--live); opacity: .75; transition: opacity .2s, width .2s, height .2s;
}
.card::before, .contact-card::before, .project-card::before {
  top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: var(--radius);
}
.card::after, .contact-card::after, .project-card::after {
  bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: var(--radius);
}
.contact-card:hover::before, .contact-card:hover::after,
.project-card:hover::before, .project-card:hover::after { width: 22px; height: 22px; opacity: 1; }

/* Section labels trail off into a trace line. */
.eyebrow, .dash__section { display: flex; align-items: center; gap: 12px; }
.eyebrow::after, .dash__section::after {
  content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--live-glow), transparent);
}
.notfound .eyebrow { justify-content: center; }
.notfound .eyebrow::after { content: none; }

/* // before page titles. */
.h-display::before { content: "// "; color: var(--live); text-shadow: 0 0 14px var(--live-glow); }
.notfound .h-display::before { content: none; }

/* Glow = live: lit things glow, idle things don't. */
.btn--primary { box-shadow: 0 0 14px var(--action-glow); transition: transform .12s, background .15s, box-shadow .2s; }
.btn--primary:hover { box-shadow: 0 0 22px rgba(255, 214, 10, .45); }
.btn--ghost:hover { border-color: var(--live); }
.card.is-live { border-left: 2px solid var(--live); box-shadow: -6px 0 18px -10px var(--live-glow); }
.lamp.is-on { animation: lamp-pulse 2.4s ease-in-out infinite; }
@keyframes lamp-pulse { 0%, 100% { box-shadow: 0 0 6px var(--live); } 50% { box-shadow: 0 0 14px var(--live); } }

/* Live numbers keep their width while they change. */
.stat__value, .facts dd, .stat__sub, .kpi__value { font-variant-numeric: tabular-nums; }

/* Hover lift. */
.contact-card:hover, .project-card:hover {
  transform: translateY(-3px); border-color: var(--live); box-shadow: 0 10px 30px -14px var(--live-glow);
}

/* Brief accent ring when a dashboard tile's value changes. */
.is-flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 1px var(--live), 0 0 18px var(--live-glow); } to { box-shadow: 0 0 0 1px transparent; } }

/* Scroll reveal (homepage only): nothing is hidden by CSS. nav.js fades each section in with the Web Animations API just before it scrolls
   into view, so a full-page screenshot, which never scrolls, still shows everything. */

@media (prefers-reduced-motion: reduce) {
  .lamp.is-on, .is-flash { animation: none; }
  .contact-card:hover, .project-card:hover { transform: none; }
}

/* ---------- Homepage: project cards ---------- */
#projects { padding-bottom: 24px; }
.project-grid { display: grid; gap: 18px; grid-template-columns: 1fr; margin-top: 28px; }
@media (min-width: 640px) { .project-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .project-grid { grid-template-columns: repeat(3, 1fr); } }
.project-card {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .15s, border-color .15s, box-shadow .2s, opacity .5s ease-out;
}
.project-card:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.project-card__art {
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line); background: #0b0b0b;
}
.project-card__art img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
/* Status badge on a card's image, e.g. "In development". */
.project-card__badge {
  position: absolute; top: 10px; left: 10px; z-index: 1; background: rgba(12, 12, 12, .85);
  color: var(--yellow); border-color: color-mix(in srgb, var(--yellow) 55%, transparent);
}
.project-card__badge--live { color: var(--live); border-color: var(--live); box-shadow: 0 0 10px -4px var(--live-glow); }  /* Running / Released */
.project-card__badge--hold { color: #e07a3a; border-color: color-mix(in srgb, var(--rust) 80%, transparent); }  /* On hold */
/* Placeholder art (no photo yet): denser circuit + a glowing icon. */
.project-card__art--ph::before {
  content: ""; position: absolute; inset: 0; background: var(--live); opacity: .22;
  -webkit-mask: url(circuit.svg) 0 0 / 120px 120px repeat; mask: url(circuit.svg) 0 0 / 120px 120px repeat;
}
.project-card__art--ph svg { position: relative; width: 64px; height: 64px; color: var(--live); filter: drop-shadow(0 0 10px var(--live-glow)); }
.project-card__body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 18px 20px 20px; }
.project-card__title { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: 1.45rem; letter-spacing: .02em; line-height: 1.1; }
.project-card__desc { color: var(--text-dim); font-size: .9rem; }
.project-card .tags { margin-top: 2px; }
.project-card__cta { margin-top: auto; padding-top: 6px; font-size: .84rem; font-weight: 600; color: var(--yellow); }

/* ---------- Dashboard: left sidebar + overview strip ---------- */
.dash-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.dash-main { min-width: 0; display: flex; flex-direction: column; }
.dash-main .footer { margin-top: auto; }
.side {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px; padding: 22px 14px;
  background: rgba(12, 12, 12, .92); border-right: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.side__logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.side__logo img { width: 34px; height: 34px; }
.side__logo span { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .06em; }
.side__label {
  display: flex; align-items: center; gap: 10px; padding: 14px 12px 6px;
  font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--yellow);
}
.side__label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--live-glow), transparent); }
.side__nav { display: grid; gap: 2px; }
.side__link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 6px;
  border-left: 2px solid transparent; color: var(--text-dim); font-size: .9rem; font-weight: 500;
  transition: color .15s, background .15s;
}
.side__link svg { width: 18px; height: 18px; flex-shrink: 0; }
.side__link:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.side__link:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.side__link.is-active { color: var(--live); background: var(--live-soft); border-left-color: var(--live); text-shadow: 0 0 12px var(--live-glow); }
.side__count { margin-left: auto; padding: 1px 7px; border-radius: 99px; font-size: .72rem; background: var(--live-soft); color: var(--live); }
.side__foot { display: grid; gap: 10px; margin-top: auto; padding: 14px 6px 0; border-top: 1px solid var(--line); }
.side__foot .refresh { justify-content: space-between; }
.side__foot form, .side__foot .btn { width: 100%; }
.side__foot .btn { justify-content: center; }

.dash-topbar { display: none; }
.dash { max-width: 1180px; width: 100%; }
.dash .h-display { margin-bottom: 0; }
.dash__head { margin-bottom: 24px; }

/* Pill rows on the Update and Power cards (status, how long things took, when). */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.pills:empty { display: none; }
.pills .pill--live { color: var(--live); border-color: var(--live); box-shadow: 0 0 10px -4px var(--live-glow); }
.card--wide .card__desc { max-width: 70ch; }

/* System > API keys: one row per key (name + status, what it's for, paste box + buttons). */
.dash__grid + .card { margin-top: 16px; }
.keys__row { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); max-width: 70ch; }
.keys__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.keys__name { font-weight: 600; font-size: .92rem; }
.keys__row .stat__sub { margin-top: 6px; }
.keys__form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.keys__form .input { flex: 1 1 220px; width: auto; min-width: 0; padding: 10px 12px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { min-width: 0; padding: 14px 16px; background: var(--bg-panel); border: 1px solid var(--line); border-left: 2px solid var(--line); border-radius: var(--radius); }
.kpi.is-live { border-left-color: var(--live); }
.kpi__label { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); }
.kpi__value { font-family: var(--font-display); font-size: 1.9rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__value small { margin-left: 4px; font-family: var(--font-body); font-size: .8rem; color: var(--text-dim); }

@media (max-width: 900px) {
  .dash-layout { grid-template-columns: minmax(0, 1fr); }
  .dash-topbar {
    position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 16px;
    background: rgba(17, 17, 17, .85); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .dash-topbar img { width: 32px; height: 32px; }
  .dash-topbar span { font-family: var(--font-display); letter-spacing: .06em; }
  .dash-topbar .nav__burger { display: inline-flex; margin-left: auto; }
  /* Slide-in drawer, revealed with clip-path so nothing parked off-screen causes sideways scroll. */
  .side {
    position: fixed; z-index: 60; left: 0; top: 0; width: 272px;
    clip-path: inset(0 100% 0 0); visibility: hidden; transition: clip-path .25s, visibility 0s .25s;
  }
  .dash-layout.is-side-open .side { clip-path: inset(0); visibility: visible; transition: clip-path .25s; }
  .side-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .55); border: 0; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 901px) { .side-scrim { display: none; } }
/* Desktop dashboard at 80% scale: zoom shrinks text, spacing, cards and the sidebar together. Lengths
   based on the window shrink too, so the sidebar's height and the content's max width are divided by
   the same factor to keep filling the screen. The page background (body::before) isn't zoomed. */
@media (min-width: 901px) {
  .dash-layout { --dash-zoom: .8; zoom: var(--dash-zoom); min-height: calc(100vh / var(--dash-zoom)); }
  .dash-layout .side { height: calc(100vh / var(--dash-zoom)); height: calc(100dvh / var(--dash-zoom)); }
  .dash-layout .dash { max-width: calc(1180px / var(--dash-zoom)); }
}
/* Scrollbars (mouse/trackpad devices; phones keep their native overlay bars): a thin dark rail on the
   page and everything that scrolls inside it (dashboard sidebar, code blocks, logs). The thumb is faint,
   brightens when you point at it, and turns green while dragged. Chrome/Edge/Safari use the
   ::-webkit-scrollbar rules (they'd ignore them if scrollbar-color were also set), Firefox the
   standard properties. */
@media (pointer: fine) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
  ::-webkit-scrollbar-thumb { background: #2e2e2e; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
  ::-webkit-scrollbar-thumb:hover { background-color: var(--text-dim); }
  ::-webkit-scrollbar-thumb:active { background-color: var(--live); }
  .side::-webkit-scrollbar { width: 8px; }
  .side::-webkit-scrollbar-thumb { background-color: #262626; }
  .side:hover::-webkit-scrollbar-thumb { background-color: #3a3a3a; }
  .side::-webkit-scrollbar-thumb:hover { background-color: var(--text-dim); }
  .side::-webkit-scrollbar-thumb:active { background-color: var(--live); }
  @supports not selector(::-webkit-scrollbar) {
    * { scrollbar-width: thin; scrollbar-color: #3a3a3a transparent; }
  }
}

/* ---------- Site search (nav.js) and the /projects/ filter ---------- */
.nav__search {
  display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex-shrink: 0;
  border-radius: var(--radius); border: 1px solid var(--line); background: none; color: var(--text-dim); cursor: pointer;
  transition: color .15s, border-color .15s;
}
.nav__search:hover { color: var(--live); border-color: var(--live); }
.nav__search svg { width: 18px; height: 18px; }
.nav__search:focus-visible, .search__close:focus-visible, .search__hit:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
@media (max-width: 820px) {
  .nav__search { margin-left: auto; }
  .nav__search ~ .nav__burger { margin-left: 0; }
}
html.is-searching { overflow: hidden; }
.search {
  position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start;
  padding: 12vh 16px 16px; background: rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.search[hidden] { display: none; }
.search__panel {
  width: 100%; max-width: 620px; max-height: 76vh; display: flex; flex-direction: column;
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55), 0 0 0 1px var(--live-soft);
}
.search__bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--live); }
.search__bar svg { width: 20px; height: 20px; flex-shrink: 0; }
.search__input {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text);
  font: inherit; font-size: 1rem; padding: 4px 0;
}
.search__input::placeholder { color: var(--text-dim); }
.search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search__close {
  flex-shrink: 0; font: inherit; font-size: .68rem; font-weight: 600; letter-spacing: .1em; color: var(--text-dim);
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; cursor: pointer;
}
.search__status { padding: 10px 16px 4px; font-size: .74rem; color: var(--text-dim); }
.search__results { list-style: none; overflow-y: auto; padding: 4px 8px 10px; }
.search__hit {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline;
  padding: 10px 10px; border-radius: 6px; border: 1px solid transparent; color: var(--text);
}
.search__hit:hover, .search__hit.is-active { background: var(--bg-raised); border-color: var(--line); }
.search__hit.is-active { border-color: var(--live); }
.search__title { font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; }
.search__section { color: var(--live); font-weight: 500; }
.search__pill { font-size: .58rem; padding: 2px 8px; }
.search__desc { grid-column: 1 / -1; font-size: .8rem; line-height: 1.5; color: var(--text-dim); overflow-wrap: anywhere; }
.projects-filter { margin-top: 24px; max-width: 420px; }
.projects-filter input {
  width: 100%; font: inherit; font-size: .9rem; color: var(--text); background: var(--bg-raised);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px;
}
.projects-filter input:focus { outline: 2px solid var(--yellow); outline-offset: 2px; border-color: transparent; }
.projects-filter__none { margin-top: 12px; font-size: .85rem; color: var(--text-dim); }
.projects-group[hidden], .project-card[hidden] { display: none; }
@media (max-width: 560px) { .search { padding-top: 76px; } .search__panel { max-height: calc(100dvh - 92px); } }

/* ---------- Dashboard: Stats page (stats.html) ---------- */
/* The page you're on, in the sidebar's Pages group: same look as the section in view. */
.side__link[aria-current="page"] { color: var(--live); background: var(--live-soft); border-left-color: var(--live); text-shadow: 0 0 12px var(--live-glow); }
.stats-sample { margin-bottom: 20px; padding: 10px 14px; border: 1px dashed var(--yellow); border-radius: var(--radius); font-size: .84rem; color: var(--text); }
.stats-sample strong { color: var(--yellow); letter-spacing: .12em; }
.stats__disclaimer {
  margin: 0 0 16px; padding: 12px 16px; background: var(--bg-raised); font-size: .86rem;
  border: 1px solid color-mix(in srgb, var(--yellow) 45%, transparent); border-left: 3px solid var(--yellow); border-radius: var(--radius);
}
.stats__list { display: grid; gap: 16px; }
.stats__list > .card, .stats__list .chart-card { min-width: 0; }
.chart-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.chart-card__head .card__title { margin: 0; overflow-wrap: anywhere; }
.chart-card__total { margin-left: 8px; font-weight: 500; font-size: .84rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.export { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.export__label { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); margin-right: 2px; }
.export .btn { padding: 5px 10px; font-size: .74rem; }
/* Heatmaps keep their size and scroll sideways inside their own box on narrow screens. */
.heatmap { overflow-x: auto; padding: 10px; background: #0c0c0c; border: 1px solid var(--line); border-radius: 6px; }
.heatmap svg { display: block; }
.heatmap rect[data-d] { cursor: pointer; }
.heatmap rect[data-d].is-picked { stroke: var(--yellow); stroke-width: 1.5; }
.chart-readout { margin-top: 8px; min-height: 1.4em; font-size: .78rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.chart-readout b { color: var(--text); font-weight: 600; }
.chart-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }
.heat-legend { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; color: var(--text-dim); }
.heat-legend i { width: 11px; height: 11px; border-radius: 2px; box-shadow: inset 0 0 0 1px var(--line); }
.heat-legend span { margin: 0 4px; }
.chart-note { margin-top: 8px; font-size: .8rem; color: var(--text-dim); }
.linechart { position: relative; }
.linechart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; font-size: .78rem; color: var(--text-dim); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend svg { width: 22px; height: 8px; }

/* Two-factor code: six one-digit boxes (assets/otp-boxes.js); the real field stays in the form, hidden. */
.otp { position: relative; min-width: 0; }
.otp__boxes { display: flex; gap: 8px; }
.otp__boxes .otp__box.input {
  flex: 1 1 0; min-width: 0; max-width: 52px; height: 56px; padding: 0;
  text-align: center; font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.otp__real { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.keys__form .otp { flex: 1 1 300px; max-width: 360px; }

/* Ripping card (dashboard): tick boxes in the title list, the control buttons, the cancel password row, the minimum-length field */
.rip__item { grid-template-columns: auto minmax(0, 1fr) auto; }
.rip__tick { display: flex; align-items: center; padding: 6px; margin: -6px; cursor: pointer; }
.rip__tick input { width: 18px; height: 18px; accent-color: var(--yellow); cursor: pointer; }
.rip__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.rip__bulk { margin: 10px 0 4px; }
.rip__bulk[hidden] { display: none; }
.rip__est { margin: 0; align-self: center; }
.rip__rate { opacity: .75; white-space: nowrap; }
.rip__confirm { margin-top: 12px; max-width: 70ch; }
.rip__confirm-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.rip__confirm-row .input { flex: 1 1 200px; min-width: 0; max-width: 320px; box-sizing: border-box; }
.rip__min { display: flex; gap: 8px; align-items: center; }
.rip__min .input { width: 6.5em; min-width: 0; box-sizing: border-box; }
.rip__titles { margin-top: 14px; max-width: 70ch; }
.rip__block { container-type: inline-size; }
.rip__cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 24px; align-items: start; }
.rip__main, .rip__own, .rip__side { min-width: 0; }
.rip .pill { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.rip .imp__code-label, .rip .stat__sub, .rip .imp__item-name { overflow-wrap: anywhere; }
@container (min-width: 860px) {
  .rip__cols:not(.rip__cols--solo) { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .rip__cols:not(.rip__cols--solo) .rip__titles { max-width: none; }
  .rip__cols:not(.rip__cols--solo) .rip__side { margin-top: 14px; padding: 0 0 0 20px; border-left: 1px solid var(--line); }
  .rip__cols:not(.rip__cols--solo) .rip__side .rip__own { margin-top: 0; padding: 0; border-top: 0; }
}
#rip-answer { margin-top: 12px; }

/* ---------- Skeleton loaders (dashboard; skeleton.js) ----------
   Shimmering placeholders until a card's first answer. An element marked data-skel keeps its own text and size,
   the text just goes invisible, so nothing shifts when the data arrives; empty lists get shapes (.skel-*) cut to
   the size of the real rows. Reduced motion: a flat placeholder instead of the shimmer. */
@keyframes skel-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.skeleton {
  --skel-hi: color-mix(in srgb, var(--line) 82%, var(--text-dim));
  color: transparent !important; user-select: none; pointer-events: none; border-radius: 6px;
  background: linear-gradient(100deg, var(--line) 30%, var(--skel-hi) 50%, var(--line) 70%) 0 0 / 250% 100% !important;
  animation: skel-shimmer 1.5s linear infinite;
}
.skeleton > *, .skeleton::after { visibility: hidden; }
/* Text-like bars are slimmer than their line box (a mask, so the box and the layout stay the same). */
.skeleton:not(.toggle):not(.meter):not(.lamp):not(.skel-block):not(.skel-btn) {
  -webkit-mask-image: linear-gradient(transparent 14%, #000 14%, #000 86%, transparent 86%);
  mask-image: linear-gradient(transparent 14%, #000 14%, #000 86%, transparent 86%);
}
.skeleton.pill, .skeleton.toggle { border-color: transparent; }
span.skeleton { display: inline-block; max-width: 100%; vertical-align: top; }
/* Reduced motion: no sweeping shimmer, just a slow fade in place (nothing moves across the screen) */
@keyframes skel-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: skel-pulse 2s ease-in-out infinite; background: var(--line) !important; }
}
/* Shapes for containers that start empty: cut to the height of the real rows they stand in for */
.skel-line { display: block; height: 20px; }
.skel-line--title { width: 42%; height: 33px; }
.skel-line--desc { width: 64%; height: 21px; margin-bottom: 18px; }
.skel-line--status { width: 5.5rem; height: 20px; }
.skel-line--fact { width: 70%; height: 20px; margin-top: 6px; }
.skel-status + .skel-line--fact { margin-top: 16px; }
.skel-line--name { width: 38%; height: 23px; }
.skel-line--sub { width: 62%; height: 20px; margin-top: 8px; }
.skel-line--help { width: 85%; height: 48px; margin-top: 6px; }
.skel-line--dt { width: 4.5rem; height: 20px; }
.skel-line--dd { width: 9rem; max-width: 100%; height: 20px; }
.skel-line--dd2 { height: 41px; }  /* a value that wraps to two lines */
.skel-card { min-width: 0; }
.skel-card .skel-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 43px; }
.skel-btn { display: block; width: 5.5rem; height: 43px; }
.skel-btn--wide { width: 9rem; margin-top: 12px; }
.skel-pill { display: block; width: 6.5rem; height: 27px; border-radius: 999px; }
.pills > .skel-pill { display: inline-block; }
.skel-row.keys__row { margin-top: 18px; }
.skel-form { display: block; height: 48px; margin-top: 10px; border-radius: var(--radius); }
.skel-upd .skel-line--name { margin-bottom: 6px; }
.skel-upd .skel-pill { margin-bottom: 10px; }
.skel-upd .skel-line--sub { margin-top: 10px; }
.skel-item, .skel-disk { list-style: none; }
.skel-item .skel-line--sub, .skel-disk .skel-line--sub { margin-top: 10px; }
.skel-disk .skel-line--name { height: 21px; margin-bottom: 8px; }
.skel-disk .skel-line--sub { margin-top: 6px; }
.skel-bar { display: block; height: 8px; border-radius: 999px; }
.skel-chart .skel-line--title { height: 26px; }
.skel-block { display: block; height: 160px; margin-top: 12px; }
.skel-block--chart { height: 260px; margin-top: 0; }
@media (max-width: 900px) {  /* phones: help text wraps to more lines and the key form stacks */
  .skel-line--help { height: 95px; }
  .skel-form { height: 105px; }
  .skel-upd .skel-pill { margin-bottom: 45px; }
  .skel-block { height: 215px; }
  .skel-block--chart { height: 220px; }
}
/* Ripping page: a settings row's text may shrink, and a row with a dropdown wraps it under the text on a phone */
.rip .status-row > div { min-width: 0; }
.rip .rip__drive { flex-wrap: wrap; }
.rip .rip__drive > div { flex: 1 1 12rem; }
.rip .rip__drive select { max-width: 100%; }
.rip__ready select { flex: 1 1 220px; min-width: 0; max-width: 100%; }
/* One block per drive; with two, each sits in its own panel with its name on top */
.rip__drives { display: grid; gap: 16px; }
.rip__drives:empty { display: none; }
.rip__drives--multi .rip__block { border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-width: 0; }
.rip__block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.rip__block-head .pills { margin: 0; }
.rip__fold { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rip__fold .imp__file { margin: 0; }
.rip__block.is-folded .sec-toggle__arrow { transform: none; }
.rip__block.is-folded .rip__block-head { margin-bottom: 0; }
/* Ripping page: "All drives" (the global controls) looks nothing like a drive's own settings */
.rip__all { border: 2px solid var(--yellow); border-radius: 10px; background: rgba(255, 214, 10, .05); padding: 16px; margin: 4px 0 18px; min-width: 0; }
.rip__all-title { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: .06em; text-transform: uppercase; color: var(--yellow); margin: 0 0 4px; }
.rip__all-line { font-size: .85rem; font-weight: 600; margin: 0 0 14px; }
.rip__all .stat__sub:last-of-type { margin-top: 6px; }
.rip__acts { margin: 0 0 14px; padding: 0 0 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.rip__acts-title { font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); margin: 0 0 8px; }
.rip__acts .rip__confirm { margin-top: 10px; }
.rip__acts .stat__sub[role="status"] { margin-top: 10px; overflow-wrap: anywhere; }
.rip__acts--solo { padding-bottom: 10px; margin-bottom: 10px; }
@media (max-width: 480px) { .rip__acts .rip__buttons .btn { flex: 1 1 calc(50% - 8px); } }
.rip__ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.rip__both { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.rip__tag { display: inline-block; font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-dim); vertical-align: middle; white-space: nowrap; }
.rip__all .rip__tag { border-color: var(--yellow); color: var(--yellow); }
.rip__confirmbar { margin: 14px 0 0; padding: 12px; border: 1px solid var(--yellow); border-radius: 8px; background: var(--bg-raised); }
.rip__confirmbar .stat__sub { color: var(--text); margin: 0; }
.rip__own { margin-top: 18px; padding: 14px 0 0; border-top: 1px solid var(--line); }
.rip__own-title { font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); margin: 0 0 4px; }
.rip__own .imp__settings { margin-top: 12px; }
.rip__ownrow { padding-left: 10px; border-left: 3px solid var(--line); }
.rip__ownrow[data-own="1"] { border-left-color: var(--live); }
.rip__ownrow[data-own="1"] .rip__tag { border-color: var(--live); color: var(--live); }
.rip__ownrow .rip__ctl { justify-content: flex-end; }
@media (max-width: 480px) { .rip__all { padding: 12px; } .rip__ownrow .rip__ctl { justify-content: flex-start; } }
.rip__both[hidden], .rip__tag[hidden], .rip__ctl [hidden], .rip__confirmbar[hidden], .rip__own[hidden], .rip__side[hidden] { display: none; }
.rip .rip__drive > .rip__ctl { flex: 0 1 auto; }
.rip .rip__all .imp__settings, .rip .rip__own .imp__settings { grid-template-columns: minmax(0, 1fr); }
.rip .rip__ctl select, .rip .rip__ctl .rip__min { max-width: 100%; }

/* ---- timeline (::: timeline, the History page): a centre line with dated entries on alternating sides ---- */
.timeline { --tl-fill: 1; list-style: none; position: relative; margin: 8px 0 0; padding: 0; display: grid; gap: 28px; }
.timeline::before, .timeline::after { content: ""; position: absolute; top: 0; bottom: 0; left: 15px; width: 2px; background: var(--line); border-radius: 2px; }
.timeline::after { background: linear-gradient(var(--live), var(--yellow)); transform-origin: top; transform: scaleY(var(--tl-fill)); }
.tl-item { position: relative; padding-left: 48px; }
.tl-item::before { content: ""; position: absolute; left: 8px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--live); box-shadow: 0 0 0 4px var(--bg); }
.tl-date { display: inline-block; padding: 4px 14px; border-radius: 999px; background: var(--bg-panel); border: 1px solid var(--line); color: var(--text-dim); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tl-text { margin-top: 8px; color: var(--text); line-height: 1.55; overflow-wrap: anywhere; }
.tl-item--next::before { border-color: var(--yellow); border-style: dashed; }
.tl-item--next .tl-date { border-color: var(--yellow); color: var(--yellow); }
.tl-item--next .tl-text { color: var(--text-dim); }
@media (min-width: 760px) {
  .timeline { gap: 36px; }
  .timeline::before, .timeline::after { left: 50%; margin-left: -1px; }
  .tl-item { width: 50%; padding: 0 44px 0 0; text-align: right; }
  .tl-item:nth-child(even) { margin-left: 50%; padding: 0 0 0 44px; text-align: left; }
  .tl-item::before { left: auto; right: -8px; }
  .tl-item:nth-child(even)::before { right: auto; left: -8px; }
}
/* The entries are never hidden by CSS: timeline.js fades each one in with the Web Animations API just before it scrolls into view (so a
   screenshot of the whole page, which never scrolls, still shows every entry). It adds .is-in once an entry has played. */
@media (prefers-reduced-motion: no-preference) {
  .tl-item--next.is-in::before { animation: tl-pulse 2.4s ease-in-out 1s infinite; }
}
@keyframes tl-pulse { 50% { box-shadow: 0 0 0 4px var(--bg), 0 0 14px 6px var(--action-glow); } }
.page p.lead + p.lead { margin-top: 14px; }   /* paragraphs run together otherwise (About on /history/) */

/* Overflow Card (dashboard Services): the list of every container without a card of its own. */
.ovf__body { margin-top: 4px; }
.ovf__group { margin: 14px 0 6px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.ovf__list { list-style: none; display: grid; gap: 10px; }
.ovf__row { border-top: 1px solid var(--line); padding-top: 10px; }
.ovf__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ovf__name { font-weight: 600; overflow-wrap: anywhere; margin-right: auto; }
.ovf__sub { margin-top: 4px; font-size: .78rem; color: var(--text-dim); overflow-wrap: anywhere; }
.ovf__x { font: inherit; line-height: 1; color: inherit; background: none; border: 0; padding: 0 2px; cursor: pointer; }
.ovf__x:hover { color: var(--text); }
.ovf__x:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }
.svc__btns { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Stockpile demo card (dashboard Services, Owner only). */
.demo__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.demo__pick { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-dim); }
.demo__pick select { font: inherit; color: var(--text); background: var(--bg-raised); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.demo__pick select:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.demo [data-demo-hint] { margin-top: 8px; }

/* ---- video blocks (::: video, ::: youtube): a clip with the player's own controls, or a YouTube video that loads on play ---- */
.page .video { margin: 20px 0; }
.page .video video, .page .video .yt, .page .video .yt__frame {
  display: block; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: var(--radius); background: #0b0b0b;
}
.page .video video { height: auto; object-fit: contain; }
.page .video figcaption { margin-top: 8px; font-size: .84rem; color: var(--text-dim); }
.page .video .yt {
  display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px; text-align: left; color: var(--text);
  background: radial-gradient(ellipse at center, #1c1c1c, #0b0b0b);
}
.page .video .yt:hover { border-color: var(--yellow); }
.page .video .yt:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.yt__play { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--yellow); color: #111; }
.yt__play svg { width: 30px; height: 30px; }
.yt__text { display: grid; gap: 2px; min-width: 0; }
.yt__text strong { font-size: 1.05rem; }
.yt__text small { color: var(--text-dim); font-size: .78rem; overflow-wrap: anywhere; }

/* ---- /links/ (site/links_page.py): our own link-in-bio page, one column of big buttons ---- */
body.links { min-height: 100vh; display: flex; flex-direction: column; }
.links__wrap { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: 48px 20px 40px; text-align: center; }
.links__home { display: inline-block; border-radius: 50%; }
.links__home:focus-visible { outline: 2px solid var(--yellow); outline-offset: 4px; }
.links__avatar { display: block; width: 112px; height: 112px; border-radius: 50%; box-shadow: 0 0 28px -6px var(--live-glow); }
.links__title { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; font-size: clamp(1.9rem, 8vw, 2.5rem); line-height: 1.05; margin: 20px 0 8px; }
.links__tag { color: var(--rust); font-weight: 600; margin: 0 0 6px; }
.links__list { list-style: none; display: grid; gap: 12px; margin: 28px 0 0; padding: 0; }
.links__btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; padding: 12px 18px;
  border: 1px solid var(--green-bright); border-radius: 12px; background: var(--green); color: var(--text); text-decoration: none;
  transition: transform .15s, border-color .15s, background .15s;
}
.links__btn:hover { background: color-mix(in srgb, var(--green) 80%, var(--green-bright)); border-color: var(--yellow); transform: translateY(-2px); }
.links__btn:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.links__name { font-weight: 700; font-size: 1.02rem; }
.links__note { font-size: .8rem; color: color-mix(in srgb, var(--text) 70%, transparent); }
@media (prefers-reduced-motion: reduce) { .links__btn { transition: none; } .links__btn:hover { transform: none; } }

/* Links page editor (dashboard /links): header card, link cards with a drag handle and an options menu, and a phone preview. */
.lnk__top { display: grid; gap: 10px; margin-top: 12px; }
.lnk__field { display: grid; gap: 4px; font-size: .78rem; color: var(--text-dim); }
.lnked { display: grid; gap: 28px; }
.lnked__main { min-width: 0; display: grid; gap: 14px; align-content: start; }
.lnked__bar { display: flex; flex-wrap: wrap; gap: 8px; }
.lnked__preview { display: none; }
.lnked__preview-label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); margin: 0 0 10px; text-align: center; }
.lnkphone { border: 10px solid #000; border-radius: 38px; background: #111; height: 620px; overflow: auto; box-shadow: 0 0 0 1px var(--line), 0 20px 50px -20px rgba(0, 0, 0, .8); }
.lnkp { padding: 28px 14px 24px; text-align: center; font-size: .9rem; }
.lnkp .links__avatar { width: 72px; height: 72px; margin: 0 auto; }
.lnkp .links__title { font-size: 1.35rem; margin: 12px 0 4px; }
.lnkp .links__tag { font-size: .8rem; }
.lnkp .links__social { margin-top: 12px; gap: 8px; }
.lnkp .links__icon { width: 34px; height: 34px; pointer-events: none; }
.lnkp .links__icon svg { width: 16px; height: 16px; }
.lnkp .links__list { margin-top: 18px; gap: 8px; }
.lnkp .links__btn { min-height: 44px; padding: 8px 12px; pointer-events: none; }
.lnkp .links__name { font-size: .85rem; }
.lnkp .links__note { font-size: .68rem; }
@media (min-width: 1000px) {
  .lnked { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }
  .lnked__preview { display: block; position: sticky; top: 24px; }
}
.lnkc-list { position: relative; list-style: none; display: grid; gap: 10px; margin: 0; padding: 0; }   /* position: the cards' offsetTop is measured from the list while dragging */
.lnkc { position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-panel); transition: border-color .15s, box-shadow .15s; }
.lnkc:hover { border-color: color-mix(in srgb, var(--text) 25%, var(--line)); }
.lnkc.is-off .lnkc__row { opacity: .55; }
.lnkc.is-slot { border: 1px dashed color-mix(in srgb, var(--text) 25%, var(--line)); background: color-mix(in srgb, var(--bg-panel) 55%, transparent); }
.lnkc.is-slot > * { visibility: hidden; }
.lnkc.lnkc--ghost { position: fixed; left: 0; top: 0; margin: 0; z-index: 1000; pointer-events: none; border-color: var(--yellow); background: var(--bg-raised); box-shadow: 0 24px 50px -14px rgba(0, 0, 0, .95); cursor: grabbing; will-change: transform; }
.lnkc--ghost .lnkc__menu, .lnkc--ghost .lnkc__edit { display: none; }
.lnkc-list.is-sorting, .lnkc-list.is-sorting * { user-select: none; cursor: grabbing !important; }
body.is-sorting { cursor: grabbing; user-select: none; }
.lnkc__row { display: flex; align-items: stretch; gap: 4px; padding: 6px; cursor: grab; user-select: none; }
.lnkc { position: relative; }
.lnkc__grip, .lnkc__more { flex: none; display: grid; place-items: center; width: 40px; border: 0; border-radius: 10px; background: none; color: var(--text-dim); cursor: pointer; }
.lnkc__grip { cursor: grab; touch-action: none; }
.lnkc__grip:hover, .lnkc__more:hover { color: var(--text); background: var(--bg-raised); }
.lnkc__grip:focus-visible, .lnkc__more:focus-visible, .lnkc__body:focus-visible, .lnkc__item:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.lnkc__grip svg, .lnkc__more svg { width: 22px; height: 22px; }
.lnkc__body { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 8px 6px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: left; cursor: inherit; }
.lnkc__title { font-weight: 700; overflow-wrap: anywhere; }
.lnkc__url { font-size: .8rem; color: var(--text-dim); overflow-wrap: anywhere; }
.lnkc__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lnkc__menu { position: absolute; top: calc(100% - 4px); right: 8px; z-index: 5; min-width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raised); box-shadow: 0 16px 36px -12px rgba(0, 0, 0, .9); display: grid; gap: 2px; }
.lnkc__menu[hidden] { display: none; }
.lnkc__item { padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: .88rem; text-align: left; cursor: pointer; }
.lnkc__item:hover { background: var(--bg-panel); }
.lnkc__item.is-danger { color: #e07a3a; }
.lnkc__edit { display: grid; gap: 10px; padding: 4px 14px 14px; border-top: 1px solid var(--line); margin-top: 2px; padding-top: 12px; }
.lnkc__edit[hidden] { display: none; }
.lnkc__done { justify-self: start; }
.lnkc-empty { color: var(--text-dim); text-align: center; padding: 24px; border: 1px dashed var(--line); border-radius: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { .lnkc { transition: none; } }

/* Links editor: the icon row (round icons inline above the buttons). */
.lnki { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-panel); }
.lnki__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lnki__title { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); margin: 0; }
.lnki__title--buttons { margin: 6px 0 -4px; }
.lnki-row { position: relative; list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 2px 0; padding: 0; }
.lnki-row.is-sorting, .lnki-row.is-sorting * { cursor: grabbing !important; user-select: none; }
.lnki__chip { position: relative; width: 52px; height: 52px; border-radius: 50%; touch-action: pan-y; }
.lnki__btn { display: grid; place-items: center; width: 100%; height: 100%; border: 1px solid var(--line); border-radius: 50%; background: var(--bg-raised); color: var(--text); cursor: grab; transition: border-color .15s, color .15s; }
.lnki__btn svg { width: 24px; height: 24px; }
.lnki__btn:hover { border-color: var(--yellow); }
.lnki__btn:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.lnki__chip.is-open .lnki__btn { border-color: var(--yellow); color: var(--yellow); }
.lnki__chip.is-off .lnki__btn { opacity: .4; }
.lnki__chip.is-slot { border: 1px dashed color-mix(in srgb, var(--text) 25%, var(--line)); }
.lnki__chip.is-slot > * { visibility: hidden; }
.lnki__chip.lnki--ghost { position: fixed; left: 0; top: 0; margin: 0; z-index: 1000; pointer-events: none; will-change: transform; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .8)); }
.lnki__chip.lnki--ghost .lnki__btn { border-color: var(--yellow); }
.lnki__edit { border-top: 1px solid var(--line); margin-top: 6px; padding: 12px 0 0; }
.lnki__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lnki__danger { color: #e07a3a; }
@media (prefers-reduced-motion: reduce) { .lnki__btn { transition: none; } }

/* /links/ icon row: social links as little round icons above the buttons. */
.links__social { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 18px 0 0; padding: 0; }
.links__icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); color: var(--text); background: var(--bg-panel); transition: border-color .15s, color .15s, transform .15s; }
.links__icon svg { width: 22px; height: 22px; }
.links__icon:hover { border-color: var(--yellow); color: var(--yellow); transform: translateY(-2px); }
.links__icon:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .links__icon { transition: none; } .links__icon:hover { transform: none; } }

/* Footer links (About, FAQ) above the copyright line, on every public page. */
.footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin-bottom: 12px; font-size: .85rem; }
.footer__links a { color: var(--text-dim); text-decoration: none; }
.footer__links a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--yellow); text-underline-offset: 3px; }
.footer__links a:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; border-radius: 3px; }

/* ---- Printing, and saving the page as a PDF (the same trouble as a full-page screenshot): nothing hidden, nothing floating ---- */
@media print {
  html { scroll-behavior: auto; }
  body { background: #fff; color: #111; }
  body::before, .nav__burger, .nav__cta-desktop, .search { display: none !important; }
  .nav { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; background: none; border: 0; }
  .nav__links { position: static; height: auto; clip-path: none; visibility: visible; flex-direction: row; background: none; overflow: visible; }
  .nav__flyout, .nav__mobile-cta { display: none; }
  .hero { height: auto; min-height: 0; }
  .card, .project-card, .status-group, .tl-item, figure, .spec-wrap { break-inside: avoid; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; word-break: break-all; }
}
