/* ==========================================================================
   THEME — change these variables to re-skin the entire site
========================================================================== */
:root {
  --bg: #0b0710;
  --bg-soft: #150c1f;
  --surface: #1b1024;
  --surface-hi: #24152f;
  --text: #f5f0ff;
  --text-muted: #b7abc9;
  --border: color-mix(in srgb, white 10%, transparent);

  --accent-1: #ff6b35; /* orange   */
  --accent-2: #ff3d81; /* pink     */
  --accent-3: #7b2ff7; /* purple   */
  --accent-4: #ffb703; /* gold     */

  --gradient: linear-gradient(120deg, var(--accent-1), var(--accent-2) 50%, var(--accent-3));

  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  --radius-lg: 1.5rem;
  --radius-md: 1rem;
  --max-width: 1200px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

@property --angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

/* ==========================================================================
   RESET
========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; max-width: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; }
p { margin: 0 0 1rem; color: var(--text-muted); }
mark { background: none; color: var(--accent-4); font-weight: 600; }

section, .site-header, .contact { padding-inline: var(--gutter); }
section, .contact { max-width: var(--max-width); margin-inline: auto; }

.gradient-text {
  background: var(--gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-shift 6s ease-in-out infinite;
}

.section-head { max-width: 42rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-1);
  margin-bottom: .75rem;
}
h2 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 600; }

/* ==========================================================================
   REVEAL-ON-SCROLL
========================================================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
[data-reveal].in-view { opacity: 1; transform: none; }

/* ==========================================================================
   BUTTONS
========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1.75rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .95rem;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  will-change: transform;
}
.btn--primary {
  background: var(--gradient);
  background-size: 200% auto;
  color: #100816;
}
.btn--primary:hover {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-2) 60%, transparent), 0 12px 30px -8px color-mix(in srgb, var(--accent-2) 70%, transparent);
  background-position: right center;
}
.btn--ghost {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent-2); color: var(--accent-4); }
.btn--lg { padding: 1.1rem 2.25rem; font-size: 1.05rem; margin-block: 1.5rem; }

/* ==========================================================================
   HEADER / NAV
========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 65%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: var(--max-width);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.1rem;
}
.nav__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
}
.nav__logo .dot { color: var(--accent-2); }
.nav__links { display: flex; align-items: center; gap: 2rem; }
.nav__links a {
  font-size: .95rem;
  color: var(--text-muted);
  position: relative;
  padding-block: .25rem;
  transition: color .25s;
}
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--gradient);
  transition: width .3s var(--ease);
}
.nav__links a:hover,
.nav__links a.is-active { color: var(--text); }
.nav__links a:hover::after,
.nav__links a.is-active::after { width: 100%; }
.nav__cta {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .5rem 1.1rem !important;
}
.nav__cta::after { display: none; }
.nav__cta:hover { border-color: var(--accent-2); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: .5rem;
}
.nav__toggle span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   HERO
========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: clip;
  padding-block: 6rem;
}
.hero__blobs { position: absolute; inset: 0; z-index: -1; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
  animation: float 16s ease-in-out infinite;
}
.blob--1 { width: 34vw; height: 34vw; background: var(--accent-1); top: -8%; left: -6%; }
.blob--2 { width: 28vw; height: 28vw; background: var(--accent-3); bottom: -10%; right: -4%; animation-duration: 20s; animation-delay: -4s; }
.blob--3 { width: 20vw; height: 20vw; background: var(--accent-2); top: 40%; left: 55%; animation-duration: 24s; animation-delay: -9s; }

.hero__content { max-width: 50rem; text-align: center; margin-inline: auto; }
.hero__eyebrow {
  font-family: var(--font-display);
  color: var(--text-muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .85rem;
  margin-bottom: 1rem;
}
.hero__title { font-size: clamp(2.75rem, 9vw, 6rem); font-weight: 700; margin-bottom: 1.25rem; }
.hero__subtitle { font-size: clamp(1.05rem, 2.2vw, 1.35rem); max-width: 38rem; margin-inline: auto; margin-bottom: 1rem; }
.hero__actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }

.scroll-cue {
  position: absolute;
  bottom: 2.5rem; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 2px solid var(--border);
  border-radius: 999px;
}
.scroll-cue span {
  position: absolute;
  top: 8px; left: 50%;
  translate: -50% 0;
  width: 4px; height: 8px;
  border-radius: 999px;
  background: var(--accent-4);
  animation: scroll-cue 1.8s ease-in-out infinite;
}

/* ==========================================================================
   ABOUT
========================================================================== */
.about { padding-block: clamp(4rem, 10vw, 7rem); }
.about__grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.about__avatar { display: flex; justify-content: center; }
.avatar-placeholder {
  width: clamp(140px, 20vw, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--bg);
  background: var(--gradient);
  background-size: 200% auto;
  animation: gradient-shift 6s ease-in-out infinite;
}
.about__text p:last-child { margin-bottom: 0; }

.stats {
  margin-top: clamp(3rem, 7vw, 4.5rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 2rem;
  border-top: 1px solid var(--border);
  padding-top: clamp(2rem, 5vw, 3rem);
}
.stat { display: flex; flex-direction: column; }
.stat__num, .stat__suffix {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3rem);
  font-weight: 700;
  display: inline;
  color: var(--accent-1);
}
.stat__label { color: var(--text-muted); font-size: .95rem; margin-top: .25rem; }

/* ==========================================================================
   JOURNEY / TIMELINE
========================================================================== */
.journey { padding-block: clamp(4rem, 10vw, 7rem); }
.timeline { position: relative; display: flex; flex-direction: column; gap: 2.5rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--accent-1), var(--accent-2), var(--accent-3));
  opacity: .5;
}
.timeline__item { display: grid; grid-template-columns: 16px 1fr; gap: 1.5rem; align-items: start; }
.timeline__marker {
  width: 16px; height: 16px;
  border-radius: 50%;
  margin-top: .35rem;
  background: var(--gradient);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--border);
}
.timeline__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  transition: transform .3s var(--ease), border-color .3s;
}
.timeline__card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent-2) 50%, var(--border)); }
.timeline__tag {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .2rem .6rem;
  border-radius: 999px;
  margin-bottom: .6rem;
}
.timeline__tag--edu { background: color-mix(in srgb, var(--accent-3) 25%, transparent); color: #c9a8ff; }
.timeline__tag--work { background: color-mix(in srgb, var(--accent-1) 25%, transparent); color: #ffb28a; }
.timeline__time { display: block; color: var(--text-muted); font-size: .85rem; margin-bottom: .35rem; }
.timeline__card h3 { font-size: 1.2rem; margin-bottom: .2rem; }
.timeline__role { color: var(--accent-4); font-weight: 600; margin-bottom: .6rem; }
.timeline__card p:last-child { margin-bottom: 0; }

/* ==========================================================================
   PROJECTS
========================================================================== */
.projects { padding-block: clamp(4rem, 10vw, 7rem); }
.projects__grid {
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
}
.project-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2rem);
  background: var(--surface);
  isolation: isolate;
  transform-style: preserve-3d;
  transition: transform .4s var(--ease);
}
.project-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--angle), var(--accent-1), var(--accent-2), var(--accent-3), var(--accent-4), var(--accent-1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
  animation: spin 7s linear infinite paused;
}
.project-card:hover::before { animation-play-state: running; }
.project-card h3 { font-size: 1.3rem; margin-bottom: .4rem; }
.project-card__quote { color: var(--accent-4); font-weight: 600; margin-bottom: .75rem; }
.project-card__links { display: flex; gap: 1.25rem; margin-top: 1rem; flex-wrap: wrap; }
.project-card__links a {
  font-size: .9rem;
  font-weight: 600;
  color: var(--accent-2);
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}
.project-card__links a:hover { border-color: var(--accent-2); }

@container (min-width: 420px) {
  .project-card { padding: 2.25rem; }
  .project-card h3 { font-size: 1.45rem; }
}

/* ==========================================================================
   HOBBIES
========================================================================== */
.hobbies { padding-block: clamp(4rem, 10vw, 7rem); }
.hobbies__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.5rem;
}
.hobby-card {
  text-align: center;
  padding: clamp(1.75rem, 4vw, 2.25rem) 1.25rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform .35s var(--ease), opacity .35s var(--ease), filter .35s var(--ease), border-color .35s;
}
.hobbies__grid:has(.hobby-card:hover) .hobby-card:not(:hover) {
  opacity: .5;
  filter: saturate(.5);
}
.hobby-card:hover {
  transform: translateY(-6px) scale(1.03);
  border-color: color-mix(in srgb, var(--accent-2) 55%, var(--border));
}
.hobby-card__icon { font-size: 2.5rem; display: block; margin-bottom: .75rem; }
.hobby-card h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.hobby-card p { font-size: .9rem; margin: 0; }

/* ==========================================================================
   CONTACT / FOOTER
========================================================================== */
.contact { padding-block: clamp(4rem, 12vw, 8rem); text-align: center; }
.contact__inner { max-width: 40rem; margin-inline: auto; }
.contact h2 { margin-top: .5rem; }
.contact > .contact__inner > p { max-width: 32rem; margin-inline: auto; }
.social-links { display: flex; justify-content: center; gap: 2rem; margin-top: .5rem; }
.social-links a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: .95rem;
  border-bottom: 1px solid transparent;
  transition: color .25s, border-color .25s;
}
.social-links a:hover { color: var(--accent-4); border-color: var(--accent-4); }
.contact__copy { margin-top: 3rem; font-size: .85rem; color: var(--text-muted); opacity: .7; }

/* ==========================================================================
   KEYFRAMES
========================================================================== */
@keyframes gradient-shift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}
@keyframes spin { to { --angle: 360deg; } }
@keyframes float {
  0%, 100% { translate: 0 0 scale(1); }
  33% { translate: 4% 6%; scale: 1.08; }
  66% { translate: -5% -3%; scale: .95; }
}
@keyframes scroll-cue {
  0% { opacity: 0; top: 8px; }
  30% { opacity: 1; }
  100% { opacity: 0; top: 22px; }
}

/* ==========================================================================
   RESPONSIVE
========================================================================== */
@media (max-width: 800px) {
  .about__grid { grid-template-columns: 1fr; text-align: center; }
  .about__avatar { margin-bottom: 1rem; }

  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed;
    top: 64px;
    right: 0;
    left: 0;
    /* explicit height (not a `bottom` inset) because .site-header's
       backdrop-filter creates a containing block for this fixed
       descendant, so `bottom: 0` would resolve against the header's
       own (short) box instead of the viewport */
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
    overflow-y: auto;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    background: var(--bg-soft);
    transform: translateX(100%);
    transition: transform .4s var(--ease);
    padding-top: 2rem;
  }
  .nav__links.is-open { transform: translateX(0); }
  .nav__links li { width: 100%; text-align: center; }
  .nav__links a { display: block; padding: 1rem; font-size: 1.1rem; }
  .nav__cta { margin-top: 1rem; }
}

/* Small phones — tighten grids/gutters so nothing sits at the overflow edge */
@media (max-width: 420px) {
  :root { --gutter: 1rem; }

  .hero { padding-block: 4rem; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { justify-content: center; }

  .projects__grid { grid-template-columns: 1fr; }
  .hobbies__grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .stats { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1.5rem; }

  .timeline__item { grid-template-columns: 12px 1fr; gap: 1rem; }
  .timeline::before { left: 5px; }
  .timeline__marker { width: 12px; height: 12px; }

  .social-links { gap: 1.25rem; flex-wrap: wrap; }
}

/* Short / landscape mobile viewports — the full-height hero shouldn't force
   its own scroll on top of the page scroll */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; padding-block: 5.5rem 3rem; }
  .scroll-cue { display: none; }
}

/* ==========================================================================
   ACCESSIBILITY — respect reduced-motion preference
========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  html { scroll-behavior: auto; }
}
