/* ==========================================================================
   EJ Quigley - shared styles
   Direction: bright, Apple-like. Soft gradient wash, frosted cards with
   hairline borders, one accent. Glass is a web approximation (backdrop-filter
   + hairlines + inner highlight), with a solid fallback for reduced transparency.
   Shape rule: cards 28px, nested/inner 20px, every interactive control a pill.
   ========================================================================== */

/* Inter, self-hosted (SIL Open Font License). Latin subset, four static weights. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/Inter-Bold.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --font-head: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(18px, 5vw, 40px);
  --max: 1120px;
  --r-card: 28px;
  --r-inner: 20px;

  --bg: #fbfbfd;
  --ink: #0f1115;
  --muted: #4a5160;
  --faint: #5b6270;
  --line: rgba(15, 17, 21, 0.1);
  --card: rgba(255, 255, 255, 0.72);
  --card-solid: #ffffff;
  --hi: rgba(255, 255, 255, 0.95);
  --chip: rgba(15, 17, 21, 0.05);
  --accent: #0a5bd8;
  --accent-ink: #ffffff;
  --accent-soft: rgba(10, 91, 216, 0.1);
  --accent-text: #0a5bd8;
  --shadow: 0 1px 2px rgba(20, 30, 60, 0.04), 0 18px 40px -18px rgba(30, 50, 110, 0.18);
  --shadow-hover: 0 2px 4px rgba(20, 30, 60, 0.05), 0 28px 50px -18px rgba(30, 50, 110, 0.28);
  --wash-1: rgba(120, 170, 255, 0.42);
  --wash-2: rgba(120, 220, 205, 0.32);
  --wash-3: rgba(255, 205, 170, 0.28);
  --tint-a: rgba(120, 170, 255, 0.26);
  --tint-b: rgba(120, 220, 205, 0.22);
  --mono-a: #1f6ae6;
  --mono-b: #0a3d9c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c10;
    --ink: #f2f3f6;
    --muted: #b1b7c3;
    --faint: #98a0ae;
    --line: rgba(255, 255, 255, 0.12);
    --card: rgba(255, 255, 255, 0.055);
    --card-solid: #15171d;
    --hi: rgba(255, 255, 255, 0.1);
    --chip: rgba(255, 255, 255, 0.07);
    --accent: #7db2ff;
    --accent-ink: #06101f;
    --accent-soft: rgba(125, 178, 255, 0.16);
    --accent-text: #8ebbff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -18px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 28px 50px -18px rgba(0, 0, 0, 0.75);
    --wash-1: rgba(40, 100, 230, 0.34);
    --wash-2: rgba(20, 170, 160, 0.2);
    --wash-3: rgba(200, 110, 60, 0.12);
    --tint-a: rgba(60, 120, 240, 0.2);
    --tint-b: rgba(30, 170, 160, 0.14);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Fixed ambient wash so frosted surfaces always have colour to refract */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 38rem at 12% -6%, var(--wash-1), transparent 62%),
    radial-gradient(46rem 34rem at 96% 8%, var(--wash-2), transparent 60%),
    radial-gradient(50rem 40rem at 70% 105%, var(--wash-3), transparent 60%);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -80px; z-index: 60;
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px;
  text-decoration: none; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center;
}
.skip:focus { top: 12px; }

.icon {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Header: floating translucent pill ---------- */
.site-header { position: sticky; top: 10px; z-index: 40; padding-inline: var(--gutter); margin-top: 10px; }
.header-bar {
  max-width: var(--max); margin-inline: auto; min-height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 8px 6px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 var(--hi);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  backdrop-filter: blur(22px) saturate(1.6);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px 0 12px;
  font-family: var(--font-head); font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.015em;
  text-decoration: none; border-radius: 999px; white-space: nowrap;
}
.nav-desktop { display: none; }
.nav-desktop ul { display: flex; align-items: center; gap: 2px; }
.nav-desktop a, .menu-panel a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border-radius: 999px; text-decoration: none; font-weight: 500; font-size: 0.9375rem; color: var(--muted);
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
.nav-desktop a:hover, .menu-panel a:hover { background: var(--chip); color: var(--ink); }
.nav-desktop a.nav-cta, .menu-panel a.nav-cta { background: var(--ink); color: var(--bg); font-weight: 600; margin-left: 6px; }
.nav-desktop a.nav-cta:hover, .menu-panel a.nav-cta:hover { background: var(--ink); opacity: 0.86; }

/* Mobile menu (details/summary, works without JS) */
.menu { position: relative; }
.menu summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--chip);
  font-weight: 600; font-size: 0.9375rem;
}
.menu summary::-webkit-details-marker { display: none; }
.menu-bars { position: relative; width: 16px; height: 10px; }
.menu-bars::before, .menu-bars::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; border-radius: 2px;
  transition: transform 0.5s var(--ease), top 0.5s var(--ease);
}
.menu-bars::before { top: 1px; }
.menu-bars::after { top: 8px; }
.menu[open] .menu-bars::before { top: 4.5px; transform: rotate(45deg); }
.menu[open] .menu-bars::after { top: 4.5px; transform: rotate(-45deg); }
.menu-panel {
  position: absolute; right: -2px; top: calc(100% + 18px); width: min(300px, calc(100vw - 2 * var(--gutter)));
  padding: 8px; border-radius: var(--r-card);
  background: var(--card-solid); border: 1px solid var(--line); box-shadow: var(--shadow-hover);
}
.menu-panel ul { display: grid; gap: 2px; }
.menu-panel a { width: 100%; min-height: 48px; font-size: 1.0625rem; }
.menu-panel a.nav-cta { margin: 6px 0 0; justify-content: center; }
@media (prefers-reduced-motion: no-preference) {
  .menu[open] .menu-panel { animation: rise 0.5s var(--ease) both; }
}

@media (min-width: 800px) {
  .nav-desktop { display: block; }
  .menu { display: none; }
}

/* ---------- Buttons: pill with nested icon island ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 14px;
  min-height: 52px; padding: 6px 6px 6px 24px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), background-color 0.4s var(--ease);
}
.btn-icon {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  transition: transform 0.5s var(--ease);
}
.btn-icon .icon { width: 18px; height: 18px; }
.btn:hover .btn-icon { transform: translate(2px, -1px) scale(1.05); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -10px var(--accent); }
.btn-primary .btn-icon { background: rgba(255, 255, 255, 0.22); }
@media (prefers-color-scheme: dark) { .btn-primary .btn-icon { background: rgba(0, 0, 0, 0.14); } }
.btn-primary:hover { box-shadow: 0 16px 30px -10px var(--accent); }
.btn-ghost {
  background: var(--card); color: var(--ink); border-color: var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 var(--hi);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.btn-ghost .btn-icon { background: var(--chip); }
.btn-ghost:hover { box-shadow: var(--shadow-hover), inset 0 1px 0 var(--hi); }

/* ---------- Glass card ---------- */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow), inset 0 1px 0 var(--hi);
  padding: clamp(22px, 3.2vw, 34px);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
/* Blur is expensive, so only the header, ghost button, and featured cards get it. */
.card-feature {
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
}
.card-link:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover), inset 0 1px 0 var(--hi); }
.card-link:has(a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (prefers-reduced-transparency: reduce) {
  .card, .header-bar, .btn-ghost, .card-feature { background: var(--card-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.chip {
  display: inline-flex; align-items: center; min-height: 28px; padding: 2px 12px; border-radius: 999px;
  background: var(--chip); color: var(--muted); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.01em;
  white-space: nowrap;
}
.chip-active { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- Sections ---------- */
.section { padding-block: clamp(72px, 10vw, 128px); }
h2 {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(2rem, 4.6vw, 3.25rem); line-height: 1.05; letter-spacing: -0.035em;
}
h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.section-head { margin-bottom: clamp(32px, 5vw, 56px); display: grid; gap: 16px; }
.section-intro { color: var(--muted); max-width: 56ch; font-size: 1.125rem; }

/* ---------- Hero ---------- */
/* The hero is the whole first screen. The header is 70px tall including its top offset. */
.hero { position: relative; min-height: calc(100dvh - 70px); display: grid; align-content: center; padding-block: clamp(32px, 5vw, 64px) clamp(72px, 9vw, 112px); }
.hero-grid { align-self: center; }
.hero-grid { display: grid; gap: 40px; justify-items: center; text-align: center; }
.hero-copy { max-width: 640px; }
.hero h1 {
  font-family: var(--font-head); font-weight: 700; line-height: 0.98; letter-spacing: -0.045em;
  font-size: clamp(2.875rem, 9.4vw, 6.25rem);
}
.hero h1 span { display: block; }
.tagline {
  margin-top: 26px; max-width: 36ch; color: var(--ink);
  font-family: var(--font-head); font-weight: 500; letter-spacing: -0.02em; line-height: 1.25;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
}
.hero-support { margin-top: 18px; max-width: 46ch; color: var(--muted); font-size: 1.0625rem; }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
@media (max-width: 480px) { .hero-actions .btn { width: 100%; } }

.headshot { width: 132px; order: -1; }
.headshot-shell {
  padding: 5px; border-radius: 28px; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-hover), inset 0 1px 0 var(--hi);
}
.headshot-core {
  position: relative; aspect-ratio: 4 / 5; border-radius: 24px; overflow: hidden;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 80% at 20% 0%, rgba(255, 255, 255, 0.28), transparent 55%),
    linear-gradient(150deg, var(--mono-a), var(--mono-b));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.headshot-core img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 900px) {
  /* Text left, portrait right, the pair centered as a block with the text vertically centered on the portrait */
  .hero-grid { grid-template-columns: minmax(0, 620px) 340px; justify-content: center; align-items: center; gap: 72px; text-align: left; justify-items: stretch; }
  .hero-copy { max-width: none; }
  .hero-actions { justify-content: flex-start; }
  .headshot { width: 340px; order: 0; justify-self: end; }
  .headshot-shell { padding: 8px; border-radius: 40px; }
  .headshot-core { border-radius: 32px; }
}

/* ---------- About ---------- */
.about-grid { display: grid; gap: 28px; }
.about-text {
  font-family: var(--font-head); font-weight: 500; letter-spacing: -0.02em; line-height: 1.38;
  font-size: clamp(1.3rem, 2.5vw, 1.875rem); color: var(--ink); max-width: 34em;
}
@media (min-width: 900px) { .about-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr); gap: 72px; } }

/* ---------- Experience ---------- */
.roles { display: grid; gap: 20px; }
.role { display: grid; gap: 22px; }
.role-meta { display: grid; gap: 10px; align-content: start; }
.role-meta .chip { justify-self: start; }
.role h3 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); }
.role-org { color: var(--muted); font-weight: 500; }
.role-when { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-text); }
.role-body { display: grid; gap: 18px; align-content: start; }
.role-body p { color: var(--muted); max-width: 62ch; }
.text-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; width: fit-content;
  font-weight: 600; color: var(--accent-text); text-decoration: none; border-radius: 999px;
}
.text-link .icon { width: 18px; height: 18px; transition: transform 0.5s var(--ease); }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.text-link:hover .icon { transform: translate(2px, -2px); }
@media (min-width: 860px) {
  .role { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: 56px; }
}

/* ---------- Projects: bento, four cells ---------- */
.bento { display: grid; gap: 16px; grid-template-columns: 1fr; }
.project { display: flex; flex-direction: column; gap: 14px; min-height: 220px; }
.project h3 { font-size: 1.375rem; }
.project p { color: var(--muted); }
.project-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.project .go {
  margin-top: auto; align-self: flex-end; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--chip); color: var(--ink);
  transition: transform 0.5s var(--ease), background-color 0.4s var(--ease), color 0.4s var(--ease);
}
.project .go .icon { width: 18px; height: 18px; }
.project:hover .go { transform: translate(2px, -2px); background: var(--accent); color: var(--accent-ink); }
.project h3 a { text-decoration: none; }
.project h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-card); }
.project h3 a:focus-visible { outline: none; }
.project-feature {
  min-height: 300px;
  background:
    radial-gradient(90% 70% at 100% 0%, var(--tint-a), transparent 65%),
    var(--card);
}
.project-feature.alt {
  background:
    radial-gradient(90% 70% at 100% 0%, var(--tint-b), transparent 65%),
    var(--card);
}
.project-feature h3 { font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.03em; }
.project-feature p { font-size: 1.125rem; max-width: 34ch; }
.project .spacer { margin-top: auto; }

.project-unlinked .cta-hint { color: var(--faint); }
@media (min-width: 640px) {
  .bento { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .project.project-feature { min-height: 360px; }
}

/* ---------- Off the keyboard: three cards that point at the résumé pages ---------- */
.cred-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.cred-grid .project { min-height: 0; }
@media (min-width: 700px) { .cred-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.section-intro a { color: var(--accent-text); font-weight: 600; text-decoration: none; }
.section-intro a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Skills ---------- */
.skills-panel { display: grid; padding: 0; overflow: hidden; }
.skill-row { display: grid; gap: 14px; padding: clamp(22px, 3vw, 32px); }
.skill-row + .skill-row { border-top: 1px solid var(--line); }
.skill-row h3 { font-size: 1.25rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  display: inline-flex; align-items: center; min-height: 36px; padding: 4px 16px; border-radius: 999px;
  background: var(--chip); border: 1px solid var(--line); font-size: 0.9375rem; font-weight: 500;
}
@media (min-width: 860px) { .skill-row { grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr); gap: 56px; align-items: baseline; } }

/* ---------- Right now: one line that points at /now/, plus the GitHub strip ---------- */
.now-teaser { display: grid; gap: 20px; }
.now-teaser-text { font-family: var(--font-head); font-weight: 500; letter-spacing: -0.02em; line-height: 1.3; font-size: clamp(1.25rem, 2.4vw, 1.625rem); max-width: 30ch; }
@media (min-width: 860px) { .now-teaser { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; } }

/* ---------- Contribution graph (data from /assets/data/contributions.json) ---------- */
.contrib { margin-top: 28px; display: grid; gap: 16px; padding: clamp(18px, 2.4vw, 26px); }
.contrib[hidden] { display: none; }
.contrib-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.contrib-head h3 { font-size: 1.125rem; color: var(--muted); }
.contrib-total { font-family: var(--font-head); font-weight: 500; letter-spacing: -0.015em; font-size: 1.0625rem; }
.contrib-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; padding-bottom: 4px; }
.contrib-svg { display: block; width: 100%; min-width: 760px; height: auto; font-family: var(--font-body); }
.contrib-svg text { fill: var(--faint); font-size: 10px; }
.contrib-cell { fill: var(--chip); stroke: var(--line); stroke-width: 1; }
.contrib-cell[data-l="1"] { fill: var(--accent); fill-opacity: 0.3; stroke: none; }
.contrib-cell[data-l="2"] { fill: var(--accent); fill-opacity: 0.55; stroke: none; }
.contrib-cell[data-l="3"] { fill: var(--accent); fill-opacity: 0.8; stroke: none; }
.contrib-cell[data-l="4"] { fill: var(--accent); fill-opacity: 1; stroke: none; }
.contrib-foot { color: var(--faint); font-size: 0.875rem; }
.contrib-foot a { color: var(--accent-text); font-weight: 600; text-decoration: none; }
.contrib-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Contact ---------- */
.contact-card { display: grid; gap: 22px; justify-items: start; }
.contact-copy { display: grid; gap: 12px; }
.contact-card p { font-family: var(--font-head); font-weight: 500; letter-spacing: -0.02em; line-height: 1.3; font-size: clamp(1.25rem, 2.6vw, 1.75rem); max-width: 26ch; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.contact-note { color: var(--muted); font-size: 0.9375rem; font-family: var(--font-body); font-weight: 400; letter-spacing: 0; }
@media (max-width: 480px) { .contact-actions .btn { width: 100%; } }
@media (min-width: 860px) { .contact-card { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; } .contact-card .contact-actions { justify-self: end; } }

/* ---------- Outside the work ---------- */
.beyond-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.beyond-item { display: grid; gap: 10px; align-content: start; }
.beyond-item h3 { font-size: 1.375rem; }
.beyond-item p { color: var(--muted); max-width: 44ch; }
.beyond-item.feature {
  background: radial-gradient(90% 80% at 0% 0%, var(--tint-a), transparent 65%), var(--card);
}
.beyond-item.feature h3 { font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.03em; }
.beyond-item.feature p { font-size: 1.125rem; }
@media (min-width: 700px) {
  .beyond-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .beyond-grid { grid-template-columns: repeat(12, 1fr); gap: 20px; }
  .beyond-item { grid-column: span 4; }
  .beyond-item:nth-child(1) { grid-column: span 7; }
  .beyond-item:nth-child(2) { grid-column: span 5; }
  .beyond-item:nth-child(3) { grid-column: span 5; }
  .beyond-item:nth-child(4) { grid-column: span 7; }
}

/* ---------- Footer ---------- */
.site-footer { padding-block: 72px 56px; border-top: 1px solid var(--line); }
.footer-inner { display: grid; gap: 28px; }
.footer-line { color: var(--muted); max-width: 40ch; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; }
.social {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px 0 16px;
  border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 var(--hi);
  text-decoration: none; font-weight: 600; font-size: 0.9375rem;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.social:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover), inset 0 1px 0 var(--hi); }
.copyright { color: var(--faint); font-size: 0.875rem; }

/* ---------- Hero motion: portrait tilt + moving highlight (transform only) ---------- */
.headshot { perspective: 900px; }
.headshot-shell { transition: transform 0.6s var(--ease); will-change: auto; }
.headshot-shell.is-tilting { transition: transform 0.12s var(--ease); }
.headshot-core::after {
  content: ""; position: absolute; inset: -50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.24), transparent 38%);
  transform: translate3d(var(--hx, 0px), var(--hy, 0px), 0);
  transition: opacity 0.5s var(--ease);
}
.headshot-shell.is-tilting .headshot-core::after { opacity: 1; }

/* Gradient wash drifts a few px with page scroll (CSS scroll-driven, no JS) */
@keyframes wash-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, -36px, 0); } }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    body::before { inset: -48px 0; animation: wash-drift linear both; animation-timeline: scroll(root block); }
  }
}

/* ---------- Story timeline ---------- */
.timeline { position: relative; display: grid; gap: 20px; max-width: 760px; padding-left: 34px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 14px; bottom: 14px; width: 2px; border-radius: 2px;
  background: linear-gradient(to bottom, var(--line), var(--accent-soft) 30%, var(--line));
}
.timeline-item { position: relative; display: grid; gap: 4px; }
.timeline-item::before {
  content: ""; position: absolute; left: -34px; top: 7px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent-text);
}
.timeline-when { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-text); }
.timeline-item p { font-family: var(--font-head); font-weight: 500; font-size: clamp(1.125rem, 2vw, 1.375rem); letter-spacing: -0.015em; line-height: 1.3; max-width: 44ch; }

/* ---------- GitHub activity strip ---------- */
.activity { display: grid; gap: 12px; }
.activity h3 { font-size: 1.125rem; color: var(--muted); }
.activity-list { display: grid; gap: 4px; }
.activity-list[hidden] { display: none; }
.activity-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; padding: 6px 18px;
  border-radius: 999px; text-decoration: none; border: 1px solid transparent;
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.activity-row:hover { background: var(--card); border-color: var(--line); }
.activity-text { font-size: 0.9375rem; font-weight: 500; overflow-wrap: anywhere; }
.activity-time { flex: none; color: var(--faint); font-size: 0.8125rem; }
.activity-fallback { color: var(--muted); }
.activity-fallback a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--accent-text); }

/* ---------- Project card affordances ---------- */
.project-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.project-foot .go { margin: 0; flex: none; }
.foot-text { display: grid; gap: 0; }
.cta-hint { font-size: 0.875rem; font-weight: 600; color: var(--accent-text); }
.mini-link {
  position: relative; z-index: 1; display: inline-flex; align-items: center; min-height: 44px; width: fit-content;
  font-size: 0.875rem; font-weight: 500; color: var(--muted); text-underline-offset: 3px;
}
.mini-link:hover { color: var(--ink); }

/* ---------- F1 easter egg: McLaren papaya accent ---------- */
.beyond-item { position: relative; }
.papaya-toggle {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: transparent; display: grid; place-items: center; cursor: pointer;
}
.papaya-toggle[hidden] { display: none; }
.papaya-dot {
  width: 14px; height: 14px; border-radius: 50%; background: #ff8000; box-shadow: 0 0 0 1.5px #8f4600;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.papaya-toggle:hover .papaya-dot { transform: scale(1.35); }
.papaya-toggle[aria-pressed="true"] .papaya-dot { box-shadow: 0 0 0 3px var(--card-solid), 0 0 0 5px #ff8000; }
/* Papaya as fill with dark ink; text uses a darker tone so it still passes AA on light */
html[data-theme-accent="papaya"] {
  --accent: #ff8000; --accent-ink: #1a0d00; --accent-soft: rgba(255, 128, 0, 0.16); --accent-text: #8f4600;
  --mono-a: #e06a00; --mono-b: #9a4300; --tint-a: rgba(255, 128, 0, 0.2);
}
@media (prefers-color-scheme: dark) {
  html[data-theme-accent="papaya"] {
    --accent: #ff8000; --accent-ink: #1a0d00; --accent-soft: rgba(255, 128, 0, 0.18); --accent-text: #ffa04d;
    --tint-a: rgba(255, 128, 0, 0.16);
  }
}
html[data-theme-accent="papaya"] :focus-visible { outline-color: var(--accent-text); }

/* ---------- Command palette ---------- */
.cmdk {
  border: 0; padding: 0; background: transparent; color: var(--ink); width: min(600px, calc(100vw - 32px));
  max-height: 80dvh; margin: 12vh auto auto; overflow: visible;
}
.cmdk::backdrop { background: rgba(10, 12, 18, 0.45); }
.cmdk-panel {
  display: grid; gap: 8px; padding: 10px; border-radius: var(--r-card); background: var(--card-solid);
  border: 1px solid var(--line); box-shadow: var(--shadow-hover);
}
.cmdk-input {
  width: 100%; min-height: 52px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--chip); color: var(--ink); font: inherit; font-size: 1.0625rem;
}
.cmdk-input:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.cmdk-list { display: grid; gap: 2px; max-height: 50dvh; overflow-y: auto; overscroll-behavior: contain; }
.cmdk-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 6px 16px;
  border-radius: 999px; cursor: pointer; font-weight: 500;
}
.cmdk-item[aria-selected="true"] { background: var(--accent-soft); }
.cmdk-group { color: var(--faint); font-size: 0.8125rem; font-weight: 600; }
.cmdk-empty, .cmdk-foot { padding: 6px 16px; color: var(--muted); font-size: 0.875rem; }
.cmdk-empty[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .cmdk[open] .cmdk-panel { animation: rise 0.4s var(--ease) both; }
}

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  /* Hero staggers in on load (CSS only, no hidden state needed) */
  .rise { animation: rise 1s var(--ease) backwards; }
  .rise:nth-child(2) { animation-delay: 0.08s; }
  .rise:nth-child(3) { animation-delay: 0.16s; }
  .rise:nth-child(4) { animation-delay: 0.24s; }
  .headshot.rise { animation-delay: 0.2s; }
  /* Everything else reveals on scroll. After the animation ends, normal styles
     return so hover transforms keep working. */
  .js .reveal:not(.is-in) { opacity: 0; }
  .js .reveal.is-in { animation: rise 0.9s var(--ease) backwards; }
  .js .reveal.is-in:nth-child(2) { animation-delay: 0.06s; }
  .js .reveal.is-in:nth-child(3) { animation-delay: 0.12s; }
  .js .reveal.is-in:nth-child(4) { animation-delay: 0.18s; }
  .js .reveal.is-in:nth-child(5) { animation-delay: 0.24s; }
  .js .reveal.is-in:nth-child(6) { animation-delay: 0.3s; }
  .js .reveal.is-in:nth-child(7) { animation-delay: 0.36s; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
  .card-link:hover, .social:hover { transform: none; }
}

@media print { .reveal, .rise { opacity: 1 !important; animation: none !important; transform: none !important; } }
