:root {
  --bg: #f8fbff;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.84);
  --text: #0f172a;
  --text-muted: #475569;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --surface-border: rgba(148, 163, 184, 0.28);
  --shadow: 0 24px 80px rgba(37, 99, 235, 0.12);
  --radius: 24px;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #111827;
  --surface-soft: rgba(15, 23, 42, 0.92);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-dark: #0ea5e9;
  --surface-border: rgba(148, 163, 184, 0.16);
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, rgba(37, 99, 235, 0.08), var(--bg) 45%);
  line-height: 1.6;
}

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

button,
a.button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 52px;
  padding: 0.95rem 1.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

a.button:hover,
button:hover,
a.button:focus-visible,
button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(56, 189, 248, 0.18);
}

a.button:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.55);
  outline-offset: 4px;
}

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

.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 20;
  background: var(--surface-soft);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--surface-border);
  transition: transform 0.28s ease, box-shadow 0.28s ease, background-color 0.28s ease;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  will-change: transform;
}

.site-header.hidden {
  transform: translateY(-100%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.theme-toggle,
.lang-button {
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  transition: transform 0.24s ease, background-color 0.24s ease, border-color 0.24s ease, color 0.24s ease;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.85rem;
  border-radius: 999px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  font-size: 0.95rem;
}

.theme-toggle:hover,
.lang-button:hover {
  transform: translateY(-1px);
}

.theme-toggle .theme-icon {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
}

.language-switcher {
  display: inline-flex;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--surface-border);
}

.lang-button {
  min-width: 2.6rem;
  padding: 0.65rem 0.75rem;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
}

.lang-button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
}

.mobile-header-actions {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.logo {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 900;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.18);
  animation: logoFloat 4s ease-in-out infinite;
}

.logo::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
}

.logo::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  top: 10px;
  right: 10px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.35);
}

.brand h1 {
  margin: 0;
  font-size: 1.05rem;
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.site-nav {
  display: flex;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 0;
  margin: 0;
  list-style: none;
  justify-content: center;
}

.nav-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

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

.menu-toggle {
  display: none;
  border: none;
  background: transparent;
  padding: 0.5rem;
  gap: 0.35rem;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease;
}

.menu-toggle span {
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: var(--text);
  display: block;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.hero-section {
  padding: 5rem 0 3.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 2rem;
  align-items: center;
}

.hero-copy h2 {
  margin: 0 0 1rem;
  font-size: clamp(2.7rem, 4vw, 4.2rem);
  line-height: 1.05;
}

.hero-copy p {
  max-width: 620px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.12);
}

.primary:hover,
.primary:focus-visible {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--surface-border);
  backface-visibility: hidden;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
}

.secondary:hover,
.secondary:focus-visible {
  background: var(--surface-soft);
  border-color: var(--accent);
}

.hero-card {
  position: relative;
  padding: 2rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-card-glow {
  position: absolute;
  inset: -25% -10% auto auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.14), transparent 60%);
  filter: blur(18px);
}

.hero-info span {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--accent);
  font-weight: 700;
}

.hero-info h3 {
  margin: 0 0 0.75rem;
  font-size: 1.7rem;
  color: var(--text);
}

.hero-info p {
  margin: 0;
  color: var(--text-muted);
}

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

.hero-stats div {
  padding: 1rem 1.2rem;
  border-radius: 18px;
  background: var(--surface-soft);
  border: 1px solid rgba(56, 189, 248, 0.18);
}

.hero-stats strong {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.section {
  padding: 4rem 0;
}

.section-head {
  max-width: 720px;
  margin-bottom: 2rem;
}

.section-head h2 {
  margin: 0.5rem 0 0;
  font-size: clamp(2.2rem, 3vw, 3.4rem);
}

.about-section p,
.contact-section p {
  max-width: 680px;
  color: var(--text-muted);
}

.portfolio-section .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.card {
  padding: 1.75rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(37, 99, 235, 0.25);
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.14);
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.skill-pill {
  padding: 1rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: var(--surface-soft);
  color: var(--text);
  text-align: center;
  font-weight: 600;
}

.course-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  list-style-position: inside;
  display: grid;
  gap: 0.85rem;
}

.course-list li {
  line-height: 1.75;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 1.5rem;
  align-items: stretch;
}

.contact-line a {
  color: var(--accent);
  text-decoration: none;
}

.contact-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
}

.contact-card p {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
}

.contact-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 760px;
  align-items: stretch;
}

.contact-links .button {
  width: 100%;
  text-align: left;
  min-height: 64px;
}

@media (max-width: 900px) {
  .contact-links {
    grid-template-columns: 1fr;
  }
}

.contact-card button {
  width: fit-content;
  padding: 1rem 1.6rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #0f172a;
  font-weight: 700;
}

.contact-status {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.contact-status.error {
  color: #f87171;
}

.site-footer {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0;
}

.animate-item {
  opacity: 1;
  transform: none;
  will-change: opacity, transform;
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.js .animate-item {
  opacity: 0;
  transform: translateY(24px);
}

.animate-item.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 960px) {
  .hero-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-card {
    order: -1;
  }
}

@media (max-width: 780px) {
  .header-inner {
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .brand {
    order: 1;
  }

  .menu-toggle {
    display: flex;
    order: 2;
    margin-left: auto;
  }

  .site-nav {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    display: none;
    background: var(--surface-soft);
    border-radius: 0 0 18px 18px;
    overflow: hidden;
    margin-top: 0.75rem;
    padding: 0 0.8rem 1rem;
  }

  .site-nav.open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem 0 0;
    border-top: 1px solid var(--surface-border);
  }

  .header-actions {
    display: none;
  }

  .mobile-header-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    margin-top: 0.75rem;
    border: 1px solid var(--surface-border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 22px 40px rgba(15, 23, 42, 0.08);
  }

  .mobile-header-actions .theme-toggle,
  .mobile-header-actions .language-switcher {
    width: 100%;
  }

  .mobile-header-actions .theme-toggle {
    justify-content: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: var(--text);
  }

  .mobile-header-actions .theme-toggle:hover,
  .mobile-header-actions .theme-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.12);
  }

  .mobile-header-actions .theme-toggle .theme-icon {
    width: 1.6rem;
    height: 1.6rem;
    font-size: 1rem;
  }

  .mobile-header-actions .language-switcher {
    justify-content: center;
    gap: 0.35rem;
    padding: 0.4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.12);
  }

  .mobile-header-actions .lang-button {
    padding: 0.55rem 0.85rem;
    min-width: 2.4rem;
    font-size: 0.88rem;
    border-radius: 999px;
  }

  .mobile-header-actions .lang-button.active {
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
  }

  .site-header {
    padding: 0 0.5rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  .animate-item {
    transition: none !important;
    animation: none !important;
  }
}
