/* ---------- Tokens ---------- */
:root {
  --bg: #f7f7f5;
  --bg-alt: #ececea;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --border: #e3e3df;
  --border-strong: #cfcfc9;
  --text: #1a1a1a;
  --text-muted: #5b5b58;
  --text-soft: #8a8a86;
  --accent: #2f6b3a;
  --accent-soft: #e7f0e3;
  --accent-strong: #234d2c;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --maxw: 1080px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #0f1115;
  --bg-alt: #161922;
  --surface: #181b24;
  --surface-2: #1d2130;
  --border: #2a2f3d;
  --border-strong: #3a4053;
  --text: #ececea;
  --text-muted: #a8aab2;
  --text-soft: #71747f;
  --accent: #7fc18a;
  --accent-soft: #1d3024;
  --accent-strong: #a8d6af;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.35);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
[data-theme="dark"] a { color: var(--accent-strong); }
code { font-family: var(--font-mono); font-size: 0.9em; padding: 2px 6px; border-radius: 6px; background: var(--bg-alt); color: var(--text); }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; padding: 8px 12px;
  background: var(--accent); color: white; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white; display: grid; place-items: center; font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
}
.brand-text { font-size: 0.95rem; }

.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 999px;
}
.nav a:hover { color: var(--text); background: var(--bg-alt); text-decoration: none; }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  width: 36px; height: 36px; border-radius: 999px;
  cursor: pointer; display: grid; place-items: center;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover { background: var(--bg-alt); color: var(--text); }
.theme-icon { width: 16px; height: 16px; display: block; }
.theme-icon::before {
  content: "🌙";
  font-size: 14px;
  line-height: 1;
}
[data-theme="dark"] .theme-icon::before { content: "☀️"; }

@media (max-width: 720px) {
  .nav { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 56px;
  background:
    radial-gradient(1000px 400px at 10% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(700px 300px at 100% 0%, color-mix(in srgb, var(--accent-soft) 80%, transparent), transparent 60%);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
  align-items: start;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-strong);
  margin: 0 0 16px;
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  margin: 0 0 20px;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 0 0 24px;
  max-width: 60ch;
}
.hero-meta {
  list-style: none; padding: 0; margin: 0 0 28px;
  display: flex; flex-wrap: wrap; gap: 12px;
}
.hero-meta li {
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-alt); }

.hero-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
}
.links { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.links a {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  color: var(--text);
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.links a:hover { background: var(--bg-alt); border-color: var(--border); text-decoration: none; }
.link-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-soft); font-weight: 600; }
.link-handle { font-family: var(--font-mono); font-size: 0.92rem; color: var(--text); }

@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero { padding: 56px 0 40px; }
}

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.section-header { margin-bottom: 36px; max-width: 70ch; }
.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  font-weight: 700;
}
.section-header p { color: var(--text-muted); margin: 0; }

/* ---------- Timeline / roles ---------- */
.timeline {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 28px;
}
.role {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.role:last-child { border-bottom: none; padding-bottom: 0; }
.role-meta { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.role-logo {
  width: 72px; height: 72px;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .role-logo {
  background: #fff;
  border-color: var(--border-strong);
}
.role-logo--repeat { visibility: hidden; }
.role-dates { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-muted); }
.role-place { font-size: 0.85rem; color: var(--text-soft); }

@media (max-width: 720px) {
  .role-logo { width: 56px; height: 56px; padding: 6px; }
  .role-logo--repeat { display: none; }
}
.role-body h3 {
  font-size: 1.2rem;
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.role-org { color: var(--text-muted); font-weight: 500; }
.role-body p { margin: 0 0 16px; color: var(--text-muted); }
.role-body p:last-child { margin-bottom: 0; }

.bullets { padding-left: 18px; margin: 0 0 16px; color: var(--text); }
.bullets li { margin-bottom: 6px; }
.bullets li::marker { color: var(--accent); }

.timeline-compact .role { grid-template-columns: 140px 1fr; gap: 20px; padding-bottom: 18px; }

@media (max-width: 720px) {
  .role { grid-template-columns: 1fr; gap: 8px; }
  .timeline-compact .role { grid-template-columns: 1fr; }
}

/* ---------- Chips ---------- */
.chips {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.chips li {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.chips-soft li {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-feature {
  grid-column: 1 / -1;
  background:
    linear-gradient(180deg, var(--surface), var(--surface-2));
}
.card-kicker {
  margin: 0; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--accent-strong); font-weight: 600;
}
.card h3 { margin: 6px 0 0; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.005em; }
.card-feature h3 { font-size: 1.35rem; }
.card p { margin: 0; color: var(--text-muted); }

@media (max-width: 760px) {
  .cards { grid-template-columns: 1fr; }
  .card-feature { grid-column: auto; }
}

/* ---------- About ---------- */
.about-inner { max-width: 780px; margin-inline: auto; }
.about-photo {
  margin: 0 0 36px;
  display: grid;
  gap: 12px;
}
.about-photo picture,
.about-photo img {
  display: block;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.about-photo img {
  height: auto;
  max-height: 380px;
  object-fit: cover;
  object-position: center 35%;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
@media (max-width: 720px) {
  .about-photo img { max-height: 280px; }
}
.about-photo figcaption {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}
.about-prose p {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.7;
}
.about-prose p:last-child { margin-bottom: 0; }

/* ---------- Skills ---------- */
.skills-inner { max-width: 780px; margin-inline: auto; }
.skills-intro {
  margin: 0 0 28px;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.7;
}
.skills-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.skill-stack-item {
  display: grid;
  gap: 10px;
}
.skill-lead {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---------- Two col ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}
@media (max-width: 880px) {
  .two-col { grid-template-columns: 1fr; gap: 32px; }
}

.languages-heading {
  margin: 24px 0 12px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-soft);
  font-weight: 600;
}
.languages { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.languages li {
  display: flex; justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.languages .lvl { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Contact ---------- */
.contact-inner { max-width: 720px; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.contact-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.contact-list a:hover { border-color: var(--accent); background: var(--surface-2); text-decoration: none; }
.contact-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-soft); font-weight: 600; }
.contact-value { font-family: var(--font-mono); font-size: 0.95rem; }

/* ---------- Footer ---------- */
.site-footer { padding: 32px 0; border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--text-soft); font-size: 0.88rem; }
.footer-inner p { margin: 0; }

/* ---------- Print ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --bg-alt: #fff; --border: #ddd; --text: #111; --text-muted: #333; }
  .site-header, .theme-toggle, .hero-cta, .site-footer, .skip-link { display: none !important; }
  .hero { padding: 24px 0 16px; background: none; }
  .section { padding: 24px 0; page-break-inside: avoid; }
  .card { box-shadow: none; }
  a { color: var(--text); text-decoration: none; }
  .container { max-width: 100%; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
