:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --ink: #1b1e22;
  --muted: #5d646d;
  --line: #e3e5e9;
  --accent: #1f5f8b;
  --accent-ink: #17496b;
  --accent-soft: #e9f0f6;
  --on-accent: #ffffff;
  --radius: 14px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121417; --surface: #1a1d21; --ink: #e8eaed; --muted: #9aa3ad; --line: #2a2f36;
    --accent: #7fb3d9; --accent-ink: #a9cce7; --accent-soft: #1d2833; --on-accent: #0f1418;
  }
}
:root[data-theme="dark"] {
  --bg: #121417; --surface: #1a1d21; --ink: #e8eaed; --muted: #9aa3ad; --line: #2a2f36;
  --accent: #7fb3d9; --accent-ink: #a9cce7; --accent-soft: #1d2833; --on-accent: #0f1418;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; margin: 0 0 1em; }
li { margin-bottom: .35em; }
strong { font-weight: 600; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .75rem;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { font-weight: 600; color: var(--ink); letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff;
  display: inline-grid; place-items: center; font-size: .78rem; font-weight: 700; letter-spacing: .02em;
}
.nav { display: flex; gap: 6px; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: .95rem; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); text-decoration: none; }

/* Sections */
.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* Hero */
.hero { padding: 80px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero h1 { margin-bottom: .35em; }
.hero .role { font-size: 1.2rem; color: var(--muted); font-weight: 500; margin-bottom: 1.2rem; }
.hero .lead { font-size: 1.1rem; max-width: 560px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.8rem; }
.hero .facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 2rem; padding: 0; list-style: none; color: var(--muted); font-size: .95rem; }
.hero .facts li::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 9px; vertical-align: 2px; }
.portrait { border-radius: 20px; overflow: hidden; box-shadow: 0 18px 50px -24px rgba(0,0,0,.45); background: var(--surface); }
.portrait img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 20%; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 10px;
  font-weight: 600; font-size: .95rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

/* Cards */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 20px;
}
.card h3 { font-size: 1rem; margin-bottom: .45rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.card.link { transition: border-color .15s ease, transform .15s ease; }
.card.link:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: translateY(-2px); }
a.card { color: inherit; display: block; }
a.card:hover { text-decoration: none; }
.card .client { font-size: .8rem; color: var(--accent); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-bottom: .6rem; display: block; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding: 0; list-style: none; }
.tags li { font-size: .78rem; font-weight: 500; color: var(--muted); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; margin: 0; }

/* Certificates */
.cert-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 32px; }
.cert-list li { display: flex; gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; }
.cert-list .issuer { color: var(--muted); font-size: .9rem; margin-left: auto; white-space: nowrap; }

/* Contact */
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.contact-list a { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.contact-list a:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.contact-list svg { width: 22px; height: 22px; flex: none; color: var(--accent); }
.contact-list .label { font-size: .8rem; color: var(--muted); display: block; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; gap: 18px; }
.site-footer a { color: var(--muted); }

/* Projects page */
.page-head { padding: 64px 0 40px; }
.page-head p { max-width: 640px; color: var(--muted); font-size: 1.1rem; }
.project-layout { display: grid; grid-template-columns: 240px 1fr; gap: 56px; align-items: start; padding-bottom: 72px; }
.toc { position: sticky; top: 84px; font-size: .92rem; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 7px 0 7px 16px; color: var(--muted); margin-left: -1px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); text-decoration: none; border-left-color: var(--accent); }
.project { padding: 40px 0; border-top: 1px solid var(--line); scroll-margin-top: 84px; }
.project:first-of-type { border-top: 0; padding-top: 0; }
.project .meta { display: flex; flex-wrap: wrap; gap: 8px 28px; color: var(--muted); font-size: .92rem; margin: -.2rem 0 1.2rem; }
.project .meta span b { color: var(--ink); font-weight: 600; }
.project h2 { font-size: 1.55rem; }
.project h3 { font-size: 1.05rem; margin-top: 1.6rem; }
.project .result { background: var(--accent-soft); border-radius: var(--radius); padding: 18px 22px; margin-top: 1.4rem; }
.project .result p:last-child { margin: 0; }
.project .tags { margin-top: 1.2rem; }
.project ol { padding-left: 1.2em; }

/* Legal */
.legal { padding: 56px 0 80px; max-width: 720px; }
.legal h2 { font-size: 1.25rem; margin-top: 2rem; }

/* Responsive */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 36px; }
  .hero .portrait { max-width: 360px; order: -1; justify-self: start; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .project-layout { grid-template-columns: 1fr; gap: 32px; }
  .toc { position: static; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 6px; border: 0; }
  .toc a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; margin: 0; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .section { padding: 56px 0; }
  .hero { padding: 40px 0 56px; }
  .grid-3, .grid-2, .cert-list, .contact-list { grid-template-columns: 1fr; }
  .nav a { padding: 8px 10px; font-size: .9rem; }
  .site-header .brand span.name { display: none; }
}
@media print {
  .site-header, .site-footer, .hero .actions, .toc { display: none; }
  body { background: #fff; color: #000; }
}
