:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1c2330;
  --muted: #5b6577;
  --accent: #1f4e79;
  --accent-soft: #e8f0f8;
  --border: #e3e7ee;
  --chip: #eef2f7;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f141b;
  --surface: #161d27;
  --text: #e6eaf0;
  --muted: #9aa5b5;
  --accent: #7fb3e6;
  --accent-soft: #1b2a3b;
  --border: #253041;
  --chip: #1e2733;
  --shadow: none;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141b;
    --surface: #161d27;
    --text: #e6eaf0;
    --muted: #9aa5b5;
    --accent: #7fb3e6;
    --accent-soft: #1b2a3b;
    --border: #253041;
    --chip: #1e2733;
    --shadow: none;
    color-scheme: dark;
  }
}

* { 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", Roboto, sans-serif;
  line-height: 1.6;
  font-size: 16px;
}
a { color: var(--accent); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* 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(--border);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.nav { display: flex; gap: 18px; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav a:hover { color: var(--accent); }
.theme-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 14px;
}

/* hero */
.hero { padding: 56px 0 32px; display: flex; align-items: center; gap: 32px; }
.hero-text { min-width: 0; }
.avatar {
  width: 220px; height: 220px; flex: none; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--surface); box-shadow: 0 0 0 2px var(--accent), var(--shadow);
}
.hero h1 { font-size: clamp(32px, 6vw, 48px); line-height: 1.1; margin: 0 0 10px; color: var(--accent); letter-spacing: -0.02em; }
.hero .title { font-size: 19px; font-weight: 600; margin: 0 0 6px; }
/* Stack tags: flat, tinted and smaller, so they read as labels, not as buttons. */
.hero .stack { gap: 6px; margin: 6px 0 24px; }
.hero .stack li {
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 500; padding: 3px 9px; border-radius: 4px;
}
.links { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 600;
  text-decoration: none; border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.btn:hover { border-color: var(--accent); }

/* sections */
section { padding: 24px 0; }
h2 {
  font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 18px; padding-bottom: 8px; border-bottom: 2px solid var(--accent);
}
.about p { margin: 0; }
.intro { color: var(--muted); margin: -6px 0 18px; }

/* featured cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.card h3 { margin: 0; font-size: 20px; line-height: 1.3; }
.card .subtitle { color: var(--muted); margin: 2px 0 14px; font-size: 15px; }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; margin: 0 0 12px; }
.meta dt { font-weight: 600; color: var(--muted); }
.meta dd { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.chips li { background: var(--chip); border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.card h4 { font-size: 14px; margin: 14px 0 6px; color: var(--accent); }
.card ul.points { margin: 0; padding-left: 20px; }
.card ul.points li { margin-bottom: 4px; }
.card p { margin: 0 0 8px; }
.note { color: var(--muted); font-size: 14px; font-style: italic; }
.badge {
  display: inline-block; align-self: flex-start; background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 13px; border-radius: 6px; padding: 2px 8px; margin: 0 0 10px;
}
.card .links { margin-top: 14px; }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.grid .card { margin: 0; padding: 18px; display: flex; flex-direction: column; }
.grid .card h3 { font-size: 17px; }
.grid .card .links { margin-top: auto; padding-top: 12px; }
details summary { cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 600; margin-top: 4px; }
details[open] summary { margin-bottom: 6px; }

/* skills */
.skills { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; }
.skills dt { font-weight: 600; }
.skills dd { margin: 0; color: var(--muted); }

footer { padding: 32px 0 48px; color: var(--muted); font-size: 14px; text-align: center; }

@media (max-width: 640px) {
  .nav a { display: none; }
  .meta, .skills { grid-template-columns: 1fr; }
  .meta dt, .skills dt { margin-top: 6px; }
  .hero { padding-top: 36px; flex-direction: column; align-items: flex-start; gap: 20px; }
  .avatar { width: 150px; height: 150px; }
}
@media print {
  .topbar, .theme-btn { display: none; }
  .card { box-shadow: none; break-inside: avoid; }
}
