/* ===== Design tokens ===== */
:root {
  --bg: #030712;
  --card: #111827;
  --border: rgba(255, 255, 255, 0.08);
  --primary: #3B82F6;
  --secondary: #8B5CF6;
  --text: #FFFFFF;
  --text-muted: #94A3B8;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 16px;
  --section-pad: 8rem;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

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

.container {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== Background blobs ===== */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  will-change: transform;
}
.blob-1 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, var(--primary), transparent 70%);
  top: -10%; left: -10%;
  animation: float1 26s ease-in-out infinite;
}
.blob-2 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, var(--secondary), transparent 70%);
  top: 30%; right: -15%;
  animation: float2 32s ease-in-out infinite;
}
.blob-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--primary), transparent 70%);
  bottom: -15%; left: 20%;
  animation: float3 28s ease-in-out infinite;
}
@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 80px) scale(1.1); }
}
@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-70px, 50px) scale(0.95); }
}
@keyframes float3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -60px) scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
}

/* ===== Nav ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(3, 7, 18, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1120px;
  margin-inline: auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text) !important;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ===== Buttons ===== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(59, 130, 246, 0.45);
  transform: translateY(-2px);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}
/* ripple */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(255,255,255,0.35) 0%, transparent 60%);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}
.btn:active::after {
  opacity: 1;
  transform: scale(1.5);
  transition: 0s;
}

/* ===== Section base ===== */
section { padding: var(--section-pad) 0; }
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.section-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
  max-width: 640px;
}

/* ===== Hero ===== */
.hero { padding-top: 9rem; padding-bottom: 6rem; }
.hero-inner { max-width: 760px; }
.hero-name {
  font-size: clamp(2.75rem, 7vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1.25rem;
  background: linear-gradient(180deg, #fff 40%, rgba(255,255,255,0.7));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-title {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 600;
  color: var(--text-muted);
  min-height: 1.8em;
  margin-bottom: 1.5rem;
}
#rotating-title {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: opacity 0.4s ease;
}
#rotating-title.fade { opacity: 0; }
.cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--primary);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 2.25rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ===== Social cards ===== */
.socials-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.social-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.social-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.4);
  background: #141d31;
}
.social-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(139,92,246,0.15));
  color: var(--primary);
}
.social-icon svg { width: 20px; height: 20px; }
.social-title { display: block; font-weight: 600; margin-bottom: 0.15rem; }
.social-desc { display: block; font-size: 0.85rem; color: var(--text-muted); }

/* ===== About ===== */
.about-text {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 680px;
  margin-bottom: 2rem;
}
.about-focus {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.about-focus span {
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ===== Tech pills ===== */
.pills { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.pill {
  position: relative;
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.pill:hover {
  color: var(--text);
  transform: translateY(-3px);
  border-color: transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(135deg, var(--primary), var(--secondary)) border-box;
  border: 1px solid transparent;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.35);
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}
.project-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.6rem; }
.project-desc { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.25rem; flex-grow: 1; }
.project-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.badge {
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.project-link {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  align-self: flex-start;
  transition: gap 0.2s ease, color 0.2s ease;
}
.project-link:hover { color: var(--secondary); }

/* ===== Timeline ===== */
.timeline-list {
  position: relative;
  padding-left: 2rem;
  border-left: 1px solid var(--border);
}
.timeline-item { position: relative; padding-bottom: 2.5rem; padding-left: 1.5rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -2.4rem;
  top: 0.35rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
}
.timeline-item h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.35rem; }
.timeline-item p { color: var(--text-muted); font-size: 0.95rem; }

/* ===== Contact ===== */
.contact-inner { text-align: center; }
.contact-inner .section-title { margin-inline: auto; }
.contact-text { color: var(--text-muted); max-width: 480px; margin: 0 auto 2rem; }
.contact-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); padding: 2.5rem 0; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ===== Reveal on scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  :root { --section-pad: 5.5rem; }
  .socials-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: rgba(3, 7, 18, 0.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .nav-links.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .socials-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 7rem; }
}
