:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --card-bg: #ffffff;
  --text: #14181f;
  --text-muted: #57606a;
  --border: #e2e8f0;
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-soft: #ccfbf1;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08), 0 4px 10px rgba(15, 23, 42, 0.06);
  --radius: 12px;
}

:root[data-theme="dark"] {
  --bg: #0b1120;
  --bg-alt: #0f172a;
  --card-bg: #111c34;
  --text: #e5e9f0;
  --text-muted: #9aa5b1;
  --border: #22304a;
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-soft: #0f3d38;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.45), 0 4px 10px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

img, svg { max-width: 100%; display: block; }

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

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 64px;
}
.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  border: 2px solid var(--accent);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand:hover { text-decoration: none; color: var(--accent); }

.site-nav {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.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; }

/* Hero */
.hero { padding: 72px 0 56px; }
.eyebrow {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin: 0 0 8px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  margin: 0 0 6px;
  line-height: 1.1;
}
.headline {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-muted);
  font-weight: 600;
  margin: 0 0 20px;
}
.bio {
  max-width: 68ch;
  color: var(--text-muted);
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  gap: 14px;
  margin: 28px 0 48px;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #06231f; }
:root[data-theme="dark"] .btn-primary { color: #06231f; }
.btn-primary:hover { background: var(--accent-hover); color: #06231f; }
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Skills */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 8px;
}
.skill-group h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.tag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-list li {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
}
.tag-list.small li { font-size: 0.76rem; padding: 4px 9px; }

/* Sections */
.section-title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin: 0 0 8px;
}
.section-lede {
  color: var(--text-muted);
  max-width: 68ch;
  margin: 0 0 36px;
}
.projects, .experience, .contact { padding: 64px 0; border-top: 1px solid var(--border); }
.projects { background: var(--bg-alt); }

/* Project grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.project-card.featured { border-color: var(--accent); }
.card-body { padding: 22px 22px 8px; flex: 1; }
.card-body h3 { font-size: 1.08rem; margin: 0 0 10px; }
.card-body p { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 14px; }
.card-links {
  padding: 14px 22px 20px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.card-links a { font-weight: 600; font-size: 0.9rem; }

/* Timeline */
.timeline { margin-bottom: 40px; }
.timeline:last-child { margin-bottom: 0; }
.timeline-heading {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
  margin: 0 0 20px;
}
.timeline-item {
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--border);
  padding-bottom: 28px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}
.timeline-content h4 { margin: 0 0 4px; font-size: 1.05rem; }
.timeline-meta { color: var(--text-muted); font-size: 0.88rem; margin: 0 0 10px; }
.timeline-content ul { margin: 0; padding-left: 20px; color: var(--text-muted); }
.timeline-content li { margin-bottom: 6px; }
.timeline-content p { color: var(--text-muted); margin: 0; }

/* Contact */
.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  max-width: 720px;
}
.contact-list li a,
.contact-list li .contact-static {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--card-bg);
}
.contact-list li a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.contact-list .icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Footer */
.site-footer {
  padding: 28px 0 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Focus visibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 640px) {
  .site-nav { gap: 18px; }
  .hero { padding: 48px 0 40px; }
  .projects, .experience, .contact { padding: 48px 0; }
}
