:root {
  --bg: #0A1120;
  --bg-2: #0F1829;
  --panel: #121C30;
  --line: #22304A;
  --line-2: #2E3F5E;
  --text: #E4EAF4;
  --muted: #8E9BB2;
  --accent: #5DB4FF;
  --amber: #F2B84B;
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 6px;
  --s1: .5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2.5rem; --s5: 4rem; --s6: 6rem;
  --wrap: 1140px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
p { margin: 0; }
.mono { font-family: var(--mono); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s3); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--bg); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 46px; padding: 0 1.25rem; border-radius: var(--r);
  font: 500 .95rem/1 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s;
}
.btn-sm { min-height: 38px; padding: 0 .9rem; font-size: .875rem; }
.btn-primary { background: var(--accent); color: #06101F; }
.btn-primary:hover { background: #86C7FF; }
.btn-ghost { border-color: var(--line-2); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(10, 17, 32, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font: 500 1rem var(--mono); text-decoration: none; color: var(--text); }
.brand .prompt { color: var(--muted); }
.brand .dot { color: var(--amber); }
.nav { display: flex; align-items: center; gap: var(--s3); }
.nav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: .95rem; padding: .4rem 0; }
.nav a:not(.btn):hover { color: var(--text); }
.menu-btn { display: none; }

/* Hero */
.hero { padding: var(--s5) 0 var(--s4); background:
  linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 48px 48px,
  linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 48px 48px;
  background-color: var(--bg);
  position: relative; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 40%, transparent 0%, var(--bg) 75%); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--s4); align-items: center; }
.status { display: inline-flex; align-items: center; gap: .6rem; font: 400 .85rem var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: .35rem .85rem; background: var(--bg-2); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #4ADE9B; box-shadow: 0 0 0 0 rgba(74, 222, 155, .6); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(74, 222, 155, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 155, 0); } }
h1 { font-size: clamp(2.75rem, 7vw, 5rem); font-weight: 700; margin-top: var(--s3); letter-spacing: -.035em; }
.role { font: 500 clamp(1rem, 2vw, 1.2rem) var(--mono); color: var(--amber); margin-top: var(--s1); }
.lede { color: var(--muted); font-size: 1.15rem; max-width: 52ch; margin-top: var(--s3); }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: var(--s4); }
.socials { list-style: none; padding: 0; margin: var(--s3) 0 0; display: flex; flex-wrap: wrap; gap: var(--s3); }
.socials a { color: var(--muted); text-decoration: none; font: .9rem var(--mono); }
.socials a:hover { color: var(--accent); }

.portrait { margin: 0; justify-self: end; width: 100%; max-width: 400px; }
.portrait-frame { aspect-ratio: 1; border: 1px solid var(--line-2); border-radius: var(--r); background: linear-gradient(160deg, #1A2A47 0%, #0F1829 70%); overflow: hidden; position: relative; }
.portrait-frame::before { content: ""; position: absolute; left: 50%; bottom: -30%; width: 90%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, rgba(93, 180, 255, .28), transparent 65%); }
.portrait-frame img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.portrait figcaption { margin-top: .75rem; font-size: .82rem; color: var(--muted); }
.portrait .k, .k { color: var(--accent); margin-right: .5rem; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: var(--s5) 0 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); }
.stats > div { padding: var(--s3); border-left: 1px solid var(--line); display: flex; flex-direction: column-reverse; }
.stats > div:first-child { border-left: 0; }
.stats dt { color: var(--muted); font-size: .9rem; }
.stats dd { margin: 0; font: 600 2.25rem/1.1 var(--font); letter-spacing: -.03em; }

/* Sections */
.section { padding: var(--s6) 0; border-top: 1px solid var(--line); }
.sec-num { display: block; font-size: .85rem; color: var(--amber); margin-bottom: .75rem; }
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 600; }
.sec-sub { color: var(--muted); margin-top: var(--s2); max-width: 32ch; }
.two-col { display: grid; grid-template-columns: 1fr 1.6fr; gap: var(--s5); align-items: start; }
.two-col .sec-head { position: sticky; top: 100px; }
.prose p { color: #C3CCDB; max-width: 68ch; }
.prose p + p { margin-top: var(--s2); }

/* Projects */
.sec-head-row { display: flex; justify-content: space-between; align-items: end; gap: var(--s3); flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { font: 500 .875rem var(--font); color: var(--muted); background: transparent; border: 1px solid var(--line-2); border-radius: 999px; min-height: 38px; padding: 0 .9rem; cursor: pointer; transition: all .15s; }
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .count { font-family: var(--mono); font-size: .75rem; opacity: .65; margin-left: .2rem; }
.filter-status { color: var(--muted); font-size: .82rem; margin: var(--s3) 0 var(--s2); }

.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.project { background: var(--bg); display: flex; flex-direction: column; transition: background .2s; }
.project:hover { background: var(--bg-2); }
.project[hidden] { display: none; }
.project.reveal { animation: reveal .35s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.shot { aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--panel); }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s; }
.project:hover .shot img { transform: scale(1.03); }
.project-body { padding: var(--s3); display: flex; flex-direction: column; gap: .75rem; flex: 1; }
.meta { display: flex; justify-content: space-between; font-size: .8rem; }
.meta .cat { color: var(--accent); }
.meta .idx { color: var(--muted); }
.project h3 { font-size: 1.3rem; font-weight: 600; }
.project-body > p:not(.meta) { color: var(--muted); font-size: 1rem; }
.tags { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-wrap: wrap; gap: .4rem; padding-top: .5rem; }
.tags li { font: .78rem var(--mono); color: #B6C2D6; border: 1px solid var(--line-2); border-radius: 4px; padding: .2rem .5rem; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-2); }
.job { position: relative; padding: 0 0 var(--s5) var(--s4); }
.job:last-child { padding-bottom: 0; }
.job::before { content: ""; position: absolute; left: -6px; top: .45rem; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.job:first-child::before { background: var(--accent); }
.when { font-size: .82rem; color: var(--muted); }
.job h3 { font-size: 1.35rem; font-weight: 600; margin: .3rem 0 var(--s2); }
.points { margin: 0 0 var(--s2); padding-left: 1.1rem; color: #C3CCDB; }
.points li { margin-bottom: .55rem; max-width: 68ch; }
.points li::marker { color: var(--amber); }
.points strong { color: var(--text); font-weight: 600; }

/* Skills */
.skills { margin: var(--s4) 0 0; border-top: 1px solid var(--line); }
.skills > div { display: grid; grid-template-columns: 240px 1fr; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.skills dt { font: 500 .9rem var(--mono); color: var(--accent); padding-top: .1rem; }
.skills dd { margin: 0; color: #C3CCDB; }
.creds { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-top: var(--s5); }
.cred { border-top: 2px solid var(--amber); padding-top: var(--s2); }
.cred-year { font-size: .8rem; color: var(--muted); }
.cred h3 { font-size: 1.1rem; font-weight: 600; margin: .35rem 0; }
.cred p:last-child { color: var(--muted); font-size: .95rem; }

/* Contact */
.contact { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%); }
.contact h2 { font-size: clamp(2.2rem, 6vw, 3.75rem); max-width: 18ch; }
.contact-lede { color: var(--muted); font-size: 1.15rem; max-width: 56ch; margin-top: var(--s3); }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s4); }
.email { font: 500 clamp(1.05rem, 3vw, 1.6rem) var(--mono); color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(93, 180, 255, .35); word-break: break-all; }
.email:hover { border-color: var(--accent); }
.copy-status { font-size: .82rem; color: #4ADE9B; min-height: 1em; }
.contact-links { list-style: none; padding: 0; margin: var(--s5) 0 0; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); }
.contact-links a { display: flex; flex-direction: column; gap: .25rem; padding: var(--s3) var(--s2) var(--s3) 0; text-decoration: none; color: var(--text); font-weight: 500; min-height: 44px; }
.contact-links a:hover { color: var(--accent); }
.contact-links .mono { font-size: .78rem; color: var(--muted); font-weight: 400; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: var(--s3) 0; font-size: .8rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }
.built { opacity: .75; }

/* Responsive */
@media (max-width: 960px) {
  .two-col { grid-template-columns: 1fr; gap: var(--s4); }
  .two-col .sec-head { position: static; }
  .contact-links { grid-template-columns: repeat(3, 1fr); }
  .creds { grid-template-columns: 1fr; gap: var(--s3); }
}

@media (max-width: 760px) {
  :root { --s5: 3rem; --s6: 4rem; }
  .wrap { padding: 0 1.15rem; }
  .menu-btn { display: inline-flex; flex-direction: column; justify-content: center; gap: 6px; width: 44px; height: 44px; background: transparent; border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer; align-items: center; }
  .menu-btn span { display: block; width: 18px; height: 2px; background: var(--text); transition: transform .2s; }
  .menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav { position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: .5rem 1.15rem 1.15rem; display: none; }
  .nav.open { display: flex; }
  .nav a:not(.btn) { padding: .85rem 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .nav .btn { margin-top: 1rem; }

  .hero { padding-top: var(--s4); }
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { justify-self: start; max-width: 260px; order: -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .projects { grid-template-columns: 1fr; }
  .job { padding-left: var(--s3); }
  .skills > div { grid-template-columns: 1fr; gap: .25rem; }
  .contact-links { grid-template-columns: 1fr 1fr; }
}
