:root {
  --bg: #0f1117;
  --bg-secondary: #181b24;
  --text: #e8edf5;
  --text-secondary: #9ba3b5;
  --subtle: #7f879a;
  --card: rgba(30, 34, 45, 0.75);
  --card-border: rgba(255, 255, 255, 0.06);
  --line: #2a2e3a;
  --accent: #a78bfa;
  --accent-secondary: #6ee7b7;
  --accent-gradient: linear-gradient(135deg, #a78bfa, #6ee7b7);
  --glass-bg: rgba(30, 34, 45, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --nav-bg: rgba(15, 17, 23, 0.82);
  --nav-border: rgba(255, 255, 255, 0.06);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  --radius: 16px;
  --radius-sm: 10px;
}

[data-theme="light"] {
  --bg: #f4f6fa;
  --bg-secondary: #ffffff;
  --text: #1a1d27;
  --text-secondary: #4a5063;
  --subtle: #6b7387;
  --card: rgba(255, 255, 255, 0.85);
  --card-border: rgba(0, 0, 0, 0.06);
  --line: #d0d5e1;
  --accent: #7c3aed;
  --accent-secondary: #059669;
  --accent-gradient: linear-gradient(135deg, #7c3aed, #059669);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --nav-bg: rgba(244, 246, 250, 0.88);
  --nav-border: rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ---- Navigation ---- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--nav-border);
  transition: background 0.3s ease;
}

.nav-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--text);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(167, 139, 250, 0.1);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.55rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

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

/* ---- Lighting ---- */
.lighting {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 12% 10%, rgba(167, 139, 250, 0.07), transparent 60%),
    radial-gradient(1100px 620px at 85% 90%, rgba(110, 231, 183, 0.04), transparent 68%);
}

[data-theme="light"] .lighting {
  background:
    radial-gradient(900px 500px at 12% 10%, rgba(124, 58, 237, 0.05), transparent 60%),
    radial-gradient(1100px 620px at 85% 90%, rgba(5, 150, 105, 0.04), transparent 68%);
}

/* ---- Layout ---- */
.shell {
  width: min(100%, 1480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(60px + clamp(1.25rem, 3.2vw, 3.4rem)) clamp(1rem, 3vw, 3rem) clamp(1.6rem, 4vw, 4rem);
  display: grid;
  align-content: start;
  gap: clamp(2.5rem, 5vh, 4.5rem);
}

/* ---- Hero ---- */
.hero {
  max-width: 100%;
  text-align: left;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: clamp(0.7rem, 0.8vw, 0.9rem);
  font-weight: 600;
}

.hero-top {
  display: flex;
  align-items: center;
  gap: clamp(1.4rem, 3.2vw, 3.4rem);
}

.hero-copy {
  min-width: 0;
  flex: 1;
  max-width: min(112ch, 100%);
}

.avatar {
  width: clamp(110px, 11vw, 190px);
  height: clamp(110px, 11vw, 190px);
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid var(--glass-border);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.15), 0 15px 40px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.3s ease;
}

.avatar:hover {
  box-shadow: 0 0 0 6px rgba(167, 139, 250, 0.25), 0 20px 50px rgba(0, 0, 0, 0.35);
}

.avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}

h1 {
  margin: 0;
  font-family: "Sora", "Arial Narrow", sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 0.94;
  font-size: clamp(2.8rem, 5.5vw, 6rem);
  white-space: nowrap;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro {
  margin: clamp(1.1rem, 2vw, 1.6rem) 0 0;
  max-width: min(88ch, 100%);
  color: var(--text-secondary);
  line-height: 1.85;
  font-size: clamp(0.96rem, 1.08vw, 1.12rem);
  letter-spacing: 0.01em;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  margin-top: 1.2rem;
  color: var(--subtle);
  font-size: 0.85rem;
}

/* ---- Glass card ---- */
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  padding: 1.25rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.3s ease;
}

.card-glass:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* ---- Section headers ---- */
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.15rem;
  margin-bottom: 0.5rem;
}

.section-head.compact {
  margin-bottom: 0rem;
}

.section-kicker {
  margin: 0 0 0.35rem;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: clamp(0.68rem, 0.75vw, 0.88rem);
  font-weight: 600;
}

.section-title {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.15rem, 1.8vw, 1.85rem);
  letter-spacing: -0.02em;
}

/* ---- Text list (Education / Experience) ---- */
.featured,
.experience,
.bottom-grid,
.reviews {
  display: grid;
  gap: clamp(1rem, 1.3vw, 1.25rem);
}

.text-list {
  display: grid;
  gap: 0.95rem;
}

.text-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.95rem;
  padding: 0.15rem 0;
}

.text-item.card-glass {
  padding: 1.25rem;
}

.text-code {
  margin: 0;
  font-family: "Sora", sans-serif;
  color: var(--accent);
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.text-item h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(1rem, 1.15vw, 1.25rem);
  line-height: 1.15;
}

.text-item p {
  margin: 0.32rem 0 0;
  color: var(--text-secondary);
  font-size: clamp(0.86rem, 0.9vw, 1rem);
  line-height: 1.58;
}

.experience-bullets {
  margin: 0.5rem 0 0;
  padding-left: 1rem;
  color: var(--text-secondary);
  display: grid;
  gap: 0.3rem;
}

.experience-bullets li {
  line-height: 1.55;
  font-size: clamp(0.84rem, 0.88vw, 0.95rem);
}

/* ---- Bottom grid (Projects, Skills, Certs) ---- */
.bottom-grid {
  grid-template-columns: 1.15fr 0.85fr 0.95fr;
  align-items: start;
}

.skills-panel,
.quote-panel,
.traits-panel,
.review-card {
  border-radius: var(--radius);
  padding: 1.25rem;
}

.resume-project {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.resume-project-title {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.resume-project-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.5;
}

.resume-project p:last-child {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.9rem;
}

.quote-panel {
  display: grid;
  gap: 0.6rem;
  align-content: start;
}

.quote-panel strong {
  color: var(--text);
}

.quote-panel p {
  margin: 0;
  line-height: 1.6;
  font-size: clamp(0.88rem, 0.95vw, 1rem);
}

.traits-panel {
  display: grid;
  gap: 0.9rem;
}

.trait-item span {
  display: block;
  margin-bottom: 0.25rem;
  font-family: "Sora", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
}

.trait-item p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.5;
}

/* ---- Review / Summary grid ---- */
.reviews {
  margin-top: 0.1rem;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.9rem, 1.2vw, 1.25rem);
}

.review-card {
  display: grid;
  gap: 0.85rem;
}

.review-card p {
  margin: 0;
  line-height: 1.62;
  color: var(--text-secondary);
}

.review-author {
  font-family: "Sora", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
}

.review-author span {
  display: block;
  margin-top: 0.25rem;
  color: var(--subtle);
  font-family: "Manrope", sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
}

/* ---- Footer ---- */
.site-footer {
  display: grid;
  gap: 0.45rem;
  padding: 1.5rem 0 0.2rem;
  border-top: 1px solid var(--card-border);
  color: var(--text-secondary);
}

.site-footer-name {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.04em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-footer-copy {
  margin: 0;
  max-width: 70ch;
  line-height: 1.6;
  font-size: 0.88rem;
}

.site-footer-copy a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.site-footer-copy a:hover {
  border-color: var(--accent);
}

.site-footer-meta {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
}

/* ---- Back to top ---- */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--text);
  text-decoration: none;
  font-size: 1.2rem;
  box-shadow: var(--glass-shadow);
  transition: all 0.25s ease;
  z-index: 999;
}

.back-to-top:hover {
  transform: translateY(-3px);
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---- Scroll animations ---- */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Responsive ---- */
@media (min-width: 1800px) {
  .shell {
    width: min(100%, 1650px);
  }
}

@media (max-height: 760px) {
  .shell {
    gap: clamp(1.5rem, 4vh, 2.8rem);
  }

  h1 {
    font-size: clamp(1.55rem, 4.2vw, 4.4rem);
  }
}

@media (max-width: 1000px) {
  .hero {
    max-width: 100%;
  }

  .hero-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
  }

  h1 {
    white-space: normal;
  }

  .section-head,
  .hero-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .text-item,
  .bottom-grid,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .text-item {
    gap: 0.4rem;
  }

  .contact-row {
    gap: 0.4rem 0.8rem;
  }

  .site-footer {
    padding-top: 0.9rem;
  }

  .nav-links {
    gap: 0;
  }

  .nav-link {
    padding: 0.4rem 0.55rem;
    font-size: 0.78rem;
  }
}

@media (max-width: 720px) {
  .shell {
    padding-inline: 0.85rem;
  }

  .avatar {
    width: 90px;
    height: 90px;
  }

  .section-head {
    gap: 0.6rem;
  }

  .nav-inner {
    padding-inline: 0.85rem;
  }

  .nav-links .nav-link {
    padding: 0.35rem 0.45rem;
    font-size: 0.72rem;
  }
}
