:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5b616e;
  --border: #e3e4e8;
  --accent: #2563eb;
  --accent-soft: #e8efff;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --surface: #171a21;
    --text: #e8eaef;
    --muted: #9aa1ae;
    --border: #262a33;
    --accent: #6ea0ff;
    --accent-soft: #1b2540;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a21;
  --text: #e8eaef;
  --muted: #9aa1ae;
  --border: #262a33;
  --accent: #6ea0ff;
  --accent-soft: #1b2540;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  transition: background-color 0.2s, color 0.2s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { display: block; max-width: 100%; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-weight: 650; color: var(--text); }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 20px; font-size: 15px; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); text-decoration: none; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle svg { width: 18px; height: 18px; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* Hero */
.hero { padding: 72px 0 48px; }
.hero h1 { font-size: clamp(32px, 5vw, 46px); line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.02em; }
.hero .role { font-size: clamp(18px, 2.4vw, 22px); color: var(--muted); margin: 0 0 20px; }
.hero p { max-width: 680px; margin: 0 0 12px; }
.hero .cred { color: var(--muted); font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn {
  display: inline-block; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 15px; font-weight: 500;
}
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #0f1115; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0f1115; } }
.btn.primary:hover { filter: brightness(1.08); }

/* Sections */
section { padding: 32px 0; }
.section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 20px; }

/* Project cards */
.projects { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; box-shadow: var(--shadow);
}
.card .media { display: block; background: #000; aspect-ratio: 16 / 9; }
.card .media img, .card .media video { width: 100%; height: 100%; object-fit: cover; }
.card .media.contain { aspect-ratio: auto; background: #fff; }
.card .media.contain img { height: auto; object-fit: contain; }
.card .body { padding: 20px 24px 24px; }
.card h3 { font-size: 21px; margin: 0 0 6px; letter-spacing: -0.01em; }
.card h3 a { color: var(--text); }
.card p { margin: 0 0 14px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.tags li { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.more { font-weight: 500; }

/* Secondary grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; box-shadow: var(--shadow); }
.tile h3 { font-size: 17px; margin: 0 0 6px; }
.tile p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.tile ul { margin: 0; padding-left: 18px; }
.tile li { margin: 4px 0; }

/* Contact page */
.profile { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: center; padding: 64px 0 32px; }
.profile img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.profile h1 { font-size: clamp(32px, 5vw, 46px); line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.02em; }
.profile .role { font-size: clamp(18px, 2.4vw, 22px); color: var(--muted); margin: 0 0 6px; }
.profile .loc { color: var(--muted); margin: 0; }
.contact-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.contact-list li { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 14px 24px; border-top: 1px solid var(--border); }
.contact-list li:first-child { border-top: 0; }
.contact-list .label { width: 120px; flex-shrink: 0; color: var(--muted); font-size: 15px; }
.contact-list a, .contact-list span { overflow-wrap: anywhere; }
.services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 32px; padding: 40px 0 56px; }
.site-footer h2 { font-size: 24px; margin: 0 0 8px; }
.site-footer p { color: var(--muted); margin: 0 0 20px; }

@media (max-width: 640px) {
  .nav .hide-sm { display: none; }
  .hero { padding: 48px 0 32px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .card .body { padding: 16px 18px 20px; }
  .profile { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 40px 0 24px; }
  .profile img { width: 160px; }
  .services { grid-template-columns: minmax(0, 1fr); }
  .contact-list li { padding: 12px 18px; }
}
