:root{
  --bg: #000;
  --bg-soft: #08080b;
  --bg-card: #0e0e12;
  --ink: #f5f5f7;
  --ink-dim: #a1a1a6;
  --ink-fade: #8a8a90; /* Bumped from #6e6e73 to pass WCAG AA (>=4.5:1) on black */
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.16);

  --violet: #8B5CF6;
  --violet-bright: #A78BFA;
  --violet-deep: #6D28D9;
  --violet-glow: rgba(139,92,246,0.35);

  --display: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'Geist Mono', 'SF Mono', Menlo, monospace;

  --ease-apple: cubic-bezier(0.42, 0, 0.58, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Tokens */
  --nav-h: 64px;
  --content-max: 1100px;
  --content-pad: 22px;

  /* Button height token (consistent across the site) */
  --btn-h: 44px;
  --btn-h-sm: 40px;   /* navbar CTA, hamburger */
  --btn-h-xs: 30px;   /* email pill internal icons */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: var(--nav-h);
  overflow-x: clip; /* prevent any horizontal scroll from carousel transitions */
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  overflow-x: clip;
  cursor: none;
}
@media (max-width: 900px), (hover: none){ body { cursor: auto; } }

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img, svg, canvas, video { display: block; max-width: 100%; }
::selection { background: var(--violet); color: #fff; }

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}

/* CURSOR */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 10000;
  transform: translate(-50%, -50%); will-change: transform;
}
.cursor-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--violet-bright); mix-blend-mode: screen; }
.cursor-ring {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(167,139,250,0.6);
  transition: width .25s var(--ease-out), height .25s var(--ease-out), border-color .25s, background-color .25s;
}
.cursor-ring.hover { width: 64px; height: 64px; background: rgba(139,92,246,0.12); border-color: rgba(167,139,250,0.9); }
@media (max-width: 900px), (hover: none){ .cursor-dot, .cursor-ring { display: none; } }

@media (max-width: 900px) {
  #desktopPhone {
    display: none;
  }
}
/* ========================================================================
   NAVBAR — same content max-width as the rest of the site
======================================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  height: var(--nav-h);
  /* Solid-ish fallback first (so it stays visible on iOS Safari quirks),
     then upgrade to glass if backdrop-filter is supported. */
  background: rgba(0,0,0,0.92);
  border-bottom: 1px solid var(--line);
  /* Force its own compositing layer so iOS Safari doesn't drop it during scroll */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
}
@supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  .nav {
    background: rgba(0,0,0,0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
  }
}
.nav__inner {
  width: 100%;
  max-width: var(--content-max);
  padding: 0 var(--content-pad);
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
}

/* Logo: FedericoDeLuca.Dev */
.nav__brand {
  display: inline-flex; align-items: center;
  font-weight: 700; letter-spacing: -0.02em;
  font-size: 17px;
  white-space: nowrap;
  transition: opacity .2s;
}
.nav__brand:hover { opacity: 0.85; }
.nav__brand-name { color: var(--ink); }
.nav__brand-dot { color: var(--violet-bright); margin: 0 1px; }
.nav__brand-tld { color: var(--violet-bright); }

.nav__links { display: flex; gap: 30px; list-style: none; position: relative; }
.nav__links a {
  position: relative;
  color: var(--ink); opacity: 0.78;
  transition: color .25s var(--ease-out), opacity .25s;
  font-weight: 500;
  font-size: 14px;
  padding: 4px 0;
}
.nav__links a:hover { opacity: 1; }
.nav__links a.is-active { color: var(--violet-bright); opacity: 1; }
.nav__links a.is-active::after {
  content: '';
  position: absolute;
  bottom: -5px; left: 50%;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--violet-bright);
  box-shadow: 0 0 8px var(--violet-bright);
  transform: translateX(-50%);
  animation: navDot .5s var(--ease-spring);
}
@keyframes navDot { 0%{transform: translateX(-50%) scale(0);} 60%{transform: translateX(-50%) scale(1.4);} 100%{transform: translateX(-50%) scale(1);} }

@media (max-width: 760px){ .nav__links { display: none; } }

/* Navbar CTA — height 40 */
.nav__cta {
  height: var(--btn-h-sm);
  padding: 0 18px;
  border-radius: 980px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: #000;
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
  transition: background .25s, color .25s, box-shadow .3s, transform .25s var(--ease-spring);
}
.nav__cta:hover { background: var(--violet-bright); }
.nav__cta.is-active {
  background: var(--violet);
  color: #fff;
  box-shadow: 0 0 20px var(--violet-glow);
}

/* Hamburger 40x40, single icon swap (no breaking transform) */
.nav__hamburger {
  display: none;
  width: var(--btn-h-sm); height: var(--btn-h-sm);
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line-strong);
  align-items: center; justify-content: center;
  transition: background .2s;
  position: relative;
  flex-shrink: 0;
}
.nav__hamburger:hover { background: rgba(255,255,255,0.1); }
.nav__hamburger svg {
  width: 18px; height: 18px;
  position: absolute;
  transition: opacity .2s, transform .25s var(--ease-spring);
}
.nav__hamburger .icon-close {
  opacity: 0; transform: rotate(-90deg) scale(0.8);
}
.nav__hamburger.open .icon-menu {
  opacity: 0; transform: rotate(90deg) scale(0.8);
}
.nav__hamburger.open .icon-close {
  opacity: 1; transform: rotate(0) scale(1);
}

@media (max-width: 760px){
  .nav__hamburger { display: inline-flex; }
  .nav__cta { display: none; }
}

/* Mobile menu overlay */
.mobile-menu {
  position: fixed; inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.96);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex; flex-direction: column;
  padding: calc(var(--nav-h) + 28px) var(--content-pad) 32px;
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease-out);
}
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.mobile-menu a.menu-item {
  display: flex; align-items: center;
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  opacity: 0; transform: translateY(16px);
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out);
}
.mobile-menu.open a.menu-item { opacity: 1; transform: translateY(0); }
.mobile-menu.open li:nth-child(1) a { transition-delay: 80ms; }
.mobile-menu.open li:nth-child(2) a { transition-delay: 140ms; }
.mobile-menu.open li:nth-child(3) a { transition-delay: 200ms; }
.mobile-menu a .num {
  font-family: var(--mono); font-size: 11px; color: var(--violet-bright);
  margin-right: 14px; font-weight: 400;
  letter-spacing: 0.1em;
  align-self: center;
}
.mobile-menu a.is-active { color: var(--violet-bright); }
.mobile-menu a.is-active::after {
  content: ''; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--violet-bright); margin-left: 12px;
  box-shadow: 0 0 10px var(--violet-bright);
}
.mobile-menu__cta {
  margin-top: 28px;
  height: var(--btn-h);
  padding: 0 22px;
  border-radius: 980px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--violet); color: #fff;
  font-weight: 600; font-size: 14px;
  align-self: flex-start;
  transition: background .25s;
  opacity: 0; transform: translateY(16px);
  transition: opacity .5s var(--ease-out) .26s, transform .5s var(--ease-out) .26s, background .25s;
}
.mobile-menu.open .mobile-menu__cta { opacity: 1; transform: translateY(0); }

body.menu-open { overflow: hidden; }

/* ========================================================================
   BUTTON SYSTEM — consistent heights everywhere
======================================================================== */
.btn {
  height: var(--btn-h);
  padding: 0 22px;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  border-radius: 980px;
  font-size: 14px; font-weight: 600; letter-spacing: -0.005em;
  transition: transform .25s var(--ease-spring), background .25s, color .25s, border-color .25s, box-shadow .3s;
  border: 1px solid transparent;
  white-space: nowrap;
  will-change: transform;
}
.btn--primary { background: var(--violet); color: #fff; box-shadow: 0 0 0 0 var(--violet-glow); }
.btn--primary:hover { background: var(--violet-bright); box-shadow: 0 8px 32px var(--violet-glow); }
.btn--ghost { background: rgba(255,255,255,0.06); color: var(--ink); border-color: var(--line-strong); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.btn--ghost:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); }

.social-icon-btn {
  width: var(--btn-h); height: var(--btn-h); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  transition: background .2s, border-color .2s, transform .25s var(--ease-spring), color .2s;
  position: relative;
  flex-shrink: 0;
}
.social-icon-btn:hover { background: rgba(139,92,246,0.15); border-color: var(--violet); color: var(--violet-bright); }
.social-icon-btn svg { width: 18px; height: 18px; }

/* Email pill — height matches btn-h */
.email-pill {
  display: inline-flex; align-items: center;
  height: var(--btn-h);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-strong);
  border-radius: 980px;
  padding: 0 6px 0 18px;
  gap: 10px;
  transition: background .25s, border-color .25s;
  position: relative;
}
.email-pill:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.3); }
.email-pill__email {
  font-size: 13px; color: var(--ink); letter-spacing: -0.005em;
  white-space: nowrap;
}
.email-pill__sep {
  width: 1px; height: 18px; background: var(--line-strong);
  flex-shrink: 0;
}
.email-pill__btn {
  width: var(--btn-h-xs); height: var(--btn-h-xs);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-dim);
  transition: background .2s, color .2s, transform .2s var(--ease-spring);
  flex-shrink: 0;
}
.email-pill__btn:hover { background: rgba(139,92,246,0.18); color: var(--violet-bright); }
.email-pill__btn svg { width: 14px; height: 14px; }

@media (max-width: 480px) {
  .email-pill__email { font-size: 11.5px; }
  .email-pill { padding-left: 14px; }
}

/* Copy email feedback toast */
.copy-feedback {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--violet);
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s var(--ease-spring);
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.copy-feedback::after {
  content: ''; position: absolute;
  top: 100%; left: 50%; transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--violet);
}
.copy-feedback.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ========================================================================
   HERO
======================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  padding: calc(var(--nav-h) + 40px) var(--content-pad) 60px;
  isolation: isolate;
  overflow: hidden;
}
.hero__bg {
  position: absolute; inset: -10%; z-index: -1;
  background:
    radial-gradient(60vmax 60vmax at var(--mx,50%) var(--my,30%), rgba(139,92,246,0.30) 0%, rgba(139,92,246,0.10) 28%, transparent 60%),
    radial-gradient(80vmax 80vmax at calc(var(--mx,50%) - 30%) calc(var(--my,30%) + 40%), rgba(109,40,217,0.22) 0%, transparent 55%),
    radial-gradient(40vmax 40vmax at calc(var(--mx,50%) + 35%) calc(var(--my,30%) - 20%), rgba(167,139,250,0.16) 0%, transparent 55%);
  filter: blur(40px) saturate(130%);
  opacity: 0.85;
}
@media (max-width: 760px){ .hero__bg { filter: blur(30px) saturate(120%); opacity: 0.7; } }

.hero__grain {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.hero__inner {
  width: 100%; max-width: var(--content-max);
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items: center;
}

/* MOBILE HERO: photo first, then copy */
@media (max-width: 900px){
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
  .hero__copy { order: 2; }
  .hero__photo-wrap { order: 1; }
}

.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--violet-bright);
  padding: 6px 10px; border-radius: 980px;
  border: 1px solid rgba(139,92,246,0.35);
  background: rgba(139,92,246,0.08);
}
.hero__eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--violet-bright); box-shadow: 0 0 10px var(--violet-bright); animation: pulse 1.8s var(--ease-apple) infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1);} 50%{opacity:.5;transform:scale(0.8);} }

.hero__title {
  margin-top: 20px;
  font-weight: 800;
  font-size: clamp(38px, 6.4vw, 92px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}
.hero__title .it { font-family: var(--display); font-style: italic; font-weight: 400; letter-spacing: -0.02em; color: var(--violet-bright); }
.hero__title .grad {
  background: linear-gradient(180deg, #fff 0%, #fff 50%, #b8b8c0 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__title .line { display: block; }

.hero__sub { margin-top: 22px; max-width: 50ch; color: var(--ink-dim); font-size: clamp(15px, 1.05vw, 17px); line-height: 1.6; }
@media (max-width: 900px){ .hero__sub { margin-left: auto; margin-right: auto; } }

/* CTAs */
.hero__ctas {
  margin-top: 28px;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
@media (max-width: 900px){ .hero__ctas { justify-content: center; } }

.hero__divider {
  width: 1px; height: 24px; background: var(--line-strong);
  margin: 0 4px;
}
@media (max-width: 900px){ .hero__divider { display: none; } }

/* Hero photo */
.hero__photo-wrap {
  position: relative;
  width: 100%; max-width: 460px;
  aspect-ratio: 1/1;
  margin-left: auto;
  border-radius: 32px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--violet-deep), var(--violet));
  box-shadow:
    0 0 0 1px rgba(139,92,246,0.25),
    0 30px 80px rgba(139,92,246,0.18),
    0 50px 120px rgba(0,0,0,0.5);
}
@media (max-width: 900px){
  .hero__photo-wrap { max-width: 280px; margin: 0 auto; }
}
.hero__photo {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(80%) contrast(1.05);
  transition: filter .6s, transform .8s var(--ease-out);
}
.hero__photo-wrap:hover .hero__photo { filter: grayscale(0%); transform: scale(1.03); }
.hero__photo-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--display); font-style: italic;
  font-size: clamp(120px, 15vw, 220px);
  color: rgba(255,255,255,0.85);
}
.hero__photo-frame { position: absolute; inset: 0; border: 1px solid rgba(255,255,255,0.12); border-radius: 32px; pointer-events: none; }

.hero__photo-tag {
  position: absolute;
  bottom: 18px; left: 18px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 980px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  color: #fff;
}
.hero__photo-tag::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 8px #4ade80;
}

.hero__scroll {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--ink-fade); opacity: 0.7;
}
.hero__scroll::after {
  content: ''; width: 1px; height: 32px;
  background: linear-gradient(to bottom, var(--ink-fade), transparent);
  animation: scrollHint 2.4s var(--ease-apple) infinite;
}
@keyframes scrollHint { 0%{transform:scaleY(0);transform-origin:top;} 50%{transform:scaleY(1);transform-origin:top;} 51%{transform-origin:bottom;} 100%{transform:scaleY(0);transform-origin:bottom;} }
@media (max-width: 900px){ .hero__scroll { display: none; } }

/* ========================================================================
   SECTIONS — alternated bg, max-width matches navbar
======================================================================== */
.section {
  padding: 90px var(--content-pad);
  position: relative;
}
@media (max-width: 760px){ .section { padding: 64px var(--content-pad); } }
.section--alt { background: var(--bg-soft); }
.section__inner { width: 100%; max-width: var(--content-max); margin: 0 auto; }

.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--violet-bright); display: inline-block; margin-bottom: 14px;
}
.section__title {
  font-weight: 700;
  font-size: clamp(34px, 5.5vw, 76px);
  line-height: 1.02; letter-spacing: -0.035em;
  max-width: 14ch;
}
.section__title .it { font-family: var(--display); font-style: italic; font-weight: 400; color: var(--violet-bright); }
.section__title .dim { color: var(--ink-fade); }

/* ========================================================================
   HIGHLIGHTS
======================================================================== */
.highlights__bio {
  margin-top: 24px;
  max-width: 60ch;
  color: var(--ink-dim);
  font-size: 16px; line-height: 1.65;
}

.highlights__cards {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 900px){ .highlights__cards { grid-template-columns: repeat(2, 1fr); } }

.stat {
  position: relative; padding: 28px 24px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden;
  transition: transform .4s var(--ease-out), border-color .4s;
}
.stat::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(400px circle at var(--cx,50%) var(--cy,50%), rgba(139,92,246,0.12), transparent 40%);
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.stat:hover::before { opacity: 1; }
.stat:hover { border-color: rgba(139,92,246,0.4); transform: translateY(-2px); }
.stat__num {
  font-weight: 700;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1; letter-spacing: -0.04em;
  background: linear-gradient(180deg, #fff, var(--violet-bright));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat__plus { font-family: var(--display); font-style: italic; color: var(--violet-bright); -webkit-text-fill-color: var(--violet-bright); }
.stat__label { margin-top: 8px; font-size: 13px; color: var(--ink-dim); line-height: 1.4; }
.stat__sub { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 10px; color: var(--ink-fade); letter-spacing: 0.1em; text-transform: uppercase; }

/* Skills groups: 3 cols desktop / 2 cols mobile (3rd full width) */
.skills {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 900px){
  .skills { grid-template-columns: repeat(2, 1fr); }
  .skills > :nth-child(3) { grid-column: span 2; }
}
@media (max-width: 480px){
  .skills { grid-template-columns: 1fr; }
  .skills > :nth-child(3) { grid-column: span 1; }
}
.skill-group {
  position: relative;
  padding: 24px 22px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  transition: transform .4s var(--ease-out), border-color .4s;
}
.skill-group::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(400px circle at var(--cx,50%) var(--cy,50%), rgba(139,92,246,0.12), transparent 40%);
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.skill-group:hover::before { opacity: 1; }
.skill-group:hover { border-color: rgba(139,92,246,0.4); transform: translateY(-2px); }
.skill-group__title {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--violet-bright);
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.skill-group__title svg { width: 14px; height: 14px; opacity: 0.85; }
.skill-group__list { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-chip {
  font-family: var(--mono); font-size: 11px;
  padding: 7px 11px; border-radius: 8px;
  background: rgba(139,92,246,0.08);
  border: 1px solid rgba(139,92,246,0.25);
  color: var(--violet-bright);
  transition: transform .2s var(--ease-spring), background .2s, border-color .2s;
}
.skill-chip:hover {
  transform: translateY(-2px) scale(1.04);
  background: rgba(139,92,246,0.20);
  border-color: rgba(167,139,250,0.6);
}

/* ========================================================================
   PROJECTS
   Desktop: scroll-jacked sticky, title travels with first slide
   Mobile: card carousel — title+desc → phone → controls → tags+CTA
======================================================================== */
.projects { position: relative; padding: 90px 0 60px; }
@media (max-width: 760px){ .projects { padding: 64px 0 40px; } }

/* Desktop sticky pin contains both intro and slides */
.projects__sticky { position: relative; height: 360vh; }
.projects__pin {
  position: -webkit-sticky;
  position: sticky; top: 0;
  height: 100vh;
  height: 100svh; /* iOS Safari: avoid URL-bar caused jumps */
  display: grid; grid-template-columns: 1fr 1fr;
  align-items: center; gap: 40px;
  padding: calc(var(--nav-h) + 30px) var(--content-pad) 40px;
  max-width: 1280px; margin: 0 auto;
}

.projects__copy { position: relative; min-height: 460px; }

/* Intro that lives inside copy column on desktop, above the slides */
.projects__intro {
  margin-bottom: 36px;
  max-width: 600px;
}
.projects__intro .eyebrow { margin-bottom: 12px; }
.projects__intro .section__title { font-size: clamp(34px, 4.4vw, 60px); max-width: 14ch; }

/* Slides container holds all proj-slide as absolute */
.projects__slides {
  position: relative;
  min-height: 320px;
}

.proj-slide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(16px);
  transition: opacity .55s var(--ease-apple), transform .55s var(--ease-apple);
  pointer-events: none;
}
.proj-slide.is-active { opacity: 1; transform: translateY(0); pointer-events: auto; }

.proj-slide__num { font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; color: var(--violet-bright); margin-bottom: 12px; }
.proj-slide__title { font-weight: 700; font-size: clamp(30px, 3.8vw, 52px); line-height: 1; letter-spacing: -0.04em; margin-bottom: 14px; }
.proj-slide__title .it { font-family: var(--display); font-style: italic; font-weight: 400; color: var(--violet-bright); }
.proj-slide__desc { color: var(--ink-dim); font-size: 15px; line-height: 1.55; max-width: 44ch; margin-bottom: 18px; }
.proj-slide__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.tag { font-family: var(--mono); font-size: 11px; padding: 6px 12px; border-radius: 980px; border: 1px solid var(--line-strong); color: var(--ink-dim); background: rgba(255,255,255,0.02); }
.proj-slide__cta {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--violet-bright);
  padding: 8px 0; position: relative; align-self: flex-start;
}
.proj-slide__cta::after {
  content: ''; position: absolute; bottom: 0; left: 0; width: 100%;
  height: 1px; background: var(--violet-bright);
  transform: scaleX(0.3); transform-origin: left;
  transition: transform .3s var(--ease-out);
}
.proj-slide__cta:hover::after { transform: scaleX(1); }
.proj-slide__cta svg { transition: transform .3s var(--ease-out); }
.proj-slide__cta:hover svg { transform: translate(2px,-2px); }

/* Phone (right column desktop) */
.projects__phone-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  position: relative;
}

.phone {
  width: 280px; aspect-ratio: 9 / 19.5;
  border-radius: 44px; border: 9px solid #1a1a1c;
  background: #000; position: relative;
  box-shadow: 0 0 0 1.5px #2a2a2c, 0 0 80px rgba(139,92,246,0.18), 0 30px 80px rgba(0,0,0,0.55);
  overflow: hidden;
  transform: rotate(-1deg);
  transition: transform .8s var(--ease-out);
}
.phone:hover { transform: rotate(0) scale(1.02); }
.phone__notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 88px; height: 24px; background: #000; border-radius: 14px; z-index: 10; }
.phone__screen { position: absolute; inset: 0; border-radius: 35px; overflow: hidden; background: #000; }
.phone__app { position: absolute; inset: 0; opacity: 0; transition: opacity .4s var(--ease-apple); }
.phone__app.is-active { opacity: 1; }
.phone__app video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  background: #000;
}

.viewer-caption {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em;
  color: var(--ink-fade); text-transform: uppercase; text-align: center;
}

/* Side dot navigation (desktop) */
.projects__nav {
  position: fixed; right: 20px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 12px; z-index: 50;
  opacity: 0; pointer-events: none; transition: opacity .4s;
}
.projects__nav.visible { opacity: 1; pointer-events: auto; }
.projects__nav button {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: background .3s, transform .3s;
}
.projects__nav button.active { background: var(--violet-bright); transform: scale(1.4); }

/* ========================================================================
   MOBILE PROJECTS — order: phone (with side arrows) → title → desc → tags
======================================================================== */
@media (max-width: 900px){
  .projects__sticky { height: auto; }
  .projects__pin {
    position: relative; grid-template-columns: 1fr; height: auto;
    padding: 0 var(--content-pad); gap: 0;
  }
  .projects__intro {
    margin-bottom: 28px;
    max-width: none;
  }
  .projects__copy { display: contents; }
  .projects__slides {
    grid-column: 1; min-height: 0;
    position: relative;
    width: 100%;
    overflow: hidden;
    /* Height set by JS to match the active slide so the page doesn't reflow.
       Animate the height change so it feels intentional, not janky. */
    transition: height .45s var(--ease-out);
  }
  /* All slides are absolutely positioned on mobile — no position swap during
     transitions, so the cross-fade stays smooth. JS sets the container height. */
  .proj-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    /* Default state: invisible, slid to the right (used by .is-after) */
    opacity: 0;
    transform: translate3d(40px, 0, 0);
    pointer-events: none;
    transition:
      opacity .5s var(--ease-out),
      transform .5s var(--ease-out);
    will-change: opacity, transform;
  }
  /* Slides BEFORE the active one slide off to the LEFT — gives a sense of direction */
  .proj-slide.is-before {
    transform: translate3d(-40px, 0, 0);
  }
  /* The active slide is centered, fully visible, interactive */
  .proj-slide.is-active {
    position: relative; /* gives the container something to measure if JS height fails */
    opacity: 1;
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
    z-index: 2;
  }

  /* Mobile slide card — content centered, vertical stack */
  .proj-slide__inner {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 24px 20px 22px;
    display: flex; flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .proj-slide__num {
    text-align: center;
    margin-bottom: 16px;
  }

  /* Phone row: arrows on the sides, phone centered (≈65% of card width) */
  .proj-phone-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
  }
  .proj-phone-row__arrow {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--line-strong);
    color: var(--ink);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .2s, border-color .2s, opacity .2s, transform .2s var(--ease-spring);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
  }
  .proj-phone-row__arrow:active { background: rgba(139,92,246,0.20); border-color: var(--violet); transform: scale(0.94); }
  .proj-phone-row__arrow:disabled { opacity: 0.28; pointer-events: none; }
  .proj-phone-row__arrow svg { width: 18px; height: 18px; }

  .proj-phone-row__slot {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0; /* allow flex item to shrink */
  }
  /* Phone sized at ~65% of slide-card width (capped) */
  .projects__phone-wrap.proj-slide__phone-mobile {
    width: 65%;
    max-width: 230px;
    min-width: 160px;
    margin: 0 auto;
    gap: 0;
  }
  .projects__phone-wrap.proj-slide__phone-mobile .phone {
    width: 100%;
    transform: none;
  }
  .projects__phone-wrap.proj-slide__phone-mobile .phone:hover { transform: none; }

  /* Dots: small row centered below the phone row */
  .proj-controls-mobile__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 22px;
  }
  .proj-controls-mobile__dots button {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: background .3s, transform .3s, width .3s;
    -webkit-tap-highlight-color: transparent;
  }
  .proj-controls-mobile__dots button.active {
    background: var(--violet-bright);
    width: 22px; border-radius: 4px;
  }

  /* Title / desc / tags / CTA (desktop and mobile share these now) */
  .proj-slide__title,
  .proj-slide__desc { text-align: center; }
  .proj-slide__desc {
    max-width: 38ch;
    margin-left: auto; margin-right: auto;
    margin-bottom: 18px;
  }

  /* Tags as a centered, wrapping grid */
  .proj-slide__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 0 auto 18px;
    max-width: 100%;
  }

  /* Single CTA — center and tap-friendly */
  .proj-slide__cta {
    align-self: center;
  }

  /* Hide desktop-only elements on mobile */
  .projects__nav { display: none !important; }
  #desktopPhone { display: none !important; }
}

@media (min-width: 901px){
  /* Hide mobile-only controls on desktop */
  .proj-phone-row { display: none; }
  .proj-controls-mobile__dots { display: none; }
  .proj-slide__phone-mobile { display: none; }

  /* Desktop slide: contents are laid out by the parent grid */
  .proj-slide__inner { display: contents; }
}

/* ========================================================================
   EXPERIENCE
======================================================================== */
.exp {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
}
.exp__row { display: contents; }
.exp__year, .exp__body {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.exp__year {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em;
  color: var(--ink-fade); padding-right: 24px;
}
.exp__company {
  font-weight: 600; font-size: clamp(22px, 2.5vw, 32px);
  letter-spacing: -0.02em; margin-bottom: 4px;
}
.exp__role { color: var(--violet-bright); font-size: 14px; margin-bottom: 12px; font-family: var(--mono); }
.exp__desc { color: var(--ink-dim); font-size: 15px; line-height: 1.6; max-width: 60ch; }

@media (max-width: 720px){
  .exp { display: flex; flex-direction: column; gap: 14px; border-top: none; margin-top: 28px; }
  .exp__row { display: block; padding: 22px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px; }
  .exp__year, .exp__body { padding: 0; border-bottom: none; }
  .exp__year { margin-bottom: 12px; }
}

/* ========================================================================
   CONTACT
======================================================================== */
.contact { text-align: center; padding: 110px var(--content-pad) 80px; position: relative; overflow: hidden; }
@media (max-width: 760px){ .contact { padding: 72px var(--content-pad) 56px; } }
.contact::before { content: ''; position: absolute; inset: 0; background: radial-gradient(60vmax 60vmax at 50% 50%, rgba(139,92,246,0.18), transparent 60%); pointer-events: none; }
.contact__inner { position: relative; z-index: 1; }
.contact h2 { font-weight: 700; font-size: clamp(44px, 8vw, 120px); line-height: 0.95; letter-spacing: -0.045em; margin-bottom: 22px; }
.contact h2 .it { font-family: var(--display); font-style: italic; font-weight: 400; color: var(--violet-bright); }
.contact p { color: var(--ink-dim); font-size: 17px; max-width: 50ch; margin: 0 auto 30px; }
.contact__email-wrap { display: flex; justify-content: center; margin-bottom: 26px; flex-wrap: wrap; gap: 12px; }
.contact__actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.contact__socials { margin-top: 32px; display: flex; justify-content: center; gap: 8px; }

footer { border-top: 1px solid var(--line); padding: 28px var(--content-pad); text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--ink-fade); }

/* ========================================================================
   REVEAL ANIMATIONS — medium level
   fade + translate-Y + subtle scale, smooth bezier
======================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.985);
  transition:
    opacity .7s var(--ease-out),
    transform .7s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Stagger groups — applied to children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px) scale(0.985);
  transition:
    opacity .65s var(--ease-out),
    transform .65s var(--ease-out);
}
.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 90ms; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 180ms; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 270ms; }
.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Hero entrance — happens once on load */
.hero-enter > * {
  opacity: 0;
  transform: translateY(20px);
  animation: heroIn .9s var(--ease-out) forwards;
}
.hero-enter > *:nth-child(1) { animation-delay: 0.05s; }
.hero-enter > *:nth-child(2) { animation-delay: 0.18s; }
.hero-enter > *:nth-child(3) { animation-delay: 0.32s; }
.hero-enter > *:nth-child(4) { animation-delay: 0.46s; }
.hero-enter > *:nth-child(5) { animation-delay: 0.58s; }
@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}
.hero__photo-wrap.hero-enter-photo {
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  animation: heroPhotoIn 1s var(--ease-out) 0.25s forwards;
}
@keyframes heroPhotoIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .reveal, .reveal-stagger > *, .hero-enter > *, .hero__photo-wrap.hero-enter-photo {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}
