:root {
  --bg:         #0c0c0e;
  --bg-raised:  #131316;
  --border:     #21212a;
  --text:       #d8d8dc;
  --text-muted: #5c5c68;
  --accent:     #6c8ef5;
  --nav-bg:     rgba(12, 12, 14, 0.88);
  --font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono:       'Courier New', 'Menlo', monospace;
}

[data-theme="light"] {
  --bg:         #f9f9fb;
  --bg-raised:  #f0f0f4;
  --border:     #dddde6;
  --text:       #1a1a22;
  --text-muted: #8888a0;
  --accent:     #3d6fe8;
  --nav-bg:     rgba(249, 249, 251, 0.88);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:         #f9f9fb;
    --bg-raised:  #f0f0f4;
    --border:     #dddde6;
    --text:       #1a1a22;
    --text-muted: #8888a0;
    --accent:     #3d6fe8;
    --nav-bg:     rgba(249, 249, 251, 0.88);
  }
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

nav  { animation: fade-up 0.4s ease both; }
main { animation: fade-up 0.5s 0.1s ease both; }

/* ─── Nav ─────────────────────────────────────────────────────────────── */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}

nav.scrolled {
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
}

nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color 0.2s;
}

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

#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 7px;
  display: flex;
  align-items: center;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

#theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

#theme-toggle .icon-sun  { display: none; }
#theme-toggle .icon-moon { display: block; }

[data-theme="light"] #theme-toggle .icon-sun  { display: block; }
[data-theme="light"] #theme-toggle .icon-moon { display: none; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) #theme-toggle .icon-sun  { display: block; }
  :root:not([data-theme="dark"]) #theme-toggle .icon-moon { display: none; }
}

/* ─── Layout ──────────────────────────────────────────────────────────── */

main {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 28px 96px;
}

section {
  padding-top: 96px;
}

/* ─── Hero ────────────────────────────────────────────────────────────── */

#hero {
  padding-top: 160px;
  padding-bottom: 16px;
  text-align: center;
}

#hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 14px;
}

.subtitle {
  font-size: 1.05rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 10px;
}

.tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* ─── Section headings ────────────────────────────────────────────────── */

h2 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 36px;
  font-weight: 500;
}

/* ─── About ───────────────────────────────────────────────────────────── */

#about p {
  font-size: 0.975rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 16px;
}

#about p:last-child {
  margin-bottom: 0;
}

.core-areas {
  font-size: 0.825rem !important;
  color: var(--text-muted) !important;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  margin-top: 8px !important;
}

/* ─── Experience ──────────────────────────────────────────────────────── */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 52px;
}

.job {
  border-left: 1px solid var(--border);
  padding-left: 28px;
  position: relative;
}

.job::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.job h3 {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.company {
  display: block;
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
}

.period {
  font-size: 0.775rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-top: 3px;
  font-family: var(--mono);
  flex-shrink: 0;
}

.job-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-style: italic;
}

.job ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.job li {
  font-size: 0.9rem;
  color: var(--text);
  padding-left: 18px;
  position: relative;
  line-height: 1.65;
}

.job li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  top: 2px;
}

.job-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scale {
  font-size: 0.775rem;
  color: var(--text-muted);
  font-family: var(--mono);
  line-height: 1.6;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tags span {
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 100px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ─── Skills ──────────────────────────────────────────────────────────── */

.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.skill-group h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 500;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-list span {
  font-size: 0.875rem;
  padding: 5px 14px;
  border-radius: 6px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text);
}

/* ─── Contact ─────────────────────────────────────────────────────────── */

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 32px;
}

.links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.links a:hover {
  color: var(--text);
  border-bottom-color: var(--border);
}

.links svg {
  flex-shrink: 0;
  opacity: 0.6;
}


/* ─── Footer ──────────────────────────────────────────────────────────── */

footer {
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 28px 48px;
  border-top: 1px solid var(--border);
  font-size: 0.775rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

/* ─── Hero avatar ─────────────────────────────────────────────────────── */

.hero-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  display: block;
  margin: 0 auto 24px;
}

/* ─── Availability ────────────────────────────────────────────────────── */

.availability {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 14px;
}

.availability-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  box-shadow: 0 0 6px #4ade8088;
  animation: dot-pulse 2.5s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 5px #4ade8077; }
  50%       { opacity: 0.5; box-shadow: 0 0 10px #4ade80bb; }
}

/* ─── Hero CTA ────────────────────────────────────────────────────────── */

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.hero-cta:hover {
  color: var(--text);
  border-bottom-color: var(--text-muted);
}

.hero-cta svg {
  transition: transform 0.2s;
}

.hero-cta:hover svg {
  transform: translateY(2px);
}

/* ─── Earlier roles toggle ────────────────────────────────────────────── */

#earlier-roles {
  display: flex;
  flex-direction: column;
  gap: 52px;
  margin-bottom: 0;
}


#earlier-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-family: var(--font);
  transition: color 0.2s;
}

#earlier-toggle:hover {
  color: var(--text);
}

.earlier-icon {
  transition: transform 0.25s;
}

#earlier-toggle[aria-expanded="true"] .earlier-icon {
  transform: rotate(180deg);
}

/* ─── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .nav-inner { padding: 0 20px; }
  main { padding: 0 20px 80px; }

  #hero { padding-top: 120px; }

  nav ul { gap: 18px; }
  nav a { font-size: 0.8rem; }

  .job-header { flex-direction: column; gap: 4px; }
  .period { margin-top: 0; }
}

/* ─── Reduced motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }

  html { scroll-behavior: auto; }
}
