:root {
  --bg-void: #060709;
  --bg-base: #0C0E12;
  --bg-raised: #111419;
  --bg-overlay: #181B21;
  --border-subtle: #1C1F26;
  --border-default: #252930;
  --border-strong: #353A44;
  --text-primary: #F0EEE9;
  --text-secondary: #8A8D99;
  --text-tertiary: #787E90;
  --amber-500: #E8651A;
  --amber-400: #F07A33;
  --amber-600: #C45514;
  --sem-green: #22C55E;
  --sem-red: #EF4444;
  --sem-yellow: #EAB308;
  --code-bg: #0A0D11;
}

html, body {
  background: var(--bg-void);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* selection */
::selection { background: var(--amber-500); color: var(--bg-void); }

/* scrollbar – minimal */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* label */
.label-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* sharp-corner brand button */
.btn-amber {
  background: var(--amber-500);
  color: var(--bg-void);
  font-weight: 600;
  border-radius: 2px;
  transition: background 120ms ease;
}
.btn-amber:hover { background: var(--amber-400); }

.btn-ghost {
  background: var(--bg-raised);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: 2px;
  transition: border-color 120ms ease, background 120ms ease;
}
.btn-ghost:hover { border-color: var(--border-strong); background: var(--bg-overlay); }

/* terminal-logo cursor — blinking amber block after the wordmark */
.iacr-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 0.16em;
  background: var(--amber-500);
  transform: translateY(0.18em);
  animation: iacr-blink 1.06s step-end infinite;
}
@keyframes iacr-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* Pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

/* fade-in on scroll — only hide when JS has armed it via .reveal-armed */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 500ms ease-out, transform 500ms ease-out;
}
.reveal-armed {
  opacity: 0;
  transform: translateY(16px);
}
.reveal-armed.in {
  opacity: 1;
  transform: translateY(0);
}

/* Hero radial — slow drift so the page feels alive, not painted-on */
.hero-glow {
  background: radial-gradient(ellipse 700px 420px at 75% 50%, rgba(232,101,26,0.06), transparent 70%);
  pointer-events: none;
  animation: glow-drift 14s ease-in-out infinite;
}
@keyframes glow-drift {
  0%, 100% { opacity: 0.75; transform: translate3d(0, 0, 0) scale(1); }
  50% { opacity: 1; transform: translate3d(-2.5%, 1.5%, 0) scale(1.06); }
}

/* hover lift — cards rise + border warms. The workhorse of "less static". */
.lift { transition: transform 160ms cubic-bezier(0.2,0.7,0.2,1), border-color 160ms ease, box-shadow 160ms ease, background 160ms ease; }
.lift:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 12px 30px -16px rgba(0,0,0,0.7);
}
.lift-amber:hover {
  border-color: rgba(232,101,26,0.45);
  box-shadow: 0 14px 34px -18px rgba(232,101,26,0.28);
}

/* animated underline for inline links */
.link-underline { background-image: linear-gradient(currentColor, currentColor); background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size 180ms ease; }
.link-underline:hover { background-size: 100% 1px; }

/* doc TOC active state */
.toc-link { border-left: 2px solid transparent; transition: color 120ms ease, border-color 120ms ease; }
.toc-link.active { color: var(--text-primary); border-left-color: var(--amber-500); }

/* changelog timeline dot pulse on the newest entry */
.tl-dot-live { position: relative; }
.tl-dot-live::after {
  content: ""; position: absolute; inset: -4px; border-radius: 999px;
  border: 1px solid var(--amber-500); opacity: 0; animation: tl-ping 2.4s ease-out infinite;
}
@keyframes tl-ping { 0% { transform: scale(0.7); opacity: 0.7; } 100% { transform: scale(1.9); opacity: 0; } }

/* marquee for stack strip */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 45s linear infinite;
}

/* code block style */
.code-surface {
  background: var(--code-bg);
  border: 1px solid var(--code-border, #1A1D24);
}

/* tab active border */
.tab-rail {
  border-left: 2px solid var(--border-subtle);
  transition: border-color 120ms ease, background 120ms ease;
}
.tab-rail.active {
  border-left-color: var(--amber-500);
  background: linear-gradient(to right, rgba(232,101,26,0.04), transparent 60%);
}

/* faq icon swap */
.faq-toggle { transition: transform 220ms ease; }

/* small badge inside PR comment */
.sev-high { color: var(--sem-red); background: rgba(239,68,68,0.10); padding: 1px 6px; border-radius: 2px; }
.sev-med { color: var(--sem-yellow); background: rgba(234,179,8,0.10); padding: 1px 6px; border-radius: 2px; }
.sev-low { color: var(--sem-green); background: rgba(34,197,94,0.10); padding: 1px 6px; border-radius: 2px; }

.verified-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 999px;
  background: rgba(232,101,26,0.16);
  border: 1px solid var(--amber-500);
  position: relative;
}
.verified-dot::after {
  content: "";
  position: absolute; inset: 2px;
  background: var(--amber-500);
  border-radius: 999px;
}

/* segmented control */
.seg {
  display: inline-flex;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: 2px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 2px;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 120ms ease;
}
.seg button.active {
  background: var(--bg-overlay);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.seg button:not(.active):hover { color: var(--text-primary); }

/* radio row */
.radio-row {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.radio-row:hover { border-color: var(--border-default); }
/* Visible keyboard focus for the visually-hidden radio input inside the label. */
.radio-row:focus-within { outline: 1px solid var(--amber-500); outline-offset: 2px; }
.radio-row.active {
  border-color: var(--amber-500);
  background: linear-gradient(to right, rgba(232,101,26,0.05), transparent 80%);
}
.radio-dot {
  margin-top: 4px;
  width: 12px; height: 12px;
  border-radius: 999px;
  border: 1.5px solid var(--text-tertiary);
  flex-shrink: 0;
  position: relative;
}
.radio-row.active .radio-dot { border-color: var(--amber-500); }
.radio-row.active .radio-dot::after {
  content: "";
  position: absolute; inset: 2px;
  background: var(--amber-500);
  border-radius: 999px;
}

/* slider */
.slider-track {
  position: relative;
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
}
.slider-fill {
  position: absolute;
  height: 100%;
  background: var(--amber-500);
  border-radius: 2px;
}
.slider-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  background: var(--text-primary);
  border: 2px solid var(--amber-500);
  border-radius: 999px;
  cursor: pointer;
}

/* simple section divider line */
.hairline { border-top: 1px solid var(--border-subtle); }

/* dashed connector */
.connector {
  flex: 1;
  height: 1px;
  background-image: linear-gradient(to right, var(--border-default) 50%, transparent 50%);
  background-size: 8px 1px;
  background-repeat: repeat-x;
}

/* table — min-width makes narrow screens scroll the overflow-x container
   instead of crushing cells into mid-word wraps */
.dt-table { width: 100%; min-width: 640px; border-collapse: collapse; }
.dt-table th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary); padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); }
.dt-table td { padding: 12px; border-bottom: 1px solid var(--border-subtle); font-size: 13px; color: var(--text-secondary); }
.dt-table tr:last-child td { border-bottom: 0; }

/* keep things readable */
.measure { max-width: 64ch; }

/* No outline focus ring — use amber subtle */
:focus-visible {
  outline: 1px solid var(--amber-500);
  outline-offset: 2px;
}

/* anchor target scroll offset */
section[id] { scroll-margin-top: 80px; }

/* CSS grid items default to min-width:auto, so a wide child (a table, a code
   block, the comment mock) forces the implicit single-column track wider than
   the viewport on phones/tablets — the whole page then scrolls sideways. Let
   grid children shrink below their content width below the lg breakpoint; the
   wide bits already scroll inside their own overflow-x-auto wrappers. This also
   makes `truncate` work inside grid cells. */
@media (max-width: 1023px) {
  .grid > * { min-width: 0; }
}

/* dashboard form inputs */
.dash-input {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: 2px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-primary);
  transition: border-color 120ms ease;
}
.dash-input::placeholder { color: var(--text-tertiary); }
.dash-input:focus { outline: none; border-color: var(--amber-500); }
textarea.dash-input { resize: vertical; line-height: 1.5; }
/* Reserve room for absolutely-positioned adornment icons. This file loads
   AFTER tailwind.css, so .dash-input's `padding` shorthand would otherwise beat
   pl-8/pr-8 utilities and the icon overlaps the text. Two-class specificity
   (0,2,0) wins the tie, so these always apply. */
.dash-input.pad-icon-l { padding-left: 32px; }
.dash-input.pad-icon-r { padding-right: 30px; }

/* ===== dashboard v3 (senior polish) ===== */
.tabular-nums { font-variant-numeric: tabular-nums; }

/* skeleton shimmer */
.skeleton {
  border-radius: 3px;
  background: linear-gradient(90deg, var(--bg-overlay) 25%, var(--border-subtle) 45%, var(--bg-overlay) 65%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* sidebar nav rail */
.nav-item { border-left: 2px solid transparent; }
.nav-item.active {
  border-left-color: var(--amber-500);
  background: linear-gradient(to right, rgba(232,101,26,0.06), transparent 70%);
}
.nav-item:focus-visible { outline: 1px solid var(--amber-500); outline-offset: -1px; }

/* table polish */
.dt-table th.num, .dt-table td.num { text-align: right; }
.dt-table td { font-variant-numeric: tabular-nums; }
tr.row-link { cursor: pointer; transition: background 100ms ease; }
tr.row-link:hover, tr.row-link:focus-visible { background: var(--bg-overlay); }
tr.row-link:focus-visible { outline: 1px solid var(--amber-500); outline-offset: -1px; }
tr.row-link .row-chevron { opacity: 0; transition: opacity 100ms ease; }
tr.row-link:hover .row-chevron, tr.row-link:focus-visible .row-chevron { opacity: 1; }

/* inputs already styled via .dash-input; selects share it */
select.dash-input { background-image: none; }

/* ===== dashboard v4 — motion & mobile ===== */

/* page transition — subtle rise on route change */
.page-enter { animation: page-enter 240ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes page-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* user menu pop */
.menu-pop { animation: menu-pop 140ms cubic-bezier(0.2, 0.7, 0.2, 1) both; transform-origin: top right; }
@keyframes menu-pop { from { opacity: 0; transform: scale(0.96) translateY(-4px); } to { opacity: 1; transform: none; } }

/* mobile nav drawer slide-in */
.drawer-panel { animation: drawer-in 200ms cubic-bezier(0.2, 0.7, 0.2, 1) both; box-shadow: 24px 0 60px -20px rgba(0, 0, 0, 0.7); }
@keyframes drawer-in { from { transform: translateX(-100%); } to { transform: none; } }

/* activity timeline rows */
.tl-item { transition: background 100ms ease; }
a.tl-item:hover { background: var(--bg-overlay); }
a.tl-item .row-chevron { opacity: 0; transition: opacity 100ms ease; }
a.tl-item:hover .row-chevron { opacity: 1; }

/* ===== dependency graph ===== */
.bg-graph-grid {
  background-size: 40px 40px;
  background-image: linear-gradient(to right, rgba(37, 41, 48, 0.55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(37, 41, 48, 0.55) 1px, transparent 1px);
}
.graph-edge-active { stroke-dasharray: 5 5; animation: edge-dash 26s linear infinite; }
@keyframes edge-dash { to { stroke-dashoffset: -1000; } }
.graph-node {
  animation: node-in 380ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  transition: box-shadow 140ms ease, border-color 140ms ease, opacity 140ms ease, transform 140ms ease;
}
.graph-node:hover { transform: translateY(-1px); }
.graph-node:focus-visible { outline: 1px solid var(--amber-500); outline-offset: 2px; }
@keyframes node-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } to { opacity: 1; transform: none; } }
.graph-node.danger { animation: node-in 380ms cubic-bezier(0.2, 0.7, 0.2, 1) both, pulse-danger 2.6s ease-in-out infinite 500ms; }
@keyframes pulse-danger {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: 0 0 20px 1px rgba(239, 68, 68, 0.22); }
}

@media (prefers-reduced-motion: reduce) {
  .page-enter, .menu-pop, .drawer-panel { animation: none; }
  .reveal, .reveal-armed { transition: none; opacity: 1; transform: none; }
  .marquee-track { animation-duration: 240s; }
  .graph-edge-active { animation: none; }
  .graph-node, .graph-node.danger { animation: none; }
  .hero-glow, .tl-dot-live::after { animation: none; }
  .iacr-cursor { animation: none; }
  .lift:hover { transform: none; }
  /* The live pipeline still advances under reduced-motion, but the dot/rail
     step discretely instead of gliding. */
  .pipe-track * { transition: none !important; }
  /* Skeleton keeps its static gradient (still reads as a placeholder) but stops
     the infinite shimmer sweep. */
  .skeleton { animation: none; }
}
