:root {
  --bg: #f6f9f7;
  --surface: #ffffff;
  --surface-alt: #eef3f0;
  --text: #13231b;
  --muted: #475a51;
  --border: #d8e2dc;
  --brand: #1a4030;
  --accent: #0f5a30;
  --accent-strong: #1a6b3a;
  --gold: #8a6d1f;
  --on-accent: #ffffff;
  --chip-bg: #e7f0ea;
  --chip-text: #16432b;
  --learn-bg: #fff6e6;
  --learn-text: #7a5a10;
  --learn-border: #e8cf94;
  --shadow: 0 6px 24px rgba(13, 40, 24, .08);
  --radius: 16px;
  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1a14;
    --surface: #142a20;
    --surface-alt: #10221a;
    --text: #e9f1ed;
    --muted: #a6bbb0;
    --border: #244536;
    --brand: #1a4030;
    --accent: #5cd08c;
    --accent-strong: #2f9e5e;
    --gold: #d8b968;
    --on-accent: #06130c;
    --chip-bg: #16302410;
    --chip-bg: #183526;
    --chip-text: #c9e6d6;
    --learn-bg: #2a2412;
    --learn-text: #e3cf9a;
    --learn-border: #4d4322;
    --shadow: 0 8px 28px rgba(0, 0, 0, .35);
  }
}

:root[data-theme="dark"] {
  --bg: #0d1a14;
  --surface: #142a20;
  --surface-alt: #10221a;
  --text: #e9f1ed;
  --muted: #a6bbb0;
  --border: #244536;
  --brand: #1a4030;
  --accent: #5cd08c;
  --accent-strong: #2f9e5e;
  --gold: #d8b968;
  --on-accent: #06130c;
  --chip-bg: #183526;
  --chip-text: #c9e6d6;
  --learn-bg: #2a2412;
  --learn-text: #e3cf9a;
  --learn-border: #4d4322;
  --shadow: 0 8px 28px rgba(0, 0, 0, .35);
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: 8px; top: -48px;
  background: var(--accent-strong); color: var(--on-accent);
  padding: 10px 16px; border-radius: 10px; font-weight: 600;
  transition: top .15s; z-index: 200;
}
.skip-link:focus { top: 8px; text-decoration: none; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #1a4030, #1a6b3a);
  color: #fff; font-size: 14px; font-weight: 800; letter-spacing: .5px;
  border: 1px solid var(--gold);
}
.brand-name { font-size: 16px; }

.nav { display: flex; align-items: center; gap: 18px; }
.nav ul { list-style: none; display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--text); font-weight: 600; font-size: 15px;
  padding: 8px 12px; border-radius: 10px;
}
.nav a:hover { background: var(--surface-alt); text-decoration: none; }

.theme-toggle {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface-alt); color: var(--text);
  border: 1px solid var(--border); cursor: pointer; font-size: 18px;
}
.theme-toggle:hover { background: var(--chip-bg); }

.nav-toggle {
  display: none;
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--surface-alt); border: 1px solid var(--border);
  cursor: pointer; padding: 10px; flex-direction: column; gap: 4px; justify-content: center;
}
.nav-toggle-bar { display: block; height: 2px; width: 100%; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav {
    position: fixed; inset: 64px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 8px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 16px 20px 22px;
    box-shadow: var(--shadow);
    transform: translateY(-120%); transition: transform .22s ease; visibility: hidden;
  }
  .nav.open { transform: translateY(0); visibility: visible; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav a { display: block; padding: 12px 14px; font-size: 16px; }
  .theme-toggle { align-self: flex-start; }
}

.hero {
  background:
    radial-gradient(1000px 420px at 80% -10%, color-mix(in srgb, var(--accent-strong) 18%, transparent), transparent),
    linear-gradient(180deg, var(--surface-alt), var(--bg));
  padding: clamp(56px, 10vw, 110px) 0 clamp(44px, 8vw, 84px);
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  display: inline-block; font-weight: 700; font-size: 13px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold);
  background: var(--learn-bg); border: 1px solid var(--learn-border);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero-grid { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: clamp(24px, 5vw, 60px); }
.hero-photo { margin: 0; justify-self: end; }
.hero-photo img {
  width: clamp(190px, 26vw, 300px); height: clamp(190px, 26vw, 300px);
  object-fit: cover; object-position: top center; border-radius: 50%;
  border: 5px solid var(--accent);
  box-shadow: 0 10px 40px color-mix(in srgb, var(--accent-strong) 30%, transparent);
}
@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; justify-items: start; }
  .hero-photo { order: -1; justify-self: start; margin-bottom: 4px; }
  .hero-photo img { width: 150px; height: 150px; }
}
.hero h1 { font-size: clamp(34px, 7vw, 58px); line-height: 1.05; letter-spacing: -0.02em; color: var(--text); }
.hero-sub { font-size: clamp(16px, 2.5vw, 20px); color: var(--muted); max-width: 660px; margin-top: 16px; }
.hero-sub strong { color: var(--text); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; }
.hero-meta span { font-size: 14px; color: var(--muted); font-weight: 500; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px; padding: 12px 20px; border-radius: 12px;
  border: 1.5px solid transparent; cursor: pointer; transition: transform .12s, background .2s, border-color .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent-strong); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent-strong) 88%, #000); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-alt); }

.section { padding: clamp(48px, 8vw, 88px) 0; }
.section-alt { background: var(--surface-alt); }
.section-title {
  font-size: clamp(24px, 4vw, 34px); letter-spacing: -0.01em; color: var(--text);
  position: relative; padding-bottom: 12px; margin-bottom: 24px;
}
.section-title::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 56px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-strong), var(--gold));
}
.section-intro { color: var(--muted); margin-bottom: 24px; max-width: 640px; }

.prose p { color: var(--muted); max-width: 760px; margin-bottom: 16px; font-size: 17px; }
.prose strong { color: var(--text); }

.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px 32px; }
.skill-group { min-width: 0; }
.skills-group-title { font-size: 16px; margin: 0 0 12px; color: var(--text); }
.skills-group-title.learning { margin-top: 32px; }
.group-note { font-weight: 500; color: var(--muted); font-size: 14px; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  background: var(--chip-bg); color: var(--chip-text);
  border: 1px solid color-mix(in srgb, var(--chip-text) 20%, transparent);
  padding: 9px 15px; border-radius: 999px; font-weight: 600; font-size: 14px;
}
.chip-learning {
  background: var(--learn-bg); color: var(--learn-text); border-color: var(--learn-border);
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px;
  transition: transform .14s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent-strong) 50%, var(--border)); }
.card-head { display: flex; align-items: center; gap: 12px; }
.card-icon { font-size: 26px; }
.card h3 { font-size: 18px; color: var(--text); line-height: 1.25; }
.badge-live {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--on-accent); background: var(--accent-strong);
  padding: 2px 8px; border-radius: 999px;
}
.card-tagline { font-size: 13px; font-weight: 700; color: var(--accent); margin-top: -4px; }
.card-body { color: var(--muted); font-size: 15px; flex: 1; }
.card-body em { color: var(--text); font-style: normal; font-weight: 600; }
.card code { background: var(--surface-alt); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; }
.tags li {
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--surface-alt); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 8px;
}
.card-link { font-weight: 700; color: var(--accent); align-self: flex-start; }

.timeline { list-style: none; display: grid; gap: 16px; max-width: 820px; }
.tl-item {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--accent-strong); border-radius: 12px; padding: 18px 20px;
}
.tl-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.tl-title { font-size: 17px; color: var(--text); }
.tl-date { font-size: 13px; font-weight: 700; color: var(--gold); white-space: nowrap; }
.tl-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.tl-meta:empty { display: none; }
.tl-desc { color: var(--muted); font-size: 15px; margin-top: 6px; }
.tl-bullets { margin: 10px 0 0 18px; display: grid; gap: 6px; }
.tl-bullets li { color: var(--muted); font-size: 15px; }
.tl-bullets strong { color: var(--text); }
.note {
  margin-top: 20px; font-size: 14px; color: var(--muted);
  background: var(--learn-bg); border: 1px dashed var(--learn-border);
  padding: 12px 16px; border-radius: 12px; max-width: 760px;
}
.note code { background: var(--surface); padding: 1px 6px; border-radius: 6px; }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.contact-card {
  display: grid; gap: 4px; padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  box-shadow: var(--shadow); transition: transform .14s, border-color .2s;
}
.contact-card:hover { transform: translateY(-3px); text-decoration: none; border-color: color-mix(in srgb, var(--accent-strong) 50%, var(--border)); }
.contact-icon {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: var(--chip-bg); color: var(--chip-text); font-weight: 800; font-size: 15px; margin-bottom: 6px;
}
.contact-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.contact-val { font-weight: 600; word-break: break-word; }

.site-footer { border-top: 1px solid var(--border); padding: 28px 0; background: var(--surface-alt); }
.site-footer p { color: var(--muted); font-size: 14px; text-align: center; }
