:root {
  --bg: #10110f;
  --surface: #171815;
  --surface-raised: #1d1e1a;
  --text: #f0f0e9;
  --muted: #a9aaa0;
  --quiet: #797a72;
  --line: #353630;
  --accent: #d6f76a;
  --sans: 'Space Grotesk', Arial, sans-serif;
  --mono: 'DM Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.65; }
::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(1680px, calc(100% - 80px)); margin-inline: auto; }
.skip-link { position: absolute; z-index: 50; top: 12px; left: 16px; padding: 10px 14px; background: var(--accent); color: var(--bg); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

/* Navigation */
.site-header { position: sticky; z-index: 20; top: 0; height: 76px; display: flex; align-items: center; justify-content: space-between; padding-inline: max(40px, calc((100% - 1680px) / 2)); background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 13px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-decoration: none; }
.brand-mark { font: 700 18px/.9 var(--sans); letter-spacing: -.12em; }
.brand-mark span, .accent, .footer-brand span { color: var(--accent); }
.brand i { margin-left: 8px; color: var(--muted); font: 10px var(--mono); letter-spacing: .05em; }
.nav { display: flex; align-items: center; gap: 34px; }
.nav a { position: relative; min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); font-size: 13px; text-decoration: none; transition: color .2s ease; }
.nav a::after { position: absolute; right: 0; bottom: 7px; left: 0; height: 1px; background: var(--accent); content: ''; transform: scaleX(0); transform-origin: left; transition: transform .2s ease; }
.nav a:hover, .nav a:focus-visible { color: var(--text); }
.nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); }
.nav a[aria-current="location"] { color: var(--text); }
.nav a[aria-current="location"]::after { transform: scaleX(1); }
.nav .nav-contact { color: var(--accent); }
.nav .nav-contact span { margin-left: 8px; }
.menu-toggle { display: none; }

/* Hero */
.hero { min-height: calc(100svh - 76px); display: flex; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); }
.hero-inner { flex: 1; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); align-items: center; gap: clamp(48px, 6vw, 120px); padding-block: 76px 64px; }
.hero-copy { min-width: 0; }
.eyebrow, .hero-alias, .stack-heading, .stack-item > span, .stack-item small, .hero-footer, .section-index, .project-kicker, .project-bottom, .project-number, .tech-group > span, .experience-group article > span, .languages > span, .footer > span, .footer > a:last-child { font-family: var(--mono); }
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; margin: 0 0 27px; color: var(--muted); font-size: 11px; letter-spacing: .09em; }
.eyebrow-rule { width: 25px; height: 1px; background: var(--accent); }
.eyebrow-location { margin-left: 8px; color: var(--quiet); }
.hero h1 { margin: 0; font-size: clamp(82px, 8vw, 158px); font-weight: 600; line-height: .86; letter-spacing: -.095em; }
.hero h1 > span { display: block; white-space: nowrap; }
.hero-alias { margin: 28px 0 9px 5px; color: var(--quiet); font-size: 11px; letter-spacing: .1em; }
.hero-alias strong { margin-left: 8px; color: var(--accent); font-weight: 500; }
.hero-summary { max-width: 570px; margin: 0 0 0 5px; color: #d0d0c8; font-size: 18px; line-height: 1.65; }
.hero-actions { display: flex; align-items: center; gap: 29px; margin: 28px 0 0 5px; }
.button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 22px; padding: 12px 18px; font-size: 14px; font-weight: 600; text-decoration: none; transition: color .2s ease, background .2s ease, transform .2s ease; }
.button-primary { background: var(--accent); color: var(--bg); }
.button-primary:hover { background: var(--text); transform: translateY(-2px); }
.button-primary span { font-size: 18px; transition: transform .2s ease; }
.button-primary:hover span { transform: translateY(3px); }
.text-link { color: var(--text); font-size: 14px; text-decoration-color: var(--quiet); text-underline-offset: 5px; transition: color .2s ease; }
.text-link:hover { color: var(--accent); }

/* A single animated system detail */
.stack-visual { width: 100%; max-width: 680px; justify-self: end; padding-top: 8px; }
.stack-heading { margin: 0 0 23px; color: var(--quiet); font-size: 11px; letter-spacing: .1em; }
.stack-list { position: relative; border-top: 1px solid var(--line); }
.stack-list::before { position: absolute; top: 32px; bottom: 32px; left: 9px; width: 1px; background: #4c4d45; content: ''; }
.stack-signal { position: absolute; z-index: 1; top: 30px; left: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: stack-signal 6s ease-in-out infinite; }
.stack-item { min-height: 66px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.stack-item > span { color: var(--quiet); font-size: 11px; }
.stack-item strong { font-size: 14px; font-weight: 500; letter-spacing: .08em; }
.stack-item small { color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.stack-caption { margin: 19px 0 0 48px; color: var(--muted); font-size: 14px; }
.hero-footer { min-height: 58px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--quiet); font-size: 10px; letter-spacing: .07em; }
.hero-footer a { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; color: var(--accent); text-decoration: none; }
.hero-footer a span { font-size: 16px; }
@keyframes stack-signal { 0%, 12% { top: 30px; } 70%, 88%, 100% { top: calc(100% - 37px); } }

/* Projects */
.work-section { background: var(--surface); border-bottom: 1px solid var(--line); }
.section-inner { padding-block: 108px 92px; }
.section-heading { position: relative; }
.section-index { margin: 0; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.section-index span { padding-inline: 7px; color: var(--accent); }
.work-section .section-heading { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 24px 50px; margin-bottom: 50px; }
.work-section .section-index { grid-column: 1 / -1; }
.section-heading h2 { margin: 0; font-size: clamp(56px, 6vw, 94px); font-weight: 500; line-height: .98; letter-spacing: -.075em; }
.section-heading h2 span { color: var(--muted); }
.section-intro { max-width: 350px; justify-self: end; margin: 0 0 7px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.project { position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(120px, 220px); align-items: center; gap: 30px; border-top: 1px solid #484942; transition: background-color .2s ease; }
.project:hover { background: rgb(255 255 255 / 2%); }
.project-featured { min-height: 280px; padding: 35px 22px 35px 0; }
.project-number { align-self: start; padding-top: 9px; color: var(--accent); font-size: 13px; }
.project-content { min-width: 0; }
.project-kicker { margin: 0 0 10px; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.project-kicker span { padding-inline: 5px; color: var(--accent); }
.project-content h3 { margin: 0 0 12px; font-size: clamp(36px, 4vw, 60px); font-weight: 500; line-height: 1; letter-spacing: -.07em; }
.project-content > p:not(.project-kicker) { max-width: 760px; margin: 0; color: #c3c4bc; font-size: 16px; line-height: 1.75; }
.project-bottom { display: flex; flex-wrap: wrap; gap: 10px 27px; margin-top: 22px; color: var(--quiet); font-size: 11px; }
.project-mark { justify-self: center; color: var(--accent); font-size: clamp(110px, 13vw, 200px); font-weight: 500; line-height: .8; letter-spacing: -.12em; transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.project:hover .project-mark { transform: translateX(6px); }
.project-mark span { color: var(--text); }
.project-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.project-small { min-height: 240px; grid-template-columns: 48px minmax(0,1fr); align-items: start; gap: 20px; padding: 31px 18px 29px 0; border-bottom: 1px solid #484942; }
.project-small .project-number { padding-top: 5px; }
.project-small .project-content h3 { font-size: clamp(30px, 3vw, 42px); }
.project-small .project-content > p:not(.project-kicker) { max-width: 420px; font-size: 14px; }
.project-link { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--accent); font-size: 13px; text-decoration: none; }
.project-link span { transition: transform .2s ease; }
.project-link:hover span { transform: translate(3px, -3px); }
.project-mark-small { position: absolute; top: 27px; right: 17px; color: #62645a; font-size: 26px; letter-spacing: -.07em; }
.project-small:hover .project-mark-small { color: var(--accent); }
.project-small .project-content { padding-right: 55px; }
.all-projects { min-height: 52px; display: inline-flex; align-items: center; gap: 10px; margin-top: 23px; color: var(--text); font-size: 13px; text-decoration: none; }
.all-projects span { color: var(--accent); transition: transform .2s ease; }
.all-projects:hover span { transform: translate(3px, -3px); }

/* About and technical skills */
.about-section { border-bottom: 1px solid var(--line); }
.about-inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(50px, 8vw, 140px); padding-block: 108px; }
.about-inner .section-heading h2, .tech-inner .section-heading h2, .experience-inner .section-heading h2 { margin-top: 29px; font-size: clamp(48px, 5.5vw, 82px); }
.about-copy { max-width: 660px; padding-top: 37px; }
.about-copy p { margin: 0 0 19px; color: #c8c9c1; font-size: 16px; line-height: 1.8; }
.about-copy .about-lead { color: var(--text); font-size: 19px; line-height: 1.7; }
.tech-section { background: var(--surface); border-bottom: 1px solid var(--line); }
.tech-inner { display: grid; grid-template-columns: .8fr 1.2fr; gap: 70px; padding-block: 100px 106px; }
.tech-inner .section-heading { align-self: start; }
.tech-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); border-top: 1px solid #484942; }
.tech-group { min-height: 158px; padding: 21px 20px 23px 0; border-bottom: 1px solid #484942; }
.tech-group:nth-child(even) { padding-left: 24px; border-left: 1px solid #484942; }
.tech-group > span { color: var(--accent); font-size: 11px; }
.tech-group h3 { margin: 13px 0 7px; font-size: 17px; font-weight: 500; }
.tech-group p { margin: 0; color: #c0c1b9; font-size: 14px; line-height: 1.75; }
.tech-group small { display: inline-block; margin-top: 5px; color: var(--quiet); font-size: 12px; }

/* Experience, education, contact */
.experience-inner { padding-block: 106px 82px; }
.experience-inner > .section-heading { margin-bottom: 48px; }
.experience-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; }
.experience-group h3 { margin: 0 0 15px; color: var(--muted); font-size: 15px; font-weight: 500; }
.experience-group article { display: grid; grid-template-columns: 125px minmax(0,1fr); gap: 18px; padding: 17px 0; border-top: 1px solid var(--line); }
.experience-group article > span { padding-top: 2px; color: var(--accent); font-size: 11px; }
.experience-group article strong { font-size: 15px; font-weight: 500; }
.experience-group article p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.experience-note { margin: 14px 0 0; color: var(--quiet); font-size: 13px; line-height: 1.7; }
.languages { display: flex; flex-wrap: wrap; gap: 14px 25px; margin: 40px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.languages > span { color: var(--accent); font-size: 11px; letter-spacing: .08em; }
.languages p { margin: 0; color: var(--muted); font-size: 14px; }
.languages b { color: var(--text); font-weight: 500; }
.contact-section { background: var(--surface); border-top: 1px solid var(--line); }
.contact-inner { padding-block: 96px 104px; }
.contact-inner h2 { margin: 29px 0 27px; font-size: clamp(58px, 7vw, 112px); font-weight: 500; line-height: .96; letter-spacing: -.08em; }
.contact-inner h2 span { color: var(--accent); }
.contact-bottom { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.contact-bottom > p { max-width: 570px; margin: 0; color: #c8c9c1; font-size: 16px; line-height: 1.75; }
.contact-bottom > div { display: flex; align-items: center; gap: 26px; }
.contact-github { min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); font-size: 12px; text-decoration: none; }
.contact-github:hover { color: var(--accent); }
.footer { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); }
.footer-brand { font-size: 13px; font-weight: 500; text-decoration: none; }
.footer-brand span { margin-left: 6px; }
.footer > span, .footer > a:last-child { color: var(--quiet); font-size: 10px; letter-spacing: .04em; text-decoration: none; }
.footer > a:last-child:hover { color: var(--accent); }

/* Progressive reveal; content remains visible without JavaScript. */
.reveal { opacity: 1; transform: none; }
.motion-ready .reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s cubic-bezier(.2,.65,.25,1); }
.motion-ready .reveal.is-visible { opacity: 1; transform: translateY(0); }
.project-pair .project:nth-child(2), .tech-group:nth-child(even) { transition-delay: .08s; }
.project-pair .project:nth-child(3), .tech-group:nth-child(odd):not(:first-child) { transition-delay: .16s; }

@media (max-width: 950px) {
  .wrap { width: min(100% - 56px, 820px); }
  .site-header { padding-inline: max(28px, calc((100% - 820px) / 2)); }
  .hero { min-height: auto; }
  .hero-inner { grid-template-columns: 1fr; gap: 54px; padding-block: 91px 72px; }
  .hero h1 { font-size: clamp(76px, 13vw, 124px); }
  .stack-visual { max-width: 650px; justify-self: start; }
  .project-featured { grid-template-columns: 58px minmax(0,1fr) 130px; gap: 20px; }
  .project-pair { gap: 0 25px; }
  .project-small { grid-template-columns: 35px minmax(0,1fr); gap: 12px; }
  .tech-inner { grid-template-columns: 1fr; gap: 40px; }
  .tech-inner .section-heading h2 { margin-top: 20px; }
  .experience-columns { gap: 36px; }
}

@media (max-width: 1100px) {
  .project-pair { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 650px) {
  html { scroll-padding-top: 72px; }
  .wrap { width: calc(100% - 40px); }
  .site-header { height: 70px; padding-inline: 20px; }
  .brand { gap: 10px; font-size: 10px; }
  .brand-mark { font-size: 16px; }
  .brand i { margin-left: 4px; font-size: 9px; }
  .menu-toggle { width: 44px; height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
  .menu-toggle span { width: 16px; height: 1px; background: var(--text); transition: transform .2s ease; }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .nav { position: absolute; top: 69px; right: 0; left: 0; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 9px 20px 18px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .nav a { min-height: 48px; }
  .nav a::after { display: none; }
  .hero { min-height: 0; }
  .hero-inner { gap: 44px; padding-block: 76px 48px; }
  .eyebrow { gap: 8px; margin-bottom: 21px; font-size: 9px; }
  .eyebrow-location { margin-left: 1px; }
  .hero h1 { font-size: clamp(64px, 17.5vw, 92px); }
  .hero-alias { margin-top: 22px; font-size: 10px; }
  .hero-summary { font-size: 16px; }
  .hero-actions { gap: 21px; margin-top: 23px; }
  .button { min-height: 48px; font-size: 13px; }
  .stack-heading { margin-bottom: 14px; font-size: 10px; }
  .stack-item { min-height: 58px; grid-template-columns: 29px minmax(0,1fr) auto; gap: 9px; }
  .stack-item > span, .stack-item small { font-size: 10px; }
  .stack-item strong { font-size: 12px; }
  .stack-caption { margin-top: 14px; font-size: 13px; }
  .hero-footer { min-height: 52px; gap: 15px; font-size: 8px; }
  .hero-footer > span { max-width: 52%; }
  .hero-footer a { gap: 5px; font-size: 8px; }
  .section-inner, .about-inner, .experience-inner { padding-block: 72px; }
  .work-section .section-heading { grid-template-columns: 1fr; gap: 17px; margin-bottom: 31px; }
  .work-section .section-index { grid-column: auto; }
  .section-heading h2 { font-size: clamp(48px, 12vw, 70px); }
  .section-intro { justify-self: start; margin: 0; font-size: 14px; }
  .project-featured { grid-template-columns: 35px minmax(0,1fr); gap: 12px; min-height: 0; padding: 25px 0; }
  .project-number { font-size: 11px; }
  .project-featured .project-content h3 { font-size: 42px; }
  .project-content > p:not(.project-kicker) { font-size: 14px; }
  .project-kicker { font-size: 9px; }
  .project-mark { display: none; }
  .project-bottom { gap: 6px 17px; font-size: 10px; }
  .project-pair { grid-template-columns: 1fr; }
  .project-small { min-height: 0; grid-template-columns: 35px minmax(0,1fr); padding: 22px 0; }
  .project-small .project-content { padding-right: 50px; }
  .project-small .project-content h3 { font-size: 32px; }
  .project-small .project-content > p:not(.project-kicker) { font-size: 13px; }
  .project-mark-small { top: 20px; right: 6px; font-size: 22px; }
  .all-projects { min-height: 46px; margin-top: 14px; font-size: 12px; }
  .about-inner { grid-template-columns: 1fr; gap: 20px; }
  .about-inner .section-heading h2, .tech-inner .section-heading h2, .experience-inner .section-heading h2 { font-size: clamp(38px, 10vw, 64px); }
  .about-copy { padding-top: 0; }
  .about-copy p { font-size: 14px; }
  .about-copy .about-lead { font-size: 16px; }
  .tech-inner { gap: 27px; padding-block: 72px; }
  .tech-grid { grid-template-columns: 1fr; }
  .tech-group { min-height: 0; padding: 16px 0 19px; }
  .tech-group:nth-child(even) { padding-left: 0; border-left: 0; }
  .tech-group h3 { margin: 8px 0 4px; font-size: 16px; }
  .tech-group p { font-size: 13px; }
  .experience-inner > .section-heading { margin-bottom: 30px; }
  .experience-columns { grid-template-columns: 1fr; gap: 32px; }
  .experience-group h3 { font-size: 14px; }
  .experience-group article { grid-template-columns: 88px minmax(0,1fr); gap: 11px; padding: 14px 0; }
  .experience-group article > span { font-size: 9px; }
  .experience-group article strong { font-size: 14px; }
  .experience-group article p { font-size: 13px; }
  .languages { gap: 8px 14px; margin-top: 28px; }
  .languages > span { width: 100%; font-size: 10px; }
  .languages p { font-size: 13px; line-height: 1.9; }
  .contact-inner { padding-block: 72px; }
  .contact-inner h2 { margin: 24px 0 20px; font-size: clamp(40px, 10.8vw, 68px); }
  .contact-bottom { align-items: flex-start; flex-direction: column; gap: 20px; }
  .contact-bottom > p { font-size: 14px; }
  .contact-bottom > div { gap: 20px; }
  .footer { min-height: 76px; flex-wrap: wrap; gap: 5px 16px; padding-block: 15px; }
  .footer-brand { font-size: 12px; }
  .footer > span { order: 3; width: 100%; font-size: 9px; }
  .footer > a:last-child { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .motion-ready .reveal { opacity: 1; transform: none; }
}
