/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #ffffff;
  --surface: #f5f7fb;
  --surface-2: #eef1f8;
  --text: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --accent-soft: rgba(79, 70, 229, 0.10);
  --teal: #0f766e;
  --amber: #b45309;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020;
    --surface: #121a2e;
    --surface-2: #19223a;
    --text: #e6e9f2;
    --muted: #9aa4bf;
    --line: #243049;
    --accent: #8b93ff;
    --accent-ink: #0b1020;
    --accent-soft: rgba(139, 147, 255, 0.14);
    --teal: #5eead4;
    --amber: #fbbf24;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1020;
  --surface: #121a2e;
  --surface-2: #19223a;
  --text: #e6e9f2;
  --muted: #9aa4bf;
  --line: #243049;
  --accent: #8b93ff;
  --accent-ink: #0b1020;
  --accent-soft: rgba(139, 147, 255, 0.14);
  --teal: #5eead4;
  --amber: #fbbf24;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 12px; }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; position: relative; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 800;
}
.brand-name { font-size: 15px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: 8px; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-toggle, .theme-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
}
.nav-toggle { display: none; }
.theme-toggle { margin-left: 6px; }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-grid; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; font-size: 16px; }
  .theme-toggle { margin: 8px 0 0 12px; }
}

/* ------------------------------------------------------------------ hero */
.hero { padding-top: 88px; padding-bottom: 72px; display: grid; gap: 40px; align-items: center; }
@media (min-width: 980px) { .hero { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); } }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card-label { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px; }
.card-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.card-text { color: var(--muted); margin-bottom: 22px; }
.card-links { display: grid; gap: 10px; }
.card-links li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-top: 1px solid var(--line); padding-top: 10px; }
.card-links span { font-size: 13px; color: var(--muted); text-align: right; }
.eyebrow { font-family: var(--mono); font-size: 13px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; }
.hero h1 { font-size: clamp(32px, 5.4vw, 56px); font-weight: 800; max-width: 18ch; }
.hero-sub { font-size: clamp(17px, 2vw, 19px); color: var(--muted); max-width: 62ch; margin: 22px 0 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 28px; }
.hero-links a { color: var(--muted); font-weight: 500; }
.hero-links a:hover { color: var(--text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px;
  border-radius: 10px; font-weight: 600; font-size: 15px; border: 1px solid transparent; transition: transform .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }

/* ------------------------------------------------------------------ sections */
.section { padding-top: 72px; padding-bottom: 24px; }
.section-title { font-size: clamp(26px, 3.4vw, 34px); font-weight: 800; margin-bottom: 28px; }
.section-title::after { content: ""; display: block; width: 48px; height: 4px; border-radius: 4px; background: var(--accent); margin-top: 12px; }

/* about */
.about-grid { display: grid; gap: 24px; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1.6fr 1fr; gap: 40px; } }
.about-text p { color: var(--muted); font-size: 17px; }
.about-text p:first-child { color: var(--text); }
.facts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.facts dl { margin: 0; display: grid; gap: 16px; }
.facts dt { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 500; }

/* skills */
.skill-ai { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.skill-ai h3, .skill-card h3 { font-size: 17px; margin-bottom: 14px; }
.skill-ai h3 { color: var(--accent); }
.skill-list { display: grid; gap: 12px; }
.skill-list li { padding-left: 18px; position: relative; }
.skill-list li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.where { display: inline-block; margin-left: 6px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.skill-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .skill-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .skill-grid { grid-template-columns: repeat(3, 1fr); } }
.skill-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--surface-2); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 500; }

/* projects */
.project-grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .project-grid { grid-template-columns: repeat(2, 1fr); } }
.project {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s ease, border-color .2s ease;
}
.project:hover { transform: translateY(-3px); border-color: var(--accent); }
.project img { aspect-ratio: 16 / 10; object-fit: cover; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.project-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.project-body h3 { font-size: 20px; margin-bottom: 8px; }
.project-body p { color: var(--muted); }
.project-body em { color: var(--text); font-style: normal; font-weight: 600; }
.project-text { background: linear-gradient(160deg, var(--accent-soft), var(--surface) 55%); }
.project-text .project-body { justify-content: center; min-height: 280px; }
.badges { margin-bottom: 10px !important; }
.badge { display: inline-block; font-family: var(--mono); font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.badge-progress { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.tags li { font-size: 13px; font-weight: 500; padding: 2px 10px; border-radius: 6px; border: 1px solid var(--line); color: var(--text); }
.project-links { display: flex; gap: 18px; margin: auto 0 0 !important; font-weight: 600; }
.more-title { font-size: 18px; margin: 40px 0 14px; }
.more-list { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .more-list { grid-template-columns: repeat(2, 1fr); } }
.more-list a { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; color: var(--text); height: 100%; }
.more-list a:hover { border-color: var(--accent); text-decoration: none; }
.more-list strong { display: block; }
.more-list span { color: var(--muted); font-size: 14px; }

/* experience */
.timeline { display: grid; gap: 18px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline > li { position: relative; padding: 0 0 6px 26px; }
.timeline > li::before { content: ""; position: absolute; left: -8px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.when { font-family: var(--mono); font-size: 13px; color: var(--accent); margin-bottom: 4px; }
.timeline h3 { font-size: 18px; }
.where-line { color: var(--muted); font-size: 14px; margin: 2px 0 8px; }
.timeline ul { display: grid; gap: 6px; margin-top: 8px; }
.timeline ul li { color: var(--muted); padding-left: 16px; position: relative; }
.timeline ul li::before { content: "–"; position: absolute; left: 0; color: var(--accent); }

/* contact */
.contact { padding-bottom: 88px; }
.contact-lead { font-size: 18px; color: var(--muted); max-width: 60ch; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.contact-actions .btn-primary { word-break: break-all; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 26px 0; color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------------ motion */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.js .reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .project, .btn { transition: none; }
}
