:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #0b1224;
  --muted: #5b6375;
  --border: rgba(12, 18, 36, 0.08);
  --shadow: 0 18px 60px rgba(12, 18, 36, 0.12);
  --shadow-soft: 0 10px 30px rgba(12, 18, 36, 0.08);
  --primary: #5a6bff;
  --primary-soft: #e9ecff;
  --accent: #7c8cff;
  --success: #0ea960;
  --radius-lg: 26px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --maxw: 1180px;
  --gradient-1: linear-gradient(130deg, #f3f5ff 0%, #edf1ff 45%, #f6f0ff 100%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1220;
  --surface: rgba(15, 20, 34, 0.88);
  --text: #e7ecf9;
  --muted: rgba(231, 236, 249, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.28);
  --primary: #63b3ff;
  --primary-soft: rgba(99, 179, 255, 0.12);
  --accent: #9da9ff;
  --gradient-1: radial-gradient(120% 120% at 15% 10%, rgba(99, 179, 255, 0.25), transparent 55%),
    radial-gradient(110% 110% at 90% 10%, rgba(124, 58, 237, 0.22), transparent 52%),
    linear-gradient(135deg, rgba(15, 20, 34, 0.94), rgba(15, 20, 34, 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.6;
  min-height: 100vh;
}

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

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

.nav-shell {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
}

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

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

.nav-link {
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  border: 1px solid transparent;
  transition: color .15s ease, background .15s ease, border .15s ease;
}

.nav-link:hover { color: var(--text); background: var(--primary-soft); border-color: var(--border); text-decoration: none; }
.nav-link.active { color: var(--text); background: var(--primary-soft); border-color: var(--border); }

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

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 10px;
  font: inherit;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.chip:focus-visible, .btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(11, 95, 255, 0.28); }

.page { padding-bottom: 96px; }
.section { padding: 72px 0; }
.section-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 22px; }

.hero {
  position: relative;
  padding: 48px 0 72px;
  background: var(--gradient-1);
  overflow: hidden;
  background-image:
    radial-gradient(circle at 24px 24px, rgba(90, 107, 255, 0.14) 1.5px, transparent 0),
    radial-gradient(circle at 60px 60px, rgba(156, 117, 255, 0.14) 1.5px, transparent 0),
    var(--gradient-1);
  background-size: 48px 48px, 48px 48px, auto;
}

.hero-wrap {
  display: grid;
  grid-template-columns: minmax(520px, 1.6fr) minmax(320px, 1fr);
  gap: 20px;
  align-items: start;
}

.hero-copy { background: var(--surface); padding: 28px; border-radius: var(--radius-lg); border: 1px solid rgba(12,18,36,0.06); box-shadow: 0 22px 60px rgba(12,18,36,0.14); }
.hero-card { background: var(--surface); padding: 24px; border-radius: var(--radius-lg); border: 1px solid rgba(12,18,36,0.06); box-shadow: 0 20px 52px rgba(12,18,36,0.10); }
.hero-card__title { font-weight: 700; margin-bottom: 10px; }

.eyebrow {
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
}

h1, h2, h3, h4 { margin: 0; color: var(--text); }
h1 { font-size: clamp(32px, 5vw, 42px); line-height: 1.05; letter-spacing: -0.6px; }
h2 { font-size: clamp(24px, 3vw, 30px); }
h3 { font-size: 18px; }

.lede { margin: 10px 0 18px; font-size: 17px; color: var(--muted); max-width: 68ch; }
.muted { color: var(--muted); }

.metrics { display: flex; flex-wrap: wrap; gap: 10px; row-gap: 10px; margin: 14px 0 18px; }
.metric { display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 14px; background: var(--primary-soft); border: 1px solid var(--border); font-weight: 700; color: var(--text); }

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

.snapshot { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.snapshot li { border: 1px solid var(--border); padding: 12px 14px; border-radius: 12px; background: var(--surface); background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow-soft); font-size: 14px; }
.snapshot strong { display: block; font-size: 15px; color: var(--text); }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}

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

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

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

.project-card { position: relative; overflow: hidden; }
.project-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(145deg, rgba(11,95,255,0.12), rgba(99,179,255,0.05)); pointer-events: none; }
.project-top { display: grid; grid-template-columns: 1fr 120px; gap: 12px; align-items: center; margin-bottom: 12px; }
.project-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 10px; background: var(--primary-soft); color: var(--text); border: 1px solid var(--border); font-weight: 600; font-size: 13px; }
.project-thumb { width: 100%; height: 120px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: linear-gradient(135deg, rgba(11,95,255,0.12), rgba(124,58,237,0.12)); box-shadow: var(--shadow-soft); }
.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: 6px 0 10px; }
.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: 10px; border-top: 1px solid var(--border); padding-top: 10px; max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.case-study.open { max-height: 600px; }
.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: 14px; }
.timeline::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding: 12px 12px 12px 32px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-soft); }
.timeline-dot { position: absolute; left: 3px; top: 18px; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.timeline-meta { font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.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: 12px; }
.skill-group { padding: 16px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-soft); }
.skill-group h3 { margin-bottom: 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; }
.chips .chip-item { padding: 8px 10px; border-radius: 10px; background: var(--primary-soft); color: var(--text); border: 1px solid var(--border); font-size: 14px; }

.contact-wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 20px; align-items: stretch; }
.contact-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-soft); }
.contact-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.contact-note { margin-top: 12px; color: var(--muted); font-size: 14px; }

.footer { border-top: 1px solid var(--border); padding: 18px 0 26px; background: var(--bg); 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 .2s ease, transform .2s ease;
  z-index: 30;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 960px) {
  .nav-wrap { grid-template-columns: 1fr; row-gap: 8px; }
  .nav { justify-content: flex-start; }
  .nav-actions { justify-content: flex-start; }
  .hero-wrap { grid-template-columns: 1fr; }
  .contact-wrap { grid-template-columns: 1fr; }
  .project-top { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .section { padding: 56px 0; }
  .nav-shell { position: sticky; top: 0; }
  .metrics { gap: 8px; }
  .metric { width: 100%; justify-content: space-between; }
  .project-thumb { height: 160px; }
}

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