/* =========================================================
   1. Design tokens — change these to re-theme everything
   ========================================================= */
:root {
  /* dusk-sky gradient, top to horizon */
  --sky-top: #120e29;
  --sky-mid: #2e1b4a;
  --sky-low: #6b3159;
  --horizon: #c4646a;
  --glow: rgba(255, 160, 120, 0.55);   /* warm sunset glow at the bottom */
  --aurora-1: rgba(140, 90, 220, 0.35);
  --aurora-2: rgba(240, 110, 150, 0.28);

  --fg: #fbf3ee;
  --muted: rgba(251, 243, 238, 0.7);
  --line: rgba(255, 255, 255, 0.15);
  --glass: rgba(22, 13, 38, 0.55);
  --accent: #ffc4a3;                   /* peach highlight */
  --star-warm: 255, 214, 186;          /* r, g, b for warm stars */

  --serif: "Times New Roman", Times, "Cormorant Garamond", serif;
  --script: "Cormorant Garamond", "Times New Roman", serif;

  --gutter: clamp(20px, 5vw, 50px);
}

/* =========================================================
   2. Base
   ========================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--sky-top); /* fallback under the backdrop */
  color: var(--fg);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--sky-top); }

/* =========================================================
   3. Background layers (all fixed, behind everything)
   ========================================================= */
.backdrop, .aurora, #stars, .grain {
  position: fixed; inset: 0;
  pointer-events: none;
}
.backdrop {
  z-index: -4;
  background:
    radial-gradient(ellipse 90% 40% at 50% 112%, var(--glow), transparent 70%),
    linear-gradient(180deg,
      var(--sky-top) 0%,
      var(--sky-mid) 45%,
      var(--sky-low) 82%,
      var(--horizon) 100%);
}

/* two big blurred blobs that slowly wander — the "aurora" */
.aurora { z-index: -3; overflow: hidden; }
.aurora::before, .aurora::after {
  content: ""; position: absolute;
  width: 70vmax; height: 40vmax;
  border-radius: 50%;
  filter: blur(80px);
  mix-blend-mode: screen;
}
.aurora::before {
  background: var(--aurora-1);
  top: -10vmax; left: -15vmax;
  animation: wander-a 26s ease-in-out infinite alternate;
}
.aurora::after {
  background: var(--aurora-2);
  top: 25vmax; right: -25vmax;
  animation: wander-b 32s ease-in-out infinite alternate;
}
@keyframes wander-a { to { transform: translate(25vmax, 10vmax) rotate(15deg); } }
@keyframes wander-b { to { transform: translate(-30vmax, -8vmax) rotate(-12deg); } }

#stars { z-index: -2; width: 100%; height: 100%; }

/* film grain: SVG noise tiled over the page */
.grain {
  z-index: -1;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* =========================================================
   4. Header
   ========================================================= */
.site-header {
  position: fixed; inset: 0 0 auto 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter);
  z-index: 20;
  font-size: clamp(1.15rem, 1.9vw, 1.6rem);
  transition: background .4s, backdrop-filter .4s, padding .4s;
}
.site-header.scrolled {
  background: rgba(18, 14, 41, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding-top: 12px; padding-bottom: 12px;
}
.logo { letter-spacing: 0.01em; }

.nav { display: flex; gap: clamp(14px, 1.8vw, 22px); margin-left: auto; }
.nav a, .logo { position: relative; transition: color .25s; }
.nav a:hover { color: var(--accent); }
/* underline that grows on hover / active */
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .35s ease;
}
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }

.socials { display: flex; align-items: center; gap: clamp(12px, 1.6vw, 20px); }
.socials svg { width: 1.2em; height: 1.2em; fill: var(--fg); display: block; transition: transform .25s, fill .25s, stroke .25s; }
.socials svg.stroke { fill: none; stroke: var(--fg); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.socials a:hover svg { transform: translateY(-2px); fill: var(--accent); }
.socials a:hover svg.stroke { fill: none; stroke: var(--accent); }

.menu-toggle { display: none; }

/* =========================================================
   5. Hero — stacked intro: eyebrow, big name, "currently" ticker
   ========================================================= */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: 0 clamp(20px, 9vw, 140px);
  position: relative;
}
.intro { max-width: 1100px; }

.eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-size: clamp(1.1rem, 1.8vw, 1.45rem);
  color: var(--muted);
  letter-spacing: 0.04em;
  opacity: 0; transform: translateX(-12px);
  transition: opacity .8s ease, transform .8s ease;
}
.eyebrow .dash {
  width: 48px; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .8s ease .2s;
}
.intro.visible .eyebrow { opacity: 1; transform: none; }
.intro.visible .eyebrow .dash { transform: scaleX(1); }

/* the name: each letter is a <span> (built in main.js) that rises in turn */
.big-name {
  font-family: var(--script);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3.6rem, 11vw, 9.5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0.12em 0 0.22em;
  padding-bottom: 0.08em;
  /* soft warm glow on the text */
  text-shadow: 0 0 40px rgba(255, 180, 150, 0.25);
}
.big-name .ch {
  display: inline-block;
  opacity: 0; transform: translateY(0.4em);
  filter: blur(6px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1), filter .7s ease;
  transition-delay: calc(0.35s + var(--i) * 45ms);
}
.intro.visible .big-name .ch { opacity: 1; transform: none; filter: none; }

.now {
  font-size: clamp(1.15rem, 2.1vw, 1.7rem);
  color: var(--muted);
  opacity: 0;
  transition: opacity 1s ease 1.1s;
}
.intro.visible .now { opacity: 1; }
.now .label { font-style: italic; margin-right: 0.35em; }

/* rotating text with an underline that redraws on every change */
.ticker { position: relative; display: inline-block; color: var(--fg); }
.ticker::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0); transform-origin: left;
}
.ticker.draw::after { animation: underline 1.1s cubic-bezier(.6, 0, .2, 1) forwards; }
@keyframes underline { to { transform: scaleX(1); } }

#ticker-text {
  display: inline-block;
  transition: opacity .4s ease, transform .4s ease;
}
#ticker-text.out { opacity: 0; transform: translateY(-0.5em); }
#ticker-text.in-start { opacity: 0; transform: translateY(0.5em); transition: none; }

.scroll-hint {
  position: absolute; bottom: 30px; left: 50%;
  width: 1px; height: 46px; overflow: hidden;
  background: rgba(255, 255, 255, 0.15);
}
.scroll-hint::after {
  content: ""; position: absolute; left: 0; top: -46px; width: 1px; height: 46px;
  background: var(--accent);
  animation: fall 2.2s ease-in-out infinite;
}
@keyframes fall { to { top: 46px; } }

/* =========================================================
   6. Sections
   ========================================================= */
.section {
  padding: 120px var(--gutter);
  max-width: 1000px;
  margin: 0 auto;
}
.section h2 {
  font-family: var(--script);
  font-style: italic; font-weight: 500;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  margin-bottom: 28px;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(20px, 3vw, 32px);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
#about-text { color: var(--muted); font-size: 1.50rem; line-height: 1.75; }

/* About: text card on the left, photo on the right */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
}
.about-card {
  padding: clamp(32px, 4.5vw, 56px);
  min-height: 300px;
  display: flex;
  align-items: center;
}
.about-card {
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
}
#about { max-width: 1150px; }

/* Photo: a circle whose edge lights up with a gradient as the cursor nears.
   main.js sets --glow-angle (direction of the cursor) and --glow-strength (0–1). */
.photo {
  --size: clamp(220px, 26vw, 320px);
  --glow-angle: 0deg;
  --glow-strength: 0;
  position: relative;
  width: var(--size); height: var(--size);
  border-radius: 50%;
  padding: 5px;                        /* thickness of the gradient edge */
  background: var(--line);             /* faint ring when the cursor is away */
  transition: transform .5s ease;
}
/* gradient ring, faded in by --glow-strength */
.photo::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: conic-gradient(from var(--glow-angle),
    var(--accent), #f27aa6, #9b6cf0, #6fa8ff, #9b6cf0, #f27aa6, var(--accent));
  opacity: var(--glow-strength);
  transition: opacity .3s ease;
}
/* soft blurred halo of the same colors behind the photo */
.photo::after {
  content: "";
  position: absolute; inset: -14px;
  border-radius: inherit;
  background: inherit;
  background-image: conic-gradient(from var(--glow-angle),
    var(--accent), #f27aa6, #9b6cf0, #6fa8ff, #9b6cf0, #f27aa6, var(--accent));
  filter: blur(26px);
  opacity: calc(var(--glow-strength) * 0.55);
  z-index: -1;
  transition: opacity .3s ease;
}
.photo img {
  position: relative; z-index: 1;
  display: block; width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--sky-top);    /* thin dark gap between ring and photo */
}
.photo:hover { transform: scale(1.03); }

/* fade in on scroll (class toggled by IntersectionObserver in main.js) */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .9s ease, transform .9s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* Experience timeline */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 1px;
  background: linear-gradient(var(--line), rgba(255, 196, 163, .5), var(--line));
}
.job { position: relative; margin-bottom: 36px; }
.job::before {
  content: ""; position: absolute; left: -28px; top: 9px;
  width: 9px; height: 9px; border-radius: 50%;
  background: rgb(var(--star-warm));
  box-shadow: 0 0 10px rgba(var(--star-warm), .8);
}
.job h3 { font-weight: 400; font-size: 1.3rem; }
.job h3 em { font-family: var(--script); font-weight: 500; color: var(--accent); }
.job .meta { color: var(--muted); font-size: .95rem; font-style: italic; }
.job ul { margin-top: 8px; padding-left: 1.1em; color: var(--muted); }
.job li { margin-bottom: 4px; }
.job p { color: var(--muted); margin-top: 6px; }
.job li::marker { content: "✦  "; color: var(--accent); font-size: .7em; }

/* Project cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--line); border-radius: 22px;
  padding: 24px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 196, 163, 0.45);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35), 0 0 30px rgba(255, 160, 120, 0.15);
}
.card.hidden { display: none; }
.card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; margin-bottom: 14px; }
.card h3 { font-family: var(--script); font-style: italic; font-weight: 500; font-size: 1.6rem; line-height: 1.2; }
.card p { color: var(--muted); margin: 8px 0 14px; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: .85rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px;
}

/* Skills: one row per group, skills listed across */
.skills-grid { display: flex; flex-direction: column; }
.skill-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: baseline;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.skill-row:first-child { border-top: 1px solid var(--line); }
.skill-row h3 {
  font-family: var(--script);
  font-style: italic;
  font-weight: 500;
  font-size: 1.6rem;
  color: var(--accent);
}
.skill-row p { color: var(--muted); font-size: 1.15rem; line-height: 1.8; }
.skill-row .dot { color: var(--accent); margin: 0 0.6em; opacity: .7; }

@media (max-width: 760px) {
  .skill-row { grid-template-columns: 1fr; gap: 4px; }
}

/* =========================================================
   7. Footer
   ========================================================= */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 40px var(--gutter) 50px;
  color: var(--muted);
  font-size: .85rem;
}
.reach a { color: var(--accent); transition: opacity .2s; }
.reach a:hover { opacity: .75; text-decoration: underline; }

/* =========================================================
   8. Mobile
   ========================================================= */
@media (max-width: 760px) {
  .menu-toggle {
    display: flex; flex-direction: column; gap: 6px;
    background: none; border: none; cursor: pointer; padding: 6px;
    order: 3; margin-left: 4px;
  }
  .menu-toggle span { width: 22px; height: 1.5px; background: var(--fg); transition: transform .3s; }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

  .nav {
    position: fixed; inset: 0;
    flex-direction: column; align-items: center; justify-content: center; gap: 28px;
    background: rgba(18, 14, 41, 0.96);
    font-family: var(--script); font-style: italic; font-size: 2.2rem;
    opacity: 0; pointer-events: none; transition: opacity .35s;
    z-index: -1;
  }
  .nav.open { opacity: 1; pointer-events: auto; }
  .socials { margin-left: auto; }
  .eyebrow .dash { width: 28px; }

  /* stack the photo above the text on phones */
  .about-grid { grid-template-columns: 1fr; justify-items: center; }
  .photo { order: -1; --size: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .eyebrow, .now, .big-name .ch { opacity: 1 !important; transform: none !important; filter: none !important; }
  .eyebrow .dash, .ticker::after { transform: none !important; }
}