:root {
  --bg: #0a192f;
  --bg-alt: #112240;
  --surface: #172a45;
  --text: #ccd6f6;
  --text-dim: #8892b0;
  --accent: #64ffda;
  --accent-dim: rgba(100, 255, 218, 0.1);
  --border: rgba(100, 255, 218, 0.2);
  --shadow: 0 10px 30px -15px rgba(2, 12, 27, 0.7);
  --radius: 10px;
  --maxw: 1100px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --text: #1a2440;
  --text-dim: #5a6785;
  --accent: #0a8f6e;
  --accent-dim: rgba(10, 143, 110, 0.1);
  --border: rgba(10, 143, 110, 0.25);
  --shadow: 0 10px 30px -15px rgba(10, 30, 60, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  background: var(--bg);
  color: var(--text-dim);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition:
    background 0.3s ease,
    color 0.3s ease;
}

h1,
h2,
h3 {
  color: var(--text);
  line-height: 1.1;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--text);
}

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

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(20px, 5vw, 50px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}
.nav.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow);
}
.nav__brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent);
}
.nav__brand span {
  color: var(--text);
}
.nav__links {
  display: flex;
  gap: 26px;
}
.nav__links a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}
.nav__links a:hover {
  color: var(--accent);
}
.nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  transition:
    background 0.2s,
    transform 0.2s;
}
.icon-btn:hover {
  background: var(--accent-dim);
  transform: translateY(-2px);
}

.lang {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.lang__icon {
  position: absolute;
  left: 9px;
  font-size: 0.85rem;
  pointer-events: none;
  opacity: 0.8;
}
.lang select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 9px 24px 9px 28px;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.lang select:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.lang select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.lang::after {
  content: "▾";
  position: absolute;
  right: 9px;
  color: var(--text-dim);
  font-size: 0.7rem;
  pointer-events: none;
}
.lang option {
  background: var(--bg-alt);
  color: var(--text);
}

/* BUTTONS */
.btn {
  display: inline-block;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  padding: 12px 22px;
  border-radius: 8px;
  transition:
    background 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}
.btn:hover {
  background: var(--accent-dim);
  color: var(--accent);
  transform: translateY(-2px);
}
.btn--primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.btn--primary:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: var(--shadow);
}
.btn--sm {
  padding: 9px 16px;
  font-size: 0.85rem;
}

/* HERO */
.hero {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  padding: 0 clamp(20px, 8vw, 100px);
}
.hero__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}
.hero__eyebrow {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 18px;
}
.hero__name {
  font-size: clamp(2.6rem, 8vw, 4.8rem);
  font-weight: 800;
  letter-spacing: -1px;
}
.hero__tagline {
  font-size: clamp(1.8rem, 6vw, 3.6rem);
  font-weight: 800;
  color: var(--text-dim);
  margin-bottom: 22px;
}
.typed {
  color: var(--accent);
  border-right: 2px solid var(--accent);
  padding-right: 4px;
}
.hero__lead {
  max-width: 560px;
  font-size: 1.05rem;
  margin-bottom: 32px;
}
.hero__cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.hero__stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  list-style: none;
}
.hero__stats li {
  display: flex;
  flex-direction: column;
}
.hero__stats strong {
  font-size: 2rem;
  color: var(--accent);
  font-family: var(--mono);
}
.hero__stats span {
  font-size: 0.85rem;
}

/* SECTIONS */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 90px clamp(20px, 5vw, 40px);
}
.section__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 40px;
  white-space: nowrap;
}
.section__title::after {
  content: "";
  height: 1px;
  width: 100%;
  max-width: 320px;
  background: var(--border);
}
.section__title--center {
  justify-content: center;
}
.section__title--center::after {
  display: none;
}
.section__num {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 500;
}

/* ABOUT */
.about {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 50px;
  align-items: start;
}
.about__text p {
  margin-bottom: 16px;
}
.about__tech {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 20px;
  margin-top: 10px;
}
.about__tech li {
  position: relative;
  padding-left: 20px;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.about__tech li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.about__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  text-align: center;
}
.about__avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 2rem;
  color: var(--bg);
  background: var(--accent);
}
.about__quote {
  font-style: italic;
  color: var(--text);
}

/* PROJECTS */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 34px;
}
.chip {
  font-family: var(--mono);
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 20px;
  transition: all 0.2s;
}
.chip:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.chip.is-active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.project {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition:
    transform 0.25s,
    box-shadow 0.25s,
    opacity 0.25s;
}
.project:hover {
  transform: translateY(-7px);
}
.project.is-hidden {
  display: none;
}
.project__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.project__folder {
  font-size: 1.8rem;
}
.project__links a {
  font-family: var(--mono);
  font-size: 0.8rem;
}
.project__title {
  font-size: 1.35rem;
  margin-bottom: 12px;
}
.project__desc {
  flex: 1;
  font-size: 0.95rem;
  margin-bottom: 18px;
}
.project__live {
  margin-bottom: 16px;
  align-self: flex-start;
}
.project__stack {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.project__stack li {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}
.projects__empty {
  text-align: center;
  margin-top: 30px;
  font-family: var(--mono);
}

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

/* SKILLS */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}
.skills__group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.skills__group h3 {
  font-size: 1.05rem;
  margin-bottom: 14px;
  color: var(--accent);
}
.skills__group ul {
  list-style: none;
}
.skills__group li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.skills__group li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* CONTACT */
.section--contact {
  text-align: center;
  padding-bottom: 120px;
}
.contact__lead {
  max-width: 540px;
  margin: 0 auto 34px;
}
.contact__actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 30px 20px;
  font-family: var(--mono);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}
.footer__note {
  margin-top: 4px;
  opacity: 0.7;
}

/* toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: var(--bg);
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s,
    transform 0.3s;
  z-index: 100;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* RESPONSIVE */
@media (max-width: 720px) {
  .nav__links {
    display: none;
  }
  .about {
    grid-template-columns: 1fr;
  }
  .hero__stats {
    gap: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .typed {
    border-right: none;
  }
}

/* PRINT — turns the page into a clean one-column resume */
@media print {
  .nav,
  .hero__cta,
  .filters,
  .contact__actions,
  .project__live,
  .footer__note,
  .theme-icon,
  #theme-toggle,
  #print-btn,
  .lang,
  .skip-link,
  .about__card {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .hero {
    min-height: auto;
    padding: 20px 0;
  }
  .section {
    padding: 16px 0;
    page-break-inside: avoid;
  }
  .project,
  .skills__group {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
  .project.is-hidden {
    display: flex !important;
  }
  a {
    color: #000;
  }
}
