:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --text: #16161a;
  --muted: #5c5c66;
  --line: #e6e4dd;
  --brand: #6a4cff;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e12; --surface: #17171d; --text: #f1f0ec; --muted: #9a9aa6; --line: #26262e; --brand: #9b85ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e12; --surface: #17171d; --text: #f1f0ec; --muted: #9a9aa6; --line: #26262e; --brand: #9b85ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
main, .nav, footer { max-width: 1120px; margin: 0 auto; padding-inline: 24px; }
section { padding-block: 72px; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding-block: 16px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
}
.logo { font-weight: 800; text-decoration: none; font-size: 18px; }
.nav nav { display: flex; gap: 20px; align-items: center; }
.nav nav a { text-decoration: none; color: var(--muted); font-size: 15px; }
.nav nav a:hover { color: var(--text); }
.theme {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 16px;
}

/* hero */
.hero { padding-block: 120px 80px; }
.eyebrow { color: var(--brand); font-size: 14px; margin: 0 0 16px; }
.hero h1 { font-size: clamp(44px, 8vw, 92px); font-weight: 800; }
.tagline { font-size: clamp(18px, 2.2vw, 22px); color: var(--muted); max-width: 640px; margin: 24px 0 36px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  border: 1px solid var(--line); text-decoration: none; font-weight: 700;
  transition: transform .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }

/* filters */
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 32px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button {
  font: 500 14px "Manrope", sans-serif; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer;
}
.filters button.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.card {
  --accent: var(--brand);
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 14px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent);
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 16px 40px -20px var(--accent); }
.card.featured { grid-column: 1 / -1; padding: 40px; background:
  radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), var(--surface); }
.card.featured h3 { font-size: clamp(26px, 3.5vw, 38px); }
.card .meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.card .meta .tag { color: var(--accent); font-weight: 500; }
.card h3 { font-size: 22px; font-weight: 800; }
.card p { margin: 0; color: var(--muted); }
.stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.stack span {
  font-size: 12px; padding: 4px 10px; border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text);
}
.links { display: flex; gap: 16px; font-weight: 700; font-size: 14px; }
.links a { text-decoration: none; color: var(--accent); }
.links a:hover { text-decoration: underline; }

/* about */
.about p { font-size: 19px; max-width: 720px; color: var(--muted); }
.skills { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.skills li { border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 500; }

/* contact */
.contact { text-align: center; }
.mail { display: inline-block; margin: 24px 0; font-size: clamp(22px, 4vw, 40px); font-weight: 800; color: var(--brand); text-decoration: none; word-break: break-all; }
.socials { display: flex; gap: 24px; justify-content: center; }
.socials a { color: var(--muted); }

footer { padding-block: 32px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

@media (max-width: 640px) {
  main, .nav, footer { padding-inline: 16px; }
  .nav nav a { display: none; }
  .grid { grid-template-columns: 1fr; }
  .card.featured { padding: 28px; }
  .hero { padding-block: 72px 40px; }
}

/* project extras */
.subtitle { color: var(--muted); font-weight: 500; margin-top: 6px; }
.card .meta .status { font-size: 12px; }
.points { margin: 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.points li { margin-bottom: 4px; }
.points li::marker { color: var(--accent); }
.muted { color: var(--muted); }

/* experience timeline */
.timeline { list-style: none; padding: 0; margin: 32px 0 0; border-left: 2px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 0 0 32px 28px; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--brand);
}
.timeline .when { color: var(--muted); font-size: 13px; padding-top: 3px; }
.timeline h3 { font-size: 19px; font-weight: 800; }
.timeline .org { color: var(--muted); font-weight: 500; }
.timeline p { margin: 6px 0 0; color: var(--muted); }

/* skills section */
.sub { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin: 32px 0 12px; }
.skill-group .skills { margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 16px; }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.contact .muted { margin: 12px 0 0; font-size: 18px; }

@media (max-width: 640px) {
  .timeline li { grid-template-columns: 1fr; gap: 4px; padding-left: 20px; }
  .two-col { grid-template-columns: 1fr; gap: 0; }
}

/* other work */
.grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.other { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.other li { display: grid; grid-template-columns: 220px 1fr auto; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.other .mono { font-size: 12px; }
@media (max-width: 640px) { .other li { grid-template-columns: 1fr; gap: 2px; } }
