:root {
  --ink: #081514;
  --deep: #071716;
  --paper: #f2f0e7;
  --muted: #9aa9a3;
  --line: rgba(242, 240, 231, 0.16);
  --teal: #46e3c3;
  --lime: #c8ef75;
  --orange: #ff7f50;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--paper);
  background: var(--deep);
  font-family: "Manrope", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 80% 5%, rgba(70, 227, 195, .11), transparent 31rem),
    linear-gradient(90deg, transparent 49.9%, rgba(255,255,255,.025) 50%, transparent 50.1%);
  z-index: -2;
}

.noise {
  position: fixed;
  inset: 0;
  opacity: .035;
  pointer-events: none;
  z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 clamp(22px, 5vw, 80px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 23, 22, .78);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 14px; letter-spacing: -.01em; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid var(--teal); color: var(--teal); border-radius: 50%; font-family: "DM Mono", monospace; font-size: 11px; }
nav { display: flex; gap: 30px; align-items: center; font-size: 13px; }
nav a { color: #c2ccc8; transition: color .25s ease; }
nav a:hover { color: var(--paper); }
.nav-cta { border: 1px solid var(--line); padding: 10px 14px; border-radius: 999px; }

main { overflow: hidden; }
.hero, .work-section, .profile-section { padding-inline: clamp(22px, 5vw, 80px); }
.hero {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  align-items: center;
  gap: clamp(40px, 7vw, 110px);
  padding-block: clamp(70px, 10vh, 130px);
}

.eyebrow, .section-index, .column-label, .project-meta, .visual-label, .timeline-state {
  font-family: "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 10px;
}

.eyebrow { color: var(--teal); display: flex; align-items: center; gap: 10px; margin: 0 0 24px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 5px rgba(70, 227, 195, .09); }
h1 { max-width: 850px; margin: 0; font-size: clamp(48px, 6.7vw, 104px); line-height: .94; letter-spacing: -.065em; font-weight: 600; }
h1 em { color: var(--teal); font-family: Georgia, serif; font-weight: 400; }
.hero-intro { max-width: 660px; color: #b7c2bd; font-size: clamp(16px, 1.4vw, 20px); line-height: 1.65; margin: 30px 0 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 52px; padding: 0 20px; border-radius: 4px; font-size: 13px; font-weight: 700; transition: transform .25s ease, background .25s ease, color .25s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--teal); color: var(--ink); }
.button-primary:hover { background: var(--lime); }
.button-ghost { border: 1px solid var(--line); color: var(--paper); }
.quick-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 56px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.quick-facts div { display: grid; gap: 7px; }
.quick-facts dt { color: #6f817a; font-family: "DM Mono", monospace; font-size: 9px; text-transform: uppercase; letter-spacing: .14em; }
.quick-facts dd { margin: 0; font-size: 12px; }

.hero-visual { position: relative; aspect-ratio: 1; max-width: 680px; width: 100%; border: 1px solid var(--line); border-radius: 50%; background: radial-gradient(circle, rgba(70, 227, 195, .08), transparent 64%); }
.hero-visual::before, .hero-visual::after { content: ""; position: absolute; border: 1px solid var(--line); border-radius: 50%; inset: 14%; }
.hero-visual::after { inset: 31%; }
.visual-label { position: absolute; top: 9%; left: 0; right: 0; display: flex; justify-content: space-between; color: #6f817a; }
#neural-canvas { display: block; width: 100%; height: 100%; position: relative; z-index: 2; }
.visual-caption { position: absolute; z-index: 3; bottom: 7%; left: 10%; right: 10%; display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; color: #778b83; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.visual-caption strong { color: var(--paper); font-family: "DM Mono", monospace; font-size: 22px; font-weight: 400; }
.visual-caption span:last-child { text-align: right; }

.work-section { background: var(--paper); color: var(--ink); padding-block: clamp(90px, 12vw, 170px); }
.section-heading { display: grid; grid-template-columns: 1fr minmax(270px, 410px); gap: 50px; align-items: end; margin-bottom: 55px; }
.section-index { color: #688078; margin: 0 0 17px; }
.section-heading h2, .contact-strip h2 { margin: 0; font-size: clamp(38px, 5vw, 74px); line-height: .98; letter-spacing: -.055em; font-weight: 600; }
.section-heading > p { color: #5e6b67; line-height: 1.7; margin: 0 0 4px; font-size: 14px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filter { border: 1px solid rgba(8, 21, 20, .16); background: transparent; color: #56645f; border-radius: 999px; padding: 9px 14px; font-size: 11px; cursor: pointer; transition: .2s ease; }
.filter:hover, .filter.active { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.project-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid rgba(8, 21, 20, .15); border-left: 1px solid rgba(8, 21, 20, .15); }
.project-card { position: relative; min-height: 390px; display: grid; grid-template-columns: 45px 1fr; gap: 18px; padding: clamp(25px, 3.5vw, 50px); border-right: 1px solid rgba(8, 21, 20, .15); border-bottom: 1px solid rgba(8, 21, 20, .15); transition: background .3s ease, opacity .3s ease, transform .3s ease; overflow: hidden; }
.project-card:hover, .project-card:focus-within { background: #e7f0e9; }
.project-card.hidden { display: none; }
.project-card.featured { grid-column: 1 / -1; grid-template-columns: 45px minmax(0, 1fr) minmax(280px, .75fr); }
.project-number { font-family: "DM Mono", monospace; font-size: 10px; color: #84918c; padding-top: 5px; }
.project-content { max-width: 610px; }
.project-card.project-wide { grid-column: 1 / -1; min-height: auto; }
.project-wide .project-content { max-width: none; }
.project-meta { display: flex; gap: 10px; flex-wrap: wrap; color: #6f7c78; }
.project-meta span + span::before { content: "/"; margin-right: 10px; color: #abb3b0; }
.project-card h3 { max-width: 580px; margin: 45px 0 18px; font-size: clamp(25px, 2.5vw, 38px); line-height: 1.08; letter-spacing: -.045em; }
.project-card p { color: #52605b; font-size: 13px; line-height: 1.7; margin: 0; }
.project-details { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease, margin .35s ease; overflow: hidden; }
.project-details p { overflow: hidden; }
.project-card.open .project-details { grid-template-rows: 1fr; margin-top: 18px; }
.project-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin-top: 25px; }
.project-action { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.project-action-primary { padding: 10px 13px; border: 1px solid rgba(8, 21, 20, .24); border-radius: 3px; transition: background .2s ease, color .2s ease; }
.project-action-primary:hover { color: var(--paper); background: var(--ink); }
.details-toggle { margin: 0; padding: 0; border: 0; background: none; color: var(--ink); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; cursor: pointer; }
.details-toggle span { display: inline-block; margin-left: 8px; color: #558177; transition: transform .3s ease; }
.project-card.open .details-toggle span { transform: rotate(45deg); }
.connectome { position: relative; align-self: center; justify-self: center; width: min(25vw, 300px); aspect-ratio: 1; border: 1px solid rgba(8,21,20,.17); border-radius: 50%; background: repeating-radial-gradient(circle, transparent 0 26px, rgba(8,21,20,.04) 27px 28px); }
.connectome::before, .connectome::after, .connectome span, .connectome i, .connectome b { content: ""; position: absolute; border-radius: 50%; width: 9px; height: 9px; background: var(--orange); box-shadow: 0 0 0 5px rgba(255,127,80,.12); }
.connectome::before { left: 19%; top: 32%; }
.connectome::after { right: 22%; bottom: 27%; }
.connectome span { left: 57%; top: 16%; background: var(--ink); }
.connectome i { left: 42%; bottom: 14%; background: var(--teal); }
.connectome b { right: 15%; top: 43%; background: var(--lime); }

.about-section { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); column-gap: clamp(32px, 6vw, 90px); row-gap: 36px; padding: clamp(80px, 9vw, 130px) clamp(22px, 5vw, 80px); border-bottom: 1px solid var(--line); scroll-margin-top: 95px; }
.about-portrait { margin: 0; align-self: start; }
.about-portrait img { display: block; width: 100%; height: auto; border-radius: 4px; }
.about-portrait figcaption { padding-top: 18px; font-size: 16px; font-weight: 700; }
.about-portrait figcaption span { display: block; margin-top: 6px; color: #aebeb7; font-size: 14px; font-weight: 400; line-height: 1.6; }
.about-copy .section-index { color: var(--teal); font-size: 12px; }
.about-copy h2 { margin: 0 0 28px; font-size: clamp(36px, 3.7vw, 60px); line-height: 1.1; letter-spacing: -.045em; font-weight: 600; }
.about-copy h2 em { color: var(--teal); font-family: Georgia, serif; font-weight: 400; }
.about-copy p { color: #b7c2bd; font-size: 16px; line-height: 1.75; margin: 0 0 22px; }
.about-copy .about-intro { color: var(--paper); font-size: 18px; }
.about-copy { align-self: center; }
.about-story { grid-column: 1 / -1; }
.about-story h3 { margin: 0 0 12px; padding-top: 26px; border-top: 1px solid var(--line); color: var(--teal); font-size: 20px; font-weight: 600; line-height: 1.4; letter-spacing: -.015em; }
.about-story p { color: #b7c2bd; font-size: 18px; line-height: 1.8; margin: 0 0 24px; }
.about-story p:last-child { margin-bottom: 0; }
@media (max-width: 980px) { .about-section { grid-template-columns: 1fr; } .about-portrait { max-width: 420px; } }
@media (max-width: 720px) { nav > a[href="#about"] { display: inline-block; font-size: 14px; } nav { gap: 12px; } .brand > span:last-child { max-width: 75px; } .nav-cta { padding: 9px 10px; } }
.profile-section { padding-block: clamp(90px, 12vw, 160px) 0; }
.profile-section .section-heading > p { color: #9cacA6; }
.profile-grid { display: grid; grid-template-columns: 1.1fr 1fr .9fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.timeline, .toolkit, .github-card { min-height: 380px; padding: clamp(26px, 3.5vw, 46px); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.column-label { color: #71847d; margin: 0 0 38px; }
.timeline article { position: relative; padding: 0 0 30px 23px; border-left: 1px solid #31514a; }
.timeline article:last-child { padding-bottom: 0; }
.timeline article::before { content: ""; position: absolute; left: -4px; top: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.timeline-state { color: var(--teal); }
.timeline h3, .github-card h3 { margin: 10px 0 6px; font-size: 18px; letter-spacing: -.025em; }
.timeline p, .github-card p { margin: 0; color: #879a93; font-size: 12px; }
.skill-cloud { display: flex; flex-wrap: wrap; gap: 9px; }
.skill-cloud span { border: 1px solid var(--line); color: #b8c5c0; border-radius: 999px; padding: 9px 12px; font-size: 11px; transition: border-color .2s, color .2s, transform .2s; }
.skill-cloud span:hover { color: var(--teal); border-color: rgba(70, 227, 195, .5); transform: translateY(-2px); }
.github-card { display: flex; flex-direction: column; justify-content: space-between; transition: background .25s ease, color .25s ease; }
.github-card:hover { background: var(--teal); color: var(--ink); }
.github-card:hover p, .github-card:hover .column-label, .github-card:hover .repo-state { color: #19443b; }
.github-top { display: flex; justify-content: space-between; align-items: center; }
.github-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; }
.pdf-icon { font-family: "DM Mono", monospace; font-size: 9px; letter-spacing: .08em; }
.repo-state { color: #6f817a; font-family: "DM Mono", monospace; text-transform: uppercase; font-size: 8px; letter-spacing: .1em; }
.github-link { font-size: 11px; font-weight: 700; }

.contact-strip { margin-top: clamp(90px, 12vw, 160px); padding: clamp(50px, 7vw, 100px) 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 40px; align-items: end; }
.contact-strip .section-index { color: var(--teal); }
.contact-actions { display: grid; justify-items: start; gap: 15px; }
.contact-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.contact-email { color: var(--teal); font-family: "DM Mono", monospace; font-size: 12px; border-bottom: 1px solid rgba(70, 227, 195, .32); padding-bottom: 4px; }
.contact-actions p { margin: 0; color: #72847e; font-size: 10px; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { max-width: 560px; margin-inline: auto; }
  .profile-grid { grid-template-columns: 1fr 1fr; }
  .github-card { grid-column: 1 / -1; min-height: 280px; }
}

@media (max-width: 720px) {
  .site-header { min-height: 66px; }
  nav > a:not(.nav-cta) { display: none; }
  .hero { min-height: auto; padding-top: 70px; }
  h1 { font-size: clamp(43px, 15vw, 68px); }
  .quick-facts { grid-template-columns: 1fr; }
  .section-heading { grid-template-columns: 1fr; align-items: start; }
  .project-grid, .profile-grid { grid-template-columns: 1fr; }
  .project-card, .project-card.featured { grid-column: auto; grid-template-columns: 34px 1fr; }
  .connectome { display: none; }
  .timeline, .toolkit, .github-card { min-height: auto; }
  .github-card { grid-column: auto; gap: 80px; }
  .contact-strip { display: grid; }
  .visual-label { left: 4%; right: 4%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
@media (max-width: 720px) { .site-header nav > a[href="#about"] { display: inline-block; } }

/* Comfortable reading and touch controls across screen sizes. */
section[id] { scroll-margin-top: 96px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
.work-section a:focus-visible, .work-section button:focus-visible { outline-color: #156957; }
.project-card p, .section-heading > p { font-size: 16px; }
.filter, .project-action, .details-toggle { font-size: 14px; min-height: 44px; }
.details-toggle { display: inline-flex; align-items: center; padding: 8px 0; }
.project-content, .about-copy, .profile-grid > *, .contact-actions { min-width: 0; }
@media (max-width: 720px) {
  .site-header { position: relative; flex-direction: column; align-items: stretch; padding-block: 16px 10px; gap: 12px; }
  .brand > span:last-child { max-width: none; }
  .site-header nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
  .site-header nav > a, .site-header nav > a:not(.nav-cta), .site-header nav > a[href="#about"] { display: inline-flex; align-items: center; min-height: 44px; }
  section[id] { scroll-margin-top: 20px; }
  .hero { padding-top: 44px; gap: 36px; }
  h1 { font-size: clamp(40px, 11.8vw, 68px); line-height: 1.04; letter-spacing: -.045em; }
  .hero-visual { max-width: 390px; }
  .visual-label, .visual-caption { font-size: 12px; letter-spacing: 0; }
  .visual-caption { left: 4%; right: 4%; gap: 8px; }
  .eyebrow, .section-index, .column-label, .project-meta, .timeline-state { font-size: 12px; letter-spacing: .06em; }
  .eyebrow { line-height: 1.6; }
  .status-dot { flex-shrink: 0; }
  .quick-facts dt { font-size: 12px; color: #a2b4ac; }
  .quick-facts dd, .timeline p, .github-card p { font-size: 16px; line-height: 1.6; }
  .button, .skill-cloud span, .github-link, .contact-email { font-size: 14px; }
  .contact-email { overflow-wrap: anywhere; }
  .contact-actions p, .repo-state, .pdf-icon { font-size: 12px; }
  .project-card, .project-card.featured, .project-card.project-wide { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 24px 20px; min-height: auto; }
  .project-number { font-size: 12px; }
  .project-card h3 { margin-top: 24px; overflow-wrap: break-word; }
  .project-actions { gap: 12px; }
  .section-heading { gap: 24px; margin-bottom: 32px; }
  .about-story p { font-size: 16px; }
  .about-portrait { width: 100%; margin-inline: auto; }
  .about-section { row-gap: 28px; }
  .timeline, .toolkit, .github-card { padding: 26px 20px; }
}
