:root {
  color-scheme: light;
  --bg: #f3f5fb;
  --surface: #ffffff;
  --surface-2: #f7f8fd;
  --text: #0c1226;
  --muted: #5b6377;
  --border: rgba(12, 18, 38, 0.12);
  --border-strong: rgba(12, 18, 38, 0.18);
  --shadow: 0 20px 60px -32px rgba(12, 18, 38, 0.32);
  --shadow-soft: 0 14px 44px -28px rgba(12, 18, 38, 0.26);
  --shadow-flat: 0 1px 0 rgba(12, 18, 38, 0.04), 0 10px 24px rgba(12, 18, 38, 0.08);
  --primary: #3f6df6;
  --primary-strong: #2f58dd;
  --primary-soft: rgba(63, 109, 246, 0.14);
  --accent: #8ab6ff;
  --success: #19b27c;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --maxw: 1180px;
  --grid-gap: 18px;
  --gradient-1: radial-gradient(120% 140% at 12% 10%, rgba(63, 109, 246, 0.18), transparent 38%),
    radial-gradient(100% 120% at 86% 0%, rgba(141, 91, 255, 0.22), transparent 42%),
    linear-gradient(135deg, #eef2ff 0%, #f8fbff 52%, #eef0ff 100%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: rgba(16, 21, 33, 0.94);
  --surface-2: rgba(16, 21, 33, 0.82);
  --text: #e7ecf9;
  --muted: rgba(231, 236, 249, 0.78);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow: 0 22px 60px -28px rgba(0, 0, 0, 0.72);
  --shadow-soft: 0 16px 46px -26px rgba(0, 0, 0, 0.56);
  --shadow-flat: 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 28px rgba(0, 0, 0, 0.38);
  --primary: #78c2ff;
  --primary-strong: #64aef0;
  --primary-soft: rgba(120, 194, 255, 0.16);
  --accent: #b3c5ff;
  --success: #3ddba4;
  --gradient-1: radial-gradient(130% 160% at 14% 14%, rgba(120, 194, 255, 0.18), transparent 42%),
    radial-gradient(110% 130% at 90% 6%, rgba(124, 58, 237, 0.22), transparent 48%),
    linear-gradient(135deg, rgba(7, 12, 22, 0.94), rgba(10, 16, 28, 0.94));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  line-height: 1.7;
  letter-spacing: 0.01em;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; }

.wrap {
  width: min(100% - 36px, var(--maxw));
  margin: 0 auto;
}

.page { padding-bottom: 120px; }
.section { padding: 88px 0; }
.section + .section { border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.section-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 28px; }

.nav-shell {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 30px -24px rgba(12, 18, 38, 0.35);
}

.nav-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.2px;
}

.brand-name { font-size: 16px; }
.brand-role { font-size: 13px; color: var(--muted); }
.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 7px;
  box-shadow: var(--shadow-soft);
}

.nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link {
  position: relative;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  border: 1px solid transparent;
  transition: color 160ms ease, background 160ms ease, border 160ms ease, transform 160ms ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 160ms ease;
}

.nav-link:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 90%, transparent); border-color: var(--border); text-decoration: none; }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.active { color: var(--text); background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 25%, var(--border)); }
.nav-link.active::after { transform: scaleX(1); }

.nav-actions { display: flex; gap: 8px; align-items: center; }

.chip {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-flat);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.chip:hover { transform: translateY(-1px); border-color: var(--border-strong); box-shadow: var(--shadow-soft); }

.hero {
  position: relative;
  padding: 64px 0 96px;
  background: var(--gradient-1);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.35) 1px, transparent 0),
    radial-gradient(circle at 70% 32%, rgba(255, 255, 255, 0.25) 1.5px, transparent 0);
  background-size: 80px 80px;
  opacity: 0.5;
  pointer-events: none;
}

.hero-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.85fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.hero-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-flat);
}

.hero-copy { box-shadow: var(--shadow); }
.hero-card__title { font-weight: 700; margin-bottom: 12px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 6px var(--primary-soft);
}

h1, h2, h3, h4 { margin: 0; color: var(--text); }
h1 { font-size: clamp(34px, 4.8vw, 52px); line-height: 1.05; letter-spacing: -0.8px; }
h2 { font-size: clamp(26px, 3.2vw, 36px); line-height: 1.15; letter-spacing: -0.4px; }
h3 { font-size: 19px; letter-spacing: -0.1px; }

.lede {
  margin: 12px 0 20px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 72ch;
}

.muted { color: var(--muted); }

.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  row-gap: 10px;
  margin: 16px 0 22px;
}

.metric {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary-soft), color-mix(in srgb, var(--surface) 70%, transparent));
  border: 1px solid var(--border);
  font-weight: 700;
  color: var(--text);
  box-shadow: var(--shadow-flat);
  flex: 1 1 220px;
  min-width: 210px;
  line-height: 1.5;
}

.meta-line {
  color: var(--muted);
  font-size: 14px;
  margin-top: 10px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-flat);
}

.snapshot {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.snapshot li {
  border: 1px solid var(--border);
  padding: 14px 15px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-flat);
  font-size: 14px;
}

.snapshot strong { display: block; font-size: 15px; color: var(--text); }

.cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: linear-gradient(120deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn.secondary {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-flat);
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}

.grid { display: grid; gap: var(--grid-gap); }
.projects-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-flat);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.project-card { overflow: hidden; }
.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(63, 109, 246, 0.08), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.project-top {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.project-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 13px;
}

.project-thumb {
  width: 100%;
  height: 160px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(63, 109, 246, 0.16), rgba(141, 91, 255, 0.14));
  box-shadow: var(--shadow-flat);
}

.project-thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-body { position: relative; z-index: 1; }

.project-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0 12px;
}

.case-toggle {
  border: none;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.case-toggle:hover { text-decoration: underline; }

.case-study {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 220ms ease;
}

.case-study.open { max-height: 640px; }
.case-study h4 { margin: 6px 0; font-size: 15px; }
.case-study ul { padding-left: 18px; margin: 6px 0 0; color: var(--muted); }

.timeline {
  position: relative;
  display: grid;
  gap: 16px;
  padding-left: 6px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding: 14px 14px 16px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-flat);
}

.timeline-dot {
  position: absolute;
  left: 6px;
  top: 20px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 5px var(--primary-soft);
}

.timeline-meta { font-size: 13px; color: var(--muted); margin: 6px 0 10px; }
.timeline-bullets { margin: 8px 0 0; padding-left: 16px; color: var(--muted); }

.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

.skill-group {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-flat);
}

.skill-group h3 { margin-bottom: 12px; }

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  list-style: none;
}

.chips .chip-item {
  padding: 9px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-soft) 80%, var(--surface) 20%);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
}

.contact-wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  align-items: stretch;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-flat);
}

.contact-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.contact-note { margin-top: 14px; color: var(--muted); font-size: 14px; }

.footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 28px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 30;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0); }

.btn:focus-visible,
.chip:focus-visible,
.nav-link:focus-visible,
.case-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-soft), 0 0 0 1px var(--primary-strong);
}

@media (max-width: 1024px) {
  .nav-wrap { grid-template-columns: 1fr; row-gap: 10px; }
  .nav { justify-content: flex-start; }
  .nav-actions { justify-content: flex-start; }
  .hero-wrap { grid-template-columns: 1fr; }
  .section { padding: 78px 0; }
}

@media (max-width: 720px) {
  .wrap { width: min(100% - 28px, var(--maxw)); }
  .section { padding: 64px 0; }
  .nav-shell { top: 0; }
  .hero { padding: 52px 0 78px; }
  .cta { width: 100%; }
  .btn { width: 100%; justify-content: center; }
  .metrics { gap: 8px; }
  .metric { width: 100%; justify-content: space-between; }
  .project-top { grid-template-columns: 1fr; }
  .contact-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  h1 { font-size: clamp(30px, 8vw, 40px); }
  .section-head { margin-bottom: 22px; }
  .card,
  .hero-copy,
  .hero-card,
  .contact-card { padding: 18px; }
}

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