/* ============================================================
   Suhaas Mandava, Portfolio
   Premium monochrome system: black, white, and brushed silver.
   Metallic gradients + layered depth. No colour, dark only.
   Display: JetBrains Mono · Body: Inter · Emphasis: Instrument Serif.
   ============================================================ */

:root {
  --max-width: 1180px;

  /* Spacing scale. Grids, card padding, and section rhythm all draw from here
     so nothing is off by a stray 2px. */
  --space-section: clamp(56px, 8vw, 96px);
  --space-card: 26px;
  --space-gap: 18px;

  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --font-display: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Instrument Serif', 'Times New Roman', serif;

  --transition: 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);   /* overshoot-and-settle */

  /* Silver "accent" (monochrome). accent-rgb feeds all the rgba() tints. */
  --accent: #eef0f2;
  --accent-rgb: 238, 240, 242;
  --accent-2: #a7a9b0;            /* dimmer silver for subtle two-tone gradients */
  --accent-2-rgb: 167, 169, 176;
  --accent-ink: #0a0a0b;          /* dark text that sits on silver fills */

  /* Brushed-metal gradient: bright highlight, a hard reflection line, then
     a dark trough. Used for metal buttons, bars, and clipped silver text. */
  --grad: linear-gradient(180deg, #ffffff 0%, #d7d9de 44%, #a4a6ad 52%, #e6e8ec 100%);
  --grad-soft: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(167, 169, 176, 0.06));
  --metal-text: linear-gradient(180deg, #ffffff 0%, #e4e6ea 38%, #9a9ca3 60%, #f2f3f6 100%);
}

/* ---- Theme: permanently dark (no light mode, no toggle) ---- */
:root {
  --bg: #08080a;                  /* neutral near-black, no colour cast */
  --bg-2: #0d0d10;
  --card: #131316;
  --card-2: #191a1e;
  --surface: #131316;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #e9eaee;
  --text-dim: #90929a;            /* neutral grey */
  --heading: #ffffff;
  --shadow: 0 16px 40px -20px rgba(0, 0, 0, 0.75);
  /* One soft contact shadow. No inset bevels, no white halo. */
  --glow: 0 14px 34px -18px rgba(0, 0, 0, 0.7);
  --glow-2: 0 10px 26px -16px rgba(0, 0, 0, 0.6);
  /* Hero video scrim: neutral dark on the text side + a bottom fade into the page. */
  --hero-scrim:
    linear-gradient(90deg, rgba(6, 6, 7, 0.92), rgba(6, 6, 7, 0.62) 52%, rgba(6, 6, 7, 0.38)),
    linear-gradient(0deg, var(--bg) 2%, transparent 34%);
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

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

/* Custom cursor active: hide the native one across interactive elements */
body.has-cursor,
body.has-cursor a,
body.has-cursor button,
body.has-cursor [data-magnetic],
body.has-cursor [data-tilt],
body.has-cursor .feature { cursor: none; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.08em;
  color: #f5f6f8;
  letter-spacing: 0.005em;
}

/* Ambient studio lighting: a soft overhead spotlight + a faint side fill,
   fixed behind everything, for a premium lit-from-above look. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(70% 50% at 50% -10%, rgba(255, 255, 255, 0.05), transparent 62%);
}

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }

/* ============================================================
   Glow cursor (WebGL trail, see glow-cursor.js)
   ============================================================ */
.glow-cursor-canvas {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  will-change: transform;
}

/* ============================================================
   Scroll progress bar
   ============================================================ */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 200;
  background: transparent;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--accent);
}

/* ============================================================
   Utility components
   ============================================================ */
.eyebrow {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.14em;
  margin-bottom: 18px;
}

.display {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--heading);
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.display--section {
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  line-height: 1.08;
  margin-bottom: 22px;
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition),
    border-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.pill:hover {
  border-color: var(--border-strong);
  color: var(--heading);
}

/* CTA: gradient pill + circular arrow */
.cta { display: inline-flex; align-items: center; gap: 10px; }
.cta__pill {
  padding: 15px 30px;
  border-radius: var(--radius-pill);
  background: var(--grad);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.6);
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}
.cta__arrow {
  display: inline-grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: var(--accent);
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}
.cta:hover .cta__pill {
  filter: brightness(1.04);
  box-shadow: 0 12px 26px -12px rgba(0, 0, 0, 0.7);
}
.cta:hover .cta__arrow { transform: translateX(3px); border-color: var(--accent); }
.cta:active .cta__pill { transform: scale(0.98); }
.cta--center { justify-content: center; }

/* Circular icon button */
.icon-circle {
  display: inline-grid; place-items: center; flex: none;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.icon-circle:hover { background: var(--card-2); color: var(--heading); border-color: var(--border-strong); }
.icon-circle:active { transform: scale(0.94); }
.icon-circle:disabled { opacity: 0.3; cursor: default; background: var(--surface); color: var(--text); box-shadow: none; }

/* Small square icon button (theme / burger) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--radius-pill);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--heading); }

/* ============================================================
   Navbar
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 74px; }
.nav__brand {
  display: inline-block;   /* so the magnetic transform actually applies */
  font-family: var(--font-display);
  font-weight: 700; font-size: 1rem; line-height: 1.15;
  color: var(--heading); letter-spacing: -0.02em;
}
.nav__dot { color: var(--accent); }
.nav__links { display: flex; gap: 34px; margin-left: auto; margin-right: 34px; position: relative; }
.nav__links a {
  font-size: 0.92rem; font-weight: 500;
  color: var(--text-dim);
  position: relative;
  padding: 4px 2px;
  transition: color var(--transition);
}
.nav__links a:hover { color: var(--heading); }
.nav__links a.active { color: var(--accent); }
/* Shared sliding indicator (position set by JS via --nav-ind-x / --nav-ind-w) */
.nav__indicator {
  position: absolute;
  bottom: -4px; left: 0;
  height: 2px;
  width: var(--nav-ind-w, 0);
  border-radius: 2px;
  background: var(--grad);
  transform: translateX(var(--nav-ind-x, 0));
  opacity: 0;
  transition: transform 0.35s var(--ease-out), width 0.35s var(--ease-out), opacity var(--transition);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.6);
}
.nav__indicator.is-active { opacity: 1; }
.nav__actions { display: flex; align-items: center; gap: 10px; }

/* Burger */
.nav__burger { display: none; flex-direction: column; gap: 4px; }
.nav__burger span { display: block; width: 17px; height: 2px; background: currentColor; border-radius: 2px; transition: var(--transition); }

/* ============================================================
   Hero
   ============================================================ */
main { position: relative; z-index: 1; }

/* Stable height so the hero never reflows as the typing headline wraps between
   1 and 2 lines. A flexing height would make object-fit:cover re-scale the
   background video every reflow (the "pulsing zoom"); a fixed min-height fixes it. */
.hero {
  position: relative;
  /* Full-bleed: the hero background spans the whole viewport width even though
     it lives inside the centered max-width container. The content is
     re-centered via .hero__content below. */
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  min-height: min(88vh, 880px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 8vw, 96px) 0 60px;
  overflow: hidden;
}

/* Background video + scrim (behind the dot grid, glow, and content) */
.hero__media {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden;
  pointer-events: none;
  /* Branded fallback shown until the first video frame is ready / for no-JS. */
  background:
    radial-gradient(120% 120% at 50% 10%, rgba(255, 255, 255, 0.07), transparent 58%),
    var(--bg);
}
.hero__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;      /* fill the hero on any aspect ratio, no distortion */
  opacity: 0;             /* fade in once the first frame decodes */
  transition: opacity 0.8s var(--ease-out);
}
.hero__video.is-ready { opacity: 1; }
.hero__scrim { position: absolute; inset: 0; background: var(--hero-scrim); }

.hero__grid { position: absolute; inset: -20px 0 0 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; opacity: 0.9; }
.hero__glow {
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03) 42%, transparent 70%);
  filter: blur(40px);
  z-index: 1;
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0);
  left: 50%; top: 40%;
  opacity: 0.9;
  will-change: transform;
}
.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;   /* matches .container so content aligns with the rest of the page */
}
.hero__kicker { font-family: var(--font-display); color: var(--text-dim); font-size: 0.9rem; letter-spacing: 0.02em; margin-bottom: 14px; }
/* Headline must never wrap: the typing cycle stays on one line at every width.
   Font-size scales with the viewport (clamp) so the longest phrase
   ("Aspiring AI Engineer", ~11.5em wide in JetBrains Mono) fits inside the
   container down to ~320px instead of wrapping. white-space: nowrap enforces
   the single line and keeps the blinking caret inline right after the text. */
.hero__title {
  font-size: clamp(1.2rem, 5.6vw, 4.4rem);
  min-height: 1.1em;
  white-space: nowrap;
}
.type {
  background: var(--metal-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.type-caret {
  display: inline-block;
  width: 0.06em; height: 0.9em;
  margin-left: 0.06em;
  background: var(--accent);
  vertical-align: -0.08em;
  animation: caretBlink 1s steps(1) infinite;
}
.hero__lead { max-width: 540px; margin-top: 24px; font-size: 1.05rem; line-height: 1.7; color: var(--text-dim); }
.hero__actions { margin-top: 36px; }
.social-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.social-row--center { justify-content: center; }

/* ============================================================
   Stats (count-up)
   ============================================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-gap);
  padding: 30px 0 10px;
}
.stat {
  padding: var(--space-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.stat::before {
  content: ""; position: absolute; inset: 0;
  background: var(--grad-soft); opacity: 0;
  transition: opacity var(--transition);
}
.stat:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.stat:hover::before { opacity: 1; }

/* ============================================================
   GitHub activity: live "currently building" list
   ============================================================ */
.gh { padding: 26px 0 6px; }
.gh.is-hidden { display: none; }
.gh__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 14px;
}
.gh__title {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 0.72rem;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-dim);
}
.gh__pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.7);
  animation: ghPulse 2.4s ease-in-out infinite;
}
@keyframes ghPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.gh__profile {
  font-family: var(--font-display); font-size: 0.76rem; color: var(--text-dim);
  transition: color var(--transition);
}
.gh__profile:hover { color: var(--accent); }

.gh__list {
  list-style: none; margin: 0; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--card); overflow: hidden;
}
.gh__item {
  display: grid;
  grid-template-columns: minmax(140px, auto) 1fr auto;
  align-items: baseline; gap: 16px;
  padding: 15px var(--space-card);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.gh__list .gh__item:last-child { border-bottom: none; }
.gh__item:hover { background: rgba(255, 255, 255, 0.022); }
.gh__item[data-href] { cursor: pointer; }
/* Hovering anywhere on the row highlights the repo name, so it reads as one
   target rather than a link sitting next to inert text. */
.gh__item[data-href]:hover .gh__repo { color: var(--accent); }
.gh__repo {
  font-family: var(--font-display); font-weight: 700; font-size: 0.84rem;
  color: var(--heading); transition: color var(--transition);
}
.gh__repo:hover { color: var(--accent); }
.gh__msg {
  color: var(--text-dim); font-size: 0.88rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.gh__meta {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-size: 0.74rem;
  color: var(--text-dim); opacity: 0.8; white-space: nowrap;
}
.gh__lang {
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-dim);
}
.stat__num {
  position: relative;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.75rem, 3.4vw, 2.35rem);
  background: var(--metal-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  line-height: 1;
}
.stat__label { position: relative; display: block; margin-top: 8px; color: var(--text-dim); font-size: 0.9rem; }

/* ============================================================
   Sections
   ============================================================ */
.section { padding: var(--space-section) 0; }
/* Every section leads with the same block: label, heading, optional intro. */
.section__head { margin-bottom: 36px; max-width: 60ch; }
.section__head .display--section { margin-bottom: 16px; }
.section__head .section__intro:last-child,
.section__head .contact__lead:last-child { margin-bottom: 0; }
.section--contact .section__head { max-width: none; margin-inline: auto; }
.section__intro { color: var(--text-dim); max-width: 60ch; font-size: 1rem; line-height: 1.7; margin-bottom: 28px; }

/* ============================================================
   Projects: featured carousel (with 3D tilt)
   ============================================================ */
.carousel { display: flex; align-items: center; gap: 18px; }
.carousel__track {
  display: flex; gap: var(--space-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 10px 2px 20px;
  flex: 1;
  scrollbar-width: none;
  perspective: 1000px;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__nav { display: none; }

.feature {
  scroll-snap-align: start;
  flex: 0 0 100%;   /* one card per view; arrows / snap move between them */
  display: grid;
  grid-template-columns: 40% 1fr;
  min-height: 260px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  transform-style: preserve-3d;
  transition: border-color var(--transition);
  will-change: transform;
  cursor: pointer;   /* the whole card opens its repo, see initCardLinks */
}
.feature:hover { border-color: var(--border-strong); }
/* Dark brushed-metal panels with a soft light streak (no colour). */
.feature__media {
  background:
    radial-gradient(120% 120% at 22% 8%, rgba(255, 255, 255, 0.5), transparent 42%),
    linear-gradient(150deg, #3a3b40 0%, #17171a 46%, #2c2d32 74%, #101012 100%);
  position: relative;
}
.feature--b .feature__media {
  background:
    radial-gradient(130% 120% at 78% 12%, rgba(255, 255, 255, 0.42), transparent 46%),
    linear-gradient(150deg, #45464c 0%, #161618 52%, #34353b 100%);
}
.feature--muted .feature__media { background: linear-gradient(150deg, #1a1a1d, #0e0e10 60%, #232327); }
/* Image thumbnail: the <img> IS the media grid cell, so it stretches to the
   card height and crops to fill (no letterboxing), same footprint as the
   gradient placeholder. */
.feature__media--img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
/* Crop anchors, set per project via `imagePos`. Anchoring left keeps the left
   edge of a screenshot in frame (a headline, a sidebar) instead of trimming it
   evenly off both sides the way the default centre crop does. */
.feature__media--left { object-position: left center; }
.feature__media--right { object-position: right center; }
.feature__body {
  background: var(--card);
  color: var(--text);
  padding: var(--space-card);
  display: flex; flex-direction: column;
  transform: translateZ(30px);
}
.feature__title { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; line-height: 1.2; margin-bottom: 10px; color: var(--heading); }
.feature__desc { font-size: 0.9rem; color: var(--text-dim); flex-grow: 1; }
.feature__tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 18px; }
.feature__tags span {
  font-family: var(--font-display); font-size: 0.68rem;
  padding: 4px 10px; border-radius: var(--radius-pill);
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}
.feature__links { display: flex; gap: 10px; align-items: center; }
.feature__btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-pill);
  background: var(--grad); color: var(--accent-ink);
  font-weight: 600; font-size: 0.85rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.feature__btn:hover { filter: brightness(1.04); }
.feature__btn--ghost { background: transparent; color: var(--accent); border: 1px solid rgba(var(--accent-rgb), 0.4); }

.feature--placeholder { grid-template-columns: 1fr; align-items: center; text-align: center; border-style: dashed; }
.feature--placeholder .feature__body { align-items: center; justify-content: center; }

/* ============================================================
   About
   ============================================================ */
.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 50px; align-items: center; }
.about__hello { font-size: 1.2rem; color: var(--heading); font-weight: 500; margin-bottom: 20px; line-height: 1.4; }
.about__intro p { color: var(--text-dim); margin-bottom: 14px; }
.about__intro a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(var(--accent-rgb), 0.5); transition: text-decoration-color var(--transition); }
.about__intro a:hover { text-decoration-color: var(--accent); }
.about__photo { display: flex; justify-content: center; perspective: 1000px; }
.photo-frame {
  width: 100%; max-width: 340px;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(var(--accent-rgb), 0.22), transparent 60%),
    linear-gradient(160deg, var(--card-2), var(--card));
  display: grid; place-items: center;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: box-shadow var(--transition), border-color var(--transition);
  will-change: transform;
}
.photo-frame:hover { border-color: var(--border-strong); }
.photo-frame span {
  font-family: var(--font-display); font-weight: 800; font-size: 3.4rem;
  background: var(--metal-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  letter-spacing: 0.05em;
  transform: translateZ(40px);
}

/* "Where I'm headed" goals block inside About */
.goals {
  margin-top: 28px;
  padding: 20px var(--space-card);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: var(--radius-md);
  background: var(--grad-soft);
}
.goals__label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.goals p { margin: 0; color: var(--text); }

/* ============================================================
   Skills: dark cards with accent gradient bar + colour tags
   ============================================================ */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-gap); }
.skill-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-card);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.skill-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad); transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}
.skill-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.skill-card:hover::before { transform: scaleX(1); }
.skill-card h3 {
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  margin-bottom: 16px; color: var(--heading);
  display: flex; align-items: center; gap: 10px;
}
.skill-card h3 span { color: var(--accent); }
.skill-card__items { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-card__items span {
  font-family: var(--font-display); font-size: 0.78rem;
  padding: 5px 12px; border-radius: var(--radius-pill);
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid var(--border);
  transition: transform var(--transition), color var(--transition), border-color var(--transition), background var(--transition);
}
.skill-card__items span:hover { color: var(--heading); border-color: var(--border-strong); }

/* ============================================================
   Experience: table / list
   ============================================================ */
.exp { border-top: 1px solid var(--border); }
.exp__row {
  display: grid; grid-template-columns: 0.8fr 1fr 1.4fr; gap: 24px; align-items: center;
  padding: 22px var(--space-card);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-md);
  position: relative;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.exp__row::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px;
  border-radius: 2px; background: var(--grad); opacity: 0; transition: opacity var(--transition);
}
.exp__row:hover, .exp__row--active {
  background: rgba(var(--accent-rgb), 0.06);
  border-color: rgba(var(--accent-rgb), 0.25);
}
.exp__row:hover::before, .exp__row--active::before { opacity: 1; }
.exp__range { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; color: var(--heading); }
.exp__dur { display: block; font-size: 0.8rem; color: var(--text-dim); margin-top: 3px; }
.exp__org { font-weight: 600; font-size: 1.05rem; }
.exp__org a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(var(--accent-rgb), 0.5); }
.exp__org a:hover { text-decoration-color: currentColor; }
.exp__row:hover .exp__org, .exp__row--active .exp__org { color: var(--accent); }
.exp__role { font-family: var(--font-display); font-size: 0.9rem; color: var(--text-dim); }
.exp__total { text-align: right; margin-top: 26px; color: var(--text-dim); font-size: 0.95rem; }
.exp__total em { color: var(--accent); font-weight: 600; }

/* ============================================================
   Hackathons: card grid
   ============================================================ */
.hacks { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-gap); }
.hack {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-card);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.hack::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad); transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}
.hack:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.hack:hover::before { transform: scaleX(1); }
/* A card with a placement keeps its top rule lit, so a win reads at a glance. */
.hack--won::before { transform: scaleX(1); }

.hack__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; width: 100%; margin-bottom: 14px;
}
.hack__event {
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem;
  color: var(--accent); letter-spacing: 0.02em;
}
.hack__date { font-family: var(--font-display); font-size: 0.75rem; color: var(--text-dim); white-space: nowrap; }
.hack__badge {
  font-family: var(--font-display); font-size: 0.7rem; font-weight: 700;
  padding: 5px 12px; border-radius: var(--radius-pill);
  background: var(--grad); color: var(--accent-ink);
  margin-bottom: 12px;
}
.hack__title { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--heading); }
.hack__meta { font-family: var(--font-display); font-size: 0.78rem; color: var(--text-dim); margin-top: 6px; }
.hack__desc { color: var(--text-dim); font-size: 0.95rem; line-height: 1.65; margin-top: 12px; }
.hack__tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 0; }
.hack__tags span {
  font-family: var(--font-display); font-size: 0.68rem;
  padding: 4px 10px; border-radius: var(--radius-pill);
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}
/* Links pin to the bottom so buttons line up across cards of unequal height. */
.hack__links { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: auto; padding-top: 20px; }
.hack__btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-pill);
  background: var(--grad); color: var(--accent-ink);
  font-weight: 600; font-size: 0.85rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.hack__btn:hover { filter: brightness(1.04); }

/* Empty state: no entries yet, so one card spans the grid and says so. */
.hack--empty { grid-column: 1 / -1; }
.hack--empty .hack__desc { max-width: 60ch; }

/* ============================================================
   Contact
   ============================================================ */
.section--contact { text-align: center; }
.contact__lead { max-width: 480px; margin: 0 auto; color: var(--text-dim); font-size: 1.02rem; line-height: 1.7; }
.section--contact .cta { margin-bottom: 40px; }

/* ============================================================
   Footer
   ============================================================ */
.footer { border-top: 1px solid var(--border); padding: 28px 0; position: relative; z-index: 1; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer p { font-size: 0.85rem; color: var(--text-dim); font-family: var(--font-display); }
.footer a { color: var(--accent); transition: color var(--transition); }
.footer a:hover { color: var(--heading); }
.footer__top { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 0.85rem; font-family: var(--font-display); transition: color var(--transition); }
.footer__top:hover { color: var(--accent); }

/* ============================================================
   Legal / prose pages (privacy policy)
   ============================================================ */
/* Horizontal padding is repeated here on purpose: this element also carries
   .container, and the shorthand below would otherwise reset its 0 28px and
   let the text run into the screen edges on phones. */
.legal { max-width: 760px; padding: 60px 28px 90px; position: relative; z-index: 1; }
.legal__back { display: inline-block; margin-bottom: 30px; color: var(--accent); font-family: var(--font-display); font-size: 0.9rem; }
.legal__back:hover { color: var(--heading); }
.legal h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 2.8rem); color: var(--heading); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.legal__updated { color: var(--text-dim); font-size: 0.85rem; font-family: var(--font-display); margin-bottom: 40px; }
.legal h2 { font-family: var(--font-display); color: var(--heading); font-size: 1.2rem; margin: 36px 0 12px; }
.legal p { color: var(--text-dim); margin-bottom: 14px; }
.legal ul { display: grid; gap: 8px; margin: 10px 0 14px; }
.legal ul li { position: relative; padding-left: 22px; color: var(--text-dim); }
.legal ul li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }
.legal a { color: var(--accent); text-decoration: underline; }
.legal__note { border-left: 2px solid var(--accent); background: var(--card); padding: 16px 20px; border-radius: var(--radius-sm); font-size: 0.9rem; }

/* ============================================================
   Scroll reveal + motion
   ============================================================ */
/* Reveal animates the INDEPENDENT translate/scale properties (not `transform`)
   so a finished forwards-animation never clobbers hover/tilt `transform`. */
.reveal { opacity: 0; translate: 0 16px; }
.reveal.visible {
  animation: revealIn 0.7s var(--ease-spring) forwards;   /* overshoot-and-settle */
  animation-delay: var(--reveal-delay, 0ms);
}
.stats .stat:nth-child(2) { --reveal-delay: 80ms; }
.stats .stat:nth-child(3) { --reveal-delay: 160ms; }
.stats .stat:nth-child(4) { --reveal-delay: 240ms; }
.skills .skill-card:nth-child(2) { --reveal-delay: 80ms; }
.skills .skill-card:nth-child(3) { --reveal-delay: 160ms; }
.skills .skill-card:nth-child(4) { --reveal-delay: 240ms; }
.exp__row:nth-child(2) { --reveal-delay: 70ms; }
.exp__row:nth-child(3) { --reveal-delay: 140ms; }
.exp__row:nth-child(4) { --reveal-delay: 210ms; }
.exp__row:nth-child(n+5) { --reveal-delay: 280ms; }
.hacks .hack:nth-child(2) { --reveal-delay: 80ms; }
.hacks .hack:nth-child(3) { --reveal-delay: 160ms; }
.hacks .hack:nth-child(4) { --reveal-delay: 240ms; }

@keyframes revealIn { to { opacity: 1; translate: 0 0; } }
@keyframes caretBlink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* ============================================================
   Responsive
   ============================================================ */
@media (min-width: 760px) { .carousel__nav { display: inline-grid; } }

/* Below 760px the arrows would crowd the card, so they move under it in a
   centred row. They stay visible, because one card shows at a time and swipe
   alone gives no hint that there are more projects. */
@media (max-width: 759px) {
  .carousel { flex-wrap: wrap; gap: 0; }
  .carousel__track { flex: 1 0 100%; order: -1; }
  .carousel__nav { display: inline-grid; margin: 4px auto 0; }
  .carousel__nav#carouselPrev { margin-right: 8px; }
  .carousel__nav#carouselNext { margin-left: 8px; }
}

@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; gap: 36px; }
  .about__photo { order: -1; }
  .photo-frame { max-width: 260px; }
}

@media (max-width: 680px) {
  .nav__links {
    position: fixed; top: 74px; right: 0;
    height: calc(100vh - 74px); width: 74%; max-width: 320px;
    flex-direction: column; gap: 26px; margin: 0; padding: 44px 34px;
    background: var(--bg-2); border-left: 1px solid var(--border);
    transform: translateX(100%); transition: transform var(--transition);
  }
  .nav__links.open { transform: translateX(0); }
  .nav__links a { font-size: 1.15rem; }
  .nav__indicator { display: none; }
  .nav__burger { display: flex; }
  .nav__burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav__burger.open span:nth-child(2) { opacity: 0; }
  .nav__burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .skills { grid-template-columns: 1fr; }
  .hacks { grid-template-columns: 1fr; }
  .hack { padding: 22px; }
  .feature { grid-template-columns: 1fr; }
  .feature__media { min-height: 150px; }
  .exp__row { grid-template-columns: 1fr; gap: 6px; padding: 20px 18px; }
  .exp__total { text-align: left; }
  .hero__lead { font-size: 1.05rem; }

  /* Repo, message and time cannot share a row on a phone. Stack them, and let
     the commit message wrap instead of being truncated to a few words. */
  .gh__item { grid-template-columns: 1fr; gap: 5px; padding: 16px 18px; }
  .gh__msg { white-space: normal; }
}

/* ============================================================
   Reduced motion: honour the OS setting. Kill all motion (the
   custom cursor, tilt, magnetic pull, typing, counters, floats)
   but keep everything visible and usable.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; translate: none !important; scale: none !important; transform: none !important; animation: none !important; }
  .type-caret { animation: none !important; opacity: 1; }
  .glow-cursor-canvas { display: none !important; }
}
