:root {
  --bg: #f5f5f7;
  --bg-solid: #ffffff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-alt: #ffffff;
  --card: rgba(255, 255, 255, 0.86);
  --text: #1d1d1f;
  --secondary: #6e6e73;
  --accent: #0071e3;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --hairline: rgba(0, 0, 0, 0.1);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.06);
  --glass: rgba(245, 245, 247, 0.72);
  --glass-solid: rgba(255, 255, 255, 0.86);
  --radius: 22px;
  font-synthesis: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-solid: #000000;
    --surface: rgba(28, 28, 30, 0.66);
    --surface-alt: #0b0b0d;
    --card: rgba(28, 28, 30, 0.72);
    --text: #f5f5f7;
    --secondary: #a1a1a6;
    --accent: #0a84ff;
    --accent-soft: rgba(10, 132, 255, 0.14);
    --hairline: rgba(255, 255, 255, 0.12);
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
    --glass: rgba(0, 0, 0, 0.66);
    --glass-solid: rgba(18, 18, 20, 0.86);
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
button { font: inherit; }

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

.shell {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 180ms ease-out;
}
.skip-link:focus { transform: translateY(0); }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: background 260ms ease, border-color 260ms ease, box-shadow 260ms ease;
}
.site-header.is-scrolled {
  background: var(--glass-solid);
  border-bottom-color: var(--hairline);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0a84ff, #0066cc);
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.02em;
}
.brand-name { font-size: 15px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}
.nav-links a {
  color: var(--secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 520;
  transition: color 180ms ease;
}
.nav-links a:hover { color: var(--text); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: transform 120ms ease-out, filter 180ms ease;
}
.nav-cta:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .nav-cta:hover { filter: brightness(1.08); }
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 7px 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.menu-toggle-bars { display: grid; gap: 3px; width: 14px; }
.menu-toggle-bars i {
  display: block;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.menu-toggle[aria-expanded="true"] .menu-toggle-bars i:first-child { transform: translateY(2.25px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars i:last-child { transform: translateY(-2.25px) rotate(-45deg); }

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(88px, 13vw, 168px) 0 72px;
  text-align: center;
}
.hero-glow {
  position: absolute;
  inset: -40% 0 auto;
  height: 780px;
  background:
    radial-gradient(ellipse 42% 42% at 50% 42%, var(--accent-soft), transparent 70%),
    radial-gradient(ellipse 30% 30% at 72% 28%, rgba(255, 45, 85, 0.08), transparent 72%);
  filter: blur(14px);
  pointer-events: none;
}
.hero-inner { position: relative; }

.eyebrow, .kicker {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0; font-weight: 680; }

h1 {
  font-size: clamp(3.5rem, 11vw, 7.25rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.hero-lead {
  max-width: 760px;
  margin: 28px auto 0;
  color: var(--secondary);
  font-size: clamp(1.05rem, 2.1vw, 1.4rem);
  line-height: 1.45;
  letter-spacing: -0.012em;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease-out, background 200ms ease, color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.button:active { transform: scale(0.98); }
.button-primary { background: var(--accent); color: #fff; }
.button-secondary {
  background: var(--card);
  border-color: var(--hairline);
  color: var(--text);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.button-quiet { background: transparent; color: var(--secondary); }
@media (hover: hover) and (pointer: fine) {
  .button-primary:hover { filter: brightness(1.08); box-shadow: 0 8px 24px rgba(0, 113, 227, 0.24); }
  .button-secondary:hover { border-color: var(--accent); color: var(--accent); }
  .button-quiet:hover { color: var(--text); }
}

.contact-line {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
  color: var(--secondary);
  font-size: 14px;
}
.contact-line a { text-decoration-color: var(--hairline); text-underline-offset: 3px; }
.contact-line a:hover { color: var(--accent); }
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--secondary); opacity: 0.55; }
.portfolio-line { margin: 10px 0 0; color: var(--secondary); font-size: 13px; }
.portfolio-line a { text-decoration-color: var(--hairline); text-underline-offset: 3px; }

/* Proof strip */

.proof {
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-block: 1px solid var(--hairline);
}
.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.proof-item {
  padding: 32px 28px;
  border-right: 1px solid var(--hairline);
}
.proof-item:last-child { border-right: 0; }
.proof-item strong {
  display: block;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 680;
  white-space: nowrap;
}
.proof-item .unit { font-size: 0.55em; letter-spacing: -0.02em; color: var(--secondary); }
.proof-item span:last-child {
  display: block;
  margin-top: 12px;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.5;
}

/* Sections */

.section { padding: clamp(72px, 10vw, 120px) 0; }
.section-alt { background: var(--surface-alt); }

.section-grid {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: clamp(40px, 6vw, 88px);
  align-items: start;
}
.section-head h2 {
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.038em;
}
.section-head.wide { max-width: 720px; margin-bottom: 52px; }
.section-intro {
  margin: 16px 0 0;
  color: var(--secondary);
  font-size: 17px;
  line-height: 1.6;
}
.prose p {
  margin: 0 0 20px;
  color: var(--secondary);
  font-size: 17px;
  line-height: 1.75;
}
.prose p:last-child { margin-bottom: 0; }

/* Timeline */

.timeline {
  border-left: 1px solid var(--hairline);
}
.role {
  position: relative;
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 40px;
  padding: 36px 0 36px 40px;
  border-bottom: 1px solid var(--hairline);
}
.role:last-child { border-bottom: 0; }
.role::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 45px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--bg);
}
.section-alt .role::before { box-shadow: 0 0 0 5px var(--surface-alt); }

.role-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 3px;
  color: var(--secondary);
  font-size: 13px;
}
.role-meta span:first-child { color: var(--text); font-weight: 620; }
.role-content h3 {
  margin-bottom: 18px;
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  letter-spacing: -0.022em;
  line-height: 1.25;
}
.role-content h3 em { color: var(--secondary); font-size: 0.78em; font-style: normal; font-weight: 520; }
.role-content ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.role-content li {
  position: relative;
  margin-bottom: 11px;
  padding-left: 20px;
  color: var(--secondary);
  font-size: 15.5px;
  line-height: 1.62;
}
.role-content li:last-child { margin-bottom: 0; }
.role-content li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

/* Cards */

.skill-grid, .work-grid {
  display: grid;
  gap: 14px;
}
.skill-grid { grid-template-columns: repeat(3, 1fr); }
.work-grid { grid-template-columns: repeat(2, 1fr); }

.skill-card, .work-card {
  position: relative;
  padding: 26px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 260ms ease, border-color 260ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .skill-card:hover, .work-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: rgba(0, 113, 227, 0.28);
  }
}
.skill-card h3, .work-card h3 {
  font-size: 16px;
  letter-spacing: -0.012em;
}
.skill-card p, .work-card p {
  margin: 12px 0 0;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.62;
}
.work-card { min-height: 180px; }
.work-card::after {
  content: "";
  position: absolute;
  left: 26px;
  right: 26px;
  top: 0;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.work-index {
  display: block;
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

/* Contact */

.contact {
  padding: clamp(88px, 12vw, 140px) 0;
  text-align: center;
  background: linear-gradient(180deg, var(--bg), var(--surface));
  border-top: 1px solid var(--hairline);
}
.contact-inner { max-width: 760px; }
.contact h2 {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.contact-copy {
  margin: 20px auto 0;
  max-width: 600px;
  color: var(--secondary);
  font-size: 17px;
  line-height: 1.6;
}
.contact-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}
.contact-small { margin: 28px 0 0; color: var(--secondary); font-size: 13px; }
.contact-small a { text-decoration-color: var(--hairline); text-underline-offset: 3px; }

/* Footer */

.site-footer { border-top: 1px solid var(--hairline); }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 26px;
  color: var(--secondary);
  font-size: 13px;
}
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--accent); }

/* Reveal */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Responsive */

@media (max-width: 900px) {
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
  .proof-item:nth-child(2) { border-right: 0; }
  .proof-item:nth-child(-n+2) { border-bottom: 1px solid var(--hairline); }
  .section-grid { grid-template-columns: 1fr; gap: 28px; }
  .skill-grid { grid-template-columns: repeat(2, 1fr); }
  .role { grid-template-columns: 150px 1fr; gap: 24px; }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 32px, 1120px); }
  .menu-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    display: grid;
    gap: 0;
    margin: 0;
    padding: 8px 16px 16px;
    background: var(--glass-solid);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--hairline);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 220ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), visibility 220ms;
  }
  .nav-links.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav-links a { padding: 12px 4px; border-bottom: 1px solid var(--hairline); font-size: 15px; }
  .nav-links a:last-child { border-bottom: 0; }
  .nav { gap: 14px; }
  .brand-name { display: none; }

  .hero { padding-top: 76px; }
  .proof-item { padding: 24px 18px; }
  .skill-grid, .work-grid { grid-template-columns: 1fr; }
  .role { grid-template-columns: 1fr; gap: 10px; padding: 30px 0 30px 26px; }
  .role::before { top: 36px; }
  .role-meta { flex-direction: row; flex-wrap: wrap; gap: 6px 12px; }
  .role-meta span:first-child::after { content: " ·"; color: var(--secondary); }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 440px) {
  .proof-grid { grid-template-columns: 1fr; }
  .proof-item { border-right: 0; border-bottom: 1px solid var(--hairline); }
  .proof-item:last-child { border-bottom: 0; }
  .contact-line .dot { display: none; }
  .hero-actions .button { flex: 1 1 140px; }
}

/* User preferences */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: opacity 160ms ease; }
  .button, .nav-cta, .skill-card, .work-card, .skip-link { transition: background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease; }
  .button:active, .nav-cta:active { transform: none; }
  @media (hover: hover) and (pointer: fine) {
    .skill-card:hover, .work-card:hover { transform: none; }
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header, .site-header.is-scrolled, .nav-links {
    background: var(--bg-solid);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .button-secondary, .skill-card, .work-card, .proof { background: var(--bg-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --secondary: #3a3a3c; --hairline: rgba(0, 0, 0, 0.28); }
  @media (prefers-color-scheme: dark) {
    :root { --secondary: #e1e1e6; --hairline: rgba(255, 255, 255, 0.34); }
  }
}

/* Print */

@page { size: A4; margin: 15mm; }

@media print {
  :root { --bg: #fff; --surface: #fff; --surface-alt: #fff; --card: #fff; --text: #000; --secondary: #333; --hairline: #ccc; --accent: #000; }
  html { scroll-behavior: auto; }
  body { font-size: 10.5pt; background: #fff; color: #000; }
  .site-header, .hero-glow, .hero-actions, .menu-toggle, .nav-links, .contact-actions, .site-footer, .skip-link { display: none !important; }
  .shell { width: 100%; }
  .hero { padding: 0 0 8mm; text-align: left; }
  h1 { font-size: 30pt; }
  .hero-lead { font-size: 11pt; margin-top: 6mm; }
  .contact-line, .portfolio-line { justify-content: flex-start; margin-top: 4mm; font-size: 9pt; }
  .proof { border: 0; background: #fff; }
  .proof-grid { grid-template-columns: repeat(4, 1fr); }
  .proof-item { padding: 4mm 3mm; border-right: 1px solid #ddd; }
  .proof-item strong { font-size: 18pt; }
  .section { padding: 8mm 0; }
  .section-head h2 { font-size: 17pt; }
  .section-intro, .prose p, .role-content li, .skill-card p, .work-card p { font-size: 9.5pt; }
  .section-grid { grid-template-columns: 45mm 1fr; gap: 8mm; }
  .section-head.wide { margin-bottom: 5mm; }
  .timeline { border-left-color: #ddd; }
  .role { grid-template-columns: 35mm 1fr; gap: 6mm; padding: 5mm 0 5mm 6mm; break-inside: avoid; }
  .role::before { background: #000; box-shadow: none; }
  .role-content li::before { background: #000; }
  .skill-grid { grid-template-columns: repeat(2, 1fr); gap: 3mm; }
  .work-grid { grid-template-columns: repeat(2, 1fr); gap: 3mm; }
  .skill-card, .work-card { padding: 4mm; border-color: #ddd; box-shadow: none; break-inside: avoid; }
  .contact { padding: 8mm 0; text-align: left; background: #fff; }
  .contact h2 { font-size: 18pt; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}
