:root {
  --bg: #000;
  --surface: #0f1115;
  --line: #22262e;
  --text: #f2f4f7;
  --muted: #a3abb8;
  --accent: #4a90e2;
  --sans: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 1.0625rem/1.65 var(--sans);
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 40px 40px;
}
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--accent); color: #000; padding: .5rem 1rem; z-index: 2000; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
section { padding: 5rem 0; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.02em; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 2rem; max-width: 22ch; }
h3 { font-size: 1.2rem; }
.lead { color: var(--muted); font-size: 1.25rem; max-width: 56ch; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 1000; background: rgba(0,0,0,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav { max-width: 1100px; margin: 0 auto; padding: .9rem 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.brand { font: 600 1.35rem var(--sans); text-decoration: none; }
.brand span { color: var(--accent); font-family: var(--mono); font-weight: 400; }
.menu { display: flex; align-items: center; gap: 1.75rem; font-family: var(--mono); font-size: .95rem; }
.menu a { text-decoration: none; color: var(--muted); transition: color .2s; }
.menu a:hover, .menu a.active { color: var(--accent); }
.menu .menu-cta { color: #000; background: var(--accent); padding: .45rem 1rem; border-radius: 6px; }
.menu .menu-cta:hover { color: #000; background: #6aa5e8; }
.nav-toggle { display: none; background: none; border: 1px solid var(--accent); color: var(--text); border-radius: 6px; padding: .3rem .5rem; font-size: 1.6rem; line-height: 1; cursor: pointer; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2rem; }
.btn { display: inline-block; padding: .8rem 1.4rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-weight: 500; transition: border-color .2s, background .2s; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #000; }
.btn.primary:hover { background: #6aa5e8; }

/* Hero */
.hero { padding: 7rem 0 4rem; }
.hero h1 { font-size: clamp(2.6rem, 8vw, 5.5rem); font-weight: 600; margin-bottom: 1.5rem; }
.stats { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.stats strong { display: block; font: 500 2rem var(--mono); color: var(--accent); }
.stats span { color: var(--muted); font-size: .95rem; }

/* About */
.about { display: grid; grid-template-columns: 320px 1fr; gap: 3.5rem; align-items: center; }
.portrait { width: 320px; height: 320px; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); }
.prose p { color: var(--muted); max-width: 62ch; margin: 0 0 1rem; }

/* Cards */
.cards.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.75rem; transition: border-color .2s; }
.card:hover { border-color: var(--accent); }
.card > i { font-size: 2rem; color: var(--accent); display: block; margin-bottom: 1rem; }
.card h3 { margin-bottom: .6rem; }
.card p { color: var(--muted); margin: 0; font-size: 1rem; }
.project { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.project img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-bottom: 1px solid var(--line); }
.project .body { padding: 1.5rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.project .role { color: var(--accent); font: .9rem var(--mono); }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .75rem; }
.tags li, .pills li { border: 1px solid var(--line); border-radius: 999px; padding: .2rem .8rem; font: .85rem var(--mono); color: var(--muted); }
.more { color: var(--accent); text-decoration: none; font-weight: 500; }
.more:hover { text-decoration: underline; }

/* Skills */
.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2rem 2.5rem; }
.skill-groups h3 { font-size: 1rem; color: var(--muted); font-weight: 500; margin-bottom: .75rem; }
.pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.pills li { color: var(--text); background: var(--surface); }

/* Contact and footer */
.contact { text-align: left; }
.contact h2 { max-width: 18ch; }
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; color: var(--muted); font-size: .95rem; }
.foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.foot p { margin: 0; }
.socials { display: flex; gap: 1rem; }
.socials i { font-size: 1.75rem; color: var(--text); transition: color .2s; }
.socials a:hover i { color: var(--accent); }

/* Reveal (set by JS only when motion is allowed) */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease, border-color .2s; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .reveal { opacity: 1; transform: none; transition: none; } }

/* Tablet and mobile */
@media (max-width: 900px) {
  .cards.three { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; gap: 2rem; }
  .portrait { width: 220px; height: 220px; }
}
@media (max-width: 760px) {
  section { padding: 3.5rem 0; }
  .hero { padding: 4rem 0 2.5rem; }
  .nav-toggle { display: block; }
  .menu { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 0; background: #000; border-bottom: 1px solid var(--line); padding: .5rem 1.5rem 1rem; }
  .menu.open { display: flex; }
  .menu li { width: 100%; }
  .menu a { display: block; padding: .8rem 0; }
  .menu .menu-cta { display: inline-block; margin-top: .5rem; padding: .6rem 1rem; }
  .stats { gap: 1.5rem; }
}
