/* ============================================================
   Aditya Patel — portfolio theme
   Design system adapted from the Funnelra reference:
   dark surface ladder, serif display, white-opacity text,
   pill radii, sparse saturated accents.
   ============================================================ */

:root {
  /* surfaces */
  --bg: #0b0b0b;
  --surface-1: #131313;
  --surface-2: #141414;
  --surface-3: #1b1b1b;
  --surface-4: #262626;
  --hairline: rgba(255, 255, 255, 0.1);
  --hairline-strong: rgba(255, 255, 255, 0.18);

  /* text ladder */
  --text-100: #ffffff;
  --text-70: rgba(255, 255, 255, 0.7);
  --text-50: rgba(255, 255, 255, 0.5);
  --text-40: rgba(255, 255, 255, 0.4);

  /* accents — green is primary, pink belongs to photography only */
  --green: #24d861;
  --green-dim: rgba(36, 216, 97, 0.15);
  --pink: #ff79fd;
  --pink-dim: rgba(255, 121, 253, 0.14);
  --blue: #58a6ff;
  --blue-70: rgba(88, 166, 255, 0.8);
  --blue-50: rgba(88, 166, 255, 0.6);

  /* type */
  --font-display: "Hedvig Letters Serif", Georgia, serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Space Mono", "Courier New", monospace;

  /* scale */
  --h1: clamp(48px, 8.5vw, 86px);
  --h2: clamp(37px, 6vw, 61px);
  --h3: clamp(24px, 3.2vw, 30px);
  --body: 19px;
  --small: 15px;
  --mono-label: 13px;

  --radius-card: 24px;
  --radius-pill: 999px;

  --container: 1140px;
  --section-pad: clamp(72px, 12vw, 140px);
}

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

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

a, button { touch-action: manipulation; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text-70);
  font-family: var(--font-body);
  font-size: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--text-100);
  margin: 0;
  line-height: 1.1;
}

p { margin: 0 0 16px; }

a { color: var(--text-100); text-decoration: none; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--green); color: #0b0b0b; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* positioned so section content paints above the hero's field canvas,
   which extends down behind About and the pullquote */
.section { padding: var(--section-pad) 0; position: relative; }

.section + .section { border-top: 1px solid var(--hairline); }

/* mono eyebrow — the utility voice of the page */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--mono-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
  display: block;
  margin-bottom: 20px;
}

.section-head { max-width: 720px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head h2 { font-size: var(--h2); margin-bottom: 16px; }
.section-head p { color: var(--text-50); max-width: 560px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s ease, background-color 0.25s ease,
              border-color 0.25s ease, color 0.25s ease;
}

.btn-primary { background: var(--green); color: #0b0b0b; }
.btn-primary:hover { background: #3ee477; transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  color: var(--text-100);
  border-color: var(--hairline-strong);
}
.btn-ghost:hover { border-color: var(--text-100); transform: translateY(-2px); }

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1100px, calc(100% - 28px));
  z-index: 50;
  border-radius: var(--radius-pill);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04) 45%, rgba(255, 255, 255, 0.09));
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: url(#nav-warp) blur(3px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-100);
  transition: transform 0.3s ease;
}

.nav.menu-open .nav-toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav.menu-open .nav-toggle span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* specular sweep across the island */
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(70% 90% at 18% -20%, rgba(255, 255, 255, 0.2), transparent 55%);
  pointer-events: none;
}

.nav-inner {
  position: relative;
  margin: 0 auto;
  padding: 12px 12px 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text-100);
}

.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }

.nav-links a {
  font-size: 15px;
  color: var(--text-70);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text-100); }

.nav .btn { padding: 10px 22px; font-size: 15px; }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  text-align: center;
  position: relative;
  /* overflow stays visible so the avatar can fly out to #about;
     the ambient glow is a background so it can't overflow layout */
  background: radial-gradient(560px 560px at 50% 18%, rgba(88, 166, 255, 0.07) 0%, transparent 70%);
  padding: 140px 0 80px;
}

/* interactive vector force field behind the hero copy */
.hero-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero .container { position: relative; z-index: 1; }

/* liquid glass ring around the portrait; the wrapper is what GSAP
   flies down to the About dock, the img bobs idly inside it */
.avatar-glass {
  position: relative;
  z-index: 40;
  display: inline-block;
  padding: 10px;
  border-radius: 50%;
  margin: 0 auto 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05) 45%, rgba(255, 255, 255, 0.1));
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  will-change: transform;
}

.avatar-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 60% at 25% -8%, rgba(255, 255, 255, 0.28), transparent 55%);
  pointer-events: none;
}

.hero-avatar {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  animation: bob 4.5s ease-in-out infinite alternate;
}

@keyframes bob {
  from { transform: translateY(3px); }
  to { transform: translateY(-6px); }
}

/* landing slot under "Hello there." — only exists when GSAP flies
   the avatar in */
.avatar-dock {
  display: none;
  width: 128px;
  height: 128px;
  margin-top: 32px;
}

@media (min-width: 769px) {
  html.gsap-on .avatar-dock { display: block; }
}

.hero-status {
  font-family: var(--font-mono);
  font-size: var(--mono-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  margin-bottom: 32px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--green-dim); }
  50% { box-shadow: 0 0 0 7px var(--green-dim); }
}

.hero h1 {
  font-size: var(--h1);
  max-width: 15ch;
  margin: 0 auto 24px;
}

.hero h1 em {
  font-style: italic;
  color: var(--green);
}

.hero-sub {
  color: var(--text-50);
  max-width: 520px;
  margin: 0 auto 40px;
  font-size: 20px;
}

.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* hero load sequence */
.hero-seq { opacity: 0; transform: translateY(24px); animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.hero-seq:nth-child(1) { animation-delay: 0.05s; }
.hero-seq:nth-child(2) { animation-delay: 0.15s; }
.hero-seq:nth-child(3) { animation-delay: 0.25s; }
.hero-seq:nth-child(4) { animation-delay: 0.38s; }
.hero-seq:nth-child(5) { animation-delay: 0.5s; }

@keyframes rise { to { opacity: 1; transform: translateY(0); } }

/* ---------- stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.stat {
  background: var(--surface-1);
  padding: 40px 28px;
  text-align: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(44px, 5.5vw, 70px);
  color: var(--text-100);
  line-height: 1;
  display: block;
  margin-bottom: 12px;
}

.stat-number sup { font-size: 0.5em; color: var(--green); }

.stat-label {
  font-family: var(--font-mono);
  font-size: var(--mono-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-50);
}

/* ---------- about + pull quote ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}

.about-copy p { color: var(--text-70); }
.about-copy .aside { color: var(--blue-50); font-size: var(--small); }

/* the signature: his motto set enormous */
.pullquote {
  padding: var(--section-pad) 0;
  border-top: 1px solid var(--hairline);
  text-align: center;
  position: relative;
}

.pullquote blockquote {
  margin: 0 auto;
  max-width: 20ch;
  font-family: var(--font-display);
  font-size: clamp(32px, 6vw, 64px);
  line-height: 1.18;
  color: var(--text-100);
}

.pullquote em { font-style: italic; color: var(--green); }

.pullquote figcaption {
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: var(--mono-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-50);
}

/* ---------- experience / education cards ---------- */
.timeline-cards { display: grid; gap: 16px; }

.xp-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 36px 40px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.35s ease, background-color 0.35s ease,
              box-shadow 0.35s ease;
}

.xp-card:hover {
  transform: translateY(-6px) scale(1.025);
  border-color: var(--hairline-strong);
  background: var(--surface-3);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.xp-meta {
  font-family: var(--font-mono);
  font-size: var(--mono-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-50);
  line-height: 1.9;
}

.xp-meta .where { color: var(--green); display: block; }

.xp-meta .where a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(36, 216, 97, 0.35);
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.xp-meta .where a:hover,
.xp-meta .where a:focus-visible {
  border-bottom-color: var(--green);
  opacity: 0.8;
  outline: none;
}

.xp-body h3 { font-size: var(--h3); margin-bottom: 10px; }
.xp-body p { color: var(--text-50); margin: 0; }

/* ---------- skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.skill-group {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 32px 36px;
}

.skill-group h3 { font-size: 22px; margin-bottom: 18px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-70);
  padding: 7px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  transition: border-color 0.2s ease, color 0.2s ease;
}

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

/* ---------- marquee ---------- */
.marquee {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
  padding: 26px 0;
  display: flex;
}

.marquee-track {
  display: flex;
  flex-shrink: 0;
  min-width: 100%;
  gap: 56px;
  padding-right: 56px;
  align-items: center;
  animation: marquee 36s linear infinite;
}

.marquee span {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text-40);
  white-space: nowrap;
}

.marquee i {
  font-style: normal;
  color: var(--green);
  font-size: 12px;
}

@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- projects: Aluro-style work slider ---------- */
.work-slider { position: relative; }

.work-viewport {
  overflow: hidden;
  border-radius: var(--radius-card);
}

.work-track {
  display: flex;
  transition: transform 1.5s cubic-bezier(0.85, 0, 0.15, 1);
}

.work-slide { min-width: 100%; }

.work-card {
  position: relative;
  display: block;
  height: clamp(320px, 42vw, 460px);
  border: 2px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.work-card:hover { border-color: var(--hairline-strong); }

.work-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
  backface-visibility: hidden;
  transform: scale(1.01);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.work-card:hover .work-card-img { transform: scale(1.05); }

.work-card-content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.48) 35%, transparent 55%);
}

.work-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.work-tag {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--blue);
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--hairline);
}

.work-card-text { max-width: 560px; text-align: left; }
.work-card-text h3 { font-size: var(--h3); margin-bottom: 8px; }
.work-card-text p { color: var(--text-70); font-size: 16px; margin: 0 0 12px; }

.work-cta {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
}

.work-cta.soon { color: var(--text-40); }

/* live app embedded as a card background — preview only,
   pointer-events off so the card itself stays clickable/swipeable */
.work-card-embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  background: #0d1420;
}

.work-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 24px;
}

.slider-arrow {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-100);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.slider-arrow:hover {
  background: var(--green-dim);
  border-color: var(--green);
  transform: translateY(-2px);
}

.slider-dots { display: flex; gap: 8px; }

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.25s ease;
}

.slider-dot.active { background: var(--green); transform: scale(1.25); }

/* ---------- photography (pink lives here only) ---------- */
.photo-section .eyebrow { color: var(--pink); }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* photo tiles: Aluro card anatomy inside the same liquid-glass
   frame as the nav island (gradient, warp backdrop, rim lights) */
.photo {
  position: relative;
  aspect-ratio: 4 / 3;
  padding: 10px;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  display: block;
  width: 100%;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04) 45%, rgba(255, 255, 255, 0.09));
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: url(#nav-warp) blur(3px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.3s ease;
}

.photo:hover { border-color: rgba(255, 255, 255, 0.28); }

/* specular sweep across the glass, same as the nav island */
.photo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(70% 90% at 18% -20%, rgba(255, 255, 255, 0.2), transparent 55%);
  pointer-events: none;
  z-index: 2;
}

.photo-img {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  border-radius: 12px;
  object-fit: cover;
  will-change: transform;
  backface-visibility: hidden;
  transform: scale(1.01);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.photo:hover .photo-img,
.photo:focus-visible .photo-img { transform: scale(1.06); }

.photo::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 12px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.32) 38%, transparent 60%);
}

.photo-tag {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--hairline);
}

.photo-label {
  position: absolute;
  left: 22px;
  bottom: 20px;
  z-index: 1;
  text-align: left;
}

.photo-label strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  color: var(--text-100);
}

.photo-more { margin-top: 40px; text-align: center; }
.photo-more .btn-ghost:hover { border-color: var(--pink); color: var(--pink); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(11, 11, 11, 0.7);
  backdrop-filter: blur(6px) saturate(130%);
  -webkit-backdrop-filter: blur(6px) saturate(130%);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.lightbox.open { display: flex; animation: fadein 0.25s ease; }

@keyframes fadein { from { opacity: 0; } }

/* liquid glass frame: translucent panel over the blurred page,
   gradient sheen, bright top edge, soft depth shadow */
.lightbox figure {
  position: relative;
  margin: 0;
  max-width: min(1000px, 92vw);
  text-align: center;
  padding: 20px 20px 22px;
  border-radius: 32px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05) 45%, rgba(255, 255, 255, 0.1));
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

.lightbox.open figure { animation: glass-in 0.45s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes glass-in {
  from { opacity: 0; transform: scale(0.94) translateY(14px); }
}

/* specular highlight sweeping the top of the glass */
.lightbox figure::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(90% 45% at 18% -6%, rgba(255, 255, 255, 0.38), transparent 55%),
    radial-gradient(70% 40% at 85% 106%, rgba(255, 255, 255, 0.14), transparent 60%);
  pointer-events: none;
}

/* faint dispersion: cool fringe catching one edge, warm the other */
.lightbox figure::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 0 22px rgba(255, 255, 255, 0.08),
    inset 2px 2px 8px -3px rgba(150, 195, 255, 0.4),
    inset -2px -2px 8px -3px rgba(255, 200, 150, 0.28);
  pointer-events: none;
}

.lb-clip {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  display: inline-block;
  max-width: 100%;
}

.lightbox img {
  max-height: 72vh;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  filter: url(#lg-lens);
}

.lightbox figcaption { position: relative; margin-top: 14px; }

.lightbox figcaption strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  color: var(--text-100);
  display: block;
}

.lightbox figcaption span {
  font-family: var(--font-mono);
  font-size: var(--mono-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-70);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  color: var(--text-100);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.lightbox-close:hover { border-color: var(--text-100); }

/* ---------- app window (embedded project demos) ---------- */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(11, 11, 11, 0.7);
  backdrop-filter: blur(6px) saturate(130%);
  -webkit-backdrop-filter: blur(6px) saturate(130%);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.app-modal.open { display: flex; animation: fadein 0.25s ease; }

/* same liquid-glass panel as the lightbox */
.app-window {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1600px, 96vw);
  height: min(1040px, 94vh);
  padding: 14px 14px 16px;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05) 45%, rgba(255, 255, 255, 0.1));
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

.app-modal.open .app-window { animation: glass-in 0.45s cubic-bezier(0.22, 1, 0.36, 1); }

.app-window::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(90% 45% at 18% -6%, rgba(255, 255, 255, 0.3), transparent 55%),
    radial-gradient(70% 40% at 85% 106%, rgba(255, 255, 255, 0.12), transparent 60%);
  pointer-events: none;
}

.app-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 6px 12px;
}

.app-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-100);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.app-newtab {
  font-family: var(--font-mono);
  font-size: var(--mono-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline);
  transition: border-color 0.2s ease;
}

.app-newtab:hover { border-color: var(--blue); }

.app-close {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  color: var(--text-100);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.app-close:hover { border-color: var(--text-100); }

.app-clip {
  position: relative;
  flex: 1;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.app-clip iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #0d1420;
}

/* ---------- contact ---------- */
.contact { text-align: center; }

.contact h2 {
  font-size: clamp(44px, 7.5vw, 78px);
  max-width: 14ch;
  margin: 0 auto 20px;
}

.contact h2 em { font-style: italic; color: var(--green); }

.contact p { color: var(--text-50); margin-bottom: 40px; }

.socials {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 36px;
  padding: 0;
  list-style: none;
}

.socials a {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-100);
  font-size: 18px;
  transition: background-color 0.25s ease, border-color 0.25s ease,
              color 0.25s ease, transform 0.25s ease;
}

.socials a:hover {
  background: var(--green-dim);
  border-color: var(--green);
  color: var(--green);
  transform: translateY(-3px);
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: var(--mono-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-50);
}

.footer a { color: var(--blue-70); }
.footer a:hover { color: var(--text-100); }

/* ---------- scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.in-view { opacity: 1; transform: none; }

/* stagger children of a revealed group */
.reveal-group > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-group.in-view > * { opacity: 1; transform: none; }
.reveal-group.in-view > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-group.in-view > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-group.in-view > *:nth-child(4) { transition-delay: 0.24s; }
.reveal-group.in-view > *:nth-child(5) { transition-delay: 0.32s; }
.reveal-group.in-view > *:nth-child(6) { transition-delay: 0.4s; }
.reveal-group.in-view > *:nth-child(7) { transition-delay: 0.48s; }
.reveal-group.in-view > *:nth-child(8) { transition-delay: 0.56s; }
.reveal-group.in-view > *:nth-child(9) { transition-delay: 0.64s; }

/* once revealed, xp-cards take their motion back from the reveal
   system — otherwise its transform:none and stagger delays override
   the hover pop and lag its response */
.reveal-group.in-view > .xp-card {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.35s ease, background-color 0.35s ease,
              box-shadow 0.35s ease;
  transition-delay: 0s;
}

.reveal-group.in-view > .xp-card:hover {
  transform: translateY(-6px) scale(1.025);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  /* photo-frame warp is too heavy for mobile GPUs (10 elements) —
     plain frost there; the nav island keeps its warp per user request */
  .photo {
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
  }

  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-inner { padding: 10px 10px 10px 22px; gap: 12px; }

  /* glass dropdown panel under the island */
  .nav.menu-open .nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    padding: 12px;
    border-radius: 24px;
    background: linear-gradient(160deg, rgba(30, 30, 30, 0.96), rgba(18, 18, 18, 0.96));
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  }

  .nav.menu-open .nav-links a {
    display: block;
    padding: 13px 16px;
    font-size: 17px;
    text-align: center;
    border-radius: 14px;
    color: var(--text-100);
  }

  .nav.menu-open .nav-links a:hover,
  .nav.menu-open .nav-links a:active { background: rgba(255, 255, 255, 0.07); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid .stat:last-child { grid-column: 1 / -1; }
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .xp-card { grid-template-columns: 1fr; gap: 12px; padding: 28px; }
}

@media (max-width: 540px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .photo-grid { grid-template-columns: 1fr; }
  .stat { padding: 28px 16px; }

  .nav { top: 10px; width: calc(100% - 20px); }
  .nav .btn { padding: 9px 16px; font-size: 14px; }
  .nav-logo { font-size: 19px; }

  .hero { padding: 120px 0 64px; }
  .hero-status {
    font-size: 11px;
    letter-spacing: 0.1em;
    white-space: normal;
    line-height: 1.7;
    max-width: 90%;
  }

  .work-card { height: 440px; }
  .work-card-text h3 { font-size: 23px; }
  .work-controls { gap: 14px; }

  .marquee span { font-size: 20px; }
  .marquee-track { gap: 40px; padding-right: 40px; }

  .lightbox { padding: 14px; }
  .app-modal { padding: 10px; }
  .app-window { width: 100%; height: 90vh; padding: 10px 10px 12px; border-radius: 20px; }
  .app-title { font-size: 17px; }
  .app-newtab { padding: 7px 11px; }
  .lightbox figure { padding: 12px 12px 16px; border-radius: 24px; }
  .lightbox img { max-height: 66vh; }
  .lightbox-close { top: 14px; right: 14px; }

  .xp-card { padding: 24px 22px; }
  .skill-group { padding: 26px 24px; }
}

/* ---------- GSAP / Lenis handoff ----------
   When the animation libraries load, .gsap-on is set on <html>:
   CSS-driven entrances step aside so GSAP owns them, and native
   smooth scrolling is disabled in favor of Lenis. */
html.lenis-active { scroll-behavior: auto; }

html.gsap-on .hero-seq { animation: none; opacity: 1; transform: none; }

html.gsap-on .blur-reveal { opacity: 0; filter: blur(12px); will-change: opacity, filter; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-seq { animation: none; opacity: 1; transform: none; }
  .status-dot { animation: none; }
  .marquee-track { animation: none; }
  .reveal, .reveal-group > * { opacity: 1; transform: none; transition: none; }
  .lightbox.open, .lightbox.open figure { animation: none; }
  .app-modal.open, .app-modal.open .app-window { animation: none; }
  .hero-avatar { animation: none; }
  .btn, .xp-card, .work-card, .work-card-img, .photo, .photo-img, .socials a { transition: none; }
  .work-track { transition: none; }
}
