:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --ink: #0d1f31;
  --muted: #5e6d7d;
  --navy: #07182b;
  --blue: #1768ac;
  --blue-soft: #eaf3fb;
  --line: #dce5ee;
  --shadow: 0 24px 70px rgba(7, 24, 43, .09);
}

* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; }
section[id] { scroll-margin-top: 100px; }
body {
  overflow-x: clip;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}
a { color: inherit; }
:focus-visible { outline: 3px solid #f0a500; outline-offset: 3px; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 10px 14px; background: white; border-radius: 8px; }
.skip-link:focus { top: 16px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  overflow: hidden;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 18px auto 0;
  padding: 12px 14px 12px 18px;
  border: 1px solid rgba(220,229,238,.85);
  border-radius: 16px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 12px 40px rgba(7,24,43,.07);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; flex: 0 0 auto; gap: 10px; align-items: center; text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--navy); color: white; font-size: 12px; }
nav { display: flex; min-width: 0; gap: 8px; align-items: center; }
nav a { padding: 9px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }
nav a:hover { color: var(--navy); background: var(--blue-soft); }
nav .nav-cta { color: white; background: var(--navy); }
nav .nav-cta:hover { color: white; background: #102b49; }

main, .site-footer { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.hero {
  display: grid;
  grid-template-columns: 1.55fr .75fr;
  gap: 70px;
  align-items: center;
  min-height: 690px;
  padding: 90px 0 70px;
}
.eyebrow { margin: 0 0 16px; color: var(--blue); font-size: 12px; line-height: 1.2; font-weight: 800; letter-spacing: .18em; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 880px; margin-bottom: 24px; font-size: clamp(44px, 6.1vw, 78px); line-height: .98; letter-spacing: -.055em; color: var(--navy); }
.hero-lead { max-width: 730px; margin-bottom: 30px; color: var(--muted); font-size: 19px; line-height: 1.65; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 34px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border-radius: 11px; text-decoration: none; font-weight: 750; font-size: 14px; }
.button.primary { background: var(--navy); color: white; box-shadow: 0 12px 30px rgba(7,24,43,.16); }
.button.primary:hover { background: #102b49; transform: translateY(-1px); }
.button.secondary { border: 1px solid var(--line); background: white; color: var(--navy); }
.hero-tags, .tech-row { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-tags span, .tech-row span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.72); color: #28435f; font-size: 12px; font-weight: 700; }

.hero-profile { padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow); }
.portrait-wrap { overflow: hidden; aspect-ratio: 1 / 1.06; border-radius: 16px; background: var(--blue-soft); }
.portrait-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: 55% 22%; filter: grayscale(100%) contrast(1.03); }
.profile-data { display: flex; flex-direction: column; gap: 3px; padding: 18px 2px 14px; }
.profile-data strong { font-size: 20px; letter-spacing: -.02em; color: var(--navy); }
.profile-data span { color: var(--muted); font-size: 13px; }
.hero-profile > a { display: block; padding-top: 14px; border-top: 1px solid var(--line); color: var(--blue); font-weight: 700; font-size: 13px; text-decoration: none; overflow-wrap: anywhere; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--navy); color: white; box-shadow: var(--shadow); }
.metrics article { padding: 28px; border-right: 1px solid rgba(255,255,255,.12); }
.metrics article:last-child { border-right: 0; }
.metrics strong { display: block; margin-bottom: 6px; font-size: 30px; line-height: 1; letter-spacing: -.04em; }
.metrics span { color: #c9d8e7; font-size: 13px; }

.section { padding: 105px 0 0; }
.section-intro { max-width: 760px; margin-bottom: 38px; }
.section-intro.compact { margin-bottom: 28px; }
h2 { margin-bottom: 16px; color: var(--navy); font-size: clamp(34px, 4vw, 52px); line-height: 1.05; letter-spacing: -.045em; }
.section-intro > p:last-child { color: var(--muted); font-size: 17px; }
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.project-card { display: flex; flex-direction: column; min-height: 320px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 16px 45px rgba(7,24,43,.045); }
.project-card.featured { grid-row: span 2; min-height: 658px; background: linear-gradient(160deg, #0b2745 0%, #07182b 100%); color: white; }
.project-card.wide { grid-column: 1 / -1; min-height: 260px; }
.project-topline { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 55px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.featured .project-topline { color: #84bdea; }
.project-card h3 { max-width: 620px; margin-bottom: 16px; color: var(--navy); font-size: 28px; line-height: 1.15; letter-spacing: -.035em; }
.project-card.featured h3 { margin-top: auto; color: white; font-size: 38px; }
.project-card p { color: var(--muted); font-size: 15px; }
.project-card.featured p, .project-card.featured li { color: #d2dfeb; }
.project-card ul { margin: 10px 0 26px; padding-left: 19px; }
.project-card li { margin-bottom: 7px; }
.project-card .tech-row { margin-top: auto; padding-top: 20px; }
.featured .tech-row span { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.07); color: white; }

.expertise-section { padding-top: 120px; }
.expertise-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.expertise-grid article { min-height: 230px; padding: 24px; border-top: 3px solid var(--blue); background: white; border-radius: 0 0 14px 14px; }
.expertise-grid article > span { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.expertise-grid h3 { margin: 50px 0 10px; color: var(--navy); font-size: 20px; letter-spacing: -.025em; }
.expertise-grid p { margin-bottom: 0; color: var(--muted); font-size: 14px; }

.stack { display: grid; grid-template-columns: .85fr 1.15fr; gap: 80px; align-items: start; }
.stack > * { min-width: 0; }
.stack h2 { font-size: 40px; }
.stack-groups { border-top: 1px solid var(--line); }
.stack-groups p { display: grid; grid-template-columns: 135px 1fr; gap: 30px; margin: 0; padding: 22px 0; border-bottom: 1px solid var(--line); }
.stack-groups strong { color: var(--navy); }
.stack-groups span { color: var(--muted); }

.contact-section { display: grid; grid-template-columns: 1.3fr .7fr; gap: 80px; margin: 120px 0 40px; padding: 58px; border-radius: 22px; background: var(--navy); color: white; box-shadow: var(--shadow); }
.contact-section h2 { color: white; }
.contact-section p { max-width: 660px; color: #c9d8e7; }
.contact-actions { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 16px; }
.contact-actions .button.primary { background: white; color: var(--navy); }
.text-link { color: white; font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 4px; }

.site-footer { display: flex; justify-content: space-between; gap: 30px; padding: 26px 0 40px; color: #7b8997; font-size: 12px; }

.error-page { display: grid; align-content: center; min-height: 100vh; padding-block: 48px; }
.error-page h1 { max-width: 760px; }
.error-page > p:not(.eyebrow) { margin-bottom: 28px; color: var(--muted); font-size: 18px; }
.error-page .button { justify-self: start; }

@media (max-width: 900px) {
  .site-header { position: sticky; margin-top: 10px; }
  .site-header nav { flex: 1 1 auto; margin-left: 8px; overflow-x: auto; scrollbar-width: none; }
  .site-header nav::-webkit-scrollbar { display: none; }
  nav a { flex: 0 0 auto; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 70px; }
  .hero-profile { max-width: 420px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics article:nth-child(2) { border-right: 0; }
  .metrics article:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.12); }
  .project-grid, .expertise-grid, .stack, .contact-section { grid-template-columns: 1fr; }
  .project-card.featured { grid-row: auto; min-height: 520px; }
  .project-card.wide { grid-column: auto; }
  .expertise-grid { grid-template-columns: repeat(2, 1fr); }
  .stack, .contact-section { gap: 36px; }
}

@media (max-width: 620px) {
  main, .site-footer, .site-header { width: min(100% - 24px, 1180px); }
  .brand > span:last-child { display: none; }
  h1 { font-size: clamp(37px, 11.5vw, 45px); line-height: 1.02; }
  .hero { gap: 40px; padding-top: 55px; }
  .metrics, .project-grid, .expertise-grid { grid-template-columns: 1fr; }
  .metrics article { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.12); }
  .metrics article:last-child { border-bottom: 0; }
  .section { padding-top: 80px; }
  .project-card, .contact-section { padding: 24px; }
  .project-card.featured { min-height: 480px; }
  .project-topline { margin-bottom: 38px; }
  .stack-groups p { grid-template-columns: 1fr; gap: 5px; }
  .site-footer { flex-direction: column; gap: 6px; }
  .button { width: 100%; }
  .contact-actions { align-items: stretch; }
  .contact-actions .text-link { overflow-wrap: anywhere; }
}

@media (max-width: 390px) {
  .site-header { padding-left: 10px; padding-right: 10px; }
  nav a { padding-inline: 9px; }
  .hero-profile { padding: 12px; }
  .metrics article { padding: 22px; }
}

@media (max-width: 340px) {
  .site-header nav { flex: 0 0 auto; }
  .site-header nav a:not(.nav-cta) { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, nav a { transition: transform .18s ease, background-color .18s ease, color .18s ease; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
