:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #16181d;
  --muted: #5b6070;
  --line: #e2ded4;
  --accent: #1f6f5c;
  --accent-soft: #e3efe9;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111317;
    --surface: #181b21;
    --ink: #ecebe6;
    --muted: #9ca1ad;
    --line: #2a2e36;
    --accent: #6fcfb2;
    --accent-soft: #1b2c27;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #111317;
  --surface: #181b21;
  --ink: #ecebe6;
  --muted: #9ca1ad;
  --line: #2a2e36;
  --accent: #6fcfb2;
  --accent-soft: #1b2c27;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 6px;
}
.skip:focus { left: 16px; z-index: 10; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top__row { display: flex; align-items: center; gap: 24px; height: 60px; }
.mark {
  font: 500 15px var(--mono); text-decoration: none; letter-spacing: .04em;
  border: 1.5px solid var(--ink); border-radius: 6px; padding: 2px 7px;
}
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { text-decoration: none; font-size: 14px; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.theme {
  background: none; border: 1px solid var(--line); border-radius: 50%;
  width: 34px; height: 34px; display: grid; place-items: center;
  color: var(--ink); cursor: pointer;
}

/* Hero */
.hero { padding: 96px 0 72px; }
.eyebrow { font: 500 13px var(--mono); color: var(--accent); letter-spacing: .02em; }
.hero h1 {
  font: 400 clamp(36px, 6vw, 64px)/1.08 var(--serif);
  letter-spacing: -.01em; margin: 18px 0 22px; max-width: 22ch;
}
.hero h1 em { color: var(--accent); }
.lede { max-width: 62ch; color: var(--muted); font-size: 17px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  text-decoration: none; font-weight: 500; font-size: 15px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); transition: border-color .15s, transform .15s;
}
.btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn--solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.facts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line);
}
.facts dt { font: 400 44px/1 var(--serif); color: var(--accent); }
.facts dd { color: var(--muted); font-size: 14px; margin-top: 8px; max-width: 26ch; }

/* Sections */
.section { padding: 72px 0; border-top: 1px solid var(--line); }
.section__title {
  font: 400 clamp(30px, 4vw, 42px)/1.1 var(--serif); margin-bottom: 40px;
  display: flex; align-items: baseline; gap: 14px;
}
.section__title span { font: 500 13px var(--mono); color: var(--muted); }
.section__intro { color: var(--muted); max-width: 60ch; margin: -20px 0 32px; }

.tag { font: 500 12px var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.stack { font: 13px var(--mono); color: var(--muted); margin-top: 14px; }

/* Featured */
.feature {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center;
  padding: 40px 0;
}
.feature + .feature { border-top: 1px dashed var(--line); }
.feature--flip .feature__text { order: 2; }
.feature h3 { font: 400 34px/1.15 var(--serif); margin: 8px 0 12px; }
.feature p { color: var(--muted); }
.points { margin: 16px 0 0 18px; color: var(--ink); }
.points li { margin: 6px 0; font-size: 15px; }
.points li::marker { color: var(--accent); }
.link {
  display: inline-block; margin-top: 18px; font-weight: 600;
  color: var(--accent); text-decoration: none; border-bottom: 1.5px solid currentColor;
}

.shot {
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  background: var(--surface); box-shadow: 0 18px 40px -24px rgb(0 0 0 / .35);
}
.shot img { width: 100%; height: auto; }
.shot--square img { aspect-ratio: 4 / 3; object-fit: cover; }

.diagram {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  font: 13px var(--mono); text-align: center;
}
.node { border: 1px solid var(--line); border-radius: 8px; padding: 12px 8px; background: var(--bg); }
.node--main { grid-column: 1 / -1; background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.node--db { grid-column: 1 / -1; border-style: dashed; }
.arrow { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.card {
  display: block; text-decoration: none; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 22px;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h4 { font: 400 24px/1.2 var(--serif); margin: 6px 0 8px; }
.card p:not(.tag):not(.stack) { color: var(--muted); font-size: 14.5px; }

/* Timeline */
.timeline { list-style: none; counter-reset: step; display: grid; gap: 10px; }
.timeline li { counter-increment: step; }
.timeline a {
  display: grid; grid-template-columns: 44px 220px 1fr; align-items: baseline; gap: 12px;
  text-decoration: none; padding: 16px 18px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); transition: border-color .15s;
}
.timeline a::before { content: "0" counter(step); font: 500 13px var(--mono); color: var(--accent); }
.timeline a:hover { border-color: var(--accent); }
.timeline span { font: 400 22px var(--serif); }
.timeline small { color: var(--muted); font-size: 14px; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 32px; }
.skills h4 { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 6px; }

/* Contact */
.contact__lead { color: var(--muted); max-width: 52ch; }
.contact__mail {
  display: inline-block; margin-top: 20px; font: 400 clamp(24px, 4.4vw, 44px) var(--serif);
  text-decoration: none; border-bottom: 2px solid var(--accent); overflow-wrap: anywhere;
}
.contact__links { margin-top: 18px; }
.contact__links a { color: var(--muted); }

.foot { padding: 32px 0 48px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* Startup pitch */
.subhead { font: 400 26px/1.2 var(--serif); margin: 48px 0 16px; }
.photo { margin: 0; }
.photo img {
  width: 100%; height: auto; object-fit: cover; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface);
}
.photo figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.photo--wide img { aspect-ratio: 16 / 9; }
.startup {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start;
  margin-top: 40px;
}
.startup h3 { font: 400 32px/1.15 var(--serif); margin: 8px 0 14px; }
.startup__text p { color: var(--muted); margin-bottom: 12px; }
.startup__text p strong { color: var(--ink); font-weight: 600; }
.startup .photo img { height: auto; object-fit: contain; }
.cta--tight { margin-top: 20px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.photos .photo img { aspect-ratio: 4 / 3; }
.slides {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 10px; outline-offset: 4px;
}
.slides img {
  flex: 0 0 min(560px, 86%); aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line); scroll-snap-align: start;
}
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.hint a { color: var(--accent); }

/* Certifications */
.certs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cert {
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; transition: border-color .15s, transform .15s;
}
.cert:hover { border-color: var(--accent); transform: translateY(-2px); }
.cert img { aspect-ratio: 1.41; object-fit: cover; border-bottom: 1px solid var(--line); }
.cert span { padding: 14px 16px; display: grid; gap: 4px; }
.cert strong { font-weight: 600; font-size: 15px; }
.cert small { color: var(--muted); font-size: 13px; }

/* Responsive */
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; gap: 28px; }
  .feature--flip .feature__text { order: 0; }
  .grid, .skills { grid-template-columns: 1fr 1fr; }
  .startup { grid-template-columns: 1fr; gap: 28px; }
  .photos, .certs { grid-template-columns: 1fr 1fr; }
  .timeline a { grid-template-columns: 36px 1fr; }
  .timeline small { grid-column: 2; }
}

@media (max-width: 560px) {
  .nav { display: none; }
  .theme { margin-left: auto; }
  .hero { padding: 56px 0 48px; }
  .facts, .grid, .skills, .photos, .certs { grid-template-columns: 1fr; }
  .facts { gap: 18px; margin-top: 44px; }
  .section { padding: 56px 0; }
  .diagram { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
