/* ===========================================================================
   Robert Hickey - personal site (neon edition)
   Single stylesheet, no build step, no external dependencies.
   Cinematic Matrix theme by default; recruiter mode via [data-theme="plain"]
   swaps the custom properties, so every color routes through a variable.
   =========================================================================== */

:root {
  --max-width: 960px;
  --mono: ui-monospace, "Cascadia Code", Consolas, Menlo, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --bg: #030805;
  --panel: rgba(6, 17, 10, 0.72);
  --panel-solid: #06110a;
  --body: #c9f2d0;
  --accent: #00ff41;
  --dim: #7ec98f;
  --border: rgba(0, 255, 65, 0.22);
  --border-soft: #103d22;
  --link: #8affab;
  --soft: rgba(0, 255, 65, 0.08);
  --selection: rgba(0, 255, 65, 0.25);
  --dim-opacity: 0.55;
  --glow-text: 0 0 6px rgba(0, 255, 65, 0.55), 0 0 22px rgba(0, 255, 65, 0.3), 0 0 48px rgba(0, 255, 65, 0.18);
  --glow-soft: 0 0 8px rgba(0, 255, 65, 0.35);
  --glow-box: 0 0 24px rgba(0, 255, 65, 0.10), inset 0 0 24px rgba(0, 255, 65, 0.03);
  --glow-btn: 0 0 16px rgba(0, 255, 65, 0.3);
  --glow-primary: 0 0 22px rgba(0, 255, 65, 0.35);
  --glow-primary-hover: 0 0 32px rgba(0, 255, 65, 0.55);
  --glow-card: 0 0 24px rgba(0, 255, 65, 0.22);
  --glow-console: 0 -6px 30px rgba(0, 255, 65, 0.15);
  --font: var(--mono);
  color-scheme: dark;
}

:root[data-theme="plain"] {
  --bg: #f7f8f7;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --body: #131a16;
  --accent: #0a5c2b;
  --dim: #47564d;
  --border: #c9d3cc;
  --border-soft: #c9d3cc;
  --link: #1d4ed8;
  --soft: rgba(10, 92, 43, 0.08);
  --selection: rgba(29, 78, 216, 0.22);
  --dim-opacity: 0.7;
  --glow-text: none;
  --glow-soft: none;
  --glow-box: none;
  --glow-btn: none;
  --glow-primary: none;
  --glow-primary-hover: none;
  --glow-card: none;
  --glow-console: none;
  --font: var(--sans);
  color-scheme: light;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .head-btn, .skill-btn, .console, kbd, code, pre, .brand,
.site-nav, .statusline, .stat-num, .footer { font-family: var(--mono); }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--selection); }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px; top: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ------------------------------------------------- atmosphere layers */
#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.layer {
  position: absolute;
  opacity: 0.45;
  filter: drop-shadow(0 0 10px rgba(0, 255, 65, 0.8));
}
html.js .layer { will-change: transform; }
@media (prefers-reduced-motion: reduce) {
  .layer { will-change: auto; }
}
.layer svg { display: block; width: 100%; height: auto; }
/* the vh term caps each artwork's height (via its aspect ratio) so layers
   can still fully exit the viewport on short, wide screens */
.layer-lineage { width: min(640px, 82vw, calc(55vh * 640 / 360)); right: -4%; top: 12%; }
.layer-dash { width: min(620px, 88vw, calc(60vh * 640 / 420)); left: -6%; top: 34%; }
.layer-trend { width: min(700px, 94vw, calc(55vh * 700 / 300)); right: 2%; top: 24%; }
.layer-schema { width: min(620px, 86vw, calc(60vh * 640 / 380)); left: 4%; top: 42%; }

/* without JS-driven parallax, keep just two artworks so the backdrop stays calm */
.layer-dash, .layer-trend { display: none; }
html.js .layer-dash, html.js .layer-trend { display: block; }
@media (prefers-reduced-motion: reduce) {
  .layer-dash, .layer-trend { display: none !important; }
  .layer-schema { top: 58%; }
}
#vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 18%,
    transparent 0%, rgba(1, 4, 2, 0.28) 62%, rgba(1, 4, 2, 0.55) 100%);
}
#spot {
  position: fixed;
  left: 0; top: 0;
  width: 640px; height: 640px;
  margin: -320px 0 0 -320px;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(0, 255, 65, 0.07), transparent 70%);
  opacity: 0;
}
:root[data-theme="plain"] #scene,
:root[data-theme="plain"] #vignette,
:root[data-theme="plain"] #spot { display: none; }

main, .footer { position: relative; z-index: 2; }

/* -------------------------------------------------------------- header */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.head-inner {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 54px;
  flex-wrap: wrap;
  padding-block: 0.4rem;
}
.brand { color: var(--body); font-weight: 700; margin-right: auto; white-space: nowrap; letter-spacing: 0.03em; }
.brand:hover { text-decoration: none; color: var(--accent); }
.site-nav { display: flex; gap: 0.9rem; overflow-x: auto; max-width: 100%; }
.site-nav a { color: var(--dim); font-size: 0.88rem; white-space: nowrap; }
.site-nav a:hover { color: var(--accent); text-decoration: none; text-shadow: var(--glow-soft); }

.head-btn {
  font-size: 0.8rem;
  color: var(--body);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  cursor: pointer;
  white-space: nowrap;
}
.head-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--glow-soft); }
.head-btn[aria-pressed="true"] { background: var(--soft); border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------------- hero */
.hero {
  min-height: 86vh;
  display: flex;
  align-items: center;
  padding-block: 4rem 3rem;
}
.hero-inner { text-align: center; }

.halo {
  position: relative;
  display: inline-block;
  margin-bottom: 1.6rem;
}
.halo::before {
  content: "";
  position: absolute;
  inset: -46%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 255, 65, 0.4), rgba(0, 255, 65, 0.12) 55%, transparent 72%);
  z-index: -1;
}
.portrait {
  width: 172px;
  height: 172px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 22px rgba(0, 255, 65, 0.45), 0 0 70px rgba(0, 255, 65, 0.22);
  filter: grayscale(0.45);
  display: block;
}
:root[data-theme="plain"] .halo::before { display: none; }
:root[data-theme="plain"] .portrait {
  filter: none;
  box-shadow: none;
  border-color: var(--border);
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2.1rem, 7vw, 3.6rem);
  letter-spacing: 0.14em;
  color: var(--accent);
  text-shadow: var(--glow-text);
}
@media (prefers-reduced-motion: no-preference) {
  @keyframes neon-in {
    0% { opacity: 0; }
    8% { opacity: 0.6; }
    12% { opacity: 0.2; }
    20% { opacity: 0.9; }
    26% { opacity: 0.5; }
    38% { opacity: 1; }
    100% { opacity: 1; }
  }
  .hero h1 { animation: neon-in 1.4s ease-out 1; }
}
.headline { margin: 0 0 0.35rem; font-weight: 600; font-size: 1.02rem; }
.statusline { margin: 0 0 1.6rem; color: var(--dim); font-size: 0.9rem; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.3rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--body);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.btn:hover {
  text-decoration: none;
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--glow-btn);
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  box-shadow: var(--glow-primary);
}
.btn-primary:hover { color: var(--bg); box-shadow: var(--glow-primary-hover); }
:root[data-theme="plain"] .btn-primary { color: #fff; }
:root[data-theme="plain"] .btn-primary:hover { color: #fff; }

/* ------------------------------------------------------------ sections */
section { padding-block: 3.5rem; }
/* keep anchor jumps clear of the sticky header, even when it wraps on phones */
section[id], #top { scroll-margin-top: 7.5rem; }
.section-title {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-shadow: var(--glow-soft);
}
.section-intro { color: var(--dim); max-width: 70ch; margin: -0.75rem 0 1.5rem; font-size: 0.95rem; }
.prose p { max-width: 70ch; margin: 0 0 1rem; }
.prose p:last-child { margin-bottom: 0; }

/* scroll reveals: only when JS is running and motion is allowed */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  html.js .reveal.visible { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------- stats */
.stats {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.stat {
  display: grid;
  gap: 0.15rem;
  background: var(--panel);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  box-shadow: var(--glow-box);
}
.stat-num {
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  font-weight: 700;
  color: var(--accent);
  text-shadow: var(--glow-soft);
  line-height: 1.1;
}
.stat-num .num { font-weight: 700; }
.stat-label { font-weight: 600; }
.stat-sub { color: var(--dim); font-size: 0.85rem; }

/* ---------------------------------------------------------- experience */
.timeline {
  position: relative;
  display: grid;
  gap: 1.5rem;
  padding-left: 1.6rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), rgba(0, 255, 65, 0.12));
  box-shadow: var(--glow-soft);
}
:root[data-theme="plain"] .timeline::before { background: var(--border); box-shadow: none; }
.role {
  position: relative;
  background: var(--panel);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.3rem 1.5rem;
  box-shadow: var(--glow-box);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.role:hover { border-color: var(--accent); box-shadow: var(--glow-card); }
.role::before {
  content: "";
  position: absolute;
  left: calc(-1.6rem + 6px);
  top: 1.75rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
  transform: translateX(-50%);
}
:root[data-theme="plain"] .role::before { box-shadow: none; }
.role h3 { margin: 0; font-size: 1.1rem; color: var(--body); }
.role-meta { color: var(--dim); font-size: 0.85rem; margin: 0.2rem 0 0.9rem; }
.role ul { margin: 0; padding-left: 1.15rem; max-width: 70ch; }
.role li { margin-bottom: 0.45rem; padding-left: 0.35rem; }
.role li::marker { color: var(--accent); }
.metric { color: var(--accent); font-weight: 700; text-shadow: var(--glow-soft); }

.role li.match { box-shadow: inset 3px 0 0 0 var(--accent); background: var(--soft); }
.role li.dim { opacity: var(--dim-opacity); }

/* -------------------------------------------------------------- skills */
.filter-bar[hidden] { display: none; }
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  background: var(--soft);
  padding: 0.5rem 0.8rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.skill-groups {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 640px) { .skill-groups { grid-template-columns: 1fr 1fr; } }
.skill-group h3 { margin: 0 0 0.7rem; font-size: 0.92rem; color: var(--dim); font-weight: 600; letter-spacing: 0.04em; }
.chips { display: flex; flex-wrap: wrap; gap: 0.55rem; list-style: none; padding: 0; margin: 0; }
.skill-btn, .chip-plain {
  display: inline-block;
  font-size: 0.9rem;
  font-family: var(--mono);
  color: var(--body);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
}
.skill-btn { cursor: pointer; transition: box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.skill-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--glow-btn); }
.skill-btn[aria-pressed="true"] {
  background: var(--soft);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--glow-btn);
}
.chip-plain { color: var(--dim); }

/* ------------------------------------------------------- education */
.seed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; max-width: 70ch; }
.seed-list li {
  border-left: 2px solid var(--border);
  padding: 0.35rem 0 0.35rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  transition: border-color 0.25s ease;
}
.seed-list li:hover { border-color: var(--accent); }
.seed-name { font-weight: 600; }
.seed-inst { color: var(--dim); font-size: 0.9rem; }

/* ------------------------------------------------------------- contact */
.exposures { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.exposure-card {
  display: grid;
  gap: 0.2rem;
  background: var(--panel);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  box-shadow: var(--glow-box);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
}
.exposure-card:hover {
  border-color: var(--accent);
  box-shadow: var(--glow-card);
  transform: translateY(-2px);
  text-decoration: none;
}
.exposure-kind { color: var(--dim); font-size: 0.8rem; letter-spacing: 0.06em; }
.exposure-url { color: var(--link); font-size: 0.88rem; overflow-wrap: anywhere; }
.print-row { margin: 1.75rem 0 0; }

/* -------------------------------------------------------------- footer */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 1.6rem;
  color: var(--dim);
  font-size: 0.82rem;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; justify-content: space-between; align-items: center; }

/* ------------------------------------------------------------- console */
.console {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  background: var(--panel-solid);
  border-top: 2px solid var(--accent);
  box-shadow: var(--glow-console);
  max-height: 45vh;
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
}
.console[hidden] { display: none; }
.console-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.4rem 1rem;
  color: var(--dim);
  border-bottom: 1px solid var(--border);
}
.console-out { overflow-y: auto; overflow-x: auto; padding: 0.6rem 1rem; flex: 1; }
.console-out > div { white-space: pre-wrap; word-break: break-word; }
.console-out .c-in { color: var(--dim); }
.console-out .c-err { color: var(--accent); }
.console-out .c-dim { color: var(--dim); font-size: 0.8rem; }
.console-out table { border-collapse: collapse; margin: 0.4rem 0; font-size: 0.8rem; }
.console-out th, .console-out td { border: 1px solid var(--border); padding: 0.25rem 0.55rem; text-align: left; }
.console-out th { color: var(--dim); }
.console-line { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 1rem; border-top: 1px solid var(--border); }
.console-line:focus-within { border-top-color: var(--accent); }
.ps1 { color: var(--accent); }
#console-in {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--body);
  font-family: var(--mono);
  font-size: 0.9rem;
  caret-color: var(--accent);
}
#console-in:focus { outline: none; }

/* --------------------------------------------------------------- print */
@media print {
  /* both selectors so the print palette also beats recruiter mode's
     higher-specificity :root[data-theme="plain"] variable set */
  :root, :root[data-theme="plain"] {
    --bg: #fff; --panel: #fff; --panel-solid: #fff; --body: #000; --accent: #000;
    --dim: #333; --border: #bbb; --border-soft: #bbb; --link: #000;
    --soft: transparent; --selection: transparent;
    --glow-text: none; --glow-soft: none; --glow-box: none;
    --glow-btn: none; --glow-primary: none; --glow-primary-hover: none;
    --glow-card: none; --glow-console: none;
    --font: var(--sans);
  }
  .site-head, #scene, #vignette, #spot, .console, .filter-bar, .print-row,
  .section-intro, .skip-link, .portrait, .halo, .cta-row,
  #console-open { display: none !important; }
  html.js .reveal { opacity: 1 !important; transform: none !important; }
  .skill-btn { box-shadow: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
  body { font-size: 11pt; }
  .hero { min-height: 0; padding-block: 0.5rem; }
  .hero-inner { text-align: left; }
  section { padding-block: 1rem; border-top: 1px solid var(--border); }
  .timeline { padding-left: 0; }
  .timeline::before, .role::before { display: none; }
  .stat, .role, .exposure-card { border: 1px solid var(--border); box-shadow: none; }
  article.role { break-inside: avoid; }
  .role li.match { box-shadow: none; background: none; }
  .role li.dim { opacity: 1; }
}
