/* =========================================================
   Riley Fallon portfolio. Plain CSS, no frameworks.
   Palette tokens live in :root ONLY. See the ruleset in index.html.
   ========================================================= */

:root {
  /* palette */
  --bg: #0a0a0a;
  --surface: #141414;
  --border: #262626;
  --border-strong: #3a3a3a;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --accent: #dc2626;
  --accent-hover: #f87171;

  /* derived tints (from --accent only, no new hues) */
  --accent-tint: color-mix(in srgb, var(--accent) 14%, var(--bg));
  --accent-line: color-mix(in srgb, var(--accent) 45%, var(--bg));
  --accent-press: color-mix(in srgb, var(--accent) 84%, black);

  /* type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* radius */
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 22px;

  /* spacing */
  --gutter: clamp(16px, 4vw, 40px);
  --section-space: clamp(72px, 10vw, 128px);
  --header-h: 64px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

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

h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 650; letter-spacing: -0.02em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

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

[hidden] { display: none !important; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--accent-hover);
  border-radius: var(--radius-m);
}
.skip-link:focus { top: 12px; }

/* ---------- utilities ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-space) 0; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.lead { font-size: 1.25rem; }
.stack-s > * + * { margin-top: 8px; }
.stack-m > * + * { margin-top: 16px; }
.stack-l > * + * { margin-top: 32px; }
.label {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent-hover);
  letter-spacing: 0.02em;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border-radius: var(--radius-m);
  border: 1px solid transparent;
  font: 600 1.125rem/1 var(--font-sans);
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-press); }
.btn-outline { background: var(--bg); color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--accent-hover); }
.btn-small { min-height: 44px; padding: 0 20px; font-size: 1rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- header ---------- */
.status-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
}
.status-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 30px;
  gap: 12px;
}
.status-left { display: inline-flex; align-items: center; gap: 8px; }
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.status-right { display: inline-flex; gap: 16px; }
.clock { font-variant-numeric: tabular-nums; color: var(--text); }

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.site-header { display: contents; }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}
.logo { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
.logo-cursor { color: var(--accent-hover); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-block;
  padding: 8px 12px;
  font-size: 0.9375rem;
  color: var(--muted);
  border-radius: var(--radius-s);
  transition: color .2s ease;
}
.nav-link:hover, .nav-link.is-active { color: var(--text); }
.nav-link.is-active::before { content: "./"; color: var(--accent-hover); }
.nav-link-cta {
  margin-left: 8px;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.nav-link-cta:hover { border-color: var(--accent-hover); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-m);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.nav-toggle-bar {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  transition: transform .2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-child { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 820px) {
  .status-loc { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-link {
    display: block;
    padding: 14px 4px;
    font-size: 1.0625rem;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }
  .nav-link-cta { margin: 16px 0 0; border: 1px solid var(--border-strong); border-radius: var(--radius-m); text-align: center; }
}

/* ---------- hero ---------- */
.hero-wrap { padding-top: clamp(16px, 3vw, 32px); }
.hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(520px, 72vh, 640px);
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 62% 70% at 22% 46%,
    color-mix(in srgb, var(--bg) 94%, transparent) 0%,
    color-mix(in srgb, var(--bg) 80%, transparent) 42%,
    color-mix(in srgb, var(--bg) 0%, transparent) 100%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  padding: clamp(32px, 6vw, 36px) clamp(20px, 3vw, 36px);
  padding-bottom: clamp(48px, 7vw, 72px);
  max-width: 720px;
}
.hero-prompt {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  color: var(--accent-hover);
  min-height: 1.6em;
}
.cursor { margin-left: 1px; animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-name {
  margin-top: 14px;
  font-size: clamp(2.5rem, 6.4vw, 3.25rem);
  font-weight: 650;
  letter-spacing: -0.025em;
}
.hero-title {
  margin-top: 12px;
  font-size: clamp(1.25rem, 2.6vw, 1.6875rem);
  color: var(--muted);
  letter-spacing: -0.01em;
}
.badges { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.badge {
  padding: 5px 14px;
  font-size: clamp(0.9375rem, 1.6vw, 1.25rem);
  letter-spacing: 0.02em;
  color: var(--accent-hover);
  background: var(--accent-tint);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-s);
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 32px; }
.hero-ctas .btn { min-height: 62px; padding: 0 28px; font-size: clamp(1.125rem, 1.8vw, 1.375rem); border-radius: 12px; }

/* staged reveal after the prompt types out (only when JS adds .is-typing) */
.reveal { transition: opacity .6s ease, transform .6s ease; }
.hero.is-typing .reveal { opacity: 0; transform: translateY(6px); }

/* ---------- section heads ---------- */
.section-head { margin-bottom: clamp(36px, 5vw, 56px); max-width: 720px; }
.section-title {
  margin-top: 10px;
  font-size: clamp(1.875rem, 4vw, 2.75rem);
}
.section-intro { margin-top: 16px; font-size: 1.125rem; max-width: 620px; }

/* ---------- timeline ---------- */
.timeline {
  position: relative;
  max-width: 860px;
  padding-left: 36px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 10px; bottom: 10px;
  width: 1px;
  background: var(--border-strong);
}
.timeline-item { position: relative; padding-bottom: 48px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-node {
  position: absolute;
  left: -36px; top: 7px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.timeline-item:first-child .timeline-node { background: var(--accent); }
.timeline-org { font-size: clamp(1.25rem, 2.4vw, 1.5rem); }
.timeline-role { margin-top: 6px; font-size: 1.125rem; color: var(--text); }
.timeline-date { margin-top: 4px; font-size: 0.875rem; color: var(--muted); }
.timeline-points { margin-top: 16px; display: grid; gap: 10px; }
.timeline-points li {
  position: relative;
  padding-left: 22px;
  color: var(--muted);
  max-width: 68ch;
}
.timeline-points li::before {
  content: "-";
  position: absolute;
  left: 2px;
  font-family: var(--font-mono);
  color: var(--accent-hover);
}

/* ---------- projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter-btn {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.9375rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.filter-btn:hover { color: var(--text); border-color: var(--border-strong); }
.filter-btn[aria-pressed="true"] { color: var(--text); border-color: var(--accent-hover); }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 20px;
}
.project-card { display: flex; }
.project-open {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  cursor: pointer;
  transition: border-color .2s ease;
  overflow: hidden;
}
.project-open:hover { border-color: var(--accent-hover); }

.term-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.term-dots { display: inline-flex; gap: 6px; }
.term-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.term-dot:first-child { background: var(--accent); }
.term-path { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.project-body { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 24px; flex: 1; }
.project-title { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.015em; line-height: 1.3; }
.project-line { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: auto; padding-top: 6px; font-size: 0.875rem; color: var(--accent-hover); }
.filter-empty { margin-top: 16px; }

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); }
.modal-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-m);
  animation: modal-in .2s ease;
}
.modal-panel:focus { outline: none; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } }
.modal-close {
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  cursor: pointer;
}
.modal-close:hover { color: var(--text); border-color: var(--border-strong); }
.modal-body { padding: 28px; }
.modal-title { margin-top: 8px; font-size: 1.75rem; }
.modal-text { margin-top: 14px; color: var(--muted); font-size: 1.125rem; }
.modal-body .tags { margin-top: 22px; }

/* ---------- network ---------- */
.net-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 20px;
}
.net-stage {
  position: relative;
  min-height: 460px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
}
.net-stage.is-dragging { cursor: grabbing; }
.net-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.net-hint {
  position: absolute;
  left: 18px; bottom: 14px;
  font-size: 0.75rem;
  color: var(--muted);
  pointer-events: none;
}
.net-tooltip {
  position: absolute;
  z-index: 2;
  padding: 6px 10px;
  font-size: 0.8125rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-s);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
  white-space: nowrap;
}
.net-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; }
.net-fallback svg { width: 100%; height: 100%; }
.net-fallback .fb-edge { stroke: var(--border-strong); stroke-width: 1; }
.net-fallback .fb-node { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; }
.net-fallback .fb-label { fill: var(--muted); font: 12px var(--font-mono); }

.sim-panel {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 20px;
}
.sim-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.sim-state { font-size: 0.8125rem; color: var(--muted); }
.sim-state.is-blocked { color: var(--accent-hover); }
.sim-log {
  flex: 1;
  min-height: 190px;
  margin: 16px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.sim-line { animation: line-in .25s ease; }
.sim-line-idle { color: var(--muted); }
.sim-line-verdict { color: var(--accent-hover); font-weight: 700; }
@keyframes line-in { from { opacity: 0; } }
.sim-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.net-nodes { margin-top: 28px; }
.node-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.node-btn {
  min-height: 40px;
  padding: 0 14px;
  font: 0.875rem var(--font-mono);
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.node-btn:hover { color: var(--text); border-color: var(--border-strong); }
.node-btn[aria-pressed="true"] { color: var(--text); border-color: var(--accent-hover); }
.node-detail { margin-top: 14px; min-height: 1.65em; }
.node-detail strong { color: var(--text); font-weight: 600; }

@media (max-width: 960px) {
  .net-layout { grid-template-columns: 1fr; }
  .net-stage { min-height: 380px; }
  .sim-log { min-height: 0; }
}

/* ---------- skills ---------- */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 20px;
}
.skill-group {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  transition: border-color .2s ease;
}
.skill-group:hover { border-color: var(--accent-hover); }
.skill-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.skill-name { font-size: 1.1875rem; }
.skill-level { font-size: 0.75rem; letter-spacing: 0.08em; color: var(--accent-hover); white-space: nowrap; }
.meter {
  height: 4px;
  margin-top: 16px;
  background: var(--border-strong);
  border-radius: 2px;
  overflow: hidden;
}
.meter-fill { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.skill-group[data-level="advanced"] .meter-fill { width: 90%; }
.skill-group[data-level="proficient"] .meter-fill { width: 66%; }
.skill-items { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.skill-items li {
  padding: 4px 10px;
  font-size: 0.9375rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
}

/* ---------- education ---------- */
.edu-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 20px;
}
.edu-item {
  padding: 24px;
  border-left: 2px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
}
.edu-meta { font-size: 0.8125rem; color: var(--accent-hover); }
.edu-title { margin-top: 10px; font-size: 1.375rem; }
.edu-org { margin-top: 6px; }

/* ---------- contact footer ---------- */
.contact { padding-bottom: 40px; }
.contact-card {
  padding: clamp(28px, 5vw, 56px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
}
.contact-title { margin-top: 12px; font-size: clamp(1.875rem, 4.4vw, 3rem); max-width: 18ch; }
.contact-pitch { margin-top: 16px; font-size: 1.1875rem; max-width: 52ch; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 32px; }
.email-row { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.email-text { font-size: 1rem; color: var(--text); overflow-wrap: anywhere; }
.copy-btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.8125rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent-hover); }
.copy-status { font-size: 0.8125rem; color: var(--accent-hover); }
.social-list { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.social-link { font-family: var(--font-mono); font-size: 0.9375rem; color: var(--muted); }
.social-link:hover { color: var(--accent-hover); }
.social-link span { color: var(--accent-hover); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---------- small screens ---------- */
@media (max-width: 480px) {
  body { font-size: 1rem; }
  .hero { min-height: 560px; align-items: flex-end; }
  .hero-overlay {
    background: radial-gradient(ellipse 120% 80% at 30% 62%,
      color-mix(in srgb, var(--bg) 94%, transparent) 0%,
      color-mix(in srgb, var(--bg) 82%, transparent) 50%,
      color-mix(in srgb, var(--bg) 20%, transparent) 100%);
  }
  .hero-ctas .btn { flex: 1 1 100%; min-height: 54px; }
  .badges { gap: 8px; }
  .timeline { padding-left: 30px; }
  .timeline-node { left: -30px; }
  .contact-actions .btn { width: 100%; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .cursor { animation: none; }
}

/* ---------- helpers used by scripts ---------- */
.net-stage.is-over-node { cursor: pointer; }
.net-stage.is-fallback { cursor: default; }
.visually-offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
.sim-line { display: grid; grid-template-columns: 3.2em 1fr; gap: 12px; white-space: pre-wrap; color: var(--text); }
.sim-line-idle { display: block; color: var(--muted); }
.sim-ts { color: var(--muted); }
.sim-line-verdict { color: var(--accent-hover); }

/* ---------- art-direction pass ---------- */
/* split layout: sticky heading left, content right on wide screens */
@media (min-width: 1024px) {
  .split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 64px; align-items: start; }
  .split .section-head { position: sticky; top: calc(var(--header-h) + 40px); margin-bottom: 0; }
}

/* skills as rows: name, level and meter left; tools right */
.skill-grid { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--border); }
.skill-group {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 12px 48px;
  align-items: center;
  padding: 26px 4px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}
.skill-group:hover { border-color: var(--border); }
.skill-group:hover .skill-name { color: var(--accent-hover); }
.skill-meta { display: grid; gap: 0; }
.skill-items { margin-top: 0; }
@media (max-width: 760px) {
  .skill-group { grid-template-columns: 1fr; gap: 16px; }
}

/* education as a quiet list, matching the timeline column */
.edu-list { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--border); }
.edu-item { padding: 26px 0; background: transparent; border-left: 0; border-bottom: 1px solid var(--border); border-radius: 0; }

/* contact headline wraps on balanced lines */
.contact-title { max-width: 22ch; text-wrap: balance; }
.section-title { text-wrap: balance; }

/* mobile: centered hero, one-line scrollable filters */
@media (max-width: 480px) {
  .hero { min-height: 0; align-items: center; }
  .hero-content { padding-block: 56px 60px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter-btn { flex: 0 0 auto; }
  .net-stage { min-height: 320px; }
}
section[tabindex="-1"]:focus, footer[tabindex="-1"]:focus { outline: none; }
.net-fallback .fb-node.is-active { stroke: var(--accent-hover); stroke-width: 3; fill: var(--accent-tint); }
.sim-target { margin-top: 12px; font-size: 0.8125rem; color: var(--text); }
.node-link { color: var(--accent-hover); white-space: nowrap; }
.node-link:hover { text-decoration: underline; }

/* ---------- project detail modals ---------- */
.project-more { margin-top: 4px; font-size: 0.8125rem; color: var(--muted); transition: color .2s ease; }
.project-open:hover .project-more, .project-open:focus-visible .project-more { color: var(--accent-hover); }
.project-body .tags { margin-top: auto; }

.modal-panel { width: min(880px, 100%); }
.modal-body { padding: clamp(20px, 4vw, 36px); }
.modal-lede { margin-top: 14px; font-size: 1.125rem; line-height: 1.6; color: var(--text); max-width: 68ch; }
.modal-section { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); }
.modal-h { font-size: 0.8125rem; font-weight: 400; letter-spacing: 0.02em; color: var(--accent-hover); }
.modal-list { margin-top: 12px; display: grid; gap: 10px; }
.modal-list li { position: relative; padding-left: 20px; color: var(--muted); max-width: 72ch; }
.modal-list li::before { content: "-"; position: absolute; left: 2px; font-family: var(--font-mono); color: var(--accent-hover); }
.modal-list strong { color: var(--text); font-weight: 600; }
.modal-section .modal-text { margin-top: 12px; font-size: 1rem; }

.modal-gallery { margin-top: 24px; display: grid; gap: 20px; }
.shot { margin: 0; }
.shot-link { display: block; border: 1px solid var(--border); border-radius: var(--radius-m); overflow: hidden; background: var(--bg); transition: border-color .2s ease; }
.shot-link:hover { border-color: var(--accent-hover); }
.shot img { display: block; width: 100%; height: auto; }
.shot-cap { margin-top: 8px; font-size: 0.8125rem; color: var(--muted); }
.modal-body > .tags { margin-top: 28px; }
@media (max-width: 480px) {
  .modal { padding: 10px; }
  .modal-panel { max-height: calc(100vh - 20px); }
}
.modal-panel > .term-bar { position: sticky; top: 0; z-index: 1; }

/* ---------- contact form ---------- */
.contact-form { margin-top: 32px; display: grid; gap: 18px; max-width: 760px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 18px; }
.field { display: grid; gap: 8px; }
.field-label { font-size: 0.8125rem; color: var(--muted); }
.field-optional { color: var(--muted); opacity: .8; }
.field-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font: 1rem/1.5 var(--font-sans);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-m);
  transition: border-color .2s ease;
}
.field-input:hover { border-color: var(--muted); }
.field-input:focus { outline: none; border-color: var(--accent-hover); }
.field-input:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.field-textarea { min-height: 150px; resize: vertical; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.form-status { font-size: 0.875rem; color: var(--muted); }
.form-status[data-kind="ok"] { color: var(--text); }
.form-status[data-kind="error"] { color: var(--accent-hover); }
.btn:disabled { opacity: .6; cursor: progress; }
.contact-card { position: relative; }
@media (max-width: 480px) { .form-actions .btn { width: 100%; } }
/* four projects read best as a 2 x 2 grid */
@media (min-width: 760px) { .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
