:root {
  color-scheme: light dark;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --bg: #f6f5f2;
  --bg-elevated: #ffffff;
  --text: #1a1a18;
  --text-muted: #5c5c56;
  --border: #e4e2dc;
  --accent: #0d6e6e;
  --accent-soft: rgba(13, 110, 110, 0.12);
  --shadow: 0 1px 2px rgba(26, 26, 24, 0.06), 0 12px 40px rgba(26, 26, 24, 0.06);
  --header-bg: rgba(246, 245, 242, 0.85);
  --hero-glow: radial-gradient(ellipse 80% 60% at 70% -10%, rgba(13, 110, 110, 0.18), transparent 60%);
}

[data-theme="dark"] {
  --bg: #111110;
  --bg-elevated: #1c1c1a;
  --text: #ededea;
  --text-muted: #9a9a92;
  --border: #2e2e2a;
  --accent: #5ec9c4;
  --accent-soft: rgba(94, 201, 196, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 48px rgba(0, 0, 0, 0.35);
  --header-bg: rgba(17, 17, 16, 0.88);
  --hero-glow: radial-gradient(ellipse 80% 60% at 70% -10%, rgba(94, 201, 196, 0.15), transparent 60%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--hero-glow);
  pointer-events: none;
  z-index: -1;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #fff;
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem clamp(1.25rem, 4vw, 3rem);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.nav {
  display: none;
  gap: 1.75rem;
  margin-left: auto;
}

.nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover {
  color: var(--text);
}

.theme-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle:active {
  transform: scale(0.96);
}

.theme-icon {
  font-size: 1rem;
  line-height: 1;
}

[data-theme="light"] .theme-icon-moon,
[data-theme="dark"] .theme-icon-sun,
:root:not([data-theme]) .theme-icon-moon {
  display: none;
}

@media (min-width: 640px) {
  .nav {
    display: flex;
  }

  .theme-toggle {
    margin-left: 0;
  }
}

main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem) 4rem;
}

@media (min-width: 900px) {
  main {
    max-width: 52rem;
  }
}

.hero {
  padding: clamp(3rem, 10vw, 6rem) 0 3rem;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.hero-title {
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
}

.hero-accent {
  color: var(--accent);
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
  max-width: 36ch;
}

.hero-lead strong {
  color: var(--text);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.08);
  color: #fff;
}

.btn-secondary {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-elevated);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.section {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.section-text {
  margin: 0;
  color: var(--text-muted);
}

.section-intro {
  margin: -0.5rem 0 1.75rem;
  color: var(--text-muted);
}

.about-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 720px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.skills-card {
  padding: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.skills-title {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.skills-title + .tag-list {
  margin-bottom: 1.25rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tag-list li {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.tag-list-muted li {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-item {
  position: relative;
  padding-left: 1.25rem;
  padding-bottom: 2rem;
  border-left: 2px solid var(--border);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.timeline-role {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
}

.timeline-org {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
}

.timeline-note {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--accent);
}

.aside-cards {
  display: grid;
  gap: 1rem;
  margin-top: 2.5rem;
}

@media (min-width: 600px) {
  .aside-cards {
    grid-template-columns: 1fr 1fr;
  }
}

.aside-card {
  padding: 1.25rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.aside-card-title {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.aside-card-body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.aside-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.aside-list li + li {
  margin-top: 0.35rem;
}

.project-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1.35rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.2s;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.project-name {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.project-desc {
  flex: 1;
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.project-tech {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.project-link {
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.section-contact .contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.contact-links a {
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
}

.contact-links a:hover {
  text-decoration: underline;
}

.site-footer {
  max-width: 52rem;
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 4vw, 3rem) 3rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0;
}
