/* ==========================================================================
   NDTZ — core: tokens, reset, typography, motion, primitives.

   Everything here is served from this origin. No external fonts, scripts,
   stylesheets or images are ever referenced — /privacy claims "no third
   parties, no tracking", and that claim is only true because of this rule.
   ========================================================================== */

/* ---------------------------------------------------------------- fonts -- */
/* Geist + Geist Mono, variable weight axis, SIL OFL (see assets/fonts/LICENSE.txt).
   swap: text paints immediately in the system fallback, then reflows once. */

@font-face {
  font-family: 'Geist';
  src: url('../assets/fonts/geist-sans.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('../assets/fonts/geist-mono.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------- tokens -- */

:root {
  /* — brand ————————————————————————————————————————————————
     One red, used deliberately: primary action, active nav, brand mark,
     live indicators. It is NOT the page ambience. Restraint is what makes
     it read as a product colour rather than a theme. */
  --brand: #e61733;
  --brand-hi: #ff3350;
  --brand-lo: #b8102a;
  --brand-ink: #ffffff;
  --brand-a08: rgba(230, 23, 51, 0.08);
  --brand-a16: rgba(230, 23, 51, 0.16);
  --brand-a32: rgba(230, 23, 51, 0.32);
  --brand-a48: rgba(230, 23, 51, 0.48);

  /* — neutrals ——————————————————————————————————————————————
     Cool near-black ramp. Each step is a real elevation level; components
     pick a step rather than inventing a one-off colour. */
  --n-0: #060608;
  --n-1: #0a0a0d;
  --n-2: #101014;
  --n-3: #16161c;
  --n-4: #1d1d24;
  --n-5: #25252e;
  --n-6: #2f2f3a;
  --n-7: #3d3d4a;

  --bg: var(--n-0);
  --bg-raised: var(--n-1);
  --surface: var(--n-2);
  --surface-2: var(--n-3);
  --surface-3: var(--n-4);

  --line: #1f1f27;
  --line-hi: #2c2c37;
  --line-brand: var(--brand-a32);

  /* — text ——————————————————————————————————————————————————— */
  --text: #f6f6f8;
  --text-2: #a9a9b8;
  --text-3: #77778a;

  /* — status ————————————————————————————————————————————————— */
  --ok: #2fbf6b;
  --ok-a16: rgba(47, 191, 107, 0.16);
  --warn: #e5a13a;
  --warn-a16: rgba(229, 161, 58, 0.16);
  --danger: #ef4351;
  --danger-a16: rgba(239, 67, 81, 0.16);
  --info: #5b8cff;
  --info-a16: rgba(91, 140, 255, 0.16);

  /* — type ——————————————————————————————————————————————————
     Geist first; the system stack is the swap fallback, so metrics stay
     close enough that the reflow is barely visible. */
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --t-display: 3.25rem;
  --t-h1: 2.25rem;
  --t-h2: 1.6rem;
  --t-h3: 1.125rem;
  --t-body: 0.9375rem;
  --t-sm: 0.8125rem;
  --t-xs: 0.75rem;
  --t-micro: 0.6875rem;

  /* — shape ——————————————————————————————————————————————————— */
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* — depth ——————————————————————————————————————————————————
     Shadows are paired with a hairline highlight on top; a shadow alone
     reads flat on near-black. */
  --sh-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --sh-md: 0 4px 16px -4px rgba(0, 0, 0, 0.6);
  --sh-lg: 0 16px 48px -12px rgba(0, 0, 0, 0.7);
  --sh-brand: 0 6px 24px -8px var(--brand-a48);
  --hairline: inset 0 1px 0 rgba(255, 255, 255, 0.04);

  /* — motion ————————————————————————————————————————————————
     Custom curves: the built-in CSS easings are too weak to read as
     intentional. Never ease-in on UI — it delays the first frame, which
     is the exact moment the user is watching. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  --d-press: 120ms;
  --d-fast: 150ms;
  --d-base: 190ms;
  --d-slow: 260ms;
  --d-pane: 220ms;

  /* — layout ————————————————————————————————————————————————— */
  --header-h: 60px;
  --wrap: 1160px;
  --wrap-narrow: 760px;
  --side-w: 244px;
  --gutter: 24px;
}

/* ---------------------------------------------------------------- reset -- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

/* Pages carrying a second sticky bar need anchors to clear both, or a jumped-to
   heading lands underneath the spine instead of below it. */
html:has(.jumpbar) {
  scroll-padding-top: calc(var(--header-h) + 74px);
}

/* Lenis animates the real scroll position, so native smooth scrolling has to
   get out of its way — running both makes anchor jumps stutter and fight.
   Lenis adds .lenis to <html> only while it is actually running, which means
   the native behaviour above stays the fallback when it is not. */
html.lenis {
  scroll-behavior: auto;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.55;
  font-feature-settings: 'ss01' 1, 'cv01' 1; /* Geist: straighter l, single-storey a */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--brand);
  color: var(--brand-ink);
}

/* Visible only for keyboard users — pointer users never see a focus ring. */
:focus-visible {
  outline: 2px solid var(--brand-hi);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--n-5);
  border: 3px solid var(--bg);
  border-radius: var(--r-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--n-6);
}

/* ----------------------------------------------------------- typography -- */

h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* Optical tracking: the larger the type, the tighter it wants to be. */
.t-display {
  font-size: var(--t-display);
  font-weight: 620;
  line-height: 1.03;
  letter-spacing: -0.035em;
}

.t-h1 {
  font-size: var(--t-h1);
  letter-spacing: -0.028em;
}

.t-h2 {
  font-size: var(--t-h2);
  letter-spacing: -0.024em;
}

.t-h3 {
  font-size: var(--t-h3);
  font-weight: 580;
  letter-spacing: -0.015em;
}

.t-lead {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-2);
  text-wrap: pretty;
}

.t-sm {
  font-size: var(--t-sm);
}

.muted {
  color: var(--text-2);
}
.muted-2 {
  color: var(--text-3);
}

/* Section eyebrow — small caps label above a heading. */
.eyebrow {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
  letter-spacing: -0.01em;
}

/* Numbers in tables/stats: tabular so columns don't jitter as values change. */
.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.accent {
  color: var(--brand);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------- layout -- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap-narrow {
  max-width: var(--wrap-narrow);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.spacer {
  flex: 1;
}

/* ---------------------------------------------------------------- icons -- */

.ico {
  width: 1em;
  height: 1em;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ico-16 {
  font-size: 16px;
}
.ico-18 {
  font-size: 18px;
}
.ico-20 {
  font-size: 20px;
}
.ico-24 {
  font-size: 24px;
}

/* -------------------------------------------------------------- buttons -- */

.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-line: var(--line-hi);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-line);
  box-shadow: var(--hairline);
  font-size: var(--t-sm);
  font-weight: 550;
  letter-spacing: -0.01em;
  white-space: nowrap;
  user-select: none;
  transition:
    transform var(--d-press) var(--ease-out),
    background-color var(--d-fast) ease,
    border-color var(--d-fast) ease,
    opacity var(--d-fast) ease,
    box-shadow var(--d-fast) ease;
}

/* Press feedback on every pressable thing: the UI must feel like it heard
   you. Subtle — 0.97 is felt, not seen. */
.btn:active:not(:disabled) {
  transform: scale(0.97);
  transition-duration: 60ms;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Hover only where a real pointer exists — touch fires hover on tap. */
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) {
    background: var(--surface-3);
    border-color: var(--n-6);
  }
}

.btn-primary {
  --btn-fg: var(--brand-ink);
  --btn-line: transparent;
  background: linear-gradient(180deg, var(--brand-hi), var(--brand));
  box-shadow:
    var(--sh-brand),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  font-weight: 600;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover:not(:disabled) {
    background: linear-gradient(180deg, #ff4a63, var(--brand-hi));
    border-color: transparent;
    box-shadow:
      0 8px 28px -8px var(--brand-a48),
      inset 0 1px 0 rgba(255, 255, 255, 0.28);
  }
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-line: transparent;
  --btn-fg: var(--text-2);
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover:not(:disabled) {
    background: var(--surface-2);
    border-color: transparent;
    color: var(--text);
  }
}

.btn-danger {
  --btn-fg: #ffd9dc;
  --btn-bg: rgba(239, 67, 81, 0.12);
  --btn-line: rgba(239, 67, 81, 0.28);
}

@media (hover: hover) and (pointer: fine) {
  .btn-danger:hover:not(:disabled) {
    --btn-bg: rgba(239, 67, 81, 0.2);
    --btn-line: rgba(239, 67, 81, 0.45);
  }
}

.btn-sm {
  height: 30px;
  padding: 0 11px;
  font-size: var(--t-xs);
  border-radius: var(--r-xs);
}

.btn-lg {
  height: 46px;
  padding: 0 22px;
  font-size: var(--t-body);
  border-radius: var(--r-md);
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
}

/* Busy state: the label stays (no layout shift), a spinner replaces it. */
.btn[data-busy='true'] {
  color: transparent;
  pointer-events: none;
}

.btn[data-busy='true']::after {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  animation: spin 620ms linear infinite;
}

/* Deliberately fast: a quicker spinner makes the wait *feel* shorter, even
   when the request takes exactly as long. */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------------------------------------------------------- cards -- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm), var(--hairline);
}

.card-pad {
  padding: 20px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.card-head .ico {
  color: var(--text-3);
  margin-top: 2px;
}

.card-head h3 {
  font-size: var(--t-h3);
  font-weight: 580;
}

.card-head p {
  margin-top: 3px;
  font-size: var(--t-sm);
  color: var(--text-3);
  line-height: 1.5;
  text-wrap: pretty;
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* A lone button in a column-flex card would otherwise stretch to full width. */
.card-body > .btn {
  align-self: flex-start;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* --------------------------------------------------------------- fields -- */

/* A label + control pair. Deliberately NOT flex: 1 1 220px here — most
   fields sit inside a column-direction .card-body, where a flex-basis would
   be read as a height and stretch every field to 220px tall. The growing
   behaviour belongs to .field-row, which is the row-direction container. */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field > label,
.label {
  font-size: var(--t-sm);
  font-weight: 520;
  color: var(--text-2);
  letter-spacing: -0.005em;
}

.hint {
  font-size: var(--t-xs);
  color: var(--text-3);
  line-height: 1.5;
  text-wrap: pretty;
}

.input,
.select,
.textarea {
  width: 100%;
  min-width: 0;
  background: var(--n-1);
  border: 1px solid var(--line-hi);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: var(--t-sm);
  color: var(--text);
  transition:
    border-color var(--d-fast) ease,
    box-shadow var(--d-fast) ease,
    background-color var(--d-fast) ease;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-3);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--n-6);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-a16);
  background: var(--n-2);
}

.textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
  font-family: inherit;
}

/* Native select, restyled: the chevron is an inline data-URI SVG, which is
   same-origin by definition (no asset request, no third party). */
.select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2377778a' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px;
  cursor: pointer;
}

.select option {
  background: var(--n-2);
  color: var(--text);
}

/* ------------------------------------------------------------- switches -- */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .track {
  position: relative;
  width: 40px;
  height: 23px;
  flex: none;
  border-radius: var(--r-pill);
  background: var(--n-5);
  border: 1px solid var(--line-hi);
  transition:
    background-color var(--d-base) var(--ease-out),
    border-color var(--d-base) var(--ease-out);
}

.switch .track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: transform var(--d-base) var(--ease-out);
}

.switch input:checked + .track {
  background: var(--brand);
  border-color: var(--brand-hi);
}

.switch input:checked + .track::after {
  transform: translateX(17px);
}

/* The knob squashes slightly while held — a tiny physical cue that the
   control is under your finger. */
.switch:active .track::after {
  width: 20px;
}

.switch input:checked:active + .track::after {
  transform: translateX(14px);
}

.switch input:focus-visible + .track {
  outline: 2px solid var(--brand-hi);
  outline-offset: 2px;
}

.switch .switch-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.switch .switch-label {
  font-size: var(--t-sm);
  font-weight: 520;
}

.switch .switch-sub {
  font-size: var(--t-xs);
  color: var(--text-3);
}

/* A switch presented as a full-width row inside a card. */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  background: var(--n-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color var(--d-fast) ease;
}

@media (hover: hover) and (pointer: fine) {
  .switch-row:hover {
    border-color: var(--line-hi);
  }
}

/* ---------------------------------------------------------------- pills -- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 4px 0 10px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  border: 1px solid var(--line-hi);
  font-size: var(--t-xs);
  font-weight: 500;
  white-space: nowrap;
}

.pill.static {
  padding-right: 10px;
}

.pill .x {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: var(--text-3);
  transition:
    background-color var(--d-fast) ease,
    color var(--d-fast) ease,
    transform var(--d-press) var(--ease-out);
}

.pill .x:hover {
  background: var(--danger-a16);
  color: #ff9aa2;
}

.pill .x:active {
  transform: scale(0.88);
}

/* Role pills carry the role's own colour as a leading dot. */
.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  flex: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--line-hi);
}

.badge.on {
  background: var(--ok-a16);
  color: #7fe0a6;
  border-color: rgba(47, 191, 107, 0.3);
}

.badge.off {
  background: var(--n-3);
  color: var(--text-3);
}

.badge.brand {
  background: var(--brand-a16);
  color: #ff8f9d;
  border-color: var(--brand-a32);
}

/* Live dot — the only always-on animation in the system, and it is 2s slow
   so it reads as a heartbeat rather than a blink. */
.live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 var(--ok-a16);
  animation: pulse 2.4s var(--ease-out) infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 191, 107, 0.5);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(47, 191, 107, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 191, 107, 0);
  }
}

/* ---------------------------------------------------------------- lists -- */

.list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--n-1);
  border-bottom: 1px solid var(--line);
  font-size: var(--t-sm);
  transition: background-color var(--d-fast) ease;
}

.list-row:last-child {
  border-bottom: 0;
}

@media (hover: hover) and (pointer: fine) {
  .list-row:hover {
    background: var(--n-2);
  }
}

.list-empty {
  padding: 22px 14px;
  text-align: center;
  font-size: var(--t-sm);
  color: var(--text-3);
  background: var(--n-1);
}

/* Rows leave the list by collapsing rather than vanishing — an element
   disappearing with no transition reads as a glitch. */
.list-row.leaving {
  animation: row-out 180ms var(--ease-out) forwards;
}

@keyframes row-out {
  to {
    opacity: 0;
    transform: translateX(-8px);
    max-height: 0;
    padding-block: 0;
    border-bottom-width: 0;
  }
}

/* --------------------------------------------------------------- empty --- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--line-hi);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
}

.empty .ico {
  color: var(--text-3);
  font-size: 30px;
  stroke-width: 1.4;
}

.empty h3 {
  font-size: var(--t-h3);
}

.empty p {
  font-size: var(--t-sm);
  color: var(--text-3);
  max-width: 42ch;
}

/* ---------------------------------------------------------------- toast -- */

.toast-region {
  position: fixed;
  z-index: 200;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: min(92vw, 400px);
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line-hi);
  box-shadow: var(--sh-lg), var(--hairline);
  font-size: var(--t-sm);
  pointer-events: auto;
  /* Transitions, not keyframes: toasts can stack up faster than one
     animation completes, and transitions retarget instead of restarting. */
  transition:
    opacity var(--d-slow) var(--ease-out),
    transform var(--d-slow) var(--ease-out);
}

.toast[data-state='enter'] {
  opacity: 0;
  transform: translateY(12px) scale(0.96);
}

.toast[data-state='exit'] {
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition-duration: var(--d-fast); /* exits snappier than enters */
}

.toast .ico {
  flex: none;
}

.toast.ok .ico {
  color: var(--ok);
}
.toast.err .ico {
  color: var(--danger);
}
.toast.info .ico {
  color: var(--info);
}

/* -------------------------------------------------------------- avatars -- */

.avatar {
  border-radius: 50%;
  background: var(--surface-3);
  object-fit: cover;
  flex: none;
}

/* Fallback when a guild/user has no image: first letter on a tinted plate. */
.noimg {
  display: grid;
  place-items: center;
  flex: none;
  background: linear-gradient(140deg, var(--n-4), var(--n-2));
  border: 1px solid var(--line-hi);
  color: var(--text-2);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* -------------------------------------------------------------- skeleton -- */

.skel {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--n-2) 25%, var(--n-4) 37%, var(--n-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

@keyframes shimmer {
  to {
    background-position: -135% 0;
  }
}

/* --------------------------------------------------------------- reveal -- */
/* Landing-only entrance. Rare-view content, so it earns real animation.
   Elements start visible if JS never runs — .reveal is added by script. */

.reveal {
  opacity: 0;
  transform: translateY(14px);
}

.reveal.in {
  opacity: 1;
  transform: none;
  transition:
    opacity 620ms var(--ease-out),
    transform 620ms var(--ease-out);
}

/* ------------------------------------------------------ reduced motion --- */
/* Not "no motion": opacity and colour changes still aid comprehension.
   What goes away is movement, scaling and anything decorative/looping. */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .btn:active:not(:disabled),
  .pill .x:active {
    transform: none;
  }

  .toast[data-state='enter'],
  .toast[data-state='exit'] {
    transform: none;
  }

  .live,
  .skel {
    animation: none;
  }
}
