/*
  =========================================================================
  STYLE.CSS — all visual styling lives here
  =========================================================================
  Organized top to bottom as:
    1. Font faces + design tokens (colors, spacing, type scale)
    2. Reset / base element styles
    3. The aurora background (purple + green)
    4. Layout primitives (container, section spacing)
    5. Components (nav, hero, cards, tags, buttons, footer)
    6. Responsive breakpoints
  =========================================================================
*/

/* ---------------------------------------------------------------------
   1. FONT FACES + DESIGN TOKENS
   --------------------------------------------------------------------- */

@font-face {
  font-family: "Inter";
  src: url("./assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F,
    U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  src: url("./assets/fonts/inter-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Base surface */
  --bg: #09090b;
  --bg-raised: #111113;
  --edge: #232327;
  --edge-soft: #1a1a1d;

  /* Text */
  --text: #f4f4f5;
  --text-muted: #b4b4bd;
  --text-faint: #7c7c88;

  /* Purple aurora palette */
  --aurora-purple-1: #8b5cf6;
  --aurora-purple-2: #a78bfa;
  --aurora-purple-3: #c084fc;
  --aurora-violet-deep: #5b21b6;

  /* Green aurora palette ("max aura points") */
  --aurora-green-1: #34d399;
  --aurora-green-2: #4ade80;
  --aurora-green-3: #10b981;

  /* Accent used for interactive elements — sits between the two auroras */
  --accent: #b39ddb;
  --accent-strong: #d8b4fe;

  /* Type scale */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-hero: clamp(2.25rem, 5vw + 1rem, 4rem);
  --fs-h2: clamp(1.5rem, 2.5vw + 0.5rem, 2.25rem);
  --fs-h3: 1.25rem;
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-micro: 0.75rem;

  /* Spacing */
  --space-section: clamp(4rem, 10vw, 8rem);
  --radius: 14px;
  --radius-sm: 8px;
  --max-width: 1100px;
}

/* ---------------------------------------------------------------------
   2. RESET / BASE
   --------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

/* ---------------------------------------------------------------------
   3. AURORA BACKGROUND — purple + green, layered and drifting
   --------------------------------------------------------------------- */

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.aurora__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  mix-blend-mode: screen;
  will-change: transform;
}

/* Purple layer — three overlapping blobs for depth */
.aurora__blob--p1 {
  top: -18%;
  left: -12%;
  width: 62vw;
  height: 62vw;
  background: radial-gradient(circle at 30% 30%, var(--aurora-purple-3), var(--aurora-violet-deep) 70%, transparent 75%);
  animation: drift-a 34s ease-in-out infinite;
}

.aurora__blob--p2 {
  top: 8%;
  right: -18%;
  width: 48vw;
  height: 48vw;
  background: radial-gradient(circle at 60% 40%, var(--aurora-purple-1), transparent 72%);
  animation: drift-b 40s ease-in-out infinite;
  opacity: 0.4;
}

.aurora__blob--p3 {
  bottom: -20%;
  left: 18%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, var(--aurora-purple-2), transparent 70%);
  animation: drift-c 46s ease-in-out infinite;
  opacity: 0.35;
}

/* Green layer — "max aura points" */
.aurora__blob--g1 {
  top: 30%;
  right: -14%;
  width: 46vw;
  height: 46vw;
  background: radial-gradient(circle at 40% 60%, var(--aurora-green-1), transparent 72%);
  animation: drift-d 38s ease-in-out infinite;
  opacity: 0.32;
}

.aurora__blob--g2 {
  bottom: -22%;
  right: 8%;
  width: 52vw;
  height: 52vw;
  background: radial-gradient(circle at 50% 50%, var(--aurora-green-3), transparent 74%);
  animation: drift-e 42s ease-in-out infinite;
  opacity: 0.3;
}

.aurora__blob--g3 {
  top: -12%;
  left: 40%;
  width: 30vw;
  height: 30vw;
  background: radial-gradient(circle, var(--aurora-green-2), transparent 70%);
  animation: drift-f 30s ease-in-out infinite;
  opacity: 0.24;
}

/* A soft grain/vignette to keep the aurora from feeling flat */
.aurora__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, transparent 0%, var(--bg) 78%);
}

@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(4vw, 6vh) scale(1.08); }
}
@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-5vw, 4vh) scale(0.95); }
}
@keyframes drift-c {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(3vw, -5vh) scale(1.06); }
}
@keyframes drift-d {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-4vw, -4vh) scale(1.1); }
}
@keyframes drift-e {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(3vw, 3vh) scale(0.94); }
}
@keyframes drift-f {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-3vw, 5vh) scale(1.05); }
}

/* ---------------------------------------------------------------------
   4. LAYOUT PRIMITIVES
   --------------------------------------------------------------------- */

.page {
  position: relative;
  z-index: 1;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-inline: 1.5rem;
}

section {
  padding-block: var(--space-section);
}

.section__head {
  margin-bottom: 2rem;
  max-width: 42ch;
}

.section__kicker {
  display: block;
  font-size: var(--fs-small);
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.section__title {
  font-size: var(--fs-h2);
}

/* ---------------------------------------------------------------------
   5. COMPONENTS
   --------------------------------------------------------------------- */

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(9, 9, 11, 0.72);
  border-bottom: 1px solid var(--edge-soft);
}

.scroll-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--aurora-purple-2), var(--aurora-green-1));
  transition: width 0.1s linear;
}

.nav__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.nav__mark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.nav__mark-badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--aurora-purple-1), var(--aurora-green-1));
  color: #09090b;
}

.nav__links {
  display: flex;
  gap: 1.75rem;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.nav__links a {
  position: relative;
  padding-bottom: 2px;
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--aurora-purple-2), var(--aurora-green-1));
  transition: right 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.nav__links a:hover {
  color: var(--text);
}

.nav__links a:hover::after {
  right: 0;
}

.nav__links {
  display: none;
}

@media (min-width: 720px) {
  .nav__links {
    display: flex;
  }
}

/* Hero */
.hero {
  padding-top: clamp(4rem, 10vw, 7rem);
  padding-bottom: var(--space-section);
}

.hero__heading {
  font-size: var(--fs-hero);
  max-width: 18ch;
  margin-bottom: 1.5rem;
  background: linear-gradient(
    100deg,
    var(--text) 20%,
    var(--aurora-purple-3) 45%,
    var(--aurora-green-2) 60%,
    var(--text) 80%
  );
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: heading-shine 7s ease-in-out infinite;
  animation-delay: 1s;
}

@keyframes heading-shine {
  0%, 15% { background-position: 100% 0; }
  55%, 100% { background-position: -60% 0; }
}

.hero__sub {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 58ch;
  margin-bottom: 2.25rem;
  display: grid;
  gap: 1rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-size: var(--fs-small);
  font-weight: 500;
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.2s ease,
    background 0.2s ease, box-shadow 0.25s ease;
}

.btn--primary {
  background: linear-gradient(135deg, var(--aurora-purple-2), var(--aurora-green-1));
  background-size: 160% 160%;
  color: #09090b;
  animation: btn-gradient-shift 5s ease infinite;
}

.btn--primary:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 24px -8px rgba(139, 92, 246, 0.55);
}

.btn--primary:active {
  transform: translateY(0) scale(0.98);
}

@keyframes btn-gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.btn--ghost {
  border: 1px solid var(--edge);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -10px rgba(52, 211, 153, 0.35);
}

.btn--ghost:active {
  transform: translateY(0);
}

.btn--small {
  padding: 0.45rem 0.9rem;
  font-size: var(--fs-micro);
}

/* Experience */
.experience__layout {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.timeline {
  display: grid;
  gap: 2.25rem;
}

/* Animated rail: a static faint track, an accent line that grows
   downward as the section comes into view, and a dot per job lined up
   with that job's title. All positioning is done in script.js since it
   depends on the rendered height of each job entry. */
.timeline-rail {
  position: relative;
  height: 100%;
  min-height: 100%;
}

.timeline-rail__track {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: var(--edge);
}

.timeline-rail__line {
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  transform: translateX(-50%) scaleY(0);
  transform-origin: top;
  background: linear-gradient(180deg, var(--aurora-purple-2), var(--aurora-green-1));
  transition: transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.timeline-rail--visible .timeline-rail__line {
  transform: translateX(-50%) scaleY(1);
}

.timeline-rail__dots {
  position: absolute;
  inset: 0;
}

.timeline-rail__dot {
  position: absolute;
  left: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: var(--bg);
  border: 2px solid var(--aurora-purple-2);
  box-shadow: 0 0 0 4px var(--bg);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: var(--dot-delay, 0ms);
}

.timeline-rail__dot::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid var(--aurora-green-1);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.6s ease;
  transition-delay: var(--dot-delay, 0ms);
}

.timeline-rail--visible .timeline-rail__dot {
  transform: translate(-50%, -50%) scale(1);
}

.timeline-rail--visible .timeline-rail__dot::after {
  opacity: 1;
  animation: dot-ping 2.4s ease-out 1;
  animation-delay: calc(var(--dot-delay, 0ms) + 0.4s);
}

@keyframes dot-ping {
  0% {
    transform: scale(0.7);
    opacity: 0.7;
  }
  70% {
    opacity: 0;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

@media (max-width: 719px) {
  .experience__layout {
    grid-template-columns: 1fr;
  }
  .timeline-rail {
    display: none;
  }
}

.timeline__item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--edge-soft);
}

.timeline__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.timeline__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.timeline__title {
  font-size: var(--fs-h3);
}

.timeline__org {
  color: var(--accent);
  font-weight: 500;
}

.timeline__meta {
  color: var(--text-faint);
  font-size: var(--fs-small);
  white-space: nowrap;
}

.timeline__bullets {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5rem;
  color: var(--text-muted);
}

.timeline__bullets li {
  padding-left: 1.1rem;
  position: relative;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--bullet-delay, 0ms);
}

.reveal--visible .timeline__bullets li {
  opacity: 1;
  transform: translateX(0);
}

.timeline__bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* Projects */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: border-color 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.3s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 18px 40px -20px rgba(139, 92, 246, 0.4), 0 10px 24px -16px rgba(52, 211, 153, 0.3);
}

.card:hover .card__title {
  color: var(--accent-strong);
  transition: color 0.2s ease;
}

.card__head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.card__title {
  font-size: 1.1rem;
}

.card__role {
  font-size: var(--fs-small);
  color: var(--accent);
}

.card__period {
  font-size: var(--fs-micro);
  color: var(--text-faint);
}

.card__summary {
  color: var(--text-muted);
  font-size: var(--fs-small);
}

.card__details {
  display: grid;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: var(--fs-small);
}

.card__details li {
  padding-left: 1rem;
  position: relative;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--bullet-delay, 0ms);
}

.reveal--visible .card__details li {
  opacity: 1;
  transform: translateX(0);
}

.card__details li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--aurora-green-1);
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-size: var(--fs-micro);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--edge);
  color: var(--text-faint);
  opacity: 0;
  transform: translateY(6px) scale(0.92);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, color 0.2s ease;
  transition-delay: var(--tag-delay, 0ms);
}

.reveal--visible .tag {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tag:hover {
  border-color: var(--aurora-green-1);
  color: var(--text);
}

.card__footer {
  margin-top: auto;
  padding-top: 0.5rem;
}

/* GitHub link slot — replaces the old "case study" block.
   Renders only when content.js supplies a github URL for the project. */
.card__github {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--edge);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.9rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card__github:hover {
  border-color: var(--aurora-green-1);
  transform: translateY(-1px);
}

.card__github svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Placeholder shown when no GitHub link has been added yet */
.card__github-empty {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-micro);
  color: var(--text-faint);
  border: 1px dashed var(--edge);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.9rem;
}

/* Skills */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.75rem;
}

.skills__group-title {
  font-size: var(--fs-small);
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.skills__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Education */
.education__card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.75rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--bg-raised);
}

.education__notes {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: var(--fs-small);
}

/* Footer / contact */
.footer {
  border-top: 1px solid var(--edge-soft);
  padding-block: var(--space-section);
}

.footer__heading {
  font-size: var(--fs-h2);
  margin-bottom: 1rem;
}

.footer__body {
  color: var(--text-muted);
  max-width: 48ch;
  margin-bottom: 2rem;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 3rem;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-faint);
  font-size: var(--fs-micro);
  padding-top: 2rem;
  border-top: 1px solid var(--edge-soft);
}

/* Resume-not-found notice */
.resume-note {
  font-size: var(--fs-micro);
  color: var(--text-faint);
  margin-top: 0.6rem;
}

/* Projects — "view all" button under the highlighted grid */
.projects__more {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

/* ---------------------------------------------------------------------
   7. ANIMATION — page-load entrance + scroll reveal
   --------------------------------------------------------------------- */

/* Hero: heading, subhead, and the action row fade + rise in on load,
   staggered by the --reveal-delay each element sets inline. One
   orchestrated moment, played once. */
.hero-anim {
  opacity: 0;
  transform: translateY(18px);
}

.hero-anim.is-playing {
  animation: hero-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: var(--reveal-delay, 0ms);
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* The nav badge gets its own small entrance so the page doesn't feel
   static in the first half-second. */
.nav__mark-badge {
  animation: badge-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav__mark:hover .nav__mark-badge {
  transform: rotate(-10deg) scale(1.12);
}

@keyframes badge-in {
  from {
    opacity: 0;
    transform: scale(0.6) rotate(-8deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* Everything below the fold: fade up the first time it scrolls into
   view, then stays put (JS adds .reveal--visible via IntersectionObserver
   and stops observing — this never replays). */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

/* Stagger project cards within a grid slightly so they don't all land
   in the same frame. */
.projects__grid .card.reveal--visible:nth-child(2) {
  transition-delay: 0.08s;
}
.projects__grid .card.reveal--visible:nth-child(3) {
  transition-delay: 0.16s;
}

/* ---------------------------------------------------------------------
   8. RESPONSIVE
   --------------------------------------------------------------------- */

@media (max-width: 719px) {
  .timeline__row {
    flex-direction: column;
    gap: 0.15rem;
  }
}
