/* ==========================================================
   jackcavanaugh.net — data console
   Change the accent in one place: --accent
   ========================================================== */

:root {
  --bg: #08090c;
  --bg-2: #0e1015;
  --line: #1c1f27;
  --line-2: #2a2e38;
  --text: #d6d8de;
  --dim: #80858f;
  --bright: #f4f4f1;
  --accent: #ff5c35;                    /* signal orange */
  --accent-soft: rgba(255, 92, 53, .12);
  --ok: #4ade80;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --wrap: 1120px;
  --nav-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.wrap { width: min(100% - 48px, var(--wrap)); margin-inline: auto; }
kbd {
  font: 12px var(--mono); padding: 1px 6px; border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 4px; color: var(--bright);
}
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--accent); color: var(--bg); padding: 8px 14px; }
.skip:focus { left: 8px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--nav-h);
  transition: background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(8, 9, 12, .82); backdrop-filter: blur(10px); border-bottom-color: var(--line); }
.nav__inner { height: 100%; display: flex; align-items: center; gap: 32px; }
.nav__logo { font-weight: 700; font-size: 18px; color: var(--bright); margin-right: auto; }
.blink { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav__links { display: flex; gap: 26px; font-size: 13px; }
.nav__links a { color: var(--dim); position: relative; transition: color .2s; }
.nav__links a::before { content: "/"; color: var(--accent); opacity: 0; margin-right: 3px; transition: opacity .2s; }
.nav__links a:hover, .nav__links a.active { color: var(--bright); }
.nav__links a:hover::before, .nav__links a.active::before { opacity: 1; }
.term-btn {
  background: none; border: 1px solid var(--line-2); color: var(--dim); border-radius: 6px;
  font-size: 12px; padding: 5px 9px; cursor: pointer; transition: color .2s, border-color .2s;
}
.term-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: stretch;
  overflow: hidden; border-bottom: 1px solid var(--line);
  /* faint chart grid */
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  background-position: center center;
}
.hero::after {   /* fade the grid out toward the edges */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 30%, var(--bg) 85%);
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.axis { position: absolute; z-index: 2; font-size: 11px; color: var(--dim); letter-spacing: .08em; }
.axis--y { left: 14px; top: calc(var(--nav-h) + 150px); transform: rotate(-90deg); transform-origin: left top; }
.axis--x { right: 24px; bottom: 18px; }

.hero__inner {
  position: relative; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--nav-h) + 36px) 0 56px;
}
.hero__inner a { pointer-events: auto; }
.hero__meta { font-size: 12px; color: var(--dim); margin: 0; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 6px; box-shadow: 0 0 10px var(--ok); }

.hero__name {
  font: 400 clamp(64px, 13vw, 190px)/.9 var(--serif);
  letter-spacing: -.02em; color: var(--bright); margin: 0;
}
/* When the particle canvas is running, the real heading stays for screen readers and SEO. */
.has-canvas .hero__name {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.hero__bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.hero__tag { max-width: 38ch; margin: 0; font-size: clamp(18px, 2vw, 22px); line-height: 1.45; color: var(--dim); }
.hero__tag em { font: italic 1.2em/1 var(--serif); color: var(--bright); }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; padding: 12px 20px; font-size: 13px;
  border: 1px solid var(--line-2); color: var(--bright); border-radius: 999px;
  background: rgba(8, 9, 12, .6); backdrop-filter: blur(4px);
  transition: border-color .2s, background .2s, color .2s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #0b0b0b; font-weight: 500; }
.btn--primary:hover { background: var(--bright); border-color: var(--bright); color: #0b0b0b; }

/* ---------- Sections ---------- */
.section { padding: 140px 0 120px; border-bottom: 1px solid var(--line); }
.query { font-size: 13px; color: var(--dim); min-height: 1.6em; }
.query .kw { color: var(--accent); }
.query .str { color: var(--ok); }
.query::after { content: "▍"; color: var(--accent); animation: blink 1.1s steps(1) infinite; }
.query.done::after { content: "  → " attr(data-rows); animation: none; color: var(--dim); opacity: .7; }
.section__title {
  font: 400 clamp(48px, 7vw, 96px)/1 var(--serif); color: var(--bright);
  margin: 18px 0 56px; letter-spacing: -.02em;
}

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 72px; align-items: start; }
.about__text p { margin: 0 0 20px; max-width: 60ch; color: var(--dim); }
.about__text .lead { font: 400 clamp(26px, 3vw, 34px)/1.25 var(--serif); color: var(--bright); }
.about__text q { font-style: italic; quotes: "“" "”"; color: var(--accent); }

.stats { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.stats div { padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats dt { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.stats dd { margin: 6px 0 0; font-size: 38px; font-weight: 500; color: var(--bright); font-variant-numeric: tabular-nums; }

/* ---------- Projects (result set) ---------- */
.results { border-top: 1px solid var(--line-2); }
.results__head, .row summary {
  display: grid; grid-template-columns: 56px 1.4fr 1.2fr 110px; gap: 20px; align-items: center;
}
.results__head { padding: 12px 8px; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--line-2); }
.row { border-bottom: 1px solid var(--line); }
.row summary {
  list-style: none; cursor: pointer; padding: 26px 8px; position: relative;
  transition: background .25s, padding .25s;
}
.row summary::-webkit-details-marker { display: none; }
.row summary::after {
  content: "+"; position: absolute; right: 8px; font: 20px var(--mono); color: var(--dim); transition: transform .25s, color .25s;
}
.row[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.row summary:hover { background: var(--bg-2); padding-left: 16px; }
.row__id { font-size: 13px; color: var(--dim); }
.row__name { font: 400 clamp(24px, 2.6vw, 32px)/1.1 var(--serif); color: var(--bright); transition: color .2s; }
.row summary:hover .row__name { color: var(--accent); }
.row__stack { font-size: 12.5px; color: var(--dim); }
.row__status { font-size: 12.5px; color: var(--text); padding-right: 28px; }
.row__status i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; background: var(--ok); }
.row__status i.live { background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.row.flash summary { background: var(--accent-soft); }
.row__body { padding: 0 8px 30px calc(56px + 28px); max-width: 820px; color: var(--dim); }
.row__body p { margin: 0 0 14px; }
.row__lede { color: var(--text); font-size: 17.5px; }
.row__points { margin: 0 0 22px; padding-left: 18px; font-size: 15.5px; }
.row__points li { margin-bottom: 8px; }
.row__points li::marker { content: "▸  "; color: var(--accent); }
.row__points em { color: var(--text); }
.row__body code { font: 13px var(--mono); color: var(--accent); background: var(--bg-2); padding: 1px 5px; border-radius: 4px; }
.row__chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 16px; padding: 0; font-size: 12px; }
.row__chips li { padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--text); }
.row__meta { font-size: 12.5px; color: var(--dim); margin: 0 !important; }
.link { font-size: 13px; color: var(--accent); }
.link:hover { text-decoration: underline; }

/* ---------- Skills ---------- */
.sk-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: -16px 0 36px; }
.sk-tabs[hidden] { display: none; }
.sk-tab {
  font: 12.5px var(--mono); color: var(--dim); background: none; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 14px;
  transition: color .2s, border-color .2s, background .2s;
}
.sk-tab b { font-weight: 400; color: var(--dim); opacity: .6; margin-left: 6px; }
.sk-tab:hover { color: var(--bright); border-color: var(--dim); }
.sk-tab[aria-selected="true"] { color: #0b0b0b; background: var(--accent); border-color: var(--accent); }
.sk-tab[aria-selected="true"] b { color: #0b0b0b; }

.sk-group + .sk-group { margin-top: 56px; }
.sk-groups.tabbed .sk-group { margin-top: 0; }
.sk-groups.tabbed .sk-group__title { display: none; }
.sk-groups.tabbed .sk-group dl { animation: fadeUp .45s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
.sk-group__title {
  margin: 0 0 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2);
  font-size: 12px; font-weight: 500; color: var(--accent); text-transform: uppercase; letter-spacing: .1em;
}
.sk-group dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 72px; border-top: 1px solid var(--line); }
.sk {
  display: grid; grid-template-columns: 1fr auto; column-gap: 16px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
  transition: padding .25s, background .25s;
}
.sk:hover { padding-left: 10px; background: linear-gradient(90deg, var(--bg-2), transparent); }
.sk dt { font: 400 24px/1.2 var(--serif); color: var(--bright); }
.sk dd { grid-column: 1; margin: 4px 0 0; color: var(--dim); font-size: 15px; line-height: 1.55; }
.sk__ref { grid-column: 2; grid-row: 1; align-self: center; font-size: 11.5px; color: var(--accent); white-space: nowrap; opacity: .75; }
.sk__ref:hover { opacity: 1; text-decoration: underline; }

.soft { margin-top: 80px; }
.soft__label { color: var(--dim); font-size: 13px; margin: 0 0 18px; }
.soft__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.soft__list li { padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.soft__list strong { display: block; font: 400 22px/1.2 var(--serif); color: var(--bright); margin-bottom: 6px; }
.soft__list span { color: var(--dim); font-size: 14.5px; line-height: 1.5; }

/* ---------- Experience ---------- */
.exp { display: grid; grid-template-columns: 1.6fr 1fr; gap: 80px; }
.log { list-style: none; margin: 0; padding: 0; }
.log > li { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.log > li:first-child { border-top: 0; padding-top: 0; }
.log__date { font-size: 12.5px; color: var(--accent); padding-top: 8px; }
.log h3 { margin: 0; font: 400 30px/1.15 var(--serif); color: var(--bright); }
.log__org { margin: 4px 0 12px; font-size: 13px; color: var(--dim); }
.log ul { margin: 0; padding-left: 18px; color: var(--dim); font-size: 15.5px; }
.log ul li { margin-bottom: 6px; }
.log ul li::marker { content: "— "; color: var(--line-2); }

.skills { position: sticky; top: calc(var(--nav-h) + 30px); align-self: start; }
.skills__label { color: var(--dim); font-size: 13px; margin: 0 0 18px; }
.skills dl { margin: 0 0 30px; }
.skills dt { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; }
.skills dd { margin: 4px 0 20px; color: var(--text); }

/* ---------- Contact ---------- */
.contact { padding-bottom: 160px; border-bottom: 0; }
.contact__title { font: 400 clamp(44px, 7vw, 100px)/1 var(--serif); color: var(--bright); margin: 24px 0 48px; letter-spacing: -.02em; }
.contact__title em { color: var(--accent); }
.contact__mail {
  display: inline-block; font: 500 clamp(18px, 3vw, 30px) var(--mono); color: var(--bright);
  border-bottom: 2px solid var(--accent); padding-bottom: 4px; transition: color .2s;
  word-break: break-all;
}
.contact__mail:hover { color: var(--accent); }
.contact__where { margin: 40px 0 0; font-size: 13px; color: var(--dim); }
.socials { display: flex; gap: 28px; list-style: none; padding: 0; margin: 44px 0 0; font-size: 14px; }
.socials a { color: var(--dim); }
.socials a::after { content: " ↗"; color: var(--accent); }
.socials a:hover { color: var(--bright); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 24px 0; font-size: 12.5px; color: var(--dim); }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- Terminal ---------- */
.terminal {
  position: fixed; right: 24px; bottom: 24px; z-index: 100;
  width: min(560px, calc(100vw - 32px)); height: min(380px, 70vh);
  display: flex; flex-direction: column;
  background: rgba(12, 13, 17, .96); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(255,92,53,.08);
  font-size: 13px; animation: pop .18s ease-out;
}
.terminal[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.terminal__bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); color: var(--dim); font-size: 12px; }
.terminal__bar button { background: none; border: 0; color: var(--dim); font-size: 18px; cursor: pointer; line-height: 1; }
.terminal__bar button:hover { color: var(--accent); }
.terminal__out { flex: 1; overflow-y: auto; padding: 14px; white-space: pre-wrap; line-height: 1.6; }
.terminal__out .cmd { color: var(--bright); }
.terminal__out .cmd::before { content: "~ $ "; color: var(--accent); }
.terminal__out .err { color: #f87171; }
.terminal__out .hl { color: var(--accent); }
.terminal__out a { color: var(--ok); text-decoration: underline; }
.terminal__form { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.ps { color: var(--accent); }
.terminal__form input { flex: 1; background: none; border: 0; color: var(--bright); font: inherit; outline: none; caret-color: var(--accent); }

/* ---------- Easter eggs ---------- */
.hero__inner, main > section, .footer { transition: opacity .6s ease, transform .6s ease, filter .6s ease; }
.dropped { opacity: .06 !important; filter: blur(3px); transform: translateY(40px) rotate(-1deg); }

.boot {
  position: fixed; inset: 0; z-index: 300; background: #000; color: #b8c0c8;
  padding: 6vh 6vw; font-size: clamp(12px, 1.6vw, 15px); line-height: 1.75; white-space: pre-wrap;
  transition: opacity .8s ease;
}
.boot b { color: var(--ok); font-weight: 500; }
.boot.out { opacity: 0; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 250;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--bg-2); border: 1px solid var(--accent); color: var(--bright);
  padding: 10px 18px; border-radius: 999px; font-size: 13px; white-space: nowrap;
  box-shadow: 0 20px 40px -16px rgba(0,0,0,.8);
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.stats .headcount { cursor: pointer; transition: background .2s; user-select: none; }
.stats .headcount:hover { background: var(--bg-2); }
.stats .headcount.denied dt { color: var(--accent); }
.stats .headcount.denied { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about, .exp { grid-template-columns: 1fr; gap: 48px; }
  .skills { position: static; }
  .sk-group dl { grid-template-columns: 1fr; }
  .soft__list { grid-template-columns: 1fr 1fr; }
  .results__head { display: none; }
  .row summary { grid-template-columns: 36px 1fr; gap: 4px 12px; }
  .row__stack { grid-column: 2; }
  .row__status { display: none; }
  .row__body { padding-left: 56px; }
}
@media (max-width: 640px) {
  .nav__links { display: none; }
  .wrap { width: min(100% - 36px, var(--wrap)); }
  .section { padding: 100px 0 80px; }
  .log > li { grid-template-columns: 1fr; gap: 6px; }
  .soft__list { grid-template-columns: 1fr; }
  .sk { grid-template-columns: 1fr; }
  .sk__ref { grid-column: 1; grid-row: auto; margin-top: 6px; }
  .log__date { padding-top: 0; }
  .hero { background-size: 48px 48px; }
  .axis--y { display: none; }
  .terminal { right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
