/* ===================== RESET & TOKENS ===================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg:        #0a0e1a;
  --bg-2:      #0e1424;
  --surface:   #121a2e;
  --surface-2: #161f38;
  --border:    rgba(255, 255, 255, 0.08);
  --border-2:  rgba(255, 255, 255, 0.14);

  --text:      #e8edf7;
  --muted:     #94a3b8;
  --muted-2:   #64748b;

  --accent:    #22d3ee;   /* cyan  */
  --accent-2:  #7c3aed;   /* violet */
  --accent-3:  #34d399;   /* green */
  --grad: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
  --maxw: 1120px;

  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-head: 'Space Grotesk', var(--font);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Subtle ambient glows on the page background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vw 60vw at 80% -10%, rgba(124, 58, 237, 0.18), transparent 60%),
    radial-gradient(50vw 50vw at -10% 20%, rgba(34, 211, 238, 0.14), transparent 55%);
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; font-weight: 700; }

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.4rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn i { font-size: 1.2rem; }
.btn-primary {
  background: var(--grad);
  color: #07101f;
  box-shadow: 0 12px 30px -12px rgba(34, 211, 238, 0.6);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -12px rgba(124, 58, 237, 0.65); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-2);
  color: var(--text);
}
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--accent); color: #fff; }

/* ===================== NAVBAR ===================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(10, 14, 26, 0.72);
  border-bottom: 1px solid var(--border);
}
.navbar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
}
.logo span { color: var(--accent); }

.menu {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.menu a {
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}
.menu a:hover, .menu a.active { color: #fff; background: rgba(255, 255, 255, 0.06); }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.6rem;
  padding-left: 0.9rem;
  border-left: 1px solid var(--border);
  color: var(--muted-2);
}
.lang-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  transition: color 0.2s;
}
.lang-btn.active { color: var(--accent); }
.lang-btn:hover { color: #fff; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.8rem;
  cursor: pointer;
}

/* ===================== HERO ===================== */
.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 2rem;
}
.hero-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: 0.5px; margin-bottom: 0.6rem; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -1px; }
.role {
  font-family: var(--font-head);
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  font-weight: 600;
  color: var(--text);
  margin: 0.9rem 0 1rem;
}
.hero-sub { color: var(--muted); max-width: 60ch; margin-inline: auto; font-size: 1.02rem; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.8rem 0 1.2rem; justify-content: center; }

.hero-social { display: flex; gap: 0.6rem; justify-content: center; }
.hero-social a {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border-2);
  font-size: 1.35rem;
  color: var(--muted);
  transition: transform 0.2s, color 0.2s, border-color 0.2s, background 0.2s;
}
.hero-social a:hover { color: #fff; border-color: var(--accent); transform: translateY(-3px); background: rgba(34, 211, 238, 0.1); }

/* Hero photo */
.hero-photo { position: relative; justify-self: center; }
.photo-ring {
  width: clamp(220px, 32vw, 320px);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 6px;
  background: var(--grad);
  box-shadow: var(--shadow);
}
.photo-ring img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--bg);
}
.badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: float 4s ease-in-out infinite;
}
.badge i { color: var(--accent); font-size: 1rem; }
.badge-1 { top: 8%; left: -8%; }
.badge-2 { bottom: 16%; left: -10%; animation-delay: 1.3s; }
.badge-3 { bottom: 6%; right: -4%; animation-delay: 2.4s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* Hero stats */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 3rem;
  padding: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat { text-align: center; }
.stat strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.9rem;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span { font-size: 0.82rem; color: var(--muted); }

/* ===================== SECTIONS ===================== */
.section { max-width: var(--maxw); margin: 0 auto; padding: 5rem 1.5rem; }
.section-head { margin-bottom: 2.5rem; }
.kicker {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -0.5px; }
.section-sub { color: var(--muted); margin-top: 0.6rem; }

/* ABOUT */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.5rem; }
.about-text p { color: var(--muted); margin-bottom: 1rem; }
.about-text p:first-child { color: var(--text); font-size: 1.08rem; }
.about-highlights { display: grid; gap: 0.7rem; align-content: start; }
.about-highlights li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  transition: border-color 0.2s, transform 0.2s;
}
.about-highlights li:hover { border-color: var(--accent); transform: translateX(4px); }
.about-highlights i { font-size: 1.3rem; color: var(--accent); }

/* STACK */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.stack-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.stack-card:hover { border-color: var(--border-2); transform: translateY(-4px); box-shadow: var(--shadow); }
.stack-card h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.stack-card h3 i { color: var(--accent); font-size: 1.3rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
}

/* PROJECTS */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.3rem;
}
.project {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.project:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: var(--shadow); }
.project.featured {
  grid-column: span 1;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border-color: var(--border-2);
}
.project-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.9rem; }
.tag, .tag-featured {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
}
.tag { background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid var(--border); }
.tag-featured { background: rgba(34, 211, 238, 0.12); color: var(--accent); border: 1px solid rgba(34, 211, 238, 0.3); }
.project-links { display: flex; gap: 0.5rem; }
.project-links a {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 1.15rem;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.project-links a:hover { color: #fff; border-color: var(--accent); background: rgba(34,211,238,0.1); }
.project h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.project p { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.1rem; flex: 1; }

.projects-foot { display: flex; justify-content: center; margin-top: 2.2rem; }

/* EXPERIENCE / TIMELINE */
.timeline { position: relative; max-width: 760px; margin-left: 0.5rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2));
}
.tl-item { position: relative; padding-left: 2.4rem; margin-bottom: 2rem; }
.tl-dot {
  position: absolute;
  left: 0; top: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
}
.tl-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}
.tl-content:hover { border-color: var(--border-2); transform: translateX(4px); }
.tl-period {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(34,211,238,0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  margin-bottom: 0.5rem;
}
.tl-content h3 { font-size: 1.2rem; margin-bottom: 0.7rem; }
.tl-content ul { display: grid; gap: 0.5rem; }
.tl-content li { color: var(--muted); font-size: 0.92rem; padding-left: 1.1rem; position: relative; }
.tl-content li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }

/* EDUCATION */
.edu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  text-align: center;
  transition: border-color 0.25s, transform 0.25s;
}
.edu-card:hover { transform: translateY(-4px); border-color: var(--border-2); }
.edu-card.highlight { border-color: rgba(124,58,237,0.4); background: linear-gradient(160deg, rgba(124,58,237,0.12), var(--surface)); }
.edu-card i { font-size: 2.2rem; color: var(--accent); margin-bottom: 0.7rem; }
.edu-card h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.edu-card p { color: var(--muted); font-size: 0.9rem; }

/* CONTACT */
.contact { padding-top: 2rem; }
.contact-card {
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-2);
  border-radius: 24px;
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.contact-card h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin-bottom: 0.8rem; }
.contact-card > p { color: var(--muted); max-width: 52ch; margin: 0 auto 1.8rem; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; margin-bottom: 1.6rem; }
.contact-social {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.contact-social a { font-size: 1.6rem; color: var(--muted); transition: color 0.2s, transform 0.2s; }
.contact-social a:hover { color: var(--accent); transform: translateY(-3px); }
.contact-social .loc { font-size: 0.88rem; display: inline-flex; align-items: center; gap: 0.35rem; }
.contact-social .loc i { color: var(--accent); }

/* FOOTER */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 0.88rem;
}

/* TO TOP */
.to-top {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad);
  color: #07101f;
  font-size: 1.5rem;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 90;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ===================== SCROLL REVEAL ===================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 920px) {
  .stack-grid, .projects-grid, .edu-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .menu {
    position: fixed;
    inset: 64px 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem 1.5rem;
    transform: translateY(-150%);
    transition: transform 0.35s ease;
    box-shadow: var(--shadow);
  }
  .menu.open { transform: translateY(0); }
  .menu a { width: 100%; padding: 0.7rem 0.5rem; }
  .lang-switch { margin: 0.5rem 0 0; padding: 0.5rem 0 0; border-left: none; border-top: 1px solid var(--border); width: 100%; }

  .hero-inner { grid-template-columns: 1fr; text-align: center; gap: 2.5rem; }
  .hero-text { order: 2; }
  .hero-photo { order: 1; }
  .hero-sub { margin-inline: auto; }
  .hero-cta, .hero-social { justify-content: center; }
  .badge-1 { left: 0; }
  .badge-2 { left: -2%; }

  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 1.2rem 0.5rem; }

  .about-grid { grid-template-columns: 1fr; gap: 1.8rem; }
}

@media (max-width: 540px) {
  .stack-grid, .projects-grid, .edu-grid { grid-template-columns: 1fr; }
  .section { padding: 3.5rem 1.2rem; }
  .hero { padding-top: 2.5rem; }
  .contact-card { padding: 2.2rem 1.2rem; }
}

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