/* ============================================================
   VARIABLES / DESIGN TOKENS
   ============================================================ */
:root {
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --surface: #ffffff;
  --text: #1a1f29;
  --text-muted: #5b6472;
  --text-soft: #8a93a2;
  --border: #e6e8ed;
  --accent: #2b6cb0;
  --accent-soft: #e8f0fa;
  --accent-text: #1f5aa8;
  --shadow-sm: 0 1px 2px rgba(20, 25, 40, 0.05);
  --shadow-md: 0 10px 30px -12px rgba(20, 25, 40, 0.12);
  --shadow-lg: 0 30px 60px -20px rgba(20, 25, 40, 0.18);
  --radius: 16px;
  --maxw: 1120px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { font-family: var(--font); background-color: var(--bg); color: var(--text); line-height: 1.7; font-weight: 400; font-size: 16px; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.cursor-glow { position: fixed; top: 0; left: 0; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle at center, rgba(43, 108, 176, 0.07), rgba(43, 108, 176, 0) 65%); pointer-events: none; z-index: 0; transform: translate(-50%, -50%); transition: opacity 0.3s ease; opacity: 0; }
body.loaded .cursor-glow { opacity: 1; }

.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; margin: 0 auto; width: 100%; padding: 20px clamp(20px, 5vw, 64px); transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease), padding 0.35s var(--ease); }
.nav.scrolled { background: rgba(15, 18, 22, 0.16); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow-sm); padding-top: 14px; padding-bottom: 14px; }
.nav__left { display: flex; align-items: center; gap: 12px; }
.nav__brand { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; color: var(--text); }
.nav__links { display: flex; gap: 34px; align-items: center; margin: 0 auto; }
.nav__links a { font-size: 0.925rem; font-weight: 500; color: var(--text-muted); position: relative; transition: color 0.25s var(--ease); }
.nav__links a::after { content: ''; position: absolute; left: 0; bottom: -6px; width: 100%; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after, .nav__links a.active::after { transform: scaleX(1); }
.nav__links a.active { color: var(--text); }
.nav__right { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-soft);
  transition: color 0.25s var(--ease), background 0.25s var(--ease), transform 0.2s var(--ease);
}
.theme-toggle:hover {
  color: var(--text);
  background: rgba(0,0,0,0.04);
  transform: scale(1.08);
}
/* sun visible by default, moon hidden — toggled via JS */
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }
body[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
body[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
/* in dark mode: invert icon colors for contrast */
@media (prefers-color-scheme: dark) {
  .theme-toggle .icon-sun { display: none; }
  .theme-toggle .icon-moon { display: block; }
}
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}
.lang-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 6px 14px;
  border-radius: 999px;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), transform 0.2s var(--ease);
}
.lang-btn:hover {
  color: var(--text);
  background: rgba(0,0,0,0.04);
  transform: scale(1.05);
}
.lang-btn.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 2px 10px -2px rgba(43, 108, 176, 0.35);
}
.lang-sep { display: none; }


/* ============================================================
   HERO
   ============================================================ */
.hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 120px clamp(20px, 5vw, 64px) 80px; position: relative; z-index: 1; }
.hero__inner { max-width: 620px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero__avatar-wrap { position: relative; width: 176px; height: 176px; margin-bottom: 32px; }
.hero__avatar { width: 176px; height: 176px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-lg); }
.hero__avatar-wrap::before { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), transparent 60%); z-index: -1; opacity: 0.6; }
.hero__status { position: absolute; right: 8px; bottom: 10px; width: 22px; height: 22px; border-radius: 50%; background: #34d399; border: 4px solid var(--bg); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25); }
.hero__name { font-size: clamp(2.6rem, 7vw, 4rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; margin-bottom: 14px; }
.hero__tagline { font-size: clamp(1rem, 2.4vw, 1.2rem); font-weight: 500; color: var(--accent-text); margin-bottom: 22px; letter-spacing: 0.01em; }
.hero__intro { font-size: 1.05rem; color: var(--text-muted); max-width: 480px; margin-bottom: 34px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 28px; border-radius: 999px; font-size: 0.95rem; font-weight: 500; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease); cursor: pointer; }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -10px rgba(43, 108, 176, 0.6); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -10px rgba(43, 108, 176, 0.7); }
.btn--ghost { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-text); transform: translateY(-2px); }

/* ============================================================
   SECTIONS (shared)
   ============================================================ */
.section { padding: clamp(70px, 10vw, 120px) clamp(20px, 5vw, 64px); position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.section__title { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 48px; position: relative; display: inline-block; }
.section__title::after { content: ''; display: block; width: 48px; height: 4px; border-radius: 2px; background: var(--accent); margin-top: 12px; }

/* ============================================================
   ABOUT
   ============================================================ */
.about__grid { max-width: 760px; display: flex; flex-direction: column; gap: 20px; align-items: center; text-align: center; }
.about__text { font-size: 1.15rem; color: var(--text); line-height: 1.8; text-align: center; }
.about__text:nth-child(2) { color: var(--text-muted); }

/* ============================================================
   SKILLS
   ============================================================ */
.skills__grid { display: grid; grid-template-columns: repeat(2, 1fr); justify-content: center; gap: 30px; max-width: var(--maxw); margin: 0 auto; }
.skill-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease); }
.skill-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: transparent; }
.skill-card__icon { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 20px; }
.skill-card__title { font-size: 1.2rem; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; }
.skill-card__sub { font-size: 0.85rem; color: var(--text-soft); margin-bottom: 20px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.skill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-list li { font-size: 0.85rem; font-weight: 500; padding: 6px 12px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); transition: all 0.2s var(--ease); }
.skill-list li:hover { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); }

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-list {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  justify-content: center;
  align-content: start;
  gap: 22px;
}
.project { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: baseline; padding: 40px 40px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease); }
.project:hover { transform: translateX(4px); box-shadow: var(--shadow-md); border-color: transparent; }
.project__index { font-size: 1.5rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; min-width: 44px; opacity: 0.85; }
.project__title { font-size: 1.25rem; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.01em; }
.project__desc { color: var(--text-muted); font-size: 1rem; margin-bottom: 16px; max-width: 620px; }
.project__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.project__tags li { font-size: 0.78rem; font-weight: 500; padding: 5px 11px; background: var(--bg-alt); border-radius: 999px; color: var(--text-soft); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { max-width: 640px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.contact__lead { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 28px; }
.contact__email { font-size: clamp(1.3rem, 4vw, 2rem); font-weight: 600; color: var(--text); letter-spacing: -0.02em; position: relative; padding-bottom: 4px; transition: color 0.25s var(--ease); }
.contact__email::after { content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform 0.3s var(--ease); }
.contact__email:hover { color: var(--accent-text); }
.contact__email:hover::after { transform: scaleX(1); transform-origin: left; }
.socials { display: flex; gap: 16px; margin-top: 36px; }
.social { display: inline-flex; align-items: center; gap: 9px; font-size: 0.95rem; font-weight: 500; color: var(--text-muted); padding: 10px 18px; border: 1px solid var(--border); border-radius: 999px; transition: all 0.25s var(--ease); }
.social svg { transition: fill 0.25s var(--ease); }
.social:hover { color: #fff; border-color: var(--accent); background: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.social:hover svg path { fill: #fff; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { padding: 34px clamp(20px, 5vw, 64px); text-align: center; font-size: 0.875rem; color: var(--text-soft); border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; z-index: 1; position: relative; }
.footer__name { font-weight: 600; color: var(--text-muted); }

/* ============================================================
   ENTRANCE ANIMATIONS
   ============================================================ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  .nav__left { position: relative; }
  .nav__links {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-width: 210px;
    padding: 12px;
    background: var(--bg);
    border-radius: 14px;
    box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
    z-index: 105;
    max-width: calc(100vw - 32px);
  }
  .nav__links.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .nav__links a {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
  }
  .nav__links a:hover {
    background: var(--bg-alt);
  }
  .nav__links a:hover::after,
  .nav__links a.active::after { display: none; }
  .nav__links a.active {
    background: var(--accent-soft);
    color: var(--accent);
  }
  .hamburger {
    display: flex !important;
  }
  .lang-switch { transform: scale(0.85); transform-origin: right center; }
  .projects-list { grid-template-columns: 1fr; }
  .project { grid-template-columns: 1fr; gap: 22px; padding: 24px; }
  .project__index { font-size: 1.15rem; }
}
@media (max-width: 1024px) {
  .skills__grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .nav { padding: 16px 20px; }
  .nav__links { gap: 16px; }
  .lang-btn { padding: 4px 4px; font-size: 0.8rem; }
  .hero__avatar, .hero__avatar-wrap { width: 148px; height: 148px; }
  .hero__avatar-wrap { margin-bottom: 26px; }
}

/* ============================================================
   MOBILE HAMBURGER MENU
   ============================================================ */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 110;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  transform-origin: center;
}
.hamburger.is-active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 12, 16, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
  z-index: 99;
}
.nav-overlay.is-open { opacity: 1; pointer-events: auto; }

@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1216; --bg-alt: #151a21; --surface: #171c23; --text: #eef1f6; --text-muted: #a4adcb; --text-soft: #727c93; --border: #242b36; --accent: #5b9fe0; --accent-soft: rgba(91, 159, 224, 0.14); --accent-text: #84bcf2; --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-md: 0 20px 40px -16px rgba(0, 0, 0, 0.6); --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.7); }
  .nav.scrolled { background: rgba(15, 18, 22, 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .skill-card, .project { background: var(--surface); }
  .lang-btn.active {
    box-shadow: 0 0 12px -2px rgba(91, 159, 224, 0.6), 0 0 24px -8px rgba(91, 159, 224, 0.3);
  }
  .lang-switch:has(.lang-btn.active) {
    box-shadow: 0 0 0 1px rgba(91, 159, 224, 0.2), 0 4px 16px -4px rgba(91, 159, 224, 0.15);
  }
  .lang-btn:hover {
    background: rgba(255,255,255,0.06);
  }
}
