/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  color-scheme: light;
  --bg: #faf8f4;
  --surface: #ffffff;
  --surface-2: #f3efe7;
  --border: #e5dfd3;
  --border-strong: #d3cbbb;
  --text: #1b1a17;
  --text-2: #57524a;
  --muted: #6b665c;
  --accent: #0f766e;
  --accent-hover: #0b5f58;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1ee;
  --accent-text: #0d6b64;
  --warm: #b45309;
  --warm-soft: #fbeedd;
  --grid: #ebe6dc;
  --shadow: 0 1px 2px rgba(40, 32, 20, 0.05), 0 8px 24px rgba(40, 32, 20, 0.06);
  --shadow-lg: 0 2px 6px rgba(40, 32, 20, 0.06), 0 24px 60px rgba(40, 32, 20, 0.14);
  --hero-glow: radial-gradient(60% 60% at 80% 10%, rgba(15, 118, 110, 0.12), transparent 70%),
    radial-gradient(40% 50% at 10% 30%, rgba(180, 83, 9, 0.08), transparent 70%);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;

  --radius: 14px;
  --radius-sm: 10px;
  --container: 1120px;
  --gutter: 16px;
  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1012;
    --surface: #15181b;
    --surface-2: #1c2024;
    --border: #272c31;
    --border-strong: #353b41;
    --text: #eceae5;
    --text-2: #b9b5ac;
    --muted: #8d897f;
    --accent: #2cc5b0;
    --accent-hover: #4fd6c3;
    --accent-ink: #062320;
    --accent-soft: #10302c;
    --accent-text: #5fd9c8;
    --warm: #f0a35a;
    --warm-soft: #2e2214;
    --grid: #23282d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.35), 0 24px 60px rgba(0, 0, 0, 0.5);
    --hero-glow: radial-gradient(60% 60% at 80% 10%, rgba(44, 197, 176, 0.13), transparent 70%),
      radial-gradient(40% 50% at 10% 30%, rgba(240, 163, 90, 0.07), transparent 70%);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1012;
  --surface: #15181b;
  --surface-2: #1c2024;
  --border: #272c31;
  --border-strong: #353b41;
  --text: #eceae5;
  --text-2: #b9b5ac;
  --muted: #8d897f;
  --accent: #2cc5b0;
  --accent-hover: #4fd6c3;
  --accent-ink: #062320;
  --accent-soft: #10302c;
  --accent-text: #5fd9c8;
  --warm: #f0a35a;
  --warm-soft: #2e2214;
  --grid: #23282d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.35), 0 24px 60px rgba(0, 0, 0, 0.5);
  --hero-glow: radial-gradient(60% 60% at 80% 10%, rgba(44, 197, 176, 0.13), transparent 70%),
    radial-gradient(40% 50% at 10% 30%, rgba(240, 163, 90, 0.07), transparent 70%);
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: var(--accent-text);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--accent-hover);
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
  font-optical-sizing: auto;
}
p {
  margin: 0;
}
ul {
  margin: 0;
  padding: 0;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
::selection {
  background: var(--accent-soft);
  color: var(--text);
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 12px;
  color: var(--accent-ink);
}
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
@media (min-width: 768px) {
  :root {
    --gutter: 32px;
  }
}

/* ==========================================================================
   Buttons, chips, tags
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 18px -8px var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
  transform: translateY(-1px);
}
.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--text-2);
  color: var(--text);
  transform: translateY(-1px);
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
  text-decoration: none;
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-text);
  font-weight: 500;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.brand:hover {
  color: var(--text);
}
.monogram {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 16px;
  letter-spacing: 0;
}
.nav-links {
  display: none;
  gap: 4px;
  list-style: none;
}
.nav-links a {
  display: block;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s, background-color 0.2s;
}
.nav-links a:hover,
.nav-links a[aria-current="true"] {
  color: var(--text);
  background: var(--surface-2);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.theme-toggle .icon-moon {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}
.menu-toggle {
  display: inline-grid;
}
.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  z-index: 39;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 8px var(--gutter) 16px;
}
.mobile-nav[hidden] {
  display: none;
}
.mobile-nav a {
  display: block;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.mobile-nav li:last-child a {
  border-bottom: 0;
}
.mobile-nav ul {
  list-style: none;
}
@media (min-width: 900px) {
  .nav-links {
    display: flex;
  }
  .menu-toggle {
    display: none;
  }
  .mobile-nav {
    display: none !important;
  }
}

/* ==========================================================================
   Sections
   ========================================================================== */
section {
  padding-block: 72px;
}
@media (min-width: 768px) {
  section {
    padding-block: 104px;
  }
}
.section-head {
  max-width: 680px;
  margin-bottom: 40px;
}
.section-head h2 {
  font-size: clamp(30px, 5vw, 44px);
  margin-top: 10px;
}
.section-head p {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 17px;
}
.alt-bg {
  background: var(--surface-2);
  background: color-mix(in srgb, var(--surface-2) 55%, var(--bg));
  border-block: 1px solid var(--border);
}

/* Hero ------------------------------------------------------------------ */
.hero {
  position: relative;
  padding-top: 56px;
  padding-bottom: 72px;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: calc(var(--header-h) * -1) 0 0;
  background: var(--hero-glow);
  z-index: -1;
  pointer-events: none;
}
.hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}
@media (min-width: 960px) {
  .hero {
    padding-top: 88px;
    padding-bottom: 112px;
  }
  .hero-grid {
    grid-template-columns: 1.25fr 0.9fr;
    gap: 64px;
  }
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 4px color-mix(in srgb, #16a34a 20%, transparent);
}
.hero h1 {
  margin-top: 22px;
  font-size: clamp(40px, 8vw, 68px);
  letter-spacing: -0.025em;
  line-height: 1.04;
}
.hero h1 .accent {
  color: var(--accent-text);
  font-style: italic;
  font-weight: 500;
}
.hero-lede {
  margin-top: 22px;
  font-size: clamp(17px, 2.2vw, 19px);
  color: var(--text-2);
  max-width: 600px;
}
.hero-lede strong {
  color: var(--text);
  font-weight: 600;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.hero-social {
  display: flex;
  gap: 8px;
  margin-top: 28px;
  align-items: center;
}
.hero-social .label {
  font-size: 14px;
  color: var(--muted);
  margin-right: 6px;
}

.profile-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.profile-top {
  display: flex;
  gap: 16px;
  align-items: center;
}
.avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  flex: none;
  background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 45%, var(--warm)));
  color: #fff;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
}
.profile-top h2 {
  font-size: 22px;
}
.profile-top p {
  color: var(--text-2);
  font-size: 14px;
}
.now-list {
  list-style: none;
  margin-top: 20px;
  display: grid;
  gap: 10px;
}
.now-list li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  font-size: 15px;
  color: var(--text-2);
  align-items: start;
}
.now-list svg {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  color: var(--accent-text);
}
.now-list strong {
  color: var(--text);
  font-weight: 600;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}
.stat {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 14px 14px 12px;
}
.stat-value {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: proportional-nums;
}
.stat-label {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
  line-height: 1.35;
}
.chat-teaser {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--text-2);
  font-size: 14px;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.chat-teaser:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}
.chat-teaser svg {
  width: 22px;
  height: 22px;
  color: var(--accent-text);
  flex: none;
}

/* About ----------------------------------------------------------------- */
.about-grid {
  display: grid;
  gap: 40px;
}
@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 1.4fr 1fr;
    gap: 64px;
  }
}
.about-copy p {
  font-size: 18px;
  color: var(--text-2);
}
.about-copy p + p {
  margin-top: 18px;
}
.about-copy strong {
  color: var(--text);
  font-weight: 600;
}
.facts {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.facts li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.facts li:last-child {
  border-bottom: 0;
}
.facts .k {
  color: var(--muted);
}

/* Experience timeline --------------------------------------------------- */
.timeline {
  list-style: none;
  position: relative;
  display: grid;
  gap: 20px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}
.tl-item {
  position: relative;
  padding-left: 40px;
}
.tl-dot {
  position: absolute;
  left: 4px;
  top: 26px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-strong);
}
.tl-item.current .tl-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.tl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease);
}
.tl-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.tl-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  align-items: baseline;
}
.tl-head h3 {
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.tl-company {
  color: var(--accent-text);
  font-weight: 600;
}
.tl-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.tl-meta {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}
.tl-card ul {
  margin-top: 14px;
  padding-left: 18px;
  color: var(--text-2);
  display: grid;
  gap: 6px;
}
.tl-card li::marker {
  color: var(--border-strong);
}
.tl-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.highlight {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-top: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
  font-size: 14px;
}

/* Projects -------------------------------------------------------------- */
.project-grid {
  display: grid;
  gap: 18px;
}
@media (min-width: 720px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1040px) {
  .project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, border-color 0.3s;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.project-card.featured {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.project-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.project-icon svg {
  width: 22px;
  height: 22px;
}
.project-year {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
.project-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tech-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.tech-usage {
  margin-bottom: 24px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.tech-usage h3 {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 650;
}
.tech-usage ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.tech-usage li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  background: var(--bg);
}
.tu-count {
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.more-stack {
  color: var(--muted);
}
.project-card h3 {
  margin-top: 16px;
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.project-card .problem {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 15px;
}
.project-card .role {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}
.project-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.project-links {
  display: flex;
  gap: 16px;
  margin-top: auto;
  padding-top: 18px;
}
.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  min-height: 32px;
}
.project-links a:hover {
  text-decoration: underline;
}
.project-links svg {
  width: 16px;
  height: 16px;
}
.more-projects {
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px 22px;
}
.more-projects h3 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 650;
}
.more-projects ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.more-projects a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  transition: border-color 0.2s, color 0.2s;
}
.more-projects a:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* GitHub charts --------------------------------------------------------- */
.gh-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
@media (min-width: 720px) {
  .gh-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.gh-stats .stat {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 18px;
}
.chart-grid {
  display: grid;
  gap: 18px;
}
@media (min-width: 900px) {
  .chart-grid {
    grid-template-columns: 1.35fr 1fr;
  }
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  min-width: 0;
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.chart-head h3 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 650;
}
.chart-head p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}
.table-toggle {
  flex: none;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 999px;
  padding: 4px 12px;
  min-height: 32px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.table-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.chart {
  position: relative;
  margin-top: 14px;
  min-height: 220px;
}
.chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart .grid-line {
  stroke: var(--grid);
  stroke-width: 1;
}
.chart .axis-text {
  fill: var(--muted);
  font-size: 12px;
  font-family: var(--font-sans);
}
.chart .value-text {
  fill: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-sans);
}
.chart .label-text {
  fill: var(--text);
  font-size: 13px;
  font-family: var(--font-sans);
}
.chart .bar {
  fill: var(--accent);
  transition: opacity 0.15s;
}
.chart .hit {
  fill: transparent;
  cursor: default;
  outline: none;
}
.chart .hit:focus-visible + .bar,
.chart g.mark:hover .bar {
  opacity: 0.8;
}
.chart .hit:focus-visible {
  stroke: var(--accent);
  stroke-width: 2;
}
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  background: var(--text);
  color: var(--bg);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px));
  box-shadow: var(--shadow);
}
.chart-tooltip strong {
  font-weight: 650;
}
.chart-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 14px;
}
.chart-table th,
.chart-table td {
  text-align: left;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
}
.chart-table td:last-child,
.chart-table th:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.chart-table th {
  color: var(--muted);
  font-weight: 500;
}
.chart-note {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}

/* Skills ---------------------------------------------------------------- */
.skill-grid {
  display: grid;
  gap: 16px;
}
@media (min-width: 720px) {
  .skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1040px) {
  .skill-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.skill-group h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 650;
}
.skill-group h3 svg {
  width: 20px;
  height: 20px;
  color: var(--accent-text);
}
.skill-group ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.skill-group li {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-2);
  background: var(--bg);
  transition: border-color 0.2s, color 0.2s;
}
.skill-group li:hover {
  border-color: var(--accent);
  color: var(--text);
}
.skill-group li.core {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--text);
  font-weight: 500;
}
.skill-legend {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.skill-legend span {
  display: inline-block;
  width: 26px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
}

/* Education & certifications ------------------------------------------- */
.edu-grid {
  display: grid;
  gap: 18px;
}
@media (min-width: 900px) {
  .edu-grid {
    grid-template-columns: 1fr 1.4fr;
  }
}
.edu-card,
.cert-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.edu-item + .edu-item {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.edu-item:first-of-type {
  margin-top: 16px;
}
.edu-item h3 {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 650;
}
.edu-item p {
  color: var(--text-2);
  font-size: 15px;
}
.edu-item .tl-date {
  display: block;
  margin-top: 4px;
}
.cert-list ul {
  list-style: none;
  margin-top: 8px;
}
.cert-list li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.cert-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.cert-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--warm-soft);
  color: var(--warm);
}
.cert-icon svg {
  width: 18px;
  height: 18px;
}
.cert-name {
  font-weight: 600;
  line-height: 1.4;
}
.cert-meta {
  font-size: 14px;
  color: var(--muted);
}
.cert-meta a {
  font-weight: 600;
}

/* Contact --------------------------------------------------------------- */
.contact-grid {
  display: grid;
  gap: 28px;
}
@media (min-width: 900px) {
  .contact-grid {
    grid-template-columns: 1fr 1.2fr;
    gap: 48px;
  }
}
.contact-links {
  list-style: none;
  display: grid;
  gap: 10px;
  margin-top: 24px;
}
.contact-links a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s var(--ease);
  min-width: 0;
}
.contact-links a:hover {
  border-color: var(--accent);
  transform: translateX(3px);
}
.contact-links svg {
  width: 20px;
  height: 20px;
  color: var(--accent-text);
  flex: none;
}
.contact-links .cl-label {
  font-size: 13px;
  color: var(--muted);
  display: block;
  line-height: 1.3;
}
.contact-links .cl-value {
  font-weight: 600;
  display: block;
  overflow-wrap: anywhere;
}
.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}
.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea {
  min-height: 140px;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-row {
  display: grid;
  gap: 16px;
}
@media (min-width: 560px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-status {
  font-size: 15px;
  min-height: 1.5em;
}
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.btn[aria-busy="true"] {
  cursor: progress;
  opacity: 0.9;
}
.turnstile-slot {
  min-height: 65px;
}
.turnstile-slot[hidden] {
  display: none;
}
.fallback-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.form-status.ok {
  color: var(--accent-text);
}
.form-status.err {
  color: #c2410c;
}
:root[data-theme="dark"] .form-status.err {
  color: #fb923c;
}

/* Footer ---------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 32px;
  color: var(--muted);
  font-size: 14px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
.site-footer a {
  color: var(--text-2);
}

/* ==========================================================================
   Chat widget
   ========================================================================== */
.chat-launcher {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.chat-launcher:hover {
  transform: translateY(-2px);
}
.chat-launcher .pulse {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}
.chat-launcher .pulse svg {
  width: 16px;
  height: 16px;
}
.chat-launcher[aria-expanded="true"] {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
}
@media (min-width: 768px) {
  .chat-launcher {
    right: 24px;
    bottom: 24px;
  }
}

.chat-panel {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s linear 0.25s;
}
.chat-panel.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s;
}
@media (min-width: 560px) {
  .chat-panel {
    inset: auto 24px 24px auto;
    width: 400px;
    height: min(640px, calc(100vh - 48px));
    height: min(640px, calc(100dvh - 48px));
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
  }
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.chat-header .avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 17px;
}
.chat-title {
  flex: 1;
  min-width: 0;
}
.chat-title h2 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.chat-title p {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-title .status-dot {
  width: 7px;
  height: 7px;
  box-shadow: none;
}
.chat-disclaimer {
  margin: 0;
  padding: 10px 16px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
  background: var(--warm-soft);
  border-bottom: 1px solid var(--border);
}
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overscroll-behavior: contain;
  background: var(--bg);
}
.msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.msg.bot {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
}
.msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom-right-radius: 6px;
}
.msg p + p,
.msg p + ul,
.msg ul + p {
  margin-top: 8px;
}
.msg ul {
  padding-left: 18px;
}
.msg li + li {
  margin-top: 2px;
}
.msg a {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.typing {
  display: inline-flex;
  gap: 4px;
  padding: 6px 2px;
}
.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
  background: var(--bg);
}
.chips[hidden] {
  display: none;
}
.chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 12px;
  min-height: 36px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background-color 0.2s;
}
.chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.followups {
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  margin-top: -2px;
}
.followups-label {
  width: 100%;
  font-size: 12px;
  color: var(--muted);
}
.followups .chip {
  font-size: 13px;
  padding: 6px 12px;
  min-height: 34px;
}
.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.chat-form textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 11px 14px;
  background: var(--bg);
  font-size: 16px;
  line-height: 1.4;
  max-height: 120px;
  min-height: 46px;
}
.chat-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.send-btn {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  align-self: flex-end;
}
.send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.send-btn svg {
  width: 20px;
  height: 20px;
}
.chat-foot {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 0 12px 10px;
  background: var(--surface);
}

/* ==========================================================================
   Motion
   ========================================================================== */
/* Content is only hidden after main.js has set up the observer (.reveal-ready),
   so the page never stays blank if scripts fail. */
.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal-ready .reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
@media (forced-colors: active) {
  .chart .bar {
    fill: CanvasText;
  }
}
