:root {
  --bg: #0b0c0f;
  --surface: #12141a;
  --line: #20232c;
  --text: #b9bfcb;
  --bright: #f2f4f8;
  --muted: #7b8394;
  --accent: #5eead4;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius: 12px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
.wrap { width: min(1080px, 100% - 3rem); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: .85rem; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 10; background: rgb(11 12 15 / .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.logo { font: 400 1.6rem var(--serif); color: var(--bright); }
.menu { display: flex; align-items: center; gap: 2rem; font-size: .9rem; }
.menu a:not(.btn):hover { color: var(--bright); }
.nav-toggle { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--bright); margin: 5px 0; transition: transform .25s; }

/* Buttons */
.btn { display: inline-flex; align-items: center; padding: .7rem 1.4rem; border: 1px solid var(--line); border-radius: 999px; color: var(--bright); font: 500 .9rem var(--sans); background: none; cursor: pointer; transition: border-color .2s, background .2s; }
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--bright); color: var(--bg); border-color: var(--bright); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--bright); border-color: transparent; }
.btn-sm { padding: .4rem 1rem; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 4rem; align-items: center; padding-block: 6rem 4rem; }
.eyebrow { display: flex; align-items: center; gap: .6rem; font: 400 .8rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1.5rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgb(94 234 212 / .15); }
h1 { font: 400 clamp(3rem, 7vw, 5.2rem)/1 var(--serif); color: var(--bright); letter-spacing: -.01em; }
.role { font: italic 400 1.5rem var(--serif); color: var(--accent); margin-top: .8rem; }
.lead { margin-top: 1.8rem; max-width: 34rem; font-size: 1.05rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.2rem; }
.portrait img { border-radius: var(--radius); border: 1px solid var(--line); aspect-ratio: 4/5; object-fit: cover; filter: grayscale(.2); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); }
.stats div { padding: 1.6rem 0; display: flex; flex-direction: column; gap: .2rem; }
.stats strong { font: 400 2.2rem/1 var(--serif); color: var(--bright); }
.stats span { font: 400 .75rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* Sections */
.section { padding-block: 6rem 0; }
h2 { font: 400 clamp(2rem, 4vw, 2.8rem)/1.1 var(--serif); color: var(--bright); margin-bottom: 3rem; display: flex; align-items: baseline; gap: 1rem; }
.num { font: 400 .85rem var(--mono); color: var(--accent); }
h3 { font: 500 1rem var(--sans); color: var(--bright); }

.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 4rem; }
.prose p + p { margin-top: 1.2rem; }
.timeline { border-left: 1px solid var(--line); padding-left: 1.6rem; display: grid; gap: 1.6rem; align-self: start; }
.timeline li { position: relative; display: flex; flex-direction: column; }
.timeline li::before { content: ''; position: absolute; left: calc(-1.6rem - 4px); top: .55rem; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline strong { color: var(--bright); font-weight: 500; }
.timeline span { font-size: .9rem; color: var(--muted); }

/* Skills */
.skills { display: grid; grid-template-columns: 1fr 1.2fr; gap: 4rem; }
.bars { display: grid; gap: 1.3rem; align-content: start; }
.bar-head { display: flex; justify-content: space-between; margin-bottom: .45rem; color: var(--bright); font-size: .9rem; }
.track { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.track i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 1.1s cubic-bezier(.22, 1, .36, 1); }
.in .track i { width: var(--w); }
.note { font-size: .8rem; color: var(--muted); margin-top: .5rem; }
.groups { display: grid; gap: 1.6rem; }
.group h3 { font: 400 .75rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .7rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li { padding: .25rem .8rem; border: 1px solid var(--line); border-radius: 999px; font-size: .82rem; }
.chips.small li { font: 400 .72rem var(--mono); padding: .15rem .6rem; color: var(--muted); }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); gap: 1.2rem; }
.card { display: flex; flex-direction: column; gap: 1rem; padding: 1.6rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .25s, transform .25s; }
.card:hover { border-color: var(--accent); transform: translateY(-3px); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.card h3 { font: 400 1.35rem var(--serif); word-break: break-word; }
.card p { font-size: .92rem; flex: 1; }
.badge { font: 400 .68rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); border: 1px solid rgb(94 234 212 / .35); border-radius: 999px; padding: .1rem .6rem; white-space: nowrap; }
.go { font-size: .82rem; color: var(--muted); }
.card:hover .go { color: var(--accent); }
.more { margin-top: 2rem; text-align: right; }
.more a:hover, .link:hover { color: var(--accent); }

/* Documents */
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 1.2rem; }
.doc { display: flex; flex-direction: column; align-items: flex-start; gap: .7rem; padding: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.doc h3 { font: 400 1.25rem/1.25 var(--serif); }
.doc p { flex: 1; font-size: .85rem; color: var(--muted); }
.doc-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; }

/* Gallery */
.gallery { columns: 3 220px; column-gap: 1rem; }
.shot { display: block; width: 100%; padding: 0; margin: 0 0 1rem; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); cursor: zoom-in; break-inside: avoid; }
.shot img { width: 100%; height: auto; transition: transform .5s, opacity .3s; }
.shot:hover img { transform: scale(1.03); }
dialog { border: 0; padding: 0; background: none; max-width: 94vw; max-height: 94vh; }
dialog::backdrop { background: rgb(0 0 0 / .88); }
dialog img { max-width: 94vw; max-height: 90vh; border-radius: var(--radius); }
dialog button { position: absolute; top: .6rem; right: .6rem; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 0; background: rgb(0 0 0 / .6); color: #fff; cursor: pointer; font-size: 1rem; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 4rem; }
.big { font: 400 2rem/1.2 var(--serif); color: var(--bright); margin-bottom: 1rem; }
.contact .prose { margin-bottom: 1.5rem; }
.links { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 1rem; }
.link { color: var(--bright); border-bottom: 1px solid var(--line); padding-bottom: 2px; }
form { display: grid; gap: 1.1rem; }
label { display: grid; gap: .4rem; font-size: .85rem; color: var(--muted); }
input, textarea { width: 100%; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--bright); font: inherit; resize: vertical; transition: border-color .2s; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
.hp { position: absolute; left: -9999px; }
form .btn { justify-self: start; }
.status { min-height: 1.4rem; font-size: .88rem; }
.status.ok { color: var(--accent); }
.status.err { color: #f87171; }

/* Footer */
.foot { margin-top: 7rem; border-top: 1px solid var(--line); }
.foot-in { display: flex; justify-content: space-between; padding-block: 2rem; font-size: .85rem; color: var(--muted); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s, transform .8s cubic-bezier(.22, 1, .36, 1); }
.reveal.in { opacity: 1; transform: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 860px) {
  .hero, .about, .skills, .contact { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero { padding-block: 3.5rem 2rem; }
  .portrait { order: -1; max-width: 18rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .section { padding-top: 4.5rem; }
  .nav-toggle { display: block; }
  .menu { position: absolute; top: 4rem; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 1.2rem; padding: 1.5rem; background: var(--bg); border-bottom: 1px solid var(--line); display: none; }
  .menu.open { display: flex; }
}

@media (max-width: 560px) {
  .wrap { width: min(1080px, 100% - 2rem); }
  .hero { padding-block: 2.5rem 1.5rem; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
  .stats strong { font-size: 1.8rem; }
  .section { padding-top: 3.5rem; }
  h2 { margin-bottom: 2rem; }
  .big { font-size: 1.6rem; }
  .foot-in { flex-direction: column; gap: .4rem; }
}

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