/* Instrument visual layer: dark, tactile, and responsive to attention. */
:root {
  color-scheme: dark;
  --page: #080c12;
  --page-raised: #101722;
  --ink: #eef3fb;
  --ink-soft: #a7b3c5;
  --ink-faint: #8492a8;
  --line: rgba(178, 199, 230, 0.16);
  --line-strong: rgba(178, 199, 230, 0.32);
  --accent: #a9c7ff;
  --accent-soft: rgba(101, 147, 232, 0.16);
  --accent-deep: #8eb4ff;
  --signal: #67e2d1;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  background: var(--page);
  scrollbar-color: rgba(169, 199, 255, 0.52) transparent;
}

body {
  background:
    radial-gradient(circle at 82% 3%, rgba(91, 139, 232, 0.09), transparent 27rem),
    var(--page);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 450;
  letter-spacing: -0.012em;
}

::selection {
  background: var(--accent);
  color: #07101d;
}

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--page); }
::-webkit-scrollbar-thumb { background: rgba(169, 199, 255, 0.34); border: 3px solid var(--page); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(169, 199, 255, 0.62); }

.section-rail { right: max(24px, calc((100vw - 1320px) / 2)); }
.section-rail-track { background: rgba(178, 199, 230, 0.16); }
.section-rail-fill { background: var(--accent); box-shadow: 0 0 14px rgba(169, 199, 255, 0.36); }
.section-rail a { color: var(--ink-faint); }
.section-rail a span { color: inherit; }
.section-rail a:hover, .section-rail a:focus-visible, .section-rail a[aria-current="location"] { color: var(--accent); }
.section-rail-current { color: var(--ink-faint); }

h1, h2, h3 { color: var(--ink); font-family: var(--display); font-weight: 620; letter-spacing: -0.065em; }
h2 { font-size: clamp(3rem, 5.8vw, 6rem); line-height: 0.91; }
h3 { font-size: 1.5rem; }
p { color: var(--ink-soft); }

.button { min-height: 48px; padding-inline: 18px; border-radius: 999px; font-family: var(--display); font-weight: 650; letter-spacing: -0.02em; }
.button-primary { background: var(--accent); color: #07101d; box-shadow: 0 10px 28px rgba(80, 127, 222, 0.2); }
.button-primary:hover, .button-primary:focus-visible { background: #c9dcff; color: #07101d; box-shadow: 0 14px 38px rgba(80, 127, 222, 0.32); }
.button-secondary { border-color: var(--line-strong); color: var(--ink); background: rgba(255, 255, 255, 0.025); }
.button-secondary:hover, .button-secondary:focus-visible { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }

.hero-story { background: #070b12; }
.hero-story-sticky { background: #070b12; }
.hero-story-vignette { background: linear-gradient(90deg, rgba(7, 11, 18, 0.78), rgba(7, 11, 18, 0.02) 64%, rgba(7, 11, 18, 0.42)), radial-gradient(ellipse at center, transparent 42%, rgba(3, 7, 13, 0.36) 100%); }
.hero-story-grid { opacity: 0.16; }
.hero-story-kicker { color: rgba(194, 213, 246, 0.7); font-family: var(--mono); letter-spacing: 0.13em; }
.hero-story h1 { font-weight: 560; letter-spacing: -0.085em; }
.hero-story h1 span:last-child { color: var(--accent); }
.hero-story-summary { color: rgba(222, 231, 245, 0.72); }
.hero-story-object-label { color: rgba(194, 213, 246, 0.62); font-family: var(--mono); }
.hero-story-bottom { color: rgba(194, 213, 246, 0.58); font-family: var(--mono); }
.hero-story-bottom strong { color: var(--accent); }
.hero-story-line::after { background: var(--accent); box-shadow: none; }

.scene-section { --scene-glow: rgba(103, 226, 209, 0.08); }
.scene-section::after { background: radial-gradient(circle 320px at var(--pointer-x) var(--pointer-y), var(--scene-glow), transparent 70%); }
.scene-section.scene-active { --scene-glow: rgba(129, 171, 255, 0.1); }

.manifesto-scene {
  min-height: 720px;
  border-color: var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 42%),
    radial-gradient(circle at 78% 42%, rgba(91, 139, 232, 0.13), transparent 27rem),
    #0c121b;
}
.manifesto-scene .intro-statement { color: var(--ink); font-weight: 540; letter-spacing: -0.064em; }
.manifesto-scene .intro-aside p { color: var(--ink-soft); }
.manifesto-footer { color: var(--ink-faint); font-family: var(--mono); }
.manifesto-footer span:nth-child(2) { color: var(--signal); }
.manifesto-orbit { border-color: rgba(169, 199, 255, 0.25); }
.manifesto-node { background: var(--accent); box-shadow: 0 0 0 7px rgba(169, 199, 255, 0.1); }
.manifesto-node-two { background: var(--signal); }
.manifesto-node-three { background: var(--accent-deep); }
.manifesto-path { border-color: rgba(103, 226, 209, 0.46); }

.work-scene {
  min-height: 980px;
  background:
    radial-gradient(circle at 74% 40%, rgba(91, 139, 232, 0.09), transparent 24rem),
    #080d14;
}
.work-scene .section-heading h2 { max-width: 9ch; }

.work-beam { background: linear-gradient(90deg, transparent, rgba(169, 199, 255, 0.32), transparent); }
.work-crosshair { border-color: rgba(169, 199, 255, 0.22); }
.work-crosshair::before, .work-crosshair::after { background: rgba(169, 199, 255, 0.25); }

.work-footer { color: var(--ink-soft); }
.text-link, .visual-caption a, .footer-email { color: var(--accent); }

.lab-scene { background: radial-gradient(circle at 72% 30%, rgba(103, 226, 209, 0.08), transparent 24rem), #0a111a; }

.experience-scene { background: radial-gradient(circle at 78% 22%, rgba(103, 226, 209, 0.08), transparent 24rem), #0b1119; }
.experience-heading h2 { max-width: 8ch; }
.experience-scene .timeline { border-top-color: var(--line); }

.about-scene { background: radial-gradient(circle at 12% 74%, rgba(103, 226, 209, 0.08), transparent 26rem), #080d14; }
.about-scene .toolkit-copy h2 { max-width: 8ch; }
.about-signal { border-color: rgba(169, 199, 255, 0.2); }
.about-signal::before, .about-signal::after { border-color: rgba(103, 226, 209, 0.2); }
.about-signal span { background: var(--accent); box-shadow: 0 0 0 6px rgba(169, 199, 255, 0.08); }
.about-signal span:nth-child(2), .about-signal span:nth-child(4) { background: var(--signal); }

.resume-scene { border-color: var(--line); background: radial-gradient(circle at 82% 50%, rgba(169, 199, 255, 0.12), transparent 23rem), rgba(255, 255, 255, 0.04); }
.resume-ring { border-color: rgba(169, 199, 255, 0.3); color: var(--accent); }
.resume-ring::before { border-color: rgba(103, 226, 209, 0.22); }
.resume-ring::after { background: rgba(169, 199, 255, 0.1); }

.footer-scene { background: radial-gradient(circle at 82% 18%, rgba(103, 226, 209, 0.08), transparent 25rem), #060a11; }
.footer-scene .footer-email { color: var(--accent); }
.footer-scene .footer-email:hover, .footer-scene .footer-email:focus-visible { color: #d5e3ff; }

/* Cursor companion. It never replaces the native pointer.
   JS moves each piece with the `translate` property only; everything else here is
   static offsets and state transitions, so nothing restarts while the pointer moves. */
.cursor-system { position: fixed; z-index: 200; inset: 0; pointer-events: none; opacity: 0; transition: opacity 240ms ease; }
.cursor-active .cursor-system { opacity: 1; }
.cursor-glow, .cursor-orb, .cursor-ring, .cursor-cross, .cursor-label { position: absolute; top: 0; left: 0; translate: -100px -100px; will-change: translate; }
.cursor-glow { width: 440px; height: 440px; margin: -220px; border-radius: 50%; background: radial-gradient(circle closest-side, rgba(144, 183, 255, 0.045), transparent 72%); }
.cursor-orb { width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 5px rgba(103, 226, 209, 0.12), 0 0 20px rgba(103, 226, 209, 0.45); }
.cursor-ring { width: 58px; height: 58px; margin: -29px; border: 1px solid rgba(169, 199, 255, 0.68); border-radius: 50%; scale: 0.55; transition: scale 260ms var(--ease), border-color 200ms ease, background 200ms ease; }
.cursor-cross { margin: -8px 0 0 -3px; color: rgba(169, 199, 255, 0.72); font: 13px/1 var(--mono); transform: translate(18px, -18px); transition: opacity 180ms ease; }
.cursor-label { margin: -8px 0 0 24px; color: var(--accent); font: 10px/1 var(--mono); letter-spacing: 0.06em; opacity: 0; transform: translate(0, 22px); transition: opacity 180ms ease, transform 260ms var(--ease); text-transform: lowercase; white-space: nowrap; }
.cursor-hover .cursor-ring { scale: 1; background: rgba(169, 199, 255, 0.055); border-color: var(--accent); }
.cursor-label-visible .cursor-label { opacity: 1; transform: translate(4px, 26px); }
.cursor-press .cursor-ring { scale: 0.72; background: rgba(103, 226, 209, 0.12); }

@media (max-width: 900px) {
  .section-rail { right: 50%; }
  .scene-section::after { display: none; }
  .cursor-system { display: none; }
}

/* Closing scene compact pass: readable hierarchy, shorter finish. */
.footer-surface {
  min-height: 560px;
  border-radius: 24px 24px 0 0;
  background:
    radial-gradient(ellipse at 18% 88%, rgba(48, 78, 174, 0.72), transparent 34%),
    radial-gradient(ellipse at 56% 46%, rgba(42, 163, 151, 0.66), transparent 44%),
    radial-gradient(ellipse at 100% 0%, rgba(127, 149, 214, 0.6), transparent 34%),
    linear-gradient(112deg, #3a62bb 0%, #3eaaa0 48%, #8799cf 100%);
}

.footer-surface::after {
  background: linear-gradient(110deg, rgba(3, 16, 52, 0.38), rgba(5, 37, 48, 0.18) 48%, rgba(23, 35, 83, 0.38));
  mix-blend-mode: normal;
}

.footer-hero {
  grid-template-columns: minmax(0, 1.08fr) minmax(250px, 0.92fr);
  gap: clamp(32px, 7vw, 96px);
  min-height: 310px;
  padding-block: 46px 38px;
}

.footer-kicker {
  margin-bottom: 14px;
  color: rgba(248, 251, 255, 0.86);
  font-size: 11px;
}

.footer-heading h2 {
  max-width: 8ch;
  font-size: clamp(3rem, 6.2vw, 5.6rem);
  line-height: 0.86;
}

.footer-focus {
  margin-top: 17px;
  color: rgba(247, 251, 255, 0.82);
  font-size: clamp(0.95rem, 1.6vw, 1.35rem);
}

.footer-contact {
  padding-top: 30px;
}

.footer-email {
  color: #071a3b;
  font-size: clamp(1.05rem, 1.9vw, 1.75rem);
  text-shadow: none;
}

.footer-contact p {
  max-width: 25ch;
  margin-top: 13px;
  color: rgba(247, 251, 255, 0.82);
  font-size: 13px;
  line-height: 1.45;
}

.footer-nav-grid {
  gap: 64px;
  width: min(470px, calc(100% - 48px));
  padding-bottom: 30px;
}

.footer-nav-group {
  gap: 5px;
}

.footer-nav-group h3 {
  margin-bottom: 11px;
  font-size: 1.08rem;
}

.footer-nav-group a {
  color: rgba(247, 251, 255, 0.86);
  font-size: 0.98rem;
}

.footer-bottom {
  padding-block: 14px 17px;
  color: rgba(247, 251, 255, 0.72);
  font-size: 10px;
}

@media (max-width: 900px) {
  .footer-surface { min-height: 600px; }
  .footer-hero { min-height: 360px; }
}

@media (max-width: 640px) {
  .footer-surface { min-height: 640px; border-radius: 18px 18px 0 0; }
  .footer-hero { min-height: 380px; gap: 26px; padding-block: 38px 28px; }
  .footer-heading h2 { font-size: clamp(3.25rem, 16vw, 5rem); }
  .footer-focus { max-width: 20ch; font-size: 1rem; }
  .footer-contact { padding-top: 0; }
  .footer-email { font-size: 1.2rem; }
  .footer-nav-grid { gap: 22px; width: var(--shell); padding-bottom: 27px; }
  .footer-nav-group h3 { font-size: 1rem; }
  .footer-nav-group a { font-size: 0.92rem; }
}

.footer-kicker { color: rgba(7, 26, 59, 0.76); }
.footer-focus { color: rgba(7, 26, 59, 0.78); }
.footer-contact p { color: rgba(7, 26, 59, 0.72); }
.footer-nav-group h3 { color: rgba(7, 26, 59, 0.9); }
.footer-nav-group a { color: rgba(7, 26, 59, 0.82); }
.footer-nav-group a:hover, .footer-nav-group a:focus-visible { color: #071a3b; }
.footer-email:hover, .footer-email:focus-visible { color: #071a3b; }
.footer-bottom { color: rgba(7, 26, 59, 0.68); border-top-color: rgba(7, 26, 59, 0.24); }

@media (min-width: 901px) {
  .footer-heading h2 { font-size: clamp(3.1rem, 5.6vw, 5.2rem); line-height: 0.88; }
  .footer-focus { font-size: clamp(0.92rem, 1.35vw, 1.22rem); }
  .footer-contact { padding-top: 18px; }
  .footer-email { font-size: clamp(1.05rem, 1.7vw, 1.65rem); }
  .footer-nav-grid { gap: 48px; padding-bottom: 22px; }
  .footer-nav-group h3 { margin-bottom: 8px; font-size: 1rem; }
  .footer-nav-group a { font-size: 0.95rem; }
}

@media (max-width: 640px) {
  .footer-heading h2 { font-size: clamp(2.9rem, 14vw, 4.5rem); line-height: 0.98; }
  .footer-contact p { font-size: 12px; }
  .footer-nav-grid { padding-bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  body::before { display: none; }
  .cursor-system { display: none; }
  .project-card, .project-card:hover, .manifesto-orbit, .manifesto-node, .work-beam, .work-crosshair, .about-signal, .resume-ring { transition: none; transform: none; }
}

/* Closing scene: a luminous, full-bleed invitation rather than a utility footer. */
.footer-scene {
  overflow: hidden;
  padding: 34px 0 0;
  background: #07101d;
}

.footer-surface {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 650px;
  border-radius: 30px 30px 0 0;
  background:
    radial-gradient(ellipse at 17% 98%, rgba(91, 111, 238, 0.72), transparent 32%),
    radial-gradient(ellipse at 60% 60%, rgba(55, 204, 184, 0.78), transparent 43%),
    radial-gradient(ellipse at 100% 2%, rgba(163, 188, 255, 0.72), transparent 34%),
    linear-gradient(112deg, #4777e8 0%, #5ecfbd 48%, #a8bbef 100%);
}

.footer-surface::before,
.footer-surface::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.footer-surface::before {
  inset: -20% -10%;
  background:
    radial-gradient(ellipse at 22% 38%, rgba(255, 255, 255, 0.16), transparent 28%),
    radial-gradient(ellipse at 75% 75%, rgba(31, 77, 193, 0.21), transparent 33%);
  filter: blur(20px);
  transform: rotate(-8deg);
}

.footer-surface::after {
  inset: 0;
  background: linear-gradient(105deg, rgba(6, 22, 76, 0.12), transparent 33%, rgba(255, 255, 255, 0.08) 65%, rgba(18, 60, 154, 0.12));
  mix-blend-mode: soft-light;
}

.footer-hero,
.footer-nav-grid,
.footer-bottom {
  position: relative;
  z-index: 1;
}

.footer-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(270px, 0.75fr);
  gap: clamp(40px, 9vw, 140px);
  align-items: end;
  min-height: 430px;
  padding-block: 64px 72px;
}

.footer-kicker {
  margin: 0 0 22px;
  color: rgba(242, 248, 255, 0.86);
  font: 600 12px/1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-heading h2 {
  max-width: 8ch;
  margin: 0;
  color: #071a3b;
  font-size: clamp(4rem, 8vw, 8rem);
  font-weight: 520;
  letter-spacing: -0.09em;
  line-height: 0.82;
}

.footer-heading h2 span {
  color: #071a3b;
}

.footer-focus {
  margin: 28px 0 0;
  color: rgba(242, 248, 255, 0.83);
  font-size: clamp(1.1rem, 2vw, 1.8rem);
  letter-spacing: -0.04em;
}

.footer-contact {
  align-self: center;
  padding-top: 70px;
}

.footer-email {
  display: inline-block;
  color: #071a3b;
  font-size: clamp(1.35rem, 2.5vw, 2.35rem);
  font-weight: 650;
  letter-spacing: -0.055em;
  text-decoration: none;
  text-shadow: 0 1px 16px rgba(21, 76, 177, 0.18);
}

.footer-email:hover,
.footer-email:focus-visible {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 7px;
}

.footer-contact p {
  max-width: 28ch;
  margin: 17px 0 0;
  color: rgba(242, 248, 255, 0.76);
  font-size: 14px;
  line-height: 1.5;
}

.footer-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  width: min(520px, calc(100% - 48px));
  margin-left: auto;
  padding-bottom: 58px;
  padding-right: 0;
}

.footer-nav-group {
  display: grid;
  align-content: start;
  gap: 8px;
}

.footer-nav-group h3 {
  margin: 0 0 20px;
  color: rgba(245, 250, 255, 0.96);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.05em;
}

.footer-nav-group a {
  width: fit-content;
  color: rgba(245, 250, 255, 0.88);
  font-size: 1.2rem;
  letter-spacing: -0.035em;
  text-decoration: none;
  transition: color 180ms ease, transform 180ms var(--ease);
}

.footer-nav-group a:hover,
.footer-nav-group a:focus-visible {
  color: #ffffff;
  transform: translateX(5px);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-block: 18px 22px;
  border-top: 1px solid rgba(245, 250, 255, 0.3);
  color: rgba(245, 250, 255, 0.75);
  font: 11px/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .footer-surface { min-height: 690px; }
  .footer-hero { grid-template-columns: 1fr; gap: 48px; min-height: 440px; }
  .footer-contact { padding-top: 0; }
  .footer-nav-grid { width: var(--shell); }
}

@media (max-width: 640px) {
  .footer-scene { padding-top: 18px; }
  .footer-surface { min-height: 790px; border-radius: 22px 22px 0 0; }
  .footer-hero { min-height: 510px; padding-block: 54px 42px; }
  .footer-heading h2 { font-size: clamp(4rem, 19vw, 6rem); }
  .footer-focus { max-width: 18ch; }
  .footer-nav-grid { grid-template-columns: 1fr 1fr; gap: 28px; width: var(--shell); padding-bottom: 46px; }
  .footer-nav-group h3 { font-size: 1.1rem; }
  .footer-nav-group a { font-size: 1rem; }
  .footer-bottom { align-items: flex-start; flex-direction: column; gap: 8px; }
}

/* Final footer overrides: keep the closing scene compact and legible. */
.footer-surface {
  min-height: 560px;
  background:
    radial-gradient(ellipse at 18% 88%, rgba(48, 78, 174, 0.72), transparent 34%),
    radial-gradient(ellipse at 56% 46%, rgba(42, 163, 151, 0.66), transparent 44%),
    radial-gradient(ellipse at 100% 0%, rgba(127, 149, 214, 0.6), transparent 34%),
    linear-gradient(112deg, #3a62bb 0%, #3eaaa0 48%, #8799cf 100%);
}
.footer-surface::after { background: linear-gradient(110deg, rgba(3, 16, 52, 0.38), rgba(5, 37, 48, 0.18) 48%, rgba(23, 35, 83, 0.38)); mix-blend-mode: normal; }
.footer-hero { grid-template-columns: minmax(0, 1.08fr) minmax(250px, 0.92fr); gap: clamp(32px, 7vw, 96px); min-height: 310px; padding-block: 46px 38px; }
.footer-kicker { margin-bottom: 14px; color: rgba(7, 26, 59, 0.76); font-size: 11px; }
.footer-heading h2 { max-width: 8ch; color: #071a3b; font-size: clamp(2.9rem, 5.2vw, 4.8rem); line-height: 0.98; letter-spacing: -0.065em; }
.footer-heading h2 span { display: block; margin-top: 0.06em; color: #071a3b; }
.footer-focus { margin-top: 17px; color: rgba(7, 26, 59, 0.78); font-size: clamp(0.92rem, 1.35vw, 1.22rem); }
.footer-contact { padding-top: 18px; }
.footer-email { color: #071a3b; font-size: clamp(1.05rem, 1.7vw, 1.65rem); text-shadow: none; }
.footer-email:hover, .footer-email:focus-visible { color: #071a3b; }
.footer-contact p { margin-top: 13px; color: rgba(7, 26, 59, 0.72); font-size: 13px; }
.footer-nav-grid { gap: 48px; width: min(470px, calc(100% - 48px)); padding-bottom: 22px; }
.footer-nav-group { gap: 5px; }
.footer-nav-group h3 { margin-bottom: 8px; color: rgba(7, 26, 59, 0.9); font-size: 1rem; }
.footer-nav-group a { color: rgba(7, 26, 59, 0.82); font-size: 0.95rem; }
.footer-nav-group a:hover, .footer-nav-group a:focus-visible { color: #071a3b; }
.footer-bottom { padding-block: 14px 17px; border-top-color: rgba(7, 26, 59, 0.24); color: rgba(7, 26, 59, 0.68); font-size: 10px; }

@media (max-width: 900px) {
  .footer-surface { min-height: 600px; }
  .footer-hero { grid-template-columns: 1fr; min-height: 360px; gap: 26px; }
  .footer-contact { padding-top: 0; }
  .footer-nav-grid { width: var(--shell); }
}

@media (max-width: 640px) {
  .footer-surface { min-height: 640px; border-radius: 18px 18px 0 0; }
  .footer-hero { min-height: 380px; padding-block: 38px 28px; }
  .footer-heading h2 { font-size: clamp(2.9rem, 14vw, 4.5rem); line-height: 0.98; }
  .footer-focus { max-width: 20ch; font-size: 1rem; }
  .footer-contact { padding-top: 0; }
  .footer-email { font-size: 1.2rem; }
  .footer-contact p { font-size: 12px; }
  .footer-nav-grid { gap: 22px; width: var(--shell); padding-bottom: 20px; }
  .footer-nav-group h3 { font-size: 1rem; }
  .footer-nav-group a { font-size: 0.92rem; }
  .footer-bottom { align-items: flex-start; flex-direction: column; gap: 8px; }
}

/* Engineering portfolio layer: proof-led project deck, telemetry, and capability console. */

/* Capability gallery: real marks, one hierarchy, evidence on selection. */

