:root {
  /* Font token only; the palette tokens are defined in `themes.css`.
   * Loading order in `templates/base.html.twig` puts `themes.css`
   * AFTER `base.css`, so the `:root[data-theme="..."]` selectors win
   * over any bare `:root` fallback in `themes.css`. */
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", "Fira Code", Menlo, Consolas, "Liberation Mono", monospace;
}

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

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  padding: 10px 24px 10px;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

@media (max-width: 720px) {
  body { font-size: 14px; max-width: 100%; }
  .topbar__host-tld { display: none; }
  .topbar__link { min-height: 44px; }
}

::selection { background: var(--accent); color: #000; }

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { color: var(--bright); text-decoration: underline; text-decoration-color: var(--accent); }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 255, 156, 0.015) 0px,
    rgba(0, 255, 156, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 1;
}

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

/* Defensive: clip any rogue horizontal overflow at the root so a single
 * long unbroken token (URL, FQN, hex) on a phone cannot trigger page-level
 * horizontal scroll. Mirrors personal-en/assets/css/heatmap.css:18. */
html, body { overflow-x: clip; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #000;
  padding: 6px 10px;
  z-index: 100;
  font-weight: 600;
}
.skip:focus { left: 8px; top: 8px; }

/* ============== TAG SYSTEM (universal) ==============
 * Single primitive family that subsumes the prior 8-class zoo
 * (.badge, .project-stats__chip*, .article-header__tag, .project__tag*,
 *  .article__tag*, .hero__tag, .svc__tag, .card__tag, .cmp__tag, .focus__tag).
 *
 *   .tag          bordered pill, inline label on listings
 *   .hero__tag    bordered pill, kicker at the top of a page/section
 *   .code-label   borderless uppercase accent label (// orch, // SVC-01, …)
 *
 * Pill-style interactive controls (.pill) live in article-graph.css because
 * they carry hover/active state semantics that belong to a button, not a label.
 */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--tag-fg);
  padding: 2px 8px;
  border: 1px solid var(--tag-border);
  background: transparent;
  border-radius: var(--tag-radius);
}
.tag--accent { color: var(--tag-fg-accent); border-color: var(--tag-border-accent); }
.tag--filled { background: var(--tag-bg-neutral); }
.tag--warn   { color: var(--tag-fg-warn); border-color: var(--tag-border-warn); }
.tag--lang   { color: var(--tag-fg-warn); border-color: var(--line); }

.status--active { color: var(--accent); }
.status--wip { color: var(--warn); }
.status--idea { color: var(--dim); }
.status--archived { color: var(--archived); }

.hero__tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  padding: 4px 10px;
  border: 1px solid var(--accent-dim);
  border-radius: var(--tag-radius);
  margin-bottom: 20px;
}

.code-label {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}