/* ===== Variables ===== */
:root {
  --bg: #08080b;
  --bg-elevated: #0d0d11;
  --bg-card: rgba(18, 18, 22, 0.7);
  --border: rgba(255, 255, 255, 0.06);
  --text: #e4e4e7;
  --text-muted: #a1a1aa;
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.15);
  --accent-glow: rgba(34, 211, 238, 0.25);
  --font: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --header-h: 72px;
  --container: min(1120px, 92vw);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* ===== Background effects ===== */
.noise {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}
.gradient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}
.gradient-orb--1 {
  width: 60vmin;
  height: 60vmin;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -20vmin;
  right: -10vmin;
}
.gradient-orb--2 {
  width: 50vmin;
  height: 50vmin;
  background: radial-gradient(circle, #a78bfa 0%, transparent 70%);
  bottom: -15vmin;
  left: -10vmin;
}

/* ===== Layout ===== */
.container {
  width: var(--container);
  margin: 0 auto;
  padding: 0 1rem;
}
.section {
  padding: clamp(4rem, 10vw, 7rem) 0;
  position: relative;
  z-index: 2;
}
.section__label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.section__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 2.5rem;
  line-height: 1.15;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(8, 8, 11, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: transform 0.4s var(--ease-out);
}
.header.hidden { transform: translateY(-100%); }
.logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.logo:hover { color: var(--accent); }
.nav {
  display: flex;
  gap: 2rem;
}
.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav a:hover { color: var(--accent); }
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.menu-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.25s var(--ease-out);
  cursor: pointer;
  border: 2px solid transparent;
}
.btn--primary {
  background: var(--accent);
  color: var(--bg);
}
.btn--primary:hover {
  background: #06b6d4;
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-1px);
}
.btn--outline {
  color: var(--text);
  border-color: var(--border);
  background: transparent;
}
.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Hero ===== */
.hero {
  padding: calc(var(--header-h) + 2.5rem) 2rem 3rem;
  position: relative;
  z-index: 2;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 380px);
  gap: 3rem;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}
.hero__content {
  min-width: 0;
}
.hero__frame-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero__frame {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 3px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 60px -15px var(--accent-glow);
  animation: fadeUp 0.8s var(--ease-out) 0.25s both;
}
.hero__frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 3px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}
.hero__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: linear-gradient(145deg, var(--bg-elevated) 0%, #1a1a22 100%);
}
/* Fallback when image is missing or fails to load */
.hero__frame {
  background: linear-gradient(145deg, var(--bg-elevated) 0%, #1a1a22 100%);
}
.hero__badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 100px;
  margin-bottom: 1rem;
  animation: fadeUp 0.8s var(--ease-out) both;
}
.hero__title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 0.5rem;
}
.hero__title-line {
  display: block;
  animation: fadeUp 0.8s var(--ease-out) both;
}
.hero__title-line:nth-child(1) { animation-delay: 0.1s; }
.hero__title-line:nth-child(2) { animation-delay: 0.2s; }
.hero__title-line:nth-child(3) { animation-delay: 0.3s; }
.hero__title-line--accent {
  color: var(--accent);
  background: linear-gradient(135deg, #22d3ee, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero__tagline {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 0 1.25rem;
  animation: fadeUp 0.8s var(--ease-out) 0.4s both;
}
.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  animation: fadeUp 0.8s var(--ease-out) 0.5s both;
}
.hero__scroll {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}
.hero__scroll-line {
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes scrollLine {
  0%, 100% { opacity: 0.3; transform: scaleY(0.5); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ===== About ===== */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.about__lead {
  font-size: 1.15rem;
  color: var(--text);
  margin: 0 0 1rem;
}
.about__main p:last-child { margin-bottom: 0; }
.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.stat {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.stat:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent-dim);
}
.stat__value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.stat__label {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== Timeline / Experience ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--border);
}
.timeline__item {
  position: relative;
  padding-bottom: 2.5rem;
}
.timeline__item.reveal { transition-delay: calc(var(--i, 0) * 0.05s); }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: attr(data-year);
  position: absolute;
  left: -2rem;
  transform: translateX(-100%);
  padding-right: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.timeline__dot {
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 12px;
  height: 12px;
  margin-left: -7px;
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg);
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}
.timeline__item:hover .timeline__dot {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px var(--bg), 0 0 20px var(--accent-glow);
}
.timeline__content {
  margin-left: 0;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease-out);
}
.card:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
  transform: translateX(4px);
}
.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}
.card__role {
  font-weight: 600;
  color: var(--accent);
}
.card__company {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.card__date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
}
.card__bullets {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.card__bullets li {
  margin-bottom: 0.4rem;
}
.card__bullets li:last-child { margin-bottom: 0; }

/* ===== Skills ===== */
.skills__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.skills__col--full { grid-column: 1 / -1; }
.skills__subtitle {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1rem;
}
.skill-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.skill-tags li {
  padding: 0.4rem 0.85rem;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.skill-tags li:hover {
  background: var(--accent);
  color: var(--bg);
}
.skill-tags--muted li {
  background: var(--bg-elevated);
  color: var(--text-muted);
}
.skill-tags--muted li:hover {
  background: var(--border);
  color: var(--text);
}
.honors {
  list-style: none;
  margin: 0;
  padding: 0;
}
.honors li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}
.honors li:last-child { border-bottom: none; }

/* ===== Education ===== */
.edu__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.edu__card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.edu__degree {
  font-weight: 600;
  color: var(--text);
}
.edu__school {
  color: var(--accent);
  font-size: 1rem;
}
.edu__date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Contact ===== */
.contact__intro {
  max-width: 560px;
  color: var(--text-muted);
  margin: 0 0 2rem;
  font-size: 1.05rem;
}
.contact__links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.contact__link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s, padding-left 0.2s;
}
.contact__link:hover {
  color: var(--accent);
  padding-left: 0.5rem;
}
.contact__icon {
  color: var(--accent);
  font-size: 1.25rem;
  transition: transform 0.2s;
}
.contact__link:hover .contact__icon {
  transform: translateX(4px);
}
.contact__location {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* ===== Footer ===== */
.footer {
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
  z-index: 2;
}

/* ===== Scroll animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero__frame-wrap {
    margin: 0 auto;
  }
  .hero__frame {
    max-width: 260px;
  }
  .about__grid {
    grid-template-columns: 1fr;
  }
  .about__stats {
    grid-template-columns: 1fr;
  }
  .skills__grid {
    grid-template-columns: 1fr;
  }
  .nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 1.5rem;
    gap: 0.5rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    z-index: 99;
  }
  .nav.is-open { display: flex; }
  .header .btn--primary { display: none; }
  .menu-toggle { display: flex; }
  .card__meta {
    flex-direction: column;
    gap: 0.25rem;
  }
  .card__date { margin-left: 0; }
}

@media (max-width: 600px) {
  .hero__cta {
    flex-direction: column;
  }
  .hero__cta .btn { width: 100%; }
  .timeline {
    padding-left: 1.5rem;
  }
  .timeline__item::before {
    left: -1.5rem;
    padding-right: 0.75rem;
  }
  .timeline__dot {
    left: -1.5rem;
    margin-left: -6px;
    width: 10px;
    height: 10px;
  }
}
