:root {
  --bg: #07111f;
  --bg-soft: #0b1728;
  --panel: rgba(13, 28, 47, 0.78);
  --panel-solid: #0d1c2f;
  --line: rgba(143, 181, 213, 0.18);
  --line-strong: rgba(119, 225, 255, 0.34);
  --text: #f2f7fb;
  --muted: #a8b8c8;
  --muted-strong: #c5d1dc;
  --accent: #75e4ff;
  --accent-2: #8fa7ff;
  --green: #6ef0b0;
  --amber: #ffd37b;
  --max: 1180px;
  --radius: 22px;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body.nav-open { overflow: hidden; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img, svg { max-width: 100%; }
code { font-family: var(--font-mono); }
h1, h2, h3, h4, .brand, .button { font-family: var(--font-display); }

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 999;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: #04101a;
  font-weight: 800;
  transition: top .2s ease;
}
.skip-link:focus { top: 16px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 520px;
  height: 520px;
  border-radius: 999px;
  filter: blur(100px);
  opacity: .13;
  pointer-events: none;
}
.ambient-one { top: -180px; right: -120px; background: var(--accent); }
.ambient-two { bottom: 8%; left: -240px; background: var(--accent-2); }

.container { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.section { padding: 112px 0; position: relative; }
.section-tight { padding-top: 36px; padding-bottom: 88px; }
.section-alt {
  background: linear-gradient(180deg, rgba(11, 23, 40, .74), rgba(9, 20, 34, .88));
  border-block: 1px solid var(--line);
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease, backdrop-filter .25s ease;
}
.site-header.scrolled {
  background: rgba(7, 17, 31, .84);
  border-color: var(--line);
  backdrop-filter: blur(18px);
}
.nav-wrap { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 760; letter-spacing: -.02em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--accent);
  background: rgba(117, 228, 255, .07);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .04em;
}
.primary-nav { display: flex; align-items: center; gap: 26px; }
.primary-nav a { color: var(--muted-strong); text-decoration: none; font-size: 14px; font-weight: 680; transition: color .2s ease; }
.primary-nav a:hover, .primary-nav a:focus-visible { color: var(--accent); }
.primary-nav .nav-cta { padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); }
.nav-toggle { display: none; border: 0; background: transparent; padding: 8px; }
.nav-toggle span:not(.sr-only) { display: block; width: 24px; height: 2px; margin: 5px 0; background: var(--text); transition: transform .2s ease, opacity .2s ease; }

.hero { padding-top: 164px; padding-bottom: 64px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: 64px; align-items: start; }
.eyebrow, .section-kicker {
  margin: 0 0 18px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  max-width: 860px;
  font-size: clamp(44px, 6.4vw, 82px);
  line-height: .99;
  letter-spacing: -.055em;
}
.hero h1 span {
  display: block;
  margin-top: 10px;
  background: linear-gradient(90deg, var(--accent), #d4f8ff 44%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lede { max-width: 620px; margin: 26px 0 0; color: var(--muted-strong); font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 13px;
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--accent); color: #03101a; border: 1px solid var(--accent); }
.button-secondary { border: 1px solid var(--line-strong); background: rgba(255,255,255,.025); color: var(--text); }
.button-secondary:hover { border-color: var(--accent); background: rgba(117,228,255,.06); }
.social-row { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 24px; }
.social-row a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 700; }
.social-row a:hover { color: var(--accent); }

.hero-panel { border: 1px solid var(--line-strong); border-radius: var(--radius); background: rgba(7, 17, 31, .84); box-shadow: var(--shadow); overflow: hidden; }
.terminal-head { min-height: 48px; padding: 0 16px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.025); }
.terminal-head span { width: 9px; height: 9px; border-radius: 999px; background: var(--muted); opacity: .55; }
.terminal-head code { margin-left: 8px; color: var(--muted); font-size: 12px; }
.terminal-body { padding: 24px; font-family: var(--font-mono); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.terminal-body p { margin: 4px 0; color: var(--muted-strong); }
.indent { padding-left: 20px; }
.code-key { color: var(--accent-2); }
.code-string { color: #bdeecf; }
.code-ok { color: var(--green); }


.split-intro { display: grid; grid-template-columns: .85fr 1.15fr; gap: 70px; align-items: start; }
h2 { margin: 0; font-size: clamp(34px, 4.6vw, 58px); line-height: 1.08; letter-spacing: -.045em; }
.prose { color: var(--muted-strong); font-size: 18px; }
.prose p { margin: 0 0 18px; }
.prose p:last-child { margin-bottom: 0; }
.section-heading { max-width: 820px; margin-bottom: 46px; }
.section-heading > p:last-child { max-width: 720px; margin: 20px 0 0; color: var(--muted); font-size: 17px; }

.capability-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.capability-card { min-height: 250px; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); transition: transform .25s ease, border-color .25s ease, background .25s ease; }
.capability-card:hover { transform: translateY(-5px); border-color: var(--line-strong); background: linear-gradient(145deg, rgba(117,228,255,.07), rgba(255,255,255,.015)); }
.card-index { display: inline-flex; margin-bottom: 34px; color: var(--accent); font-family: var(--font-mono); font-size: 12px; }
.capability-card h3 { margin: 0 0 13px; font-size: 21px; line-height: 1.25; letter-spacing: -.025em; }
.capability-card p { margin: 0; color: var(--muted); font-size: 15px; }

.project-list { display: grid; gap: 20px; }
.project-card { padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(7,17,31,.5); }
.project-card.featured { border-color: var(--line-strong); background: linear-gradient(145deg, rgba(117,228,255,.065), rgba(7,17,31,.7) 45%); }
.project-meta { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 24px; color: var(--accent); font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
.project-meta span:last-child { color: var(--muted); text-align: right; }
.project-body { display: grid; grid-template-columns: .8fr 1.2fr; gap: 52px; }
.project-card h3 { margin: 0; font-size: clamp(26px, 3vw, 40px); line-height: 1.1; letter-spacing: -.04em; }
.project-summary { margin: 18px 0 0; color: var(--muted-strong); font-size: 17px; }
.project-details { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.project-details h4 { margin: 0 0 8px; color: var(--text); font-size: 14px; text-transform: uppercase; letter-spacing: .07em; }
.project-details p { margin: 0; color: var(--muted); font-size: 14px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.tag-row span { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted-strong); font-size: 12px; }

.oss-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.oss-card { display: flex; flex-direction: column; min-height: 430px; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 14px 40px rgba(0,0,0,.12); }
.oss-top { display: flex; justify-content: space-between; gap: 14px; align-items: center; color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.status { padding: 5px 8px; border-radius: 8px; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; }
.status-owned { background: rgba(117,228,255,.1); color: var(--accent); }
.status-merged { background: rgba(110,240,176,.1); color: var(--green); }
.status-research { background: rgba(255,211,123,.1); color: var(--amber); }
.oss-card h3 { margin: 24px 0 12px; font-size: 25px; line-height: 1.2; letter-spacing: -.03em; }
.oss-card > p { margin: 0; color: var(--muted-strong); }
.oss-card ul { margin: 20px 0 24px; padding-left: 19px; color: var(--muted); font-size: 14px; }
.oss-card li { margin-bottom: 7px; }
.oss-card > a, .link-pair { margin-top: auto; }
.oss-card a { color: var(--accent); text-decoration: none; font-weight: 800; font-size: 14px; }
.link-pair { display: flex; gap: 18px; flex-wrap: wrap; }

.principle-layout { display: grid; grid-template-columns: .72fr 1.28fr; gap: 72px; align-items: start; }
.principle-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.principle-list li { display: grid; grid-template-columns: 46px 1fr; gap: 22px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.principle-list li > span { color: var(--accent); font-family: var(--font-mono); font-size: 12px; }
.principle-list h3 { margin: 0 0 8px; font-size: 21px; letter-spacing: -.025em; }
.principle-list p { margin: 0; color: var(--muted); }

.recognition-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.recognition-grid article { padding: 28px; min-height: 230px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.018); }
.recognition-grid span { color: var(--accent); font-family: var(--font-mono); font-size: 12px; }
.recognition-grid h3 { margin: 28px 0 10px; font-size: 23px; line-height: 1.25; }
.recognition-grid p { margin: 0; color: var(--muted); }
.recognition-grid article { display: flex; flex-direction: column; }
.recognition-links { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: auto; padding-top: 24px; }
.recognition-links a { color: var(--accent); text-decoration: none; font-size: 14px; font-weight: 800; }
.recognition-links a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Hero photo (nested inside hero-panel: render flush, no box-in-box) */
.hero-photo { margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; overflow: hidden; background: transparent; box-shadow: none; }
.hero-photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.hero-photo figcaption { padding: 12px 16px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); background: rgba(255,255,255,.02); }

/* Recognition media (photo + video) */
.recognition-grid article.has-media { min-height: 0; }
.media-row { display: grid; grid-template-columns: 1.35fr .65fr; gap: 14px; margin: 22px 0 4px; align-items: start; }
.media-row figure { margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: rgba(0,0,0,.25); }
.media-row figcaption { padding: 9px 12px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); background: rgba(255,255,255,.02); }
.media-photo img { display: block; width: 100%; height: 240px; object-fit: cover; }
.media-video video { display: block; width: 100%; height: 240px; object-fit: cover; background: #000; }

.media-single { margin: 22px 0 4px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: rgba(0,0,0,.25); }
.media-single img { display: block; width: 100%; height: 320px; object-fit: cover; }
.media-single figcaption { padding: 9px 12px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); background: rgba(255,255,255,.02); }

.media-embed { margin: 22px 0 4px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: rgba(0,0,0,.25); }
.media-embed .video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.media-embed .video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media-embed figcaption { padding: 9px 12px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); background: rgba(255,255,255,.02); }

.timeline { border-top: 1px solid var(--line); }
.timeline article { display: grid; grid-template-columns: 200px 1fr; gap: 40px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.timeline-date { color: var(--accent); font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.timeline h3 { margin: 0 0 8px; font-size: 23px; letter-spacing: -.025em; }
.timeline p { margin: 0; color: var(--muted); }

.contact-section { padding-top: 70px; }
.contact-card { padding: clamp(34px, 7vw, 76px); border: 1px solid var(--line-strong); border-radius: 28px; background: radial-gradient(circle at 80% 10%, rgba(117,228,255,.12), transparent 35%), var(--panel-solid); box-shadow: var(--shadow); }
.contact-card h2 { max-width: 850px; }
.contact-card > p:not(.section-kicker) { max-width: 680px; color: var(--muted-strong); font-size: 18px; }
.site-footer { padding: 34px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-wrap { display: flex; justify-content: space-between; gap: 24px; }
.footer-wrap p { margin: 0; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .65s cubic-bezier(.22,.61,.36,1), transform .65s cubic-bezier(.22,.61,.36,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Micro-interactions (lever #4): cohesive card lift + accent border on hover */
.oss-card, .project-card, .recognition-grid article {
  transition: transform .28s cubic-bezier(.22,.61,.36,1), border-color .28s ease, box-shadow .28s ease, background .28s ease;
}
.oss-card:hover, .recognition-grid article:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 22px 60px rgba(0,0,0,.32);
}
.project-card:not(.featured):hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 22px 60px rgba(0,0,0,.32);
}
.oss-card:hover .status { transform: translateY(-1px); }
.status { transition: transform .2s ease; }

/* Mono/accent links: subtle arrow nudge on hover */
.oss-card a, .recognition-links a, .social-row a {
  display: inline-flex;
  align-items: center;
  transition: color .2s ease, gap .2s ease, transform .2s ease;
}
.oss-card a:hover, .recognition-links a:hover, .social-row a:hover { transform: translateX(2px); }

/* Tag chips settle on hover within a hovered project card */
.project-card:hover .tag-row span { border-color: var(--line-strong); }
.tag-row span { transition: border-color .28s ease, color .2s ease; }

/* Spotlight-border: an accent glow rides the card border, tracking the pointer.
   Pure CSS mask + two pointer vars set in JS. Degrades to a static border if unsupported. */
.spotlight { position: relative; isolation: isolate; }
.spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(
    180px 180px at var(--mx, 50%) var(--my, 0%),
    var(--accent), transparent 60%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.spotlight:hover::after { opacity: .85; }
@supports not (mask-composite: exclude) {
  .spotlight::after { display: none; }
}

/* Subtle staggered reveal for grid children (lever #2 rhythm) */
.capability-grid .reveal:nth-child(2), .oss-grid .reveal:nth-child(2), .recognition-grid .reveal:nth-child(2) { transition-delay: .05s; }
.capability-grid .reveal:nth-child(3), .oss-grid .reveal:nth-child(3), .recognition-grid .reveal:nth-child(3) { transition-delay: .1s; }
.capability-grid .reveal:nth-child(4), .oss-grid .reveal:nth-child(4), .recognition-grid .reveal:nth-child(4) { transition-delay: .15s; }
.capability-grid .reveal:nth-child(5), .oss-grid .reveal:nth-child(5), .recognition-grid .reveal:nth-child(5) { transition-delay: .2s; }
.capability-grid .reveal:nth-child(6), .oss-grid .reveal:nth-child(6), .recognition-grid .reveal:nth-child(6) { transition-delay: .25s; }

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

@media (max-width: 980px) {
  .hero-grid, .split-intro, .principle-layout { grid-template-columns: 1fr; }
  .hero-grid { gap: 44px; }
  .hero-panel { max-width: 680px; }
  .capability-grid { grid-template-columns: repeat(2, 1fr); }
  .project-body { grid-template-columns: 1fr; gap: 30px; }
  .project-details { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .container { width: min(calc(100% - 28px), var(--max)); }
  .section { padding: 84px 0; }
  .hero { padding-top: 128px; padding-bottom: 48px; }
  .brand-text { display: none; }
  .nav-toggle { display: block; z-index: 2; }
  .nav-toggle[aria-expanded="true"] span:nth-of-type(2) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-of-type(3) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-of-type(4) { transform: translateY(-7px) rotate(-45deg); }
  .primary-nav {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 22px;
    padding: 80px 28px;
    background: rgba(7,17,31,.98);
    transform: translateX(100%);
    transition: transform .25s ease;
  }
  .primary-nav.open { transform: translateX(0); }
  .primary-nav a { font-size: 24px; }
  .primary-nav .nav-cta { padding: 0; border: 0; }
  .capability-grid, .oss-grid, .recognition-grid, .project-details { grid-template-columns: 1fr; }
  .media-row { grid-template-columns: 1fr; }
  .media-photo img, .media-video video { height: auto; }
  .media-photo img { aspect-ratio: 4 / 3; }
  .media-video video { aspect-ratio: 9 / 16; max-height: 420px; }
  .project-card, .oss-card { padding: 23px; }
  .project-meta { flex-direction: column; gap: 5px; }
  .project-meta span:last-child { text-align: left; }
  .timeline article { grid-template-columns: 1fr; gap: 9px; }
  .footer-wrap { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .reveal { transition-delay: 0s !important; }
  .button:hover, .capability-card:hover, .oss-card:hover, .project-card:hover,
  .recognition-grid article:hover, .oss-card a:hover, .recognition-links a:hover,
  .social-row a:hover { transform: none; }
  .spotlight::after { display: none; }
}
