/* =========================================================
   Suryansh Talukdar — personal site
   Layout: Heet-style single page (sticky header, section
   titles with a pixel marker, bordered cards, mono dates)
   Type:   Ryan-style (Montserrat headings, Brygada 1918 body)
   ========================================================= */

:root {
  /* Color */
  --bg: #ffffff;
  --surface: #fbfcfd;
  --ink: #1f2633;
  --ink-soft: #444d5c;
  --muted: #7b8392;
  --rule: #e6e9ee;
  --accent: #2f5fd0;
  --accent-ink: #ffffff;
  --accent-soft: #edf2fd;

  /* Status chips */
  --live: #1f7a4d;     --live-bg: #e8f5ee;
  --pilot: #8a5a00;    --pilot-bg: #fdf3e0;
  --valid: #2f5fd0;    --valid-bg: #edf2fd;
  --test: #6b4bb8;     --test-bg: #f1edfb;

  /* Type */
  --font-head: "Montserrat", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Brygada 1918", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Layout */
  --max: 1040px;
  --gutter: 24px;
  --header-h: 72px;
  --radius: 12px;

  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
  line-height: 1.25;
}

p { margin: 0; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

strong { font-weight: 600; color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--rule);
  padding-top: env(safe-area-inset-top, 0px);
  transition: box-shadow 0.2s ease;
}
.site-header.scrolled { box-shadow: 0 6px 20px rgba(20, 30, 50, 0.06); }

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: var(--gutter);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.005em;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 24px;
}

.site-nav a {
  position: relative;
  display: block;
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  padding-block: 8px;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a.active { color: var(--ink); font-weight: 700; }
.site-nav a.active::after { transform: scaleX(1); }

/* Hamburger (mobile only) */
.menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Main layout ---------- */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
  padding-block: 0 40px;
}

.section {
  padding-block: 72px;
  display: grid;
  gap: 32px;
  border-top: 1px solid var(--rule);
}

/* Heet-style title with a small pixel marker */
.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.015em;
}
.section-title::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 9px 9px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 9px 9px / 5px 5px no-repeat;
  opacity: 0.9;
  transform: translateY(2px);
}

.section-intro {
  color: var(--ink-soft);
  max-width: 62ch;
  margin-top: -12px;
}

.sub-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.prose { display: grid; gap: 1.1em; color: var(--ink-soft); max-width: 64ch; }
.prose-p { color: var(--ink-soft); max-width: 60ch; }

/* ---------- Cards (Heet) ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px 26px;
  min-width: 0;
}

.logo {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  overflow: hidden;
}
.logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.logo-img { background: #fff; border: 1px solid var(--rule); padding: 5px; }
.logo-img img { display: block; border-radius: 6px; }

.date {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.org, .meta {
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.5;
}

.tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags li {
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--rule);
  padding: 4px 10px;
  border-radius: 999px;
}

.bullets,
.job ul:not(.tags) {
  margin: 0;
  padding-left: 1.15em;
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 1.04rem;
  line-height: 1.65;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 8px;
  border: 1.5px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-head);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }

/* ---------- Portfolio (hero) ---------- */
.hero {
  padding-block: 88px 72px;
  display: grid;
  gap: 22px;
  justify-items: start;
}
.eyebrow {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.lead {
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 40ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

.hero-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: 56px;
  align-items: center;
}
.hero-text { display: grid; gap: 22px; justify-items: start; min-width: 0; }
.hero-photo { margin: 0; justify-self: end; width: 100%; }
.hero-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(20, 30, 50, 0.14);
}

/* Education on the home page */
.education {
  padding-block: 64px;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 28px;
}
.edu-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.edu-row .edu-card { align-items: flex-start; }
.honors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-block: 6px 4px;
}
.honors strong {
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
  line-height: 1.5;
}

.proof {
  list-style: none;
  margin: 26px 0 0;
  padding: 22px 0 0;
  width: 100%;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.proof li { display: grid; gap: 2px; min-width: 0; align-content: start; }
.proof b {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.proof span {
  font-family: var(--font-head);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.about-text { display: grid; gap: 32px; min-width: 0; }

.edu { display: grid; gap: 14px; }
.edu-card { display: flex; gap: 20px; align-items: center; }
.edu-card h3 { font-size: 1.08rem; font-weight: 700; }
.edu-card .date { margin-top: 8px; }

.photo { margin: 0; position: sticky; top: calc(var(--header-h) + 32px); }
.photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(20, 30, 50, 0.14);
}

.about-edu { display: grid; gap: 18px; margin-top: 24px; padding-top: 40px; border-top: 1px dashed var(--rule); }
.hero > .edu-card { width: 100%; max-width: 560px; margin-top: 10px; }

.research {
  display: grid;
  gap: 22px;
  margin-top: 24px;
  padding-top: 40px;
  border-top: 1px dashed var(--rule);
}
.research-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.thesis { display: grid; gap: 10px; }
.label {
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.thesis h4 { font-size: 1.12rem; font-weight: 700; }
.thesis-sub { font-style: italic; color: var(--muted); font-size: 0.98rem; }
.thesis ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0 0 0 16px;
  border-left: 2px solid var(--accent);
  display: grid;
  gap: 14px;
}
.thesis li { display: grid; gap: 2px; }
.thesis li b { font-family: var(--font-head); font-size: 0.92rem; font-weight: 700; color: var(--ink); }
.thesis li span { font-size: 0.98rem; line-height: 1.55; color: var(--ink-soft); }

/* ---------- Experience ---------- */
.stack { display: grid; gap: 16px; }

.job { display: grid; gap: 16px; }
.job-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}
.job-head h3 { font-size: 1.12rem; font-weight: 700; }
.job > ul:not(.tags) { padding-left: calc(52px + 18px + 1.15em); }

/* ---------- Projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.project { display: grid; gap: 14px; align-content: start; transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
.project:hover { border-color: #cfd8ea; box-shadow: 0 10px 28px rgba(20, 30, 50, 0.07); transform: translateY(-2px); }
.project-head { display: flex; gap: 16px; align-items: center; }
.project-head h3 { font-size: 1.15rem; font-weight: 700; }
.project > p { color: var(--ink-soft); font-size: 1.04rem; line-height: 1.65; }
.gh {
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  justify-self: start;
}
.gh:hover { text-decoration: underline; }

/* ---------- Experience extras ---------- */
.roles { display: grid; gap: 22px; padding-left: calc(52px + 18px); }
.role-block { display: grid; gap: 10px; position: relative; }
.role-block + .role-block { padding-top: 22px; border-top: 1px dashed var(--rule); }
.role-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
}
.role-head h4 { font-size: 1.02rem; font-weight: 700; color: var(--accent); }
.role-block ul { padding-left: 1.15em; }

.job-status { display: flex; flex-wrap: wrap; gap: 8px; padding-left: calc(52px + 18px); min-width: 0; }
.job-status .status { flex: 0 1 auto; white-space: normal; text-align: left; line-height: 1.4; }
.job, .job > * { min-width: 0; }
.job-summary { color: var(--ink-soft); font-size: 1.04rem; line-height: 1.7; padding-left: calc(52px + 18px); max-width: calc(70ch + 70px); }

.job-groups { display: grid; gap: 18px; padding-left: calc(52px + 18px); }
.job-group { display: grid; gap: 8px; }
.job-group h4 {
  font-family: var(--font-head);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.job-group ul { padding-left: 1.15em; }
.job-tags { padding-left: calc(52px + 18px); }

.job-products { display: grid; gap: 26px; padding-left: calc(52px + 18px); }
.job-product { display: grid; gap: 10px; }
.job-product + .job-product { padding-top: 24px; border-top: 1px dashed var(--rule); }
.job-product h4 {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.job-product h4 span { font-size: 0.86rem; font-weight: 600; color: var(--accent); }
.product-intro { font-style: italic; color: var(--ink-soft); font-size: 1.02rem; line-height: 1.65; max-width: 70ch; }
.job-product ul { padding-left: 1.15em; }

.job-expertise { display: grid; gap: 10px; padding-left: calc(52px + 18px); }
.expertise-label {
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Experience timeline (left rail) ---------- */
main:has(.exp-layout) { max-width: 1200px; }
main:has(.marquee) { max-width: 1200px; }
main:has(.marquee) .hero { padding-bottom: 40px; }
main:has(.marquee) .featured { padding-top: 44px; gap: 24px; }

.exp-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

.timeline {
  position: sticky;
  top: calc(var(--header-h) + 28px);
  max-height: calc(100vh - var(--header-h) - 56px);
  overflow-y: auto;
  padding-right: 4px;
}
.timeline-label {
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.tl {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  display: grid;
  gap: 22px;
}
/* the vertical line */
.tl::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--rule);
}
.tl-item { position: relative; padding-left: 26px; display: grid; gap: 8px; }
/* the dot */
.tl-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #c3cbd9;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.tl-item.is-active::before { border-color: var(--accent); background: var(--accent); transform: scale(1.1); }

.tl-org {
  font-family: var(--font-head);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  text-decoration: none;
  justify-self: start;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.25s ease, color 0.2s ease;
  padding-bottom: 1px;
}
.tl-org:hover, .tl-org:focus-visible { background-size: 100% 2px; color: var(--accent); }
.tl-item.is-active .tl-org { color: var(--accent); }

.tl-roles { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tl-role {
  display: grid;
  gap: 1px;
  text-decoration: none;
  padding: 4px 8px;
  margin-left: -8px;
  border-radius: 6px;
  transition: background 0.2s ease;
}
.tl-title {
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.4;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}
.tl-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tl-role:hover .tl-title, .tl-role:focus-visible .tl-title { text-decoration-color: var(--accent); color: var(--ink); }
.tl-role.is-active { background: var(--accent-soft); }
.tl-role.is-active .tl-title { color: var(--accent); font-weight: 700; }

/* Card highlight after a timeline click */
.job, .role-block { scroll-margin-top: calc(var(--header-h) + 24px); }
@keyframes flash-ring {
  0%   { box-shadow: 0 0 0 0 rgba(47, 95, 208, 0.0); border-color: var(--rule); }
  20%  { box-shadow: 0 0 0 4px rgba(47, 95, 208, 0.18); border-color: var(--accent); }
  100% { box-shadow: 0 0 0 0 rgba(47, 95, 208, 0.0); border-color: var(--rule); }
}
@keyframes flash-bg {
  0%, 100% { background: transparent; }
  20% { background: var(--accent-soft); }
}
.job.flash { animation: flash-ring 1.4s ease; }
.role-block.flash { animation: flash-bg 1.4s ease; border-radius: 8px; }

/* ---------- Projects: rail + category filter ---------- */
.tl-group {
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.5;
}
.tl-item.is-active .tl-group { color: var(--accent); }
.proj-rail .tl { gap: 18px; }
.proj-rail .tl-roles { gap: 4px; }

.proj-main { display: grid; gap: 14px; min-width: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.chip span {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border-radius: 999px;
  padding: 1px 7px;
  font-variant-numeric: tabular-nums;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.is-on span { background: rgba(255, 255, 255, 0.2); color: #fff; }
.filter-count { font-family: var(--font-head); font-size: 0.8rem; color: var(--muted); }

.proj-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
}
.proj-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }

/* ---------- Section quick-nav (Publications, Real Deployments) ---------- */
html:has(.subnav) { scroll-padding-top: calc(var(--header-h) + 76px); }
.subnav {
  position: sticky;
  top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  z-index: 20;
  display: flex;
  gap: 6px;
  padding: 10px 0;
  margin-block: 4px -8px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 8px;
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.subnav a span {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0 7px;
  font-variant-numeric: tabular-nums;
}
.subnav a:hover { background: var(--surface); color: var(--ink); }
.subnav a.is-active { background: var(--accent-soft); color: var(--accent); }
.subnav a.is-active span { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, var(--rule)); }

/* ---------- Publications ---------- */
.scholar-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 18px 28px;
  padding: 18px 22px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.scholar-ids { display: flex; flex-wrap: wrap; gap: 12px; }
.id-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.id-link:hover { border-color: var(--accent); box-shadow: 0 6px 16px -10px rgba(47, 95, 208, 0.6); }
.id-link b { display: block; font-family: var(--font-head); font-size: 0.86rem; font-weight: 700; line-height: 1.3; }
.id-sub { display: block; font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); line-height: 1.3; }
.id-badge {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
}
.id-orcid .id-badge { background: #a6ce39; border-radius: 50%; }
.id-scholar .id-badge { background: #4285f4; }

.metrics { display: flex; gap: 28px; margin: 0; }
.metrics div { display: grid; gap: 0; text-align: right; }
.metrics dt { font-family: var(--font-head); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); order: 2; }
.metrics dd { margin: 0; font-family: var(--font-head); font-size: 1.6rem; font-weight: 800; color: var(--ink); line-height: 1.15; font-variant-numeric: tabular-nums; }
.metrics-note { font-family: var(--font-head); font-size: 0.74rem; color: var(--muted); margin-top: -18px; }

.doc-section { display: grid; gap: 18px; padding-top: 12px; }
.doc-h {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}
.doc-note { color: var(--muted); font-size: 0.98rem; margin-top: -6px; }

.research-items { display: grid; gap: 0; }
.r-item { display: grid; gap: 8px; padding-block: 20px; border-bottom: 1px solid var(--rule); }
.r-item:first-child { padding-top: 6px; }
.r-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.r-status {
  font-family: var(--font-head);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}
.s-progress { color: var(--live); background: var(--live-bg); }
.s-prep { color: var(--pilot); background: var(--pilot-bg); }
.s-review { color: var(--test); background: var(--test-bg); }
.r-where { font-family: var(--font-head); font-size: 0.8rem; color: var(--muted); }
.r-item h3 { font-size: 1.12rem; font-weight: 700; max-width: 62ch; }
.r-item > p:not(.r-tags) { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.65; max-width: 72ch; }
.r-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.r-tags span {
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 2px 9px;
}

.patent-card {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.patent-no {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 22px;
  background: linear-gradient(150deg, var(--accent), #1f3f94);
  color: #fff;
}
.patent-label { font-family: var(--font-head); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.8; }
.patent-num { font-family: var(--font-mono); font-size: 1.05rem; font-weight: 500; }
.patent-body { display: grid; gap: 10px; padding: 22px 26px; background: var(--surface); }
.patent-body h3 { font-size: 1.15rem; font-weight: 700; }
.patent-body p { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.65; }
.patent-body .gh { justify-self: start; }

/* ---------- arXiv preprint button ---------- */
.arxiv-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1.5px solid #b31b1b;
  border-radius: 8px;
  background: #fff;
  color: #b31b1b;
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.arxiv-btn b {
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
  background: #b31b1b;
  color: #fff;
  font-size: 0.74rem;
}
.arxiv-btn:hover { background: #fdf3f3; box-shadow: 0 6px 16px -10px rgba(179, 27, 27, 0.6); transform: translateY(-1px); }
.arxiv-btn:focus-visible { outline: 2px solid #b31b1b; outline-offset: 3px; }
@media (max-width: 720px) { .arxiv-btn { margin-left: 0; margin-top: 4px; } }

/* ---------- Patent details v2 ---------- */
.patent-no { align-content: start; gap: 8px; }
.patent-facts { display: grid; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.25); }
.patent-facts dt { font-family: var(--font-head); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.7; }
.patent-facts dd { margin: 2px 0 0; font-family: var(--font-mono); font-size: 0.86rem; }
.patent-body { gap: 14px; }
.patent-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.patent-cols > div { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; }
.patent-cols h4 { font-family: var(--font-head); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.patent-list, .patent-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 0.95rem; color: var(--ink-soft); line-height: 1.5; }
.patent-list li { padding-left: 14px; position: relative; }
.patent-list li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.patent-steps { counter-reset: pstep; }
.patent-steps li { counter-increment: pstep; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; }
.patent-steps li::before { content: counter(pstep); font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); padding-top: 0.15em; }
.patent-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.patent-btn { cursor: pointer; }
.patent-modal .cert-kicker { color: var(--accent); }
@media (max-width: 720px) { .patent-cols { grid-template-columns: minmax(0, 1fr); } .patent-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.refs { list-style: none; margin: 0; padding: 0; display: grid; }
.ref {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  padding-block: 14px;
  border-bottom: 1px solid var(--rule);
}
.ref-num { font-family: var(--font-mono); font-size: 0.86rem; color: var(--muted); padding-top: 3px; font-variant-numeric: tabular-nums; }
.ref-text { display: grid; gap: 6px; min-width: 0; }
.ref-text > p:first-child { font-size: 1.02rem; line-height: 1.6; color: var(--ink-soft); }
.ref-text strong { color: var(--ink); font-weight: 600; }
.ref-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-family: var(--font-head); font-size: 0.74rem; }
.ref-type { color: var(--muted); }
.ref-cites { font-weight: 700; color: var(--accent); }
.ref-meta a { text-decoration: none; font-weight: 600; }
.ref-meta a:hover { text-decoration: underline; }

/* ---------- Real Deployments (structured) ---------- */
.dep-list { display: grid; gap: 22px; }
.dep {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.dep-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px 20px;
  padding: 22px 26px 18px;
  background: #fff;
  border-bottom: 1px solid var(--rule);
}
.dep-head h3 { font-size: 1.25rem; font-weight: 800; }
.dep-grid { display: grid; }
.dep-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 24px;
  padding: 16px 26px;
}
.dep-row + .dep-row { border-top: 1px dashed var(--rule); }
.dep-row h4 {
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 4px;
}
.dep-row > p { color: var(--ink-soft); font-size: 1.03rem; line-height: 1.65; max-width: 75ch; }
.dep-row .bullets { font-size: 1.01rem; }
.status-handover { color: var(--ink-soft); background: #eef0f4; }

/* ---------- Real Deployments v2: systems board + STAR case studies ---------- */
main:has(.dep2-layout) { max-width: 1520px; }
html:has(.dep2-layout) { scroll-padding-top: calc(var(--header-h) + 24px); }

.dep2-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

/* Systems board (sticky sidebar) */
.sys-board {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 20px 40px -30px rgba(20, 30, 60, 0.35);
}
.sys-board-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 2px 4px 8px;
  border-bottom: 1px dashed var(--rule);
}
.sys {
  position: relative;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 4px 12px;
  align-items: center;
  padding: 11px 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.sys:hover { background: var(--surface); transform: translateX(3px); }
.sys.is-active {
  background: color-mix(in srgb, var(--tile) 8%, #fff);
  border-color: color-mix(in srgb, var(--tile) 30%, var(--rule));
}
.sys-text { display: grid; gap: 1px; min-width: 0; }
.sys-name { font-family: var(--font-head); font-size: 0.88rem; font-weight: 700; line-height: 1.3; }
.sys.is-active .sys-name { color: var(--tile); }
.sys-meta { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); }
.sys-bar {
  position: absolute;
  left: 12px; right: 12px; bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: var(--rule);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.sys.is-active .sys-bar { opacity: 1; }
.sys-bar i {
  display: block;
  height: 100%;
  width: calc(var(--p, 0) * 100%);
  background: var(--tile);
  border-radius: 2px;
}

/* Status lights */
.led { width: 10px; height: 10px; border-radius: 50%; position: relative; flex: none; }
.led-live  { background: #1f9d5c; }
.led-pilot { background: #d99200; }
.led-valid { background: #2f5fd0; }
.led-done  { background: #8a93a3; }
.led-test  { background: #7a55d6; }
.led-live::after, .led-test::after, .led-pilot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  color: inherit;
  opacity: 0;
  animation: led-ping 2s cubic-bezier(0, 0, .2, 1) infinite;
}
.led-live::after  { border-color: #1f9d5c; }
.led-pilot::after { border-color: #d99200; }
.led-test::after  { border-color: #7a55d6; }
@keyframes led-ping { 0% { transform: scale(0.6); opacity: 0.8; } 100% { transform: scale(1.8); opacity: 0; } }

/* Deployment cards */
.dep2-list { display: grid; gap: 26px; min-width: 0; }
.dep2 {
  --tile: var(--accent);
  position: relative;
  display: grid;
  gap: 18px;
  padding: 26px 28px 24px;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--tile) 6%, #fff) 0%, #fff 40%);
  background-color: #fff;
  box-shadow: 0 24px 50px -40px rgba(20, 30, 60, 0.4);
  scroll-margin-top: calc(var(--header-h) + 24px);
  overflow: hidden;
}
.dep2::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(var(--tile), color-mix(in srgb, var(--tile) 30%, #fff));
}
.dep2.flash { animation: flash-ring 1.4s ease; }

.dep2-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}
.dep2-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(140deg, var(--tile), color-mix(in srgb, var(--tile) 60%, #000));
  box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--tile) 80%, transparent);
}
.dep2-icon svg { width: 26px; height: 26px; }
.dep2-title { display: grid; gap: 4px; min-width: 0; }
.dep2-title h2 { font-size: clamp(1.3rem, 2vw, 1.6rem); font-weight: 800; letter-spacing: -0.01em; }
.dep2-head .status { margin-top: 4px; }

.award {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 0.74rem;
  font-weight: 700;
  color: #7a4f00;
  background: linear-gradient(90deg, #fff4d6, #ffe7a8);
  border: 1px solid #f1d27a;
}
.award svg { width: 18px; height: 18px; color: #b07a00; }

.dep2-kpis {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.dep2-kpis li { display: grid; gap: 1px; padding: 12px 16px; }
.dep2-kpis li + li { border-left: 1px solid var(--rule); }
.dep2-kpis b { font-family: var(--font-head); font-size: 1.3rem; font-weight: 800; color: var(--tile); line-height: 1.2; font-variant-numeric: tabular-nums; }
.dep2-kpis span { font-family: var(--font-head); font-size: 0.74rem; color: var(--muted); }

.dep2-overview { color: var(--ink-soft); font-size: 1.06rem; line-height: 1.65; max-width: 90ch; }

.cases-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.dep2-cases { display: grid; gap: 14px; }
.star {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}
.star-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
}
.star-n {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--tile);
  padding: 2px 7px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--tile) 10%, #fff);
}
.star-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 10px;
}
.star-cell {
  position: relative;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px 14px 14px;
  border-radius: 10px;
  background: var(--surface);
  border-top: 3px solid var(--k);
}
.star-cell.s { --k: #8a93a3; }
.star-cell.t { --k: #d99200; }
.star-cell.a { --k: var(--tile); background: color-mix(in srgb, var(--tile) 5%, #fff); }
.star-cell.r { --k: #1f9d5c; background: #f2faf5; }
.star-k {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--k);
}
.star-cell.s .star-k { color: #5f6878; }
.star-cell p { font-size: 0.96rem; line-height: 1.6; color: var(--ink-soft); }
.star-cell p strong { color: var(--ink); }

.dep2-stack { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* ---------- Contact v2: email card, profiles, Calendly ---------- */
main:has(.contact-layout) { max-width: 1320px; }
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.contact-side { display: grid; gap: 18px; }
.ccard {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 20px 44px -36px rgba(20, 30, 60, 0.45);
  min-width: 0;
}
.cc-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.ccard .email { font-size: 1.05rem; }
.cc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cc-actions .btn { gap: 8px; padding: 0 12px; font-size: 0.86rem; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.cc-actions .btn svg { width: 17px; height: 17px; flex: none; }
.cc-facts { margin: 0; display: grid; gap: 10px; padding-top: 14px; border-top: 1px dashed var(--rule); }
.cc-facts div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; align-items: start; }
.cc-facts dt {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-head); font-size: 0.76rem; font-weight: 600; color: var(--muted);
}
.cc-facts dt svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.cc-facts dd { margin: 0; font-family: var(--font-head); font-size: 0.86rem; font-weight: 500; color: var(--ink); line-height: 1.45; }

.open-to { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.open-to li {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-head); font-size: 0.78rem; font-weight: 600; color: var(--ink-soft);
  padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft);
}
.open-to li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #1f9d5c; box-shadow: 0 0 0 3px rgba(31, 157, 92, 0.18); }

.profiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.prof {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  gap: 12px;
  align-items: center;
  padding: 9px 12px 9px 9px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.prof:hover { border-color: var(--brand); transform: translateX(3px); box-shadow: 0 8px 20px -14px var(--brand); }
.prof-badge {
  width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--font-head); font-size: 0.78rem; font-weight: 800; color: #fff;
  background: var(--brand);
}
.prof-text { display: grid; min-width: 0; }
.prof-text b { font-family: var(--font-head); font-size: 0.86rem; font-weight: 700; line-height: 1.3; }
.prof-text span { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prof-go svg { width: 16px; height: 16px; color: var(--muted); transition: color 0.15s ease, transform 0.15s ease; }
.prof:hover .prof-go svg { color: var(--brand); transform: translate(2px, -2px); }

.cal-card { padding: 0; overflow: hidden; gap: 0; }
.cal-head {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(160deg, var(--accent-soft), #fff 70%);
}
.cal-icon {
  width: 46px; height: 46px; flex: none; border-radius: 12px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--accent), #1f3f94);
  box-shadow: 0 10px 20px -10px rgba(47, 95, 208, 0.8);
}
.cal-icon svg { width: 24px; height: 24px; }
.cal-head h2 { font-size: 1.3rem; font-weight: 800; }
.cal-head p { font-family: var(--font-head); font-size: 0.84rem; color: var(--muted); margin-top: 2px; }
.calendly-inline-widget { min-width: 320px; height: 760px; }
.cal-fallback {
  display: grid; gap: 14px; justify-items: start;
  padding: 28px 22px 32px;
}
.cal-fallback p { color: var(--ink-soft); font-size: 1.04rem; line-height: 1.65; max-width: 52ch; }
.cal-fallback .btn svg { width: 17px; height: 17px; margin-right: 6px; }

/* ---------- Real Deployments v3: VECTOR series (light), architecture flow, compact STAR ---------- */
.vector-series {
  display: grid;
  gap: 22px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--rule));
  background: linear-gradient(180deg, rgba(237, 242, 253, 0.85), rgba(255, 255, 255, 0.9) 320px);
}
.vector-hero {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 26px;
  border-radius: 18px;
  background:
    radial-gradient(520px circle at 100% 0%, rgba(106, 63, 208, 0.08), transparent 60%),
    radial-gradient(420px circle at 0% 100%, rgba(47, 95, 208, 0.07), transparent 60%),
    #fff;
  border: 1px solid var(--rule);
  box-shadow: 0 24px 50px -40px rgba(20, 40, 120, 0.5);
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.vector-hero::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 4px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, #2f5fd0, #6a3fd0, #0e7c86);
}
.vector-hero.flash { animation: flash-ring 1.4s ease; }
.vh-top { display: flex; align-items: center; gap: 14px; }
.vh-logo {
  width: 54px; height: 54px; border-radius: 14px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(140deg, #2f5fd0, #6a3fd0);
  box-shadow: 0 10px 22px -10px rgba(47, 95, 208, 0.8);
}
.vh-logo svg { width: 28px; height: 28px; }
.vh-kicker { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.vector-hero h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, #1f2633, #2f5fd0);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.vector-hero .vh-top { display: grid; gap: 10px; justify-items: start; }
.vector-hero h2.vh-wordmark {
  margin: 0;
  line-height: 0;
  background: none;
  color: inherit;
  -webkit-background-clip: border-box;
          background-clip: border-box;
}
.vh-wordmark img {
  display: block;
  height: clamp(84px, 11vw, 150px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.vh-text { font-size: 1.06rem; line-height: 1.7; max-width: 90ch; color: var(--ink-soft); }

.lifecycle {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.lifecycle li {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--rule);
  animation: card-rise 0.6s cubic-bezier(.2,.8,.2,1) backwards;
}
.lifecycle li:nth-child(2) { animation-delay: 0.1s; }
.lifecycle li:nth-child(3) { animation-delay: 0.2s; }
.lifecycle li:nth-child(4) { animation-delay: 0.3s; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--rule)); }
.lifecycle li:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -11px; top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--accent);
  z-index: 1;
}
.lifecycle span { font-family: var(--font-mono); font-size: 0.68rem; color: var(--accent); }
.lifecycle b { font-family: var(--font-head); font-size: 0.98rem; font-weight: 800; color: var(--ink); }
.lifecycle small { font-family: var(--font-head); font-size: 0.74rem; color: var(--muted); }

.vh-stack {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  font-family: var(--font-head); font-size: 0.8rem; color: var(--ink-soft);
  padding-top: 14px; border-top: 1px dashed var(--rule);
}
.vh-stack span { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.vh-stack b { color: var(--ink); font-weight: 700; }
.vh-stack i { font-style: normal; color: var(--rule); }

.series-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: -8px;
  padding-left: 4px;
}

/* Development style dropdown */
.devstyle {
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.devstyle summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-family: var(--font-head);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.devstyle summary::-webkit-details-marker { display: none; }
.devstyle summary:hover { background: var(--surface); }
.devstyle summary:focus-visible { outline: 2px solid var(--tile); outline-offset: -2px; }
.dev-ic {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
  color: var(--tile);
  background: color-mix(in srgb, var(--tile) 10%, #fff);
  padding: 4px 7px; border-radius: 6px;
}
.dev-hint { font-weight: 500; font-size: 0.78rem; color: var(--muted); flex: 1; }
.dev-chev { width: 18px; height: 18px; color: var(--muted); transition: transform 0.25s ease; flex: none; }
.devstyle[open] .dev-chev { transform: rotate(180deg); }
.devstyle[open] summary { border-bottom: 1px solid var(--rule); }
.dev-list { margin: 0; display: grid; animation: body-in 0.4s cubic-bezier(.2,.8,.2,1) both; }
.dev-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  padding: 12px 16px;
}
.dev-row + .dev-row { border-top: 1px dashed var(--rule); }
.dev-row dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tile);
  padding-top: 3px;
}
.dev-row dd { margin: 0; font-size: 0.97rem; line-height: 1.6; color: var(--ink-soft); }

/* Board grouping */
.sys-group {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 8px 6px 0;
}
.sys-sub { margin-left: 14px; position: relative; }
.sys-sub::before {
  content: "";
  position: absolute;
  left: -8px; top: 0; bottom: 0;
  width: 1px;
  background: color-mix(in srgb, var(--accent) 30%, var(--rule));
}

.group-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 8px;
  border-top: 1px dashed var(--rule);
}

.arch { display: grid; gap: 8px; }
.arch-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
}
.arch-node {
  display: grid;
  gap: 1px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--tile) 25%, var(--rule));
  min-width: 0;
}
.arch-node b { font-family: var(--font-mono); font-size: 0.64rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tile); }
.arch-node span { font-family: var(--font-head); font-size: 0.8rem; font-weight: 600; color: var(--ink); line-height: 1.35; }
.arch-arrow {
  align-self: center;
  color: color-mix(in srgb, var(--tile) 60%, var(--muted));
  font-size: 0.9rem;
  animation: arrow-flow 1.8s ease-in-out infinite;
}
@keyframes arrow-flow { 0%, 100% { opacity: 0.35; transform: translateX(-2px); } 50% { opacity: 1; transform: translateX(2px); } }

.star2 {
  display: grid;
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.star2-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 16px;
  align-items: start;
}
.star2-row + .star2-row { border-top: 1px solid var(--rule); }
.star2-row.result { background: #f2faf5; }
.star2-k {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; color: #fff;
}
.star2-k.s { background: #8a93a3; }
.star2-k.t { background: #d99200; }
.star2-k.a { background: var(--tile); }
.star2-k.r { background: #1f9d5c; }
.star2-row p, .star2-actions li { font-size: 0.98rem; line-height: 1.6; color: var(--ink-soft); }
.star2-row p b, .star2-actions b { color: var(--ink); font-weight: 600; }
.star2-actions { margin: 6px 0 0; padding-left: 1.1em; display: grid; gap: 6px; }

/* ---------- QS award badge + certificate modal ---------- */
.award.award-qs { padding: 0; background: none; border: 0; }
.award-btn {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 6px 14px 6px 6px;
  border-radius: 14px;
  border: 1px solid #f1d27a;
  background: linear-gradient(90deg, #fff8e3, #ffefc2);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.award-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -14px rgba(176, 122, 0, 0.8); border-color: #e2b84a; }
.award-btn:focus-visible { outline: 2px solid #b07a00; outline-offset: 3px; }
.award-badge {
  width: 36px; height: 36px; flex: none;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 2px;
}
.award-text { font-family: var(--font-head); font-size: 0.76rem; font-weight: 700; color: #7a4f00; line-height: 1.35; }
.award-view {
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  color: #7a4f00;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.cert-modal {
  width: min(960px, 94vw);
  max-height: 92vh;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 40px 90px -30px rgba(10, 20, 50, 0.6);
  overflow: hidden;
}
.cert-modal::backdrop { background: rgba(15, 20, 35, 0.6); backdrop-filter: blur(4px); }
.cert-modal[open] { animation: cert-in 0.3s cubic-bezier(.2,.8,.2,1); }
@keyframes cert-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.cert-inner { display: grid; grid-template-rows: auto minmax(0, 1fr); max-height: 92vh; }
.cert-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule);
}
.cert-kicker { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: #b07a00; }
.cert-head h3 { font-size: 1.1rem; font-weight: 800; }
.cert-close {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
}
.cert-close:hover { border-color: var(--ink-soft); color: var(--ink); }
.cert-close svg { width: 18px; height: 18px; }
.cert-body { overflow: auto; padding: 16px; background: var(--surface); }
.cert-body img { display: block; width: 100%; height: auto; max-height: calc(92vh - 110px); object-fit: contain; margin: 0 auto; border-radius: 8px; }

/* ---------- Projects: animated network background ---------- */
.tech-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}
body:has(.tech-bg) main,
body:has(.tech-bg) .site-footer { position: relative; z-index: 1; }
body:has(.tech-bg) .site-footer { background: rgba(255, 255, 255, 0.86); }
body:has(.tech-bg) .pgrid::before { display: none; }
body:has(.tech-bg) .chip:not(.is-on) { background: rgba(255, 255, 255, 0.92); }

/* ---------- Projects: full-width bento grid ---------- */
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

main:has(.pgrid) { max-width: 1520px; }

.pgrid {
  --gap: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  grid-auto-flow: row dense;
  grid-auto-rows: minmax(var(--cell, 240px), auto); /* square cells; script sets --cell to the column width */
  gap: var(--gap);
  position: relative;
}
/* faint dot texture behind the grid */
.pgrid::before {
  content: "";
  position: absolute;
  inset: -28px -12px;
  z-index: -1;
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 16%, transparent) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
  pointer-events: none;
}

.pcard, .pcard-cta {
  animation: card-rise 0.6s cubic-bezier(.2,.8,.2,1) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes card-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.pcard {
  --tile: var(--accent);
  --rx: 0deg; --ry: 0deg;
  position: relative;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background:
    radial-gradient(380px circle at var(--mx, 50%) var(--my, -60%), color-mix(in srgb, var(--tile) 14%, transparent), transparent 60%),
    linear-gradient(155deg, color-mix(in srgb, var(--tile) 8%, #fff) 0%, #fff 60%);
  background-color: #fff;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: border-color 0.25s ease, box-shadow 0.3s ease, transform 0.2s ease-out;
  scroll-margin-top: calc(var(--header-h) + 20px);
  min-width: 0;
}
.pcard:hover {
  border-color: color-mix(in srgb, var(--tile) 45%, var(--rule));
  box-shadow: 0 22px 44px -22px color-mix(in srgb, var(--tile) 55%, transparent);
}

/* Open card: a big 2x2 tile on wide screens, with a spinning gradient border */
.pcard[open] {
  grid-column: span 2;
  grid-row: span 2;
  border-color: transparent;
  transform: none;
  box-shadow: 0 30px 70px -30px color-mix(in srgb, var(--tile) 60%, transparent);
  z-index: 1;
}
.pcard[open]::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 19px;
  padding: 1.5px;
  background: conic-gradient(from var(--ang), var(--tile), transparent 30%, color-mix(in srgb, var(--tile) 50%, #fff) 55%, transparent 80%, var(--tile));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: spin-border 4s linear infinite;
  pointer-events: none;
}
@keyframes spin-border { to { --ang: 360deg; } }

.pcard summary {
  list-style: none;
  cursor: pointer;
  height: 100%;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 18px;
  -webkit-tap-highlight-color: transparent;
}
.pcard summary::-webkit-details-marker { display: none; }
.pcard summary:focus-visible { outline: 2px solid var(--tile); outline-offset: 3px; }

.pcard-top { display: flex; align-items: center; gap: 12px; margin-bottom: auto; padding-bottom: 12px; min-height: 32px; }
.pcard-icon {
  width: 48px; height: 48px; flex: none;
  border-radius: 14px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(140deg, var(--tile), color-mix(in srgb, var(--tile) 62%, #000));
  box-shadow: 0 10px 20px -10px color-mix(in srgb, var(--tile) 85%, transparent);
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
}
.pcard-icon svg { width: 25px; height: 25px; }
.pcard:hover .pcard-icon { transform: rotate(-8deg) scale(1.08); }
.pcard-cat {
  font-family: var(--font-head);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tile);
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}
.pcard-toggle {
  width: 32px; height: 32px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  background: #fff;
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1), background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.pcard-toggle svg { width: 15px; height: 15px; }
.pcard:hover .pcard-toggle { border-color: var(--tile); color: var(--tile); transform: rotate(90deg); }
.pcard[open] .pcard-toggle { transform: rotate(135deg); background: var(--tile); border-color: var(--tile); color: #fff; }

.pcard-name {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
}
.pcard-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tile);
  background: color-mix(in srgb, var(--tile) 12%, #fff);
  padding: 3px 7px;
  border-radius: 999px;
  transform: translateY(-2px);
}
.pcard-line {
  font-family: var(--font-head);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink-soft);
}
.pcard-tags { margin-top: 4px; gap: 5px; }
.pcard-tags span {
  font-family: var(--font-head);
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--rule);
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1.4;
}
.pcard-tags .tag-more { color: var(--tile); border-color: color-mix(in srgb, var(--tile) 35%, var(--rule)); }
.pcard:not([open]) .pcard-tags .more { display: none; }
.pcard[open] .pcard-tags .tag-more { display: none; }

.pcard[open] summary { height: auto; padding-bottom: 6px; }
.pcard[open] .pcard-top { margin-bottom: 0; padding-bottom: 4px; }
.pcard[open] .pcard-name { font-size: 1.55rem; }
.pcard[open] .pcard-line { font-size: 0.98rem; color: var(--tile); }

.pcard-body {
  padding: 6px 22px 24px;
  display: grid;
  gap: 14px;
  animation: body-in 0.5s cubic-bezier(.2,.8,.2,1) both;
}
.pcard-desc { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.65; }
.pcard-body .bullets { font-size: 0.98rem; line-height: 1.55; gap: 7px; }
.pcard-body .bullets li { animation: body-in 0.5s cubic-bezier(.2,.8,.2,1) both; }
.pcard-body .bullets li:nth-child(1) { animation-delay: 0.06s; }
.pcard-body .bullets li:nth-child(2) { animation-delay: 0.11s; }
.pcard-body .bullets li:nth-child(3) { animation-delay: 0.16s; }
.pcard-body .bullets li:nth-child(4) { animation-delay: 0.21s; }
.pcard-body .bullets li:nth-child(5) { animation-delay: 0.26s; }
.pcard-body .bullets li:nth-child(6) { animation-delay: 0.31s; }
@keyframes body-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* GitHub tile that stretches to fill whatever is left in the last row */
.pcard-cta {
  grid-column: span var(--fill, 1);
  min-height: 160px;
  border-radius: 18px;
  padding: 22px 24px;
  display: grid;
  align-content: end;
  gap: 4px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(120deg, #1f2633, #2f5fd0 55%, #6a3fd0);
  background-size: 200% 200%;
  animation: card-rise 0.6s cubic-bezier(.2,.8,.2,1) backwards, cta-shift 9s ease-in-out infinite alternate;
  animation-delay: calc(var(--i, 0) * 45ms), 0s;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.pcard-cta:hover { transform: translateY(-3px); box-shadow: 0 22px 44px -20px rgba(47, 95, 208, 0.7); }
@keyframes cta-shift { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.cta-kicker { font-family: var(--font-head); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.75; }
.cta-title { font-family: var(--font-head); font-size: 1.25rem; font-weight: 800; line-height: 1.25; }
.cta-meta { font-family: var(--font-mono); font-size: 0.78rem; opacity: 0.8; }
.cta-arrow {
  position: absolute; top: 18px; right: 20px;
  font-size: 1.4rem; line-height: 1;
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1);
}
.pcard-cta:hover .cta-arrow { transform: translate(4px, -4px); }

/* ---------- Projects: expandable list (Heet style) ---------- */
:root { interpolate-size: allow-keywords; }

.proj-list { display: grid; gap: 16px; }

.proj-item {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.proj-item:hover { border-color: #cfd8ea; }
.proj-item[open] { border-color: #cfd8ea; box-shadow: 0 10px 28px rgba(20, 30, 50, 0.06); }

.proj-item summary {
  list-style: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 22px 26px;
  cursor: pointer;
  border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
}
.proj-item summary::-webkit-details-marker { display: none; }
.proj-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.proj-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--tile, var(--accent));
  background: #fff;
  background: color-mix(in srgb, var(--tile, var(--accent)) 10%, #fff);
  border: 1px solid var(--rule);
}
.proj-icon svg { width: 28px; height: 28px; }

.proj-text { display: grid; gap: 3px; min-width: 0; justify-items: start; }
.proj-name {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.proj-line {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.45;
}

.chev {
  width: 22px;
  height: 22px;
  color: var(--ink-soft);
  transition: transform 0.25s ease;
}
.proj-item[open] .chev { transform: rotate(180deg); }

/* Smooth open/close in browsers that support it; others open instantly */
.proj-item::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 0.3s ease, content-visibility 0.3s allow-discrete;
}
.proj-item[open]::details-content { block-size: auto; }

.proj-body {
  display: grid;
  gap: 16px;
  padding: 4px 26px 26px calc(26px + 56px + 20px);
}
.proj-body > p { color: var(--ink-soft); font-size: 1.04rem; line-height: 1.7; max-width: 66ch; }
.proj-text .tags { margin-top: 8px; }
.proj-text .tags span {
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--rule);
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1.4;
}
.proj-body .gh { justify-self: start; }
.private-note { font-family: var(--font-head); font-size: 0.82rem; color: var(--muted); }

/* ---------- Real Deployments ---------- */
.deploy-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.deploy-stats li {
  display: grid;
  gap: 2px;
  padding: 20px 22px;
  background: var(--surface);
  border-right: 1px solid var(--rule);
}
.deploy-stats li:last-child { border-right: 0; }
.deploy-stats b {
  font-family: var(--font-head);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.deploy-stats span { font-family: var(--font-head); font-size: 0.8rem; color: var(--muted); line-height: 1.4; }

.deploy { display: grid; gap: 14px; }
.deploy-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px 20px;
}
.deploy-head h3 { font-size: 1.2rem; font-weight: 700; }
.deploy > p { color: var(--ink-soft); font-size: 1.04rem; line-height: 1.65; max-width: 70ch; }

.status {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-live      { color: var(--live);  background: var(--live-bg); }
.status-pilot     { color: var(--pilot); background: var(--pilot-bg); }
.status-validated { color: var(--valid); background: var(--valid-bg); }
.status-testing   { color: var(--test);  background: var(--test-bg); }
.status-live::before { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.footnote { font-size: 0.98rem; font-style: italic; color: var(--muted); max-width: 70ch; }

/* ---------- Publications (Ryan) ---------- */
.pubs { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.pub { display: grid; gap: 4px; padding-block: 24px; border-bottom: 1px solid var(--rule); }
.pub h3 { font-size: 1.12rem; font-weight: 700; max-width: 60ch; }
.pub-status {
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.venue { font-style: italic; color: var(--ink-soft); }
.note { color: var(--muted); font-size: 1rem; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.contact-info { display: grid; gap: 22px; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.email {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
  user-select: all;
  overflow-wrap: anywhere;
}
.copy-btn {
  font-family: var(--font-head);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 0;
  border-radius: 6px;
  padding: 8px 13px;
  cursor: pointer;
}
.contact-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}
.contact-links a {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}
.contact-links a:hover { text-decoration: underline; }

.contact-form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label {
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 11px 13px;
  transition: border-color 0.15s ease;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus,
.field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field.invalid input,
.field.invalid textarea { border-color: #c2412d; }
.form-note { font-family: var(--font-head); font-size: 0.82rem; color: var(--muted); min-height: 1.2em; }

/* ---------- Pages ---------- */
.page {
  padding-block: 64px 80px;
  display: grid;
  gap: 32px;
}
.page > .section-title { font-size: clamp(2.2rem, 4.6vw, 3rem); }
.page-intro {
  color: var(--ink-soft);
  font-size: 1.2rem;
  max-width: 60ch;
  margin-top: -14px;
}

.next-page {
  justify-self: end;
  display: grid;
  gap: 2px;
  margin-top: 24px;
  padding: 16px 22px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-align: right;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.next-page span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.next-page:hover { border-color: var(--accent); color: var(--accent); }

/* Selected work on the home page */
.featured {
  padding-block: 64px 80px;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 32px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.feature {
  display: grid;
  gap: 10px;
  align-content: start;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.feature:hover { border-color: #cfd8ea; box-shadow: 0 10px 28px rgba(20, 30, 50, 0.07); transform: translateY(-2px); }
.feature h3 { font-size: 1.12rem; font-weight: 700; }
.feature p:not(.label) { color: var(--ink-soft); font-size: 1rem; line-height: 1.6; }
.feature .more {
  margin-top: 4px;
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}


/* ---------- Selected work: two-row carousel ---------- */
.marquee { display: grid; gap: 14px; min-width: 0; }
.marquee-row {
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: 6px 14px;
}
.marquee-row::-webkit-scrollbar { display: none; }
.marquee-track { display: flex; gap: 18px; width: max-content; }
.marquee-set { display: flex; gap: 18px; padding-right: 18px; }
.marquee .feature { flex: none; width: clamp(270px, 28vw, 380px); }
.marquee.is-ready .marquee-row {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent);
}
.marquee.is-ready .marquee-track { gap: 0; animation: marquee-left var(--dur, 50s) linear infinite; will-change: transform; }
.marquee.is-ready .marquee-row[data-dir="right"] .marquee-track { animation-name: marquee-right; }
.marquee-row:hover .marquee-track,
.marquee-row:focus-within .marquee-track { animation-play-state: paused; }
@keyframes marquee-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes marquee-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@media (max-width: 720px) { .marquee .feature { width: min(78vw, 320px); } }

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); }
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
  padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-head);
  font-size: 0.82rem;
  color: var(--muted);
}
.footer-inner a { text-decoration: none; font-weight: 600; }

/* =========================================================
   Responsive
   ========================================================= */

/* Tablet: collapse nav into a menu */
@media (max-width: 1240px) {
  .menu-btn { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 16px 30px rgba(20, 30, 50, 0.08);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.28s ease, visibility 0s linear 0.28s;
  }
  .site-nav.open {
    max-height: 80vh;
    visibility: visible;
    transition: max-height 0.28s ease;
  }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 16px;
  }
  .site-nav li + li { border-top: 1px solid var(--rule); }
  .site-nav a { font-size: 0.9rem; padding-block: 14px; }
  .site-nav a::after { display: none; }
  .site-nav a.active { color: var(--accent); }
}

@media (max-width: 960px) {
  .exp-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .proj-rail { display: none; }
  .timeline {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 20px;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--surface);
  }
}

@media (max-width: 860px) {
  .about-grid,
  .research-grid,
  .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }

  .photo { position: static; order: -1; max-width: 300px; }

  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .hero-photo { order: -1; justify-self: start; max-width: 220px; }
  .edu-row { grid-template-columns: minmax(0, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .proof,
  .deploy-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deploy-stats li:nth-child(2) { border-right: 0; }
  .deploy-stats li:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}

/* Phone */
@media (max-width: 560px) {
  :root { --gutter: 18px; --header-h: 64px; }

  body { font-size: 1.06rem; line-height: 1.7; }
  .brand { font-size: 1.18rem; }

  .hero { padding-block: 56px 48px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 100%; }

  .section { padding-block: 56px; gap: 26px; }
  .page { padding-block: 40px 56px; gap: 26px; }
  .featured { padding-block: 48px 56px; }
  .education { padding-block: 48px; }
  .hero-photo { max-width: 160px; }
  .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .next-page { justify-self: stretch; }

  .card { padding: 20px; }
  .logo { width: 44px; height: 44px; font-size: 0.7rem; }

  .job-head { grid-template-columns: auto minmax(0, 1fr); gap: 14px; }
  .job-head .date { grid-column: 2; margin-top: -8px; }
  .job > ul:not(.tags) { padding-left: 1.15em; }
  .roles, .job-status, .job-summary, .job-groups, .job-tags, .job-products, .job-expertise { padding-left: 0; }

  .edu-card { gap: 16px; align-items: flex-start; }

  .photo { max-width: 220px; }

  .deploy-stats b { font-size: 1.4rem; }
  .deploy-stats li { padding: 16px; }

  .contact-form .btn { width: 100%; }

  .proj-item summary { gap: 14px; padding: 18px; }
  .proj-icon { width: 46px; height: 46px; border-radius: 10px; }
  .proj-icon svg { width: 24px; height: 24px; }
  .proj-name { font-size: 1.05rem; }
  .proj-line { font-size: 0.88rem; }
  .proj-badge { margin-left: 0; margin-top: 4px; display: table; }

  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -18px; padding-inline: 18px; padding-bottom: 2px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .proj-text .tags span { font-size: 0.68rem; padding: 3px 8px; }
  .proj-item summary { align-items: start; }
  .chev { margin-top: 12px; }
  .proj-body { padding: 0 18px 20px; }
}

/* Motion preferences */
/* Projects grid: medium screens, the open card takes the whole row */
@media (max-width: 1099px) {
  .pcard[open] { grid-column: 1 / -1; grid-row: auto; }
}
/* Projects grid: phones get compact, app-style rows */
@media (max-width: 1200px) {
  .star-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .calendly-inline-widget { height: 1000px; }
  .dep2-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .sys-board {
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    z-index: 15;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 8px;
    border-radius: 0 0 14px 14px;
    margin-inline: calc(var(--gutter) * -1);
    border-inline: 0;
  }
  .sys-board::-webkit-scrollbar { display: none; }
  .sys-board-label { display: none; }
  .sys { padding: 8px 12px 12px; }
  .sys:hover { transform: none; }
  .sys-meta { display: none; }
  .sys-group { display: none; }
  .sys-sub { margin-left: 0; }
  .sys-sub::before { display: none; }
}

@media (max-width: 700px) {
  .ccard { padding: 18px; }
  .ccard.cal-card { padding: 0; }
  .cc-actions { grid-template-columns: minmax(0, 1fr); }
  .cc-facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .cal-head { padding: 16px 18px; }
  .calendly-inline-widget { min-width: 0; }
  .scholar-bar { padding: 16px; }
  .dep2 { padding: 20px 18px; gap: 14px; }
  .dep2-head { grid-template-columns: auto minmax(0, 1fr); }
  .dep2-head .status { grid-column: 1 / -1; justify-self: start; margin-top: 0; }
  .dep2-icon { width: 44px; height: 44px; }
  .dep2-kpis li { padding: 10px 12px; }
  .dep2-kpis b { font-size: 1.05rem; }
  .star { padding: 12px; }
  .star-grid { grid-template-columns: minmax(0, 1fr); }
  .vector-hero { padding: 20px; }
  .vector-series { padding: 10px; border-radius: 18px; }
  .dev-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .devstyle summary { flex-wrap: wrap; }
  .dev-hint { flex-basis: 100%; order: 3; }
  .lifecycle { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lifecycle li:nth-child(2)::after { display: none; }
  .star2-row { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .star2-k { width: 24px; height: 24px; font-size: 0.72rem; }
  .arch-arrow { display: none; }
  .metrics { width: 100%; justify-content: space-between; }
  .metrics div { text-align: left; }
  .metrics-note { margin-top: -14px; }
  .patent-card { grid-template-columns: minmax(0, 1fr); }
  .patent-no { padding: 18px 20px; }
  .patent-body { padding: 18px 20px; }
  .ref { grid-template-columns: 36px minmax(0, 1fr); }
  .dep-head { padding: 18px 18px 14px; }
  .dep-row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 18px; }
  .subnav { margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
}

@media (max-width: 600px) {
  .pgrid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pgrid::before { display: none; }
  .pgrid { grid-auto-rows: auto; }
  .pcard[open] { grid-column: auto; }
  .pcard summary { padding: 16px 18px; gap: 6px; }
  .pcard-top { margin-bottom: 0; padding-bottom: 2px; }
  .pcard-name, .pcard[open] .pcard-name { font-size: 1.1rem; }
  .pcard-line, .pcard[open] .pcard-line { font-size: 0.85rem; }
  .pcard-tags { margin-top: 4px; }
  .pcard-body { padding: 0 16px 20px; }
  .pcard-cta { grid-column: auto; min-height: 120px; }
}

@media (hover: none) {
  .pcard { transform: none !important; }
  .pcard:hover .pcard-toggle { transform: none; }
  .pcard[open]:hover .pcard-toggle { transform: rotate(135deg); }
}

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