:root {
  --font-body: "Fira Code", monospace;
  --accent: #7f5af0;
  --accent-secondary: #2cb1ff;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --container-width: clamp(320px, 90vw, 1120px);
  --transition-base: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #0f121c;
  --text: #f7f9ff;
  --muted: #9aa5d0;
  --accent-soft: rgba(127, 90, 240, 0.25);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 25px 50px -12px rgba(15, 18, 28, 0.65);
  --glass-bg: rgba(10, 12, 22, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.35);
  --surface: rgba(20, 24, 41, 0.78);
  --surface-alt: rgba(20, 24, 41, 0.82);
  --surface-strong: rgba(20, 24, 41, 0.95);
  --surface-hover: rgba(33, 40, 70, 0.8);
  --chip-bg: rgba(255, 255, 255, 0.04);
  --chip-border: rgba(255, 255, 255, 0.08);
  --chip-strong-bg: rgba(127, 90, 240, 0.12);
  --chip-strong-border: rgba(127, 90, 240, 0.35);
  --cta-gradient-start: rgba(127, 90, 240, 0.22);
  --cta-gradient-end: rgba(44, 177, 255, 0.18);
  --avatar-bg: rgba(15, 18, 28, 0.9);
  --hero-card-border: rgba(255, 255, 255, 0.05);
  --topbar-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.35);
  --timeline-track: linear-gradient(180deg, rgba(127, 90, 240, 0.7), rgba(127, 90, 240, 0));
  --footer-text: rgba(154, 165, 208, 0.6);
  --bg-card: var(--surface-strong);
  --bg-card-hover: var(--surface-hover);
}

[data-theme="light"] {
  --bg: #f7f8fc;
  --text: #121422;
  --muted: #585f7a;
  --accent-soft: rgba(127, 90, 240, 0.18);
  --border: rgba(15, 18, 28, 0.1);
  --shadow: 0 20px 40px -24px rgba(12, 15, 35, 0.22);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(15, 18, 28, 0.08);
  --glass-shadow: 0 18px 30px -18px rgba(15, 20, 40, 0.25);
  --surface: rgba(255, 255, 255, 0.9);
  --surface-alt: rgba(255, 255, 255, 0.95);
  --surface-strong: rgba(255, 255, 255, 1);
  --surface-hover: rgba(225, 230, 245, 0.95);
  --chip-bg: rgba(18, 19, 41, 0.05);
  --chip-border: rgba(15, 18, 28, 0.08);
  --chip-strong-bg: rgba(127, 90, 240, 0.16);
  --chip-strong-border: rgba(127, 90, 240, 0.35);
  --cta-gradient-start: rgba(127, 90, 240, 0.18);
  --cta-gradient-end: rgba(44, 177, 255, 0.24);
  --avatar-bg: rgba(255, 255, 255, 0.95);
  --hero-card-border: rgba(15, 18, 28, 0.08);
  --topbar-shadow: 0 18px 30px -18px rgba(15, 20, 40, 0.25);
  --timeline-track: linear-gradient(180deg, rgba(127, 90, 240, 0.6), rgba(127, 90, 240, 0));
  --footer-text: rgba(88, 95, 122, 0.7);
  --bg-card: var(--surface-strong);
  --bg-card-hover: var(--surface-hover);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  z-index: 0;
}

.page-shell {
  position: relative;
  z-index: 1;
  padding: 0 24px 80px;
}

.topbar {
  position: sticky;
  top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px auto 64px;
  padding: 18px 24px;
  width: var(--container-width);
  border-radius: 999px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--topbar-shadow);
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: transparent;
  text-decoration: none;
  overflow: hidden;
  border: 2px solid var(--accent-soft);
  box-shadow: 0 8px 18px rgba(15, 18, 28, 0.35);
}

.brand__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.nav {
  display: flex;
  gap: 28px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}

.nav a:hover,
.nav a:focus {
  color: var(--accent);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--transition-base), color var(--transition-base), background var(--transition-base);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(127, 90, 240, 0.08);
}

.theme-toggle:focus {
  outline: none;
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(127, 90, 240, 0.25);
}

.theme-toggle__track {
  position: relative;
  width: 44px;
  height: 22px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  padding: 0 2px;
  transition: background var(--transition-base), border-color var(--transition-base);
}

.theme-toggle__thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform var(--transition-base);
}

[data-theme="light"] .theme-toggle__thumb {
  transform: translateX(20px);
}

.theme-toggle__text {
  min-width: 80px;
  text-align: left;
}

.hero {
  width: var(--container-width);
  margin: 0 auto 120px;
  display: grid;
  gap: 48px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
}

.hero__badge {
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(127, 90, 240, 0.4);
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0 0 24px;
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.3;
}

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

.hero__description {
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 32px;
}

.hero__cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.button {
  text-decoration: none;
  font-size: 14px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}

.button--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #06070d;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(127, 90, 240, 0.35);
}

.button--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 35px rgba(127, 90, 240, 0.45);
}

.button--ghost {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}

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

.social {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 24px;
  font-size: 14px;
}

.social a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.hero__card {
  background: radial-gradient(120% 120% at 0% 0%, rgba(127, 90, 240, 0.18), var(--surface-strong));
  border-radius: var(--radius-lg);
  padding: 40px;
  border: 1px solid var(--hero-card-border);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero__avatar {
  height: 160px;
  width: 160px;
  border-radius: 50%;
  margin: 0 auto 28px;
  display: grid;
  place-items: center;
  position: relative;
  background: var(--avatar-bg);
  border: 1px solid var(--border);
}

.hero__photo {
  position: relative;
  z-index: 1;
  width: 90%;
  height: 90%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(127, 90, 240, 0.35);
  box-shadow: 0 8px 24px rgba(15, 18, 28, 0.35);
}

.hero__glow {
  position: absolute;
  inset: -12px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(127, 90, 240, 0.65), rgba(127, 90, 240, 0));
  filter: blur(18px);
  z-index: 0;
}

.hero__meta {
  color: var(--muted);
  font-size: 14px;
  display: grid;
  gap: 12px;
}

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

.section {
  width: var(--container-width);
  margin: 0 auto 120px;
  display: grid;
  gap: 40px;
}

.section__heading {
  display: grid;
  gap: 12px;
}

.section__kicker {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.section__heading h2 {
  font-size: clamp(28px, 3vw, 36px);
  margin: 0;
}

.section__heading p {
  color: var(--muted);
  max-width: 560px;
}

.section__content p {
  margin: 0 0 20px;
  color: var(--muted);
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0;
  margin: 16px 0 0;
}

.tags li {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.06em;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--muted);
}

.section--split {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  align-items: start;
  gap: 64px;
}

.timeline {
  position: relative;
  padding-left: 28px;
  display: grid;
  gap: 40px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 12px;
  width: 2px;
  background: var(--timeline-track);
}

.timeline__item {
  padding: 28px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.timeline__item::before {
  content: "";
  position: absolute;
  top: 32px;
  left: -28px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 6px rgba(127, 90, 240, 0.18);
}

.timeline__period {
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.timeline__item h3 {
  margin: 0 0 12px;
  font-size: 20px;
  color: var(--text);
}

.timeline__item p {
  margin: 0 0 20px;
  color: var(--muted);
}

.timeline__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline__tags li {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--chip-strong-border);
  color: var(--accent);
  background: var(--chip-strong-bg);
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}

.project-card {
  padding: 32px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(127, 90, 240, 0.4);
  background: var(--surface-hover);
}

.project-card__meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.project-card h3 {
  margin: 0 0 16px;
  font-size: 22px;
}

.project-card p {
  margin: 0 0 24px;
  color: var(--muted);
}

.project-card__tags {
  list-style: none;
  display: flex;
  gap: 10px;
  padding: 0;
  margin: 0 0 24px;
  flex-wrap: wrap;
}

.project-card__tags li {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--chip-border);
  color: var(--muted);
}

.project-card__link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}

.project-card__link:hover {
  text-decoration: underline;
}

.cta {
  width: var(--container-width);
  margin: 0 auto 120px;
}

.cta__inner {
  padding: 42px 48px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(127, 90, 240, 0.4);
  background: linear-gradient(135deg, var(--cta-gradient-start), var(--cta-gradient-end));
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}

.cta__inner p {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.contact-card {
  padding: 36px;
  border-radius: var(--radius-lg);
  background: var(--surface-alt);
  border: 1px solid rgba(127, 90, 240, 0.3);
  display: grid;
  gap: 28px;
}

.contact-card__title {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-card__link {
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
}

.contact-card__link:hover {
  color: var(--accent);
}

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

.contact-card__links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}

.contact-card__links a:hover {
  color: var(--accent);
}

.footer {
  width: var(--container-width);
  margin: 0 auto;
  padding: 48px 0 24px;
  color: var(--footer-text);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 960px) {
  .topbar {
    padding: 16px 20px;
    gap: 16px;
  }

  .nav {
    gap: 20px;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .hero__card {
    max-width: 420px;
  }

  .section--split {
    grid-template-columns: 1fr;
  }

  .timeline {
    padding-left: 24px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 0 16px 60px;
  }

  .topbar {
    position: static;
    width: 100%;
    margin: 18px auto 48px;
  }

  .nav {
    display: none;
  }

  .hero__badge {
    font-size: 12px;
  }

  .hero h1 {
    font-size: clamp(28px, 8vw, 36px);
  }

  .hero__cta {
    width: 100%;
  }

  .button {
    width: 100%;
    justify-content: center;
  }

  .projects {
    grid-template-columns: 1fr;
  }

  .cta__inner {
    padding: 32px;
    text-align: center;
    justify-content: center;
  }

  .contact-card {
    padding: 28px;
  }
}
