:root {
  --bg: #050a10;
  --bg-2: #07111f;
  --panel: #0a131f;
  --panel-2: #0d1927;
  --panel-3: #101f2e;
  --text: #f5f8fb;
  --muted: #a8bbca;
  --dim: #748ba0;
  --accent: #68e0cf;
  --accent-2: #9cc5ff;
  --violet: #c4b5fd;
  --line: rgba(160, 190, 214, 0.17);
  --line-strong: rgba(160, 190, 214, 0.28);
  --glow: rgba(104, 224, 207, 0.16);
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(255,255,255,.017) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.017) 1px, transparent 1px),
    var(--bg);
  background-size: 32px 32px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.58;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background: radial-gradient(circle at 22% 10%, rgba(104,224,207,.06), transparent 28%),
              radial-gradient(circle at 80% 24%, rgba(156,197,255,.055), transparent 25%);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
strong { color: #fff; }

.shell {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 1000;
  transform: translateY(-160%);
  background: var(--text);
  color: var(--bg);
  padding: 9px 13px;
  font-weight: 800;
}
.skip-link:focus { transform: translateY(0); }

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
  opacity: .25;
}
.ambient-a { width: 360px; height: 360px; left: -180px; top: 160px; background: rgba(104,224,207,.16); }
.ambient-b { width: 420px; height: 420px; right: -220px; top: 480px; background: rgba(156,197,255,.12); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 10, 16, .88);
  backdrop-filter: blur(16px);
}

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 250px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(104,224,207,.55);
  border-radius: 10px;
  color: var(--accent);
  background: rgba(104,224,207,.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.brand-copy {
  display: grid;
  gap: 1px;
  font-size: .78rem;
}
.brand-copy strong { font-size: .88rem; }
.brand-copy span { color: var(--dim); }

.nav-links {
  margin-left: auto;
  display: flex;
  gap: 18px;
}
.nav-links a,
.nav-actions a {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
}
.nav-links a:hover,
.nav-actions a:hover { color: var(--text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-actions a {
  padding: 7px 9px;
  border: 1px solid transparent;
}
.nav-actions .nav-cta {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(255,255,255,.03);
}

.hero {
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr);
  gap: 70px;
  align-items: center;
  padding-top: 76px;
  padding-bottom: 70px;
}

.eyebrow,
.section-kicker,
.mini-label,
.project-overline {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: .76rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3.2rem, 8vw, 6.35rem);
  line-height: .92;
  letter-spacing: -.055em;
  font-weight: 760;
}

.hero-lead {
  margin: 22px 0 8px;
  color: #dce7ee;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.2;
  letter-spacing: -.02em;
}

.hero-focus {
  margin: 16px 0 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86rem;
}
.hero-focus span { color: var(--accent); padding-inline: 5px; }

.hero-summary {
  max-width: 720px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.hero-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.hero-actions { margin-top: 28px; }

.button,
.card-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  color: #dce7ee;
  background: rgba(255,255,255,.025);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
  font-weight: 800;
}

.button {
  min-height: 42px;
  padding: 9px 14px;
  font-size: .82rem;
}

.button.primary,
.card-actions a.primary-link {
  color: #061016;
  border-color: var(--accent);
  background: var(--accent);
}

.button:hover,
.card-actions a:hover {
  transform: translateY(-1px);
  border-color: rgba(104,224,207,.7);
  color: #fff;
  background: rgba(104,224,207,.08);
}

.button.primary:hover,
.card-actions a.primary-link:hover {
  color: #061016;
  background: #8ae9dc;
}

.engineering-card {
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(104,224,207,.05), rgba(156,197,255,.03) 58%, transparent),
    rgba(7,17,31,.84);
  box-shadow: 0 26px 90px rgba(0,0,0,.24);
}

.engineering-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 25px;
  color: var(--dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .69rem;
  letter-spacing: .12em;
}
.status-dot {
  color: #a7f3d0;
  letter-spacing: .04em;
  text-transform: lowercase;
}
.status-dot::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #a7f3d0;
  box-shadow: 0 0 16px rgba(167,243,208,.55);
}

.engineering-flow {
  display: flex;
  align-items: center;
  gap: 8px;
}
.flow-node {
  flex: 1;
  min-width: 0;
  padding: 14px 8px;
  border: 1px solid rgba(104,224,207,.4);
  border-radius: 10px;
  color: #d8fff7;
  background: rgba(104,224,207,.07);
  text-align: center;
  font: 800 .72rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.flow-node.blue { border-color: rgba(156,197,255,.45); color: #e4efff; background: rgba(156,197,255,.07); }
.flow-node.violet { border-color: rgba(196,181,253,.45); color: #eee9ff; background: rgba(196,181,253,.065); }
.flow-arrow { color: var(--dim); }

.gate {
  width: 58%;
  margin: 28px auto 24px;
  padding: 13px 10px;
  border: 1px solid rgba(167,243,208,.32);
  border-radius: 10px;
  color: #e5fff2;
  background: rgba(167,243,208,.06);
  text-align: center;
  font: 800 .73rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .06em;
}

.engineering-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.engineering-meta div { min-width: 0; }
.engineering-meta dt {
  color: var(--dim);
  font: 700 .62rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.engineering-meta dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .75rem;
}

.profile-strip {
  display: grid;
  grid-template-columns: 1.55fr 1fr 1.15fr 1.15fr;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(10,19,31,.74);
}

.profile-identity,
.profile-fact {
  min-width: 0;
  padding: 22px;
}
.profile-identity {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 17px;
  align-items: center;
}
.profile-identity img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  filter: saturate(.92) contrast(1.03);
}
.profile-identity strong {
  display: block;
  margin-top: 6px;
  font-size: .95rem;
}
.profile-identity p,
.profile-fact p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.5;
}
.profile-fact {
  border-left: 1px solid var(--line);
}
.secondary-fact {
  padding-top: 10px;
  margin-top: 10px !important;
  border-top: 1px solid var(--line);
}
.mini-label {
  color: var(--accent);
  font-size: .62rem;
  font-weight: 800;
}

.section {
  padding-top: 112px;
}

.section-kicker {
  margin-bottom: 15px;
  color: var(--accent);
  font-size: .68rem;
  font-weight: 800;
}

.section-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.section-title-row h2 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(2rem, 4.6vw, 3.75rem);
  line-height: 1.03;
  letter-spacing: -.04em;
}
.section-title-row p {
  max-width: 350px;
  margin: 0 0 4px;
  color: var(--dim);
  font-size: .82rem;
}

.intro-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 70px;
  padding-top: 34px;
}
.intro-big {
  margin: 0;
  color: #e8f0f5;
  font-size: clamp(1.3rem, 2.5vw, 1.85rem);
  line-height: 1.45;
  letter-spacing: -.015em;
}
.intro-copy p {
  margin: 0 0 16px;
  color: var(--muted);
}

.featured-stack {
  display: grid;
  gap: 20px;
  padding-top: 34px;
}

.project-card,
.education-card,
.skill-card,
.writing-card,
.credential-card,
.evidence-card,
.publication-feature,
.credential-feature,
.timeline-card,
.contact-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(13,25,39,.92), rgba(7,17,31,.88));
}

.project-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.hero-project {
  padding: 30px;
}
.hero-project::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(var(--accent), var(--accent-2));
}
.hero-project:hover {
  border-color: rgba(104,224,207,.28);
}

.project-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.project-index {
  color: var(--dim);
  font: 800 .72rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.badge {
  display: inline-flex;
  width: fit-content;
  padding: 6px 8px;
  border: 1px solid rgba(104,224,207,.22);
  border-radius: 999px;
  color: #c7fff6;
  background: rgba(104,224,207,.07);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
  gap: 44px;
}
.project-overline {
  margin: 0 0 7px;
  color: var(--accent-2);
  font-size: .65rem;
  font-weight: 800;
}
.project-card h3,
.education-card h3,
.writing-card h3,
.credential-card h3,
.publication-feature h3,
.credential-feature h3,
.evidence-card h3 {
  margin: 0;
  line-height: 1.16;
  letter-spacing: -.025em;
}
.hero-project h3 { font-size: clamp(1.65rem, 3vw, 2.5rem); }
.project-card p,
.education-card p,
.writing-card p,
.credential-card p,
.publication-feature p,
.credential-feature p,
.evidence-card p {
  color: var(--muted);
}
.project-lead {
  color: #dce7ee !important;
  font-size: 1rem;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}
.tag-row span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #a8bdcc;
  background: rgba(255,255,255,.018);
  font: 700 .68rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.metric-panel,
.system-panel {
  display: grid;
  align-content: start;
  gap: 9px;
}
.metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4,10,16,.4);
}
.metric strong {
  display: block;
  color: var(--accent);
  font: 800 1.08rem/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.metric span {
  display: block;
  margin-top: 5px;
  color: var(--dim);
  font-size: .7rem;
}
.system-panel div {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(4,10,16,.38);
}
.system-panel span {
  color: var(--accent);
  font: 800 .65rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.system-panel strong {
  font-size: .76rem;
  font-weight: 700;
}

.card-actions {
  margin-top: 22px;
}
.card-actions.full { grid-column: 1 / -1; }
.card-actions a {
  min-height: 35px;
  padding: 7px 10px;
  font-size: .72rem;
}

.subsection-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
  margin: 72px 0 20px;
}
.subsection-heading h3 {
  margin: 8px 0 0;
  font-size: 1.5rem;
}
.subsection-heading > p {
  max-width: 360px;
  margin: 0;
  color: var(--dim);
  font-size: .8rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.compact h3 { font-size: 1.12rem; }
.compact p { font-size: .83rem; }
.compact-projects .project-card { min-height: 300px; display: flex; flex-direction: column; }
.compact-projects .card-actions { margin-top: auto; padding-top: 12px; }

.timeline {
  display: grid;
  gap: 14px;
  padding-top: 34px;
}
.timeline-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 22px;
  padding: 24px;
}
.timeline-date {
  color: var(--accent);
  font: 800 .72rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.timeline-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.timeline-heading h3 {
  margin: 6px 0 0;
  font-size: 1.3rem;
}
.timeline-copy p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .9rem;
}
.signal {
  height: fit-content;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font: 700 .64rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}

.education-grid,
.writing-grid,
.credential-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-top: 34px;
}
.education-card,
.writing-card,
.credential-card {
  padding: 24px;
}
.education-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  color: var(--dim);
  font: 700 .68rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.education-card h3 { font-size: 1.35rem; }
.institution-line { margin: 8px 0 0; font-size: .85rem; }
.evidence-list {
  margin: 20px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: .85rem;
}
.evidence-list li { margin-bottom: 9px; }

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-top: 34px;
}
.skill-card {
  padding: 22px;
}
.skill-card > span {
  color: var(--accent);
  font: 800 .66rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.skill-card h3 {
  margin: 20px 0 9px;
  font-size: 1rem;
}
.skill-card p {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
}

.open-source-card {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
  gap: 34px;
  margin-top: 34px;
  padding: 28px;
}
.evidence-card h3 { font-size: 1.65rem; }
.evidence-side {
  display: grid;
  gap: 8px;
  align-content: start;
}
.evidence-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 9px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(4,10,16,.36);
}
.evidence-step strong {
  color: var(--accent);
  font: 800 .66rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.evidence-step span { color: var(--muted); font-size: .72rem; }

.writing-card h3,
.credential-card h3 { margin-top: 10px; font-size: 1.15rem; }
.writing-card p,
.credential-card p { font-size: .83rem; }

.publication-feature,
.credential-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, .5fr);
  gap: 34px;
  margin-top: 34px;
  padding: 30px;
}
.publication-feature h3,
.credential-feature h3 {
  margin-top: 16px;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
}
.publication-stat {
  display: grid;
  align-content: center;
  gap: 7px;
  padding-left: 26px;
  border-left: 1px solid var(--line);
}
.publication-stat strong {
  margin-top: 8px;
  color: var(--accent);
  font: 800 1.45rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.publication-stat span { color: var(--dim); font-size: .72rem; }

.credential-main { grid-column: 1 / -1; }
.credential-meta {
  color: var(--accent-2) !important;
  font: 700 .74rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.credential-modules {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
}
.credential-modules span {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(4,10,16,.35);
  font-size: .7rem;
}
.credential-modules strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font: 800 .85rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.credential-detail { font-size: .82rem; }

.credential-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.contact { padding-bottom: 52px; }
.contact-card {
  display: flex;
  justify-content: space-between;
  gap: 50px;
  align-items: end;
  padding: 32px;
  background:
    radial-gradient(circle at 90% 0%, rgba(104,224,207,.08), transparent 30%),
    linear-gradient(145deg, rgba(13,25,39,.98), rgba(7,17,31,.94));
}
.contact-card h2 {
  max-width: 770px;
  margin: 10px 0 0;
  font-size: clamp(1.8rem, 4vw, 3.15rem);
  line-height: 1.08;
  letter-spacing: -.04em;
}
.contact-card p {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
}
.contact-card .hero-actions { margin: 0; justify-content: flex-end; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 2px 0;
  color: var(--dim);
  font: 600 .67rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

code {
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #d6e6f2;
  background: rgba(255,255,255,.025);
}

@media (max-width: 1020px) {
  .nav-links { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 38px; padding-top: 74px; }
  .engineering-card { max-width: 650px; }
  .profile-strip { grid-template-columns: 1fr 1fr; }
  .profile-identity { grid-column: 1 / -1; }
  .profile-fact { border-left: 0; border-top: 1px solid var(--line); }
  .profile-fact:nth-child(3) { border-left: 1px solid var(--line); }
  .project-layout,
  .open-source-card { grid-template-columns: 1fr; }
  .metric-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credential-modules { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .shell { width: min(calc(100% - 28px), var(--max)); }
  .site-header { position: static; }
  .nav { min-height: 66px; }
  .brand { min-width: 0; }
  .brand-copy span { display: none; }
  .nav-actions a:first-child { display: none; }

  .hero { padding-top: 58px; padding-bottom: 42px; }
  .hero h1 { font-size: clamp(3rem, 16vw, 5rem); }
  .hero-focus { line-height: 1.7; }

  .engineering-card { padding: 18px; }
  .engineering-head { align-items: start; flex-direction: column; }
  .engineering-flow { gap: 5px; }
  .flow-node { padding-inline: 5px; font-size: .64rem; }
  .gate { width: 72%; }

  .profile-strip { grid-template-columns: 1fr; }
  .profile-identity { grid-column: auto; grid-template-columns: 76px 1fr; }
  .profile-identity img { width: 76px; height: 76px; border-radius: 15px; }
  .profile-fact,
  .profile-fact:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }

  .section { padding-top: 82px; }
  .section-title-row,
  .subsection-heading { display: block; }
  .section-title-row p,
  .subsection-heading > p { margin-top: 12px; }
  .intro-grid { grid-template-columns: 1fr; gap: 24px; }
  .project-grid,
  .education-grid,
  .writing-grid,
  .credential-grid,
  .skill-grid { grid-template-columns: 1fr; }

  .hero-project { padding: 22px; }
  .project-topline { align-items: start; }
  .metric-panel { grid-template-columns: 1fr 1fr; }

  .timeline-card { grid-template-columns: 1fr; gap: 10px; }
  .timeline-heading { display: block; }
  .signal { display: inline-flex; margin-top: 10px; }

  .publication-feature,
  .credential-feature { grid-template-columns: 1fr; padding: 22px; }
  .publication-stat { padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--line); grid-template-columns: auto 1fr; align-items: baseline; }
  .credential-modules { grid-template-columns: 1fr 1fr; }

  .contact-card { display: block; }
  .contact-card .hero-actions { justify-content: flex-start; margin-top: 24px; }
  footer { display: grid; }
}

@media (max-width: 430px) {
  .brand-copy strong { font-size: .76rem; }
  .nav-actions .nav-cta { padding-inline: 7px; }

  .hero h1 { font-size: 3.2rem; }
  .hero-lead { font-size: 1.3rem; }
  .engineering-meta { grid-template-columns: 1fr; }
  .metric-panel { grid-template-columns: 1fr; }
  .credential-modules { grid-template-columns: 1fr; }

  .card-actions a,
  .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { transition: none !important; }
}
/* Palette reference for the TeachScribe-inspired Portfolio V2 iteration. */
:root {
  --bg: #0d1624;
  --bg-2: #0f1d2d;
  --panel: #111f30;
  --panel-2: #14263a;
  --panel-3: #172d43;
  --text: #f5f8fb;
  --muted: #b3c2d0;
  --dim: #8599ad;
  --accent: #8faef7;
  --accent-2: #6fd4e5;
  --violet: #b9aaf8;
  --line: rgba(143, 174, 247, 0.19);
  --line-strong: rgba(143, 174, 247, 0.34);
  --glow: rgba(111, 212, 229, 0.14);
}

body {
  background:
    linear-gradient(rgba(143,174,247,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143,174,247,.035) 1px, transparent 1px),
    var(--bg);
}

body::before {
  background:
    radial-gradient(circle at 22% 10%, rgba(111,212,229,.10), transparent 30%),
    radial-gradient(circle at 80% 24%, rgba(143,174,247,.12), transparent 28%);
}

.ambient-a { background: rgba(111,212,229,.16); }
.ambient-b { background: rgba(143,174,247,.16); }
.site-header { background: rgba(13, 22, 36, .90); }
.brand-mark { border-color: rgba(143,174,247,.62); background: rgba(143,174,247,.09); }

.button.primary,
.card-actions a.primary-link { color: #0b1523; }
.button:hover,
.card-actions a:hover { border-color: rgba(143,174,247,.78); background: rgba(143,174,247,.11); }
.button.primary:hover,
.card-actions a.primary-link:hover { color: #0b1523; background: #a6bef9; }

.engineering-card {
  background:
    linear-gradient(145deg, rgba(111,212,229,.07), rgba(143,174,247,.08) 58%, transparent),
    rgba(15,29,45,.92);
  box-shadow: 0 26px 76px rgba(4,10,18,.20);
}
.status-dot { color: #6fd4e5; }
.status-dot::before { background: #6fd4e5; box-shadow: 0 0 16px rgba(111,212,229,.48); }
.flow-node { border-color: rgba(111,212,229,.40); color: #dff9ff; background: rgba(111,212,229,.08); }
.flow-node.blue { border-color: rgba(143,174,247,.50); color: #eef3ff; background: rgba(143,174,247,.10); }
.flow-node.violet { border-color: rgba(185,170,248,.45); color: #f1edff; background: rgba(185,170,248,.08); }
.gate { border-color: rgba(143,174,247,.38); color: #eef3ff; background: rgba(143,174,247,.08); }

.profile-strip { background: rgba(17,31,48,.88); }
.project-card,
.education-card,
.skill-card,
.writing-card,
.credential-card,
.evidence-card,
.publication-feature,
.credential-feature,
.timeline-card,
.contact-card {
  background: linear-gradient(145deg, rgba(20,38,58,.96), rgba(15,29,45,.94));
}
.hero-project:hover { border-color: rgba(143,174,247,.34); }
.metric,
.system-panel div,
.evidence-step,
.credential-modules span { background: rgba(18,35,54,.74); }
.contact-card {
  background:
    radial-gradient(circle at 90% 0%, rgba(111,212,229,.10), transparent 32%),
    linear-gradient(145deg, rgba(20,38,58,.99), rgba(15,29,45,.97));
}
/* =========================================================
   Portfolio V3 — evidence navigation + clearer hierarchy
   ========================================================= */

.nav-actions { margin-left: auto; }

.page-rail {
  position: fixed;
  z-index: 35;
  left: 28px;
  top: 112px;
  width: 108px;
  padding: 14px 10px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(13, 22, 36, .84);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0,0,0,.16);
}
.rail-label {
  display: block;
  margin: 0 7px 10px;
  color: var(--dim);
  font: 800 .54rem/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .14em;
}
.page-rail nav {
  display: grid;
  gap: 2px;
}
.page-rail a {
  position: relative;
  display: block;
  padding: 6px 7px 6px 11px;
  border-radius: 7px;
  color: var(--dim);
  font-size: .65rem;
  font-weight: 720;
  line-height: 1.25;
}
.page-rail a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 3px;
  transform: translateY(-50%);
  border-radius: 99px;
  background: rgba(143,174,247,.42);
  transition: height .18s ease, background .18s ease, box-shadow .18s ease;
}
.page-rail a:hover,
.page-rail a.active,
.page-rail a[aria-current="true"] {
  color: var(--text);
  background: rgba(143,174,247,.07);
}
.page-rail a.active::before,
.page-rail a[aria-current="true"]::before {
  height: 17px;
  background: var(--accent-2);
  box-shadow: 0 0 14px rgba(111,212,229,.34);
}
.rail-progress {
  position: absolute;
  right: 5px;
  top: 34px;
  bottom: 12px;
  width: 1px;
  overflow: hidden;
  background: rgba(143,174,247,.10);
}
.rail-progress span {
  display: block;
  width: 100%;
  height: 0%;
  background: linear-gradient(var(--accent), var(--accent-2));
  box-shadow: 0 0 9px rgba(111,212,229,.28);
}

.section-jump { display: none; }

@media (min-width: 1280px) {
  .shell { width: min(calc(100% - 300px), var(--max)); }
}

@media (max-width: 1279px) {
  .page-rail { display: none; }
  .section-jump {
    position: sticky;
    z-index: 42;
    top: 72px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(13,22,36,.92);
    backdrop-filter: blur(14px);
    scrollbar-width: none;
  }
  .section-jump::-webkit-scrollbar { display: none; }
  .section-jump a {
    flex: 0 0 auto;
    padding: 6px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--dim);
    font-size: .67rem;
    font-weight: 760;
  }
  .section-jump a.active,
  .section-jump a[aria-current="true"] {
    color: var(--text);
    border-color: rgba(143,174,247,.26);
    background: rgba(143,174,247,.08);
  }
}

@media (max-width: 720px) {
  .section-jump {
    top: 0;
    padding-inline: 10px;
  }
}

/* Engineering loop — semantic flow + restrained motion */
.engineering-card {
  position: relative;
  overflow: hidden;
}
.engineering-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(circle at 72% 18%, rgba(111,212,229,.10), transparent 24%);
  transition: opacity .4s ease;
}
.engineering-card.is-active::after { opacity: 1; }

.engineering-flow {
  position: relative;
  gap: 8px;
}
.flow-node {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 6px;
  padding: 14px 8px 11px;
  overflow: hidden;
}
.flow-node > span,
.gate > span {
  font: 800 .72rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .025em;
}
.flow-node small,
.gate small {
  display: block;
  color: var(--dim);
  font: 650 .52rem/1.25 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .02em;
  text-transform: lowercase;
}
.flow-node::after,
.gate::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 0 1px rgba(111,212,229,.75), 0 0 24px rgba(111,212,229,.20);
}
.flow-link {
  position: relative;
  z-index: 1;
  flex: 0 0 26px;
  height: 1px;
  overflow: visible;
  background: rgba(143,174,247,.22);
}
.flow-link i {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  opacity: 0;
  background: #c9f6ff;
  box-shadow: 0 0 13px rgba(111,212,229,.9);
}

.engineering-card.is-active [data-flow-step="1"]::after { animation: flowNodePulse .52s .10s ease both; }
.engineering-card.is-active .flow-link:nth-of-type(1) i { animation: flowTravel .58s .48s ease-in-out both; }
.engineering-card.is-active [data-flow-step="2"]::after { animation: flowNodePulse .52s .98s ease both; }
.engineering-card.is-active .flow-link:nth-of-type(2) i { animation: flowTravel .58s 1.36s ease-in-out both; }
.engineering-card.is-active [data-flow-step="3"]::after { animation: flowNodePulse .52s 1.86s ease both; }
.engineering-card.is-active [data-flow-step="4"]::after { animation: flowGatePulse .78s 2.36s ease both; }

@keyframes flowTravel {
  0% { left: -2px; opacity: 0; transform: scale(.75); }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { left: calc(100% - 3px); opacity: 0; transform: scale(1.05); }
}
@keyframes flowNodePulse {
  0%,100% { opacity: 0; }
  35%,65% { opacity: 1; }
}
@keyframes flowGatePulse {
  0%,100% { opacity: 0; }
  25%,70% { opacity: 1; box-shadow: inset 0 0 0 1px rgba(143,174,247,.82), 0 0 28px rgba(143,174,247,.22); }
}
.gate {
  position: relative;
  display: grid;
  gap: 6px;
  overflow: hidden;
}

/* Profile snapshot now reads as first-class information */
.profile-identity,
.profile-fact {
  padding: 26px 24px;
}
.profile-identity {
  grid-template-columns: 108px 1fr;
  gap: 19px;
}
.profile-identity img {
  width: 108px;
  height: 108px;
}
.profile-identity strong {
  margin-top: 7px;
  font-size: 1.04rem;
}
.profile-identity p,
.profile-fact p {
  font-size: .84rem;
  line-height: 1.56;
}
.profile-strip .mini-label { font-size: .67rem; }

/* Make product / project identity scannable before the descriptive title */
.project-overline {
  margin-bottom: 9px;
  color: var(--accent-2);
  font-size: .86rem;
  font-weight: 900;
  letter-spacing: .105em;
}

/* Consistent CTA semantics and bottom alignment */
.writing-card,
.credential-card,
.education-card,
.compact-projects .project-card {
  display: flex;
  flex-direction: column;
}
.writing-card .card-actions,
.credential-card .card-actions,
.education-card .card-actions,
.compact-projects .card-actions {
  margin-top: auto;
  padding-top: 18px;
}
.card-actions a.primary-link:only-child {
  color: #dce7ee;
  border-color: var(--line-strong);
  background: rgba(255,255,255,.025);
}
.card-actions a.primary-link:only-child:hover {
  color: #fff;
  border-color: rgba(111,212,229,.58);
  background: rgba(111,212,229,.08);
}

.credential-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.credential-card {
  min-height: 255px;
}

/* Education detail stays dense but easier to scan */
.education-card .evidence-list strong { color: #f6f9fc; }
.education-card .evidence-list li { line-height: 1.5; }

/* Scroll targets should not hide beneath sticky navigation */
section[id] { scroll-margin-top: 108px; }

@media (max-width: 1020px) {
  .profile-identity {
    grid-template-columns: 104px 1fr;
  }
  .profile-identity img { width: 104px; height: 104px; }
}
@media (max-width: 720px) {
  .profile-identity { grid-template-columns: 82px 1fr; }
  .profile-identity img { width: 82px; height: 82px; }
  .profile-identity,
  .profile-fact { padding: 22px; }
  .credential-grid { grid-template-columns: 1fr; }
  .engineering-flow { gap: 4px; }
  .flow-link { flex-basis: 16px; }
  .flow-node > span { font-size: .62rem; }
  .flow-node small { font-size: .46rem; }
}
@media (max-width: 430px) {
  .flow-node small { display: none; }
  .gate small { font-size: .48rem; }
}

/* Motion is decorative/explanatory only; never required for meaning. */
@media (prefers-reduced-motion: reduce) {
  .engineering-card.is-active [data-flow-step]::after,
  .engineering-card.is-active .flow-link i { animation: none !important; opacity: 0 !important; }
}
/* Final V3 review refinement: make VERIFY → HUMAN GATE an explicit part of the animated flow. */
.gate {
  overflow: visible;
}

.gate::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -25px;
  width: 12px;
  height: 24px;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: .52;
  background:
    radial-gradient(circle, #c9f6ff 0 2px, transparent 3px) 50% -6px / 6px 6px no-repeat,
    linear-gradient(to bottom, rgba(143,174,247,.18), rgba(111,212,229,.42)) 50% 0 / 1px 100% no-repeat;
}

.engineering-card.is-active .gate::before {
  animation: gateSignalTravel .62s 2.20s ease-in-out both;
}

.engineering-card.is-active [data-flow-step="4"]::after {
  animation-delay: 2.70s;
}

@keyframes gateSignalTravel {
  0% {
    opacity: .28;
    background-position: 50% -6px, 50% 0;
  }
  24%, 82% { opacity: 1; }
  100% {
    opacity: .62;
    background-position: 50% 22px, 50% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .engineering-card.is-active .gate::before {
    animation: none !important;
    opacity: .52;
    background-position: 50% 10px, 50% 0;
  }
}
