:root {
  --accent: #00b8d4;
  --accent-soft: rgba(0, 184, 212, 0.12);
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --fg: #0b1220;
  --fg-muted: #4a5568;
  --border: #e5e7eb;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --radius-sm: 8px;
  --container: 1100px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --bg-alt: #0f172a;
  --fg: #e2e8f0;
  --fg-muted: #94a3b8;
  --border: #1f2a44;
  --card: #111a2e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --bg-alt: #0f172a;
    --fg: #e2e8f0;
    --fg-muted: #94a3b8;
    --border: #1f2a44;
    --card: #111a2e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(0, 0, 0, 0.35);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
}

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

a:hover,
a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

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

.skip-link:focus {
  left: 16px;
  top: 16px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  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: 10px;
  color: var(--fg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
}

.primary-nav {
  display: flex;
  gap: 18px;
  font-size: 15px;
}

.primary-nav a {
  color: var(--fg-muted);
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
  color: var(--fg);
  text-decoration: none;
}

.theme-toggle {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  position: relative;
  cursor: pointer;
  padding: 0;
}

.theme-toggle-track {
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  transition: left 0.2s ease;
}

.theme-toggle[aria-pressed="true"] .theme-toggle-track {
  left: calc(100% - 21px);
}

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

/* Hero */
.hero {
  padding: 88px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.hero h1 {
  margin: 8px 0 16px;
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
}

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

.hero-roles {
  display: block;
  margin-top: 4px;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--fg-muted);
  font-weight: 500;
  min-height: 1.4em;
}

.hero-roles::after {
  content: "▍";
  margin-left: 2px;
  color: var(--accent);
  animation: caret 1s steps(2) infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

.lede {
  color: var(--fg-muted);
  font-size: 1.1rem;
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

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

.btn-primary:hover {
  background: color-mix(in oklab, var(--accent) 85%, white 15%);
}

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}

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

.social-row {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 14px;
  color: var(--fg-muted);
}

.social-row a {
  color: var(--fg-muted);
}

.social-row a:hover {
  color: var(--accent);
}

.hero-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.hero-card dl {
  display: grid;
  gap: 16px;
  margin: 0;
}

.hero-card dt {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  margin-bottom: 4px;
}

.hero-card dd {
  margin: 0;
  font-weight: 500;
}

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

/* Sections */
.section {
  padding: 72px 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  margin: 0 0 36px;
}

.section-head h2 {
  margin: 8px 0 0;
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  letter-spacing: -0.01em;
  font-weight: 700;
}

.prose {
  max-width: 70ch;
  color: var(--fg-muted);
  font-size: 1.05rem;
}

/* Skills */
.skill-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.skill-grid li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
}

.skill-grid em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Timeline */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 24px;
}

.timeline li {
  position: relative;
  padding: 20px 22px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.timeline li::before {
  content: "";
  position: absolute;
  top: 22px;
  left: -1px;
  width: 4px;
  height: 32px;
  background: var(--accent);
  border-radius: 4px;
}

.timeline-meta {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  text-transform: uppercase;
}

.timeline h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.timeline p {
  margin: 0;
  color: var(--fg-muted);
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.97rem;
}

/* Stats band */
.stats-band {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 26px 0;
}

.stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px;
  text-align: center;
}

.stats li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--accent);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.contact-intro {
  margin: 0 0 20px;
  max-width: 55ch;
  color: var(--fg-muted);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 40px;
  align-items: start;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.contact-list li {
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.contact-list span {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 4px;
}

.contact-list p,
.contact-list a {
  margin: 0;
  font-weight: 500;
}

.contact-form {
  display: grid;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.contact-form label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--fg-muted);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

.form-status {
  margin: 0;
  font-size: 14px;
  min-height: 1.4em;
}

.form-status.success {
  color: var(--accent);
}

.form-status.error {
  color: #dc2626;
}

@media (max-width: 820px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer */
.site-footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero-roles::after {
    animation: none;
  }
  .btn:hover {
    transform: none;
  }
}
