:root {
  --bg: #ffffff;
  --surface: #f5f7fa;
  --ink: #1b2430;
  --muted: #5a6573;
  --accent: #1f4e79;
  --accent-soft: #e6eef6;
  --line: #dde3ea;
  --ok: #2e8b57;
  --radius: 12px;
  --max: 1040px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141a;
    --surface: #161d25;
    --ink: #e6ebf0;
    --muted: #9aa6b2;
    --accent: #7fb2e5;
    --accent-soft: #1c2a38;
    --line: #26313c;
    --ok: #4cc38a;
  }
}

:root[data-theme="dark"] {
  --bg: #0f141a;
  --surface: #161d25;
  --ink: #e6ebf0;
  --muted: #9aa6b2;
  --accent: #7fb2e5;
  --accent-soft: #1c2a38;
  --line: #26313c;
  --ok: #4cc38a;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo {
  font-weight: 700; text-decoration: none; color: var(--bg); background: var(--accent);
  width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; font-size: 14px;
}
nav a { color: var(--muted); text-decoration: none; margin-left: 24px; font-size: 15px; font-weight: 500; }
nav a:hover { color: var(--ink); }
nav { display: flex; align-items: center; }
.theme-toggle {
  margin-left: 20px; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0;
  transition: color .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.is-dark .theme-toggle .icon-sun { display: block; }
.is-dark .theme-toggle .icon-moon { display: none; }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1fr 260px; gap: 56px; align-items: center;
  padding-top: 72px; padding-bottom: 56px;
}
.eyebrow { color: var(--accent); font-weight: 600; margin: 0 0 8px; letter-spacing: .2px; }
h1 { font-size: clamp(36px, 6vw, 56px); line-height: 1.05; margin: 0 0 20px; letter-spacing: -1px; }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 24px; max-width: 620px; }
.portrait { width: 100%; height: auto; border-radius: 16px; display: block; }

.chips { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: 14px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); display: inline-flex; align-items: center; gap: 8px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: 15px;
  text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: var(--bg);
  transition: border-color .15s, transform .15s;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.stat { background: var(--surface); border-radius: var(--radius); padding: 20px; }
.stat b { display: block; font-size: 30px; color: var(--accent); line-height: 1.2; }
.stat span { color: var(--muted); font-size: 14px; }

/* Clients */
.clients { padding-top: 32px; }
.label { font-size: 13px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.clients ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.clients li { font-weight: 600; color: var(--ink); opacity: .8; }

/* Sections */
.section { padding-top: 80px; }
h2 {
  font-size: 14px; text-transform: uppercase; letter-spacing: 1.6px; color: var(--accent);
  margin: 0 0 24px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
h3 { font-size: 19px; margin: 0 0 8px; line-height: 1.35; }

/* Cases */
.cases { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.case {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  display: flex; flex-direction: column; transition: border-color .15s;
}
.case:hover { border-color: var(--accent); }
.case p { margin: 0 0 12px; color: var(--muted); }
.case-tag { font-size: 13px; font-weight: 600; color: var(--accent) !important; }
.case .result { color: var(--ink); background: var(--accent-soft); padding: 8px 12px; border-radius: 8px; margin-top: auto; }
.case .tech { font-size: 14px; margin: 12px 0 0; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 140px 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.when { color: var(--muted); font-size: 15px; padding-top: 2px; }
.timeline p { margin: 0; color: var(--muted); }

/* Skills */
.skills { margin: 0; display: grid; gap: 0; }
.skills div { display: grid; grid-template-columns: 140px 1fr; gap: 24px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.skills div:last-child { border-bottom: 0; }
.skills dt { font-weight: 600; }
.skills dd { margin: 0; color: var(--muted); }

/* Contact */
.contact p { font-size: 18px; color: var(--muted); max-width: 640px; margin: 0 0 24px; }

.footer { padding-top: 64px; padding-bottom: 40px; color: var(--muted); font-size: 14px; }

/* Mobile */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; }
  .portrait { max-width: 200px; order: -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cases { grid-template-columns: 1fr; }
  nav a { margin-left: 16px; font-size: 14px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  nav a:nth-child(2), nav a:nth-child(3) { display: none; }
  .timeline li, .skills div { grid-template-columns: 1fr; gap: 4px; }
  .lead { font-size: 17px; }
  .section { padding-top: 56px; }
}
