/* =============================================================================
   styles.css — "API Reference / Documentation" theme (light paper, plus a
   dark variant switched by <html data-theme="dark">)
   Layers:
     1. Design tokens (:root; dark overrides in :root[data-theme="dark"])
     2. Reset / base
     3. Layout shell (sidebar + main)
     4. Components (badges, endpoint lines, code panels, cards, schema, releases)
     5. Mobile drawer
     6. Motion / reduced-motion
   ============================================================================= */

/* ----------------------------------------------------------------------------
   1. DESIGN TOKENS
   ---------------------------------------------------------------------------- */
:root {
  /* Surfaces & ink */
  --paper:      #FFFFFF;   /* page background */
  --surface:    #F7F8FA;   /* sidebar + light code/aside bg */
  --ink:        #0B1221;   /* primary text */
  --ink-soft:   #5A6573;   /* muted text (passes AA on paper, 5.6:1) */
  --line:       #E4E8EF;   /* hairlines / borders */

  /* Brand (indigo) */
  --brand:      #4F46E5;   /* links, active nav, focus ring */
  --brand-weak: #EEF0FE;   /* active nav row bg */
  --brand-ink:  #4338CA;   /* darker indigo for text-on-paper */
  --on-brand:   #FFFFFF;   /* text on a --brand background (flips to dark ink in dark mode) */

  /* HTTP method badge colors (chosen so white text passes WCAG AA) */
  --get:    #15803D;   /* white-on-it ~4.5:1 */
  --post:   #2563EB;
  --put:    #B45309;   /* white-on-it ~4.7:1 */
  --delete: #DC2626;   /* white-on-it ~4.83:1 */

  /* Dark code panels */
  --code-bg:    #0D1426;
  --code-text:  #E6EDF6;   /* on --code-bg ~14:1, passes AA */
  --code-key:   #7DD3FC;   /* cyan */
  --code-str:   #A5D6A4;   /* green */
  --code-punc:  #8893A7;   /* punctuation */

  /* Type */
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Type scale */
  --fs-eyebrow: 0.75rem;
  --fs-sm:      0.875rem;
  --fs-base:    1rem;
  --fs-lede:    1.125rem;
  --fs-h3:      1.125rem;
  --fs-h2:      1.75rem;
  --fs-h1:      2.5rem;

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;

  /* Radii & misc */
  --radius:    10px;
  --radius-sm: 6px;
  --sidebar-w: 240px;
  --read-w:    760px;

  --shadow-card: 0 1px 2px rgba(11, 18, 33, 0.04), 0 4px 14px rgba(11, 18, 33, 0.05);

  color-scheme: light;     /* native scrollbars / form controls follow the theme */
}

/* Dark theme. <html data-theme="dark"> is set by the inline <head> script
   (saved choice, else OS preference) and flipped by main.js. Only the tokens
   that encode "light paper" change; layout, type and spacing are untouched.
   Ratios are WCAG contrast against the surface named in the comment. */
:root[data-theme="dark"] {
  color-scheme: dark;

  /* #0B1221 is duplicated in the <head> script of index.html (theme-color on
     first paint) — keep both in sync. */
  --paper:      #0B1221;
  --surface:    #111A2E;
  --ink:        #E6EDF6;   /* on paper 15.9:1 */
  --ink-soft:   #9AA6B8;   /* on paper 7.6:1, on surface 7.0:1 */
  --line:       #243049;

  --brand:      #818CF8;   /* on paper 6.3:1 (links, active rail) */
  --brand-weak: rgba(129, 140, 248, 0.14);
  --brand-ink:  #A5B4FC;   /* on brand-weak 7.7:1 */
  --on-brand:   #0B1221;   /* on brand 6.3:1 — white would only be 3.0:1 here */

  --code-bg:    #060B18;   /* code-text on it 16.7:1 */

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* ----------------------------------------------------------------------------
   2. RESET / BASE
   ---------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Visible focus for keyboard users everywhere */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Brand-filled buttons: an ink outline so the ring never matches the fill colour. */
.sidebar__cta-btn--primary:focus-visible,
.btn--primary:focus-visible { outline-color: var(--ink); }

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--sp-3);
  top: -3rem;
  z-index: 100;
  padding: var(--sp-2) var(--sp-4);
  background: var(--brand);
  color: var(--on-brand);
  border-radius: var(--radius-sm);
  transition: top 0.15s ease;
}
.skip-link:focus { top: var(--sp-3); }

/* Visually hidden but available to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----------------------------------------------------------------------------
   3. LAYOUT SHELL
   ---------------------------------------------------------------------------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}

/* --- Sidebar (sticky docs index) --- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;              /* dynamic viewport height where supported; the vh line above is the fallback */
  overflow-y: auto;
  padding: var(--sp-6) var(--sp-5);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

/* Brand on the left, theme toggle on the right; the version line (.sidebar__sub) sits below the row */
.sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.sidebar__brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
}
.sidebar__brand:hover { text-decoration: none; }
.sidebar__dot { color: var(--brand); }

.sidebar__sub {
  margin: var(--sp-1) 0 var(--sp-6);
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  color: var(--ink-soft);
}

.sidebar__eyebrow {
  margin: 0 0 var(--sp-3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Endpoint nav list */
.endpoint-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.endpoint-link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;            /* tap target; text stays the same size */
  padding: var(--sp-2) var(--sp-2);
  border-radius: var(--radius-sm);
  color: var(--ink);
  /* left indicator that "slides" via border-color on active */
  border-left: 2px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.endpoint-link:hover {
  background: #EEF0F3;
  text-decoration: none;
}
:root[data-theme="dark"] .endpoint-link:hover { background: #1A2440; } /* one step above --surface */
.endpoint-link__path {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}
/* Active endpoint (scroll-spy sets aria-current="true") */
.endpoint-link[aria-current="true"] {
  background: var(--brand-weak);
  border-left-color: var(--brand);
}
.endpoint-link[aria-current="true"] .endpoint-link__path {
  color: var(--brand-ink);
  font-weight: 500;
}

.sidebar__foot {
  margin-top: auto;
  padding-top: var(--sp-6);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
/* Status row is now a link to #contact */
.sidebar__status {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;            /* tap target (the text itself is ~23px tall) */
  color: var(--ink-soft);
}
.sidebar__status:hover { color: var(--ink); text-decoration: none; }

/* Quick recruiter actions (always visible in the sticky sidebar) */
.sidebar__cta {
  display: flex;
  gap: var(--sp-2);
}
.sidebar__cta-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;            /* tap target, same as .btn */
  padding: 0 var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.sidebar__cta-btn:hover { border-color: var(--brand); text-decoration: none; }
.sidebar__cta-btn--primary {
  color: var(--on-brand);
  background: var(--brand);
  border-color: var(--brand);
}
.sidebar__cta-btn--primary:hover {
  background: var(--brand-ink);
  border-color: var(--brand-ink);
}

/* Pulsing availability dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--get);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
  animation: pulse 2.4s infinite;
  flex-shrink: 0;
}

/* --- Main column --- */
.main {
  padding: var(--sp-8) var(--sp-7);
  max-width: calc(var(--read-w) + var(--sp-7) * 2);
  /* Grid item must be allowed to shrink below its content width (default is
     min-width: auto) so the inner code scrollers can scroll instead of
     widening the page. */
  min-width: 0;
}

.doc { scroll-margin-top: var(--sp-5); }
.doc__title {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: var(--sp-4) 0 var(--sp-2);
}
#about .doc__title { font-size: var(--fs-h1); }
h2.doc__title { font-size: var(--fs-h2); }

/* Role + years: the human headline, louder than the JSON proof panel below. */
.doc__role {
  margin: 0 0 var(--sp-4);
  color: var(--ink);
  font-size: var(--fs-base);
  font-weight: 500;
}
.doc__lede {
  margin: 0 0 var(--sp-5);
  font-size: var(--fs-lede);
  color: var(--ink);
}
.doc__body {
  margin: var(--sp-6) 0;
  color: var(--ink-soft);
  max-width: var(--read-w);
}

/* Hairline section divider */
.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: var(--sp-8) 0;
  max-width: var(--read-w);
}

/* ----------------------------------------------------------------------------
   4. COMPONENTS
   ---------------------------------------------------------------------------- */

/* --- Method badges (mono) --- */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 5px;
  color: #fff;
  flex-shrink: 0;
}
.badge--get    { background: var(--get); }
.badge--post   { background: var(--post); }
.badge--put    { background: var(--put); }
.badge--delete { background: var(--delete); }

/* --- Endpoint line (mono method + path + status) --- */
.endpoint-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin: 0;
}
.endpoint-line__path {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--ink);
}

/* Status pill */
.status-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.status-pill--ok {
  /* Own darker green so text clears 4.5:1 on the light tint (badge bg token is too light here) */
  color: #166534;
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.06);
}
:root[data-theme="dark"] .status-pill--ok {
  /* The light-theme green is 2.5:1 on the dark page; green-400 on its tint is 9.0:1 */
  color: #4ADE80;
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.10);
}
/* Red variant (404.html), same shape as --ok */
.status-pill--err {
  color: #B91C1C;              /* --delete is only 4.4:1 on this tint; red-700 is 5.9:1 */
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.06);
}
:root[data-theme="dark"] .status-pill--err {
  /* --delete is only 3.9:1 on the dark page; red-400 on its tint is ~8:1 */
  color: #F87171;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.10);
}

/* --- Buttons / quicklinks --- */
.quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;            /* comfortable tap target */
  padding: 0 var(--sp-5);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.btn:hover {
  border-color: var(--brand);
  text-decoration: none;
}
.btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}
.btn--primary:hover {
  background: var(--brand-ink);
  border-color: var(--brand-ink);
}

/* --- Theme toggle (sun shown in light mode, moon in dark) ---
   Two instances exist: one in the sidebar (desktop), one in the top bar
   (phones); the <= 860px block below makes sure only one is visible. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;                 /* same tap target as the hamburger */
  height: 44px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.theme-toggle:hover {
  background: var(--surface);
  border-color: var(--brand);  /* same cue as .btn, and visible on the --surface sidebar too */
}
.theme-toggle svg { width: 20px; height: 20px; display: block; }
/* Scoped to .theme-toggle so this outranks the generic `.theme-toggle svg { display:block }` rule above. */
.theme-toggle .theme-toggle__moon { display: none; }
:root[data-theme="dark"] .theme-toggle__moon { display: block; }
:root[data-theme="dark"] .theme-toggle__sun  { display: none; }
/* The sidebar instance keeps the full 44px tap target; .sidebar__head centres the
   1.25rem brand against it, so no size override is needed. */

/* --- Request -> Response signature panel --- */
.rr {
  margin: var(--sp-6) 0;
  max-width: var(--read-w);
}
.rr__caption {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--sp-3);
}
.rr__request {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none;
}
.rr__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.rr__curl {
  /* Block scroller: inline elements ignore overflow, so the long curl string
     would otherwise force PAGE horizontal scroll on narrow viewports.
     Below 480px it wraps instead of scrolling (see the small-phone block). */
  display: block;
  flex: 1 1 100%;
  max-width: 100%;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--ink);
  overflow-x: auto;          /* now actually engages */
  white-space: nowrap;
}

/* --- Dark code panels --- */
.code-panel {
  background: var(--code-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
/* On the dark page the panel is only a shade darker, so give it an edge */
:root[data-theme="dark"] .code-panel { border: 1px solid var(--line); }
/* When directly under a request block, square the top corners to read as one unit */
.rr .code-panel { border-radius: 0 0 var(--radius) var(--radius); }

.code-panel__bar {
  padding: var(--sp-2) var(--sp-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.code-panel__status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--code-punc);
}
.code-panel__body {
  margin: 0;
  padding: var(--sp-4);
  overflow-x: auto;           /* code scrolls inside itself */
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--code-text);
  tab-size: 2;
}
.code-panel__body code { font: inherit; }

/* Syntax tints */
.code-panel .k { color: var(--code-key); }
.code-panel .s { color: var(--code-str); }
.code-panel .p { color: var(--code-punc); }

/* Hero JSON lines are block-level for the reveal */
.code-panel__body .ln { display: block; }

/* --- Skills schema (rendered inside a code panel) --- */
.code-panel--schema { max-width: var(--read-w); }
.schema {
  margin: 0;
  padding: var(--sp-4) var(--sp-5);
}
.schema__row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.schema__row:last-child { border-bottom: none; }
.schema__key {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--code-key);
}
.schema__vals { margin: 0; }
/* The <ul> inside each <dd>: no bullets, tags flow as a wrapping row */
.schema__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
/* Secondary row (also_worked_with): lower emphasis but still AA on the panel.
   Panel is --code-bg in both themes; ratios are light-theme / dark-theme. */
.schema__row--muted .schema__key { color: var(--code-punc); }   /* 5.9:1 / 6.3:1 */
.schema__row--muted .tag {
  color: var(--code-punc);                                        /* 5.4:1 / 5.9:1 on the tint */
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Mono tags (used in schema, dark panel context) */
.tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(125, 211, 252, 0.10);
  border: 1px solid rgba(125, 211, 252, 0.20);
  color: var(--code-text);
}

/* --- Socials panel (GET /socials inside POST /hire) --- */
/* Sub-endpoint header: .endpoint-line is margin:0 for section tops, so give the
   in-section one a gap from the contact list above it. */
.endpoint-line--sub { margin-top: var(--sp-7); }
/* h3 under a sub-endpoint line: same 1rem gap h2.doc__title has under its line */
.doc__subtitle { margin: var(--sp-4) 0 var(--sp-3); font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); }
/* Chip link: reuses .tag colours; min-height 32px meets WCAG 2.5.8 target size */
.tag--link { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 32px; padding: 4px 10px; color: var(--code-text); text-decoration: none; }
.tag--link:hover { background: rgba(125, 211, 252, 0.18); border-color: rgba(125, 211, 252, 0.45); text-decoration: none; }
.tag--link:focus-visible { outline-color: var(--code-key); }
/* @handle on the chip tint (composited over --code-bg): 4.9:1 light / 5.4:1 dark (AA) */
.tag__handle { color: var(--code-punc); font-size: 0.72rem; }

/* --- Project endpoint cards --- */
.endpoint-cards {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.endpoint-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
/* Featured cards get a quiet indigo accent rail */
.endpoint-card--featured { border-left: 3px solid var(--brand); }

.endpoint-card__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.endpoint-card__path {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--ink);
}
/* Company tag in the card head — muted, sits beside the endpoint path */
.endpoint-card__org {
  font-size: 0.72rem;
  color: var(--ink-soft);
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--paper);
}
.endpoint-card__name {
  margin-left: auto;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--ink);
}
.endpoint-card__body { padding: var(--sp-5); }
.endpoint-card__tagline {
  margin: 0 0 var(--sp-2);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-h3);
  color: var(--ink);
}
.endpoint-card__summary {
  margin: 0 0 var(--sp-4);
  color: var(--ink-soft);
}

/* The "impact" key field, highlighted */
.endpoint-card__impact {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  margin: 0 0 var(--sp-4);
  background: var(--brand-weak);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}
.endpoint-card__impact .field {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--brand-ink);
  flex-shrink: 0;
  padding-top: 1px;
}
.endpoint-card__impact .val { color: var(--ink); }

/* tech array, JSON-style, in card (light surface) */
.endpoint-card__tech {
  list-style: none;
  margin: 0 0 var(--sp-1);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.endpoint-card__tech .bracket { color: var(--ink-soft); }
.tech-tag {
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}

.endpoint-card__view {
  display: inline-flex;
  align-items: center;
  min-height: 44px;          /* tap target, same as .btn */
  gap: 4px;
  margin-top: var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}

/* --- Releases / changelog (experience) --- */
.releases {
  list-style: none;
  margin: var(--sp-2) 0 var(--sp-7);
  padding: 0;
  max-width: var(--read-w);
}
.release {
  padding: var(--sp-5) 0;
  border-bottom: 1px solid var(--line);
}
.release:last-child { border-bottom: none; }
.release__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.release__tag {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--brand-ink);
  background: var(--brand-weak);
  padding: 1px 8px;
  border-radius: 5px;
}
.release__role {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-h3);
}
.release__at { color: var(--ink-soft); font-weight: 400; }
.release__meta {
  margin: var(--sp-1) 0 var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}
.release__list {
  margin: 0;
  padding-left: var(--sp-5);
  color: var(--ink-soft);
}
.release__list li { margin-bottom: var(--sp-2); }

/* Education + certifications */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-5);
  max-width: var(--read-w);
}
.info-card {
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.info-card__title {
  margin: 0 0 var(--sp-3);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-h3);
}
.info-card__list {
  margin: 0;
  padding-left: var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}
.info-card__list li { margin-bottom: var(--sp-2); }
.yr {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
}

/* --- Contact rows (POST /hire) --- */
.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--read-w);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.contact-list li { border-bottom: 1px solid var(--line); }
.contact-list li:last-child { border-bottom: none; }
.contact-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  color: var(--ink);
  transition: background-color 0.15s ease;
}
.contact-row:hover { background: var(--surface); text-decoration: none; }
.contact-row__key {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  width: 90px;
  flex-shrink: 0;
}
.contact-row__val { font-weight: 500; }
.contact-row__go { margin-left: auto; color: var(--brand); }

/* --- Footer --- */
.footer {
  margin-top: var(--sp-8);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  max-width: var(--read-w);
}

/* --- 404 page (404.html): centre the message in the viewport --- */
.notfound {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.notfound .endpoint-line { justify-content: center; }
.notfound .doc__title { font-size: var(--fs-h1); }

/* ----------------------------------------------------------------------------
   5. MOBILE TOP BAR + DRAWER (<= 860px)
   ---------------------------------------------------------------------------- */
.topbar { display: none; }            /* hidden on desktop */
.overlay { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }

  /* Top bar */
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
    padding: var(--sp-3) var(--sp-4);
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .topbar__brand {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--ink);
  }
  .topbar__brand:hover { text-decoration: none; }
  .topbar__dot { color: var(--brand); }

  /* Theme toggle + hamburger, side by side at the right edge */
  .topbar__actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
  }

  .topbar__toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0 10px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
  }
  .topbar__toggle-bar {
    display: block;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
  }

  /* Sidebar becomes an off-canvas drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    height: 100dvh;            /* tracks the real visible height as the phone's URL bar shows/hides */
    transform: translateX(-100%);
    /* Hidden from keyboard/AT while closed; visibility flips after the slide-out finishes. */
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
    box-shadow: 0 0 40px rgba(11, 18, 33, 0.15);
  }
  :root[data-theme="dark"] .sidebar { box-shadow: 0 0 40px rgba(0, 0, 0, 0.6); }
  .sidebar.is-open { transform: translateX(0); visibility: visible; transition-delay: 0s; }
  /* In the drawer the top bar's toggle is the one in use — never show two at once */
  .sidebar .theme-toggle { display: none; }

  .overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(11, 18, 33, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }
  .overlay.is-visible { opacity: 1; pointer-events: auto; }
  :root[data-theme="dark"] .overlay { background: rgba(0, 0, 0, 0.6); }

  .main { padding: var(--sp-6) var(--sp-5); }
  #about .doc__title { font-size: 2rem; }

  .schema__row { grid-template-columns: 1fr; gap: var(--sp-2); }
}

@media (max-width: 480px) {
  .main { padding: var(--sp-5) var(--sp-4); }
  /* Small phones: wrap the curl line instead of scrolling it sideways */
  .rr__curl { white-space: pre-wrap; overflow-wrap: anywhere; }
  .contact-row { flex-wrap: wrap; gap: var(--sp-2); }
  .contact-row__key { width: auto; }
  .contact-row__go { margin-left: auto; }
}

/* ----------------------------------------------------------------------------
   6. MOTION
   ---------------------------------------------------------------------------- */
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* Hero JSON line-by-line reveal.
   JS adds .reveal-armed to the panel, hiding lines; then staggers .is-in.
   Without JS, lines stay fully visible (default state has no hiding). */
.code-panel.reveal-armed .ln {
  opacity: 0;
  transform: translateY(4px);
}
.code-panel.reveal-armed .ln.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
  /* Ensure any armed reveal is fully visible immediately */
  .code-panel.reveal-armed .ln { opacity: 1; transform: none; }
  .status-dot { animation: none; }
}
