:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-strong: #e9eef5;

  --text: #0f172a;
  --muted: #475569;
  --border: #dbe4ee;

  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --primary-darker: #5b21b6;
  --primary-light: #a78bfa;

  --shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
  --radius: 20px;
  --max-width: 1120px;
}

body.dark {
  --bg: #0b1020;
  --surface: #121933;
  --surface-strong: #1b2445;

  --text: #eef2ff;
  --muted: #b6c2e1;
  --border: #273252;

  --primary: #8b5cf6;
  --primary-dark: #7c3aed;
  --primary-darker: #6d28d9;
  --primary-light: #c4b5fd;

  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.6;
  transition: background 0.25s ease, color 0.25s ease;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus,
a:focus {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

.container {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background 0.25s ease, border-color 0.25s ease;
}

body.dark .site-header {
  background: rgba(18, 25, 51, 0.88);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--text);
  color: var(--surface);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  transition: background 0.25s ease, color 0.25s ease;
}

.brand-text {
  font-size: 0.96rem;
  color: var(--text);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

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

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 42px;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.25s ease;
}

.theme-toggle:hover {
  border-color: var(--primary);
}

.theme-toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-strong);
  display: inline-block;
  transition: background 0.25s ease;
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--primary);
  transition: transform 0.25s ease, background 0.25s ease;
}

body.dark .theme-toggle-thumb {
  transform: translateX(20px);
}

.theme-toggle-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

.hero {
  padding: 5.5rem 0 4.5rem;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.95fr;
  gap: 2rem;
  align-items: center;
}

.hero-kicker,
.eyebrow,
.project-type,
.panel-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
}

.hero h1 {
  margin: 0.75rem 0 1rem;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  max-width: 11.5ch;
}

.hero-description {
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 2rem;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.9rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
}

.button-primary {
  background: var(--primary);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.button-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
}

.hero-highlights div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hero-highlights strong {
  font-size: 1rem;
}

.hero-highlights span {
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-panel {
  display: grid;
  gap: 1rem;
}

.panel-card,
.mini-card,
.feature-card,
.project-card,
.experience-item,
.info-card,
.skills-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: background 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease, transform 0.25s ease;
}

.profile-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.25rem;
  align-items: center;
  padding: 1.25rem;
}

.profile-image {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.profile-copy h2 {
  margin: 0.4rem 0 0.55rem;
  font-size: 1.45rem;
  line-height: 1.2;
}

.profile-copy p {
  margin: 0;
  color: var(--muted);
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.mini-card {
  padding: 1rem;
}

.mini-card span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.mini-card strong {
  font-size: 0.95rem;
  line-height: 1.4;
}

.section {
  padding: 5rem 0;
}

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

.section-heading {
  margin-bottom: 2rem;
}

.section-heading h2,
.section-intro h2,
.contact-section h2 {
  margin: 0.5rem 0 0;
  font-size: clamp(1.9rem, 3vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.two-column {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 2rem;
  align-items: start;
}

.section-content p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.skills-categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.skills-card {
  padding: 1.5rem;
}

.skills-card-header {
  margin-bottom: 1.25rem;
}

.skills-card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.skills-list {
  display: grid;
  gap: 1rem;
}

.skill-bar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skill-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.skill-header span:last-child {
  color: var(--muted);
  font-size: 0.9rem;
}

.skill-track {
  width: 100%;
  height: 10px;
  background: var(--surface-strong);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 999px;
}

.expertise-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.feature-card {
  padding: 1.5rem;
}

.feature-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.project-card {
  padding: 1.5rem;
}

.featured-project {
  grid-column: span 2;
}

.project-top h3 {
  margin: 0.35rem 0 0.9rem;
  font-size: 1.3rem;
}

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

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.project-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  transition: background 0.25s ease, color 0.25s ease;
}

.experience-list {
  display: grid;
  gap: 1.25rem;
}

.experience-item {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
}

.experience-years {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.92rem;
}

.experience-meta h3 {
  margin: 0 0 0.25rem;
  font-size: 1.12rem;
}

.experience-meta p,
.experience-details p,
.contact-copy,
.contact-inline {
  margin: 0;
  color: var(--muted);
}

.experience-details ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.experience-details li + li {
  margin-top: 0.5rem;
}

.education-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.info-card {
  padding: 1.5rem;
}

.info-card h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.stack-list {
  display: grid;
  gap: 0.85rem;
}

.stack-item {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.stack-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.stack-item strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 0.25rem;
}

.stack-item span,
.stack-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.contact-section {
  max-width: 760px;
  text-align: center;
}

.contact-copy {
  margin-top: 1rem;
}

.contact-actions {
  justify-content: center;
  margin-top: 1.5rem;
}

.contact-inline {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-top: 1.25rem;
  font-size: 0.96rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-row {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.skills-card:hover,
.project-card:hover,
.feature-card:hover,
.panel-card:hover,
.info-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 16px 40px rgba(124, 58, 237, 0.14);
  transform: translateY(-2px);
}

body.dark .skills-card:hover,
body.dark .project-card:hover,
body.dark .feature-card:hover,
body.dark .panel-card:hover,
body.dark .info-card:hover {
  box-shadow: 0 18px 44px rgba(139, 92, 246, 0.18);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: 0.08s;
}

.reveal-delay-2 {
  transition-delay: 0.16s;
}

.reveal-delay-3 {
  transition-delay: 0.24s;
}

@media (max-width: 960px) {
  .hero-layout,
  .two-column,
  .experience-item,
  .expertise-grid,
  .projects-grid,
  .education-grid,
  .skills-categories {
    grid-template-columns: 1fr;
  }

  .featured-project {
    grid-column: span 1;
  }

  .hero h1 {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 0;
  }

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

@media (max-width: 640px) {
  .container {
    width: min(var(--max-width), calc(100% - 1.25rem));
  }

  .hero {
    padding: 4.5rem 0 4rem;
  }

  .hero-actions,
  .contact-actions,
  .contact-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .profile-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-image {
    margin: 0 auto;
  }

  .profile-links {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.is-visible,
  .theme-toggle,
  .theme-toggle-thumb,
  .button,
  .panel-card,
  .mini-card,
  .feature-card,
  .project-card,
  .experience-item,
  .info-card,
  .skills-card {
    transition: none;
    transform: none;
    opacity: 1;
  }
}