/* ==========================================================================
   Orpheuzkaze portfolio, 2026 redesign
   Dark editorial · Web3 + AI
   ========================================================================== */

:root {
  --bg: #08080a;
  --bg-2: #0e0e12;
  --surface: #121217;
  --surface-2: #17171d;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f2f1ec;
  --muted: #9a9aa3;
  --dim: #8a8a94;
  --accent: #d6ff3d;          /* acid lime */
  --accent-ink: #0b0b0b;
  --ai: #9b7bff;              /* AI violet */
  --ai-2: #4fd1ff;

  --font-sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --wrap: 1240px;
  --pad: clamp(20px, 4vw, 40px);
  --radius: 18px;
  --radius-lg: 28px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 10px;
  font-weight: 600;
}
.skip-link:focus { top: 16px; }

/* ---------- Background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  opacity: 0.5;
}
.bg__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  animation: drift 22s ease-in-out infinite alternate;
}
.bg__glow--a { width: 520px; height: 520px; top: -160px; right: -120px; background: var(--ai); }
.bg__glow--b { width: 420px; height: 420px; top: 40vh; left: -200px; background: #2a5cff; opacity: 0.18; animation-delay: -8s; }
.bg__noise {
  position: absolute;
  inset: -50%;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift {
  to { transform: translate3d(-60px, 80px, 0) scale(1.1); }
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  z-index: 120;
  background: linear-gradient(90deg, var(--accent), var(--ai));
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.header.is-scrolled {
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.08em; font-size: 0.9rem; }
.logo__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative;
  padding: 8px 14px;
  font-size: 0.875rem;
  color: var(--muted);
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover,
.nav a.is-active { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav .nav__cta {
  margin-left: 8px;
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 600;
}
.nav .nav__cta:hover { color: var(--accent-ink); background: #e6ff7a; }

.burger { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); position: relative; }
.burger span {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}
.burger span:first-child { top: 17px; }
.burger span:last-child { top: 25px; }
.burger[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s, color 0.25s;
}
.btn svg { width: 18px; height: 18px; transition: transform 0.25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #e6ff7a; transform: translateY(-2px); }
.btn--ghost { border: 1px solid var(--line-2); color: var(--text); }
.btn--ghost:hover { border-color: var(--text); transform: translateY(-2px); }
.btn--light { background: var(--text); color: var(--bg); }
.btn--light:hover { background: #fff; }
.btn--sm { height: 40px; padding: 0 18px; font-size: 0.875rem; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 4px;
  transition: border-color 0.2s, color 0.2s;
}
.link-arrow svg { width: 16px; height: 16px; transition: transform 0.25s var(--ease); }
.link-arrow:hover { color: var(--accent); border-color: var(--accent); }
.link-arrow:hover svg { transform: translate(2px, -2px); }

/* ---------- Sections ---------- */
.section { position: relative; padding: clamp(88px, 12vw, 160px) 0; }
.section--tint { background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.018) 15%, rgba(255, 255, 255, 0.018) 85%, transparent); }

.section__head { position: relative; max-width: 860px; margin-bottom: clamp(48px, 6vw, 80px); }
.section__head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; max-width: none; }
.section__index {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--dim);
  margin-bottom: 18px;
}
.section__index::after {
  content: "";
  display: inline-block;
  width: 48px;
  height: 1px;
  margin-left: 12px;
  vertical-align: middle;
  background: var(--line-2);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.eyebrow--ai {
  background: linear-gradient(90deg, var(--ai), var(--ai-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section__title {
  font-size: clamp(2.4rem, 5.6vw, 4.75rem);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.035em;
}
.section__title em { color: var(--accent); }
.section__sub { margin-top: 24px; max-width: 640px; color: var(--muted); font-size: 1.075rem; }

.sub-title {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

/* ---------- Reveal ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ==========================================================================
   01 · HERO
   ========================================================================== */
.hero { position: relative; padding: calc(var(--header-h) + clamp(48px, 8vw, 110px)) 0 0; }
.hero__grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: clamp(40px, 5vw, 80px);
  align-items: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 32px;
}
.status__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; }
.status__dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid #3ddc84;
  animation: ping 2s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }

.hero__title {
  font-size: clamp(2.6rem, 5.6vw, 5.4rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.05em;
}
.hero__line { display: block; }
.hero__line--serif { font-weight: 500; }
.hero__line--serif em:first-of-type { color: var(--accent); }
.hero__line--serif em:last-of-type {
  background: linear-gradient(90deg, var(--ai), var(--ai-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.06em;
}

.hero__lead { margin-top: 32px; max-width: 560px; font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--muted); }
.hero__lead strong { color: var(--text); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.chips li {
  padding: 7px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}
.chips .chips__hl { border-color: rgba(214, 255, 61, 0.4); color: var(--accent); background: rgba(214, 255, 61, 0.06); }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

.hero__media { justify-self: end; width: 100%; max-width: 440px; }
.portrait { position: relative; }
.portrait__frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: var(--surface);
  transform: rotate(2deg);
  transition: transform 0.8s var(--ease);
}
.portrait:hover .portrait__frame { transform: rotate(0deg) scale(1.01); }
.portrait__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(8, 8, 10, 0.6));
}
.portrait__frame img { width: 100%; height: 100%; object-fit: cover; }
.portrait__tag {
  position: absolute;
  left: -24px;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(18, 18, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-2);
}
.portrait__tag .mono { color: var(--dim); font-size: 0.68rem; }
.portrait__tag strong { font-size: 1rem; }
.portrait__badge {
  position: absolute;
  top: -36px;
  right: -28px;
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}
.portrait__badge svg { position: absolute; inset: 0; animation: spin 18s linear infinite; }
.portrait__badge text { font-family: var(--font-mono); font-size: 9.6px; letter-spacing: 0.18em; fill: var(--accent-ink); }
.portrait__badge span { font-size: 1.5rem; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(64px, 9vw, 120px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.hero__stats > div { padding: 28px 24px; border-left: 1px solid var(--line); }
.hero__stats > div:first-child { border-left: 0; padding-left: 0; }
.hero__stats dt { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); }
.hero__stats dd { margin-top: 6px; font-size: clamp(1.6rem, 3vw, 2.5rem); font-weight: 600; letter-spacing: -0.03em; }

/* Marquee */
.marquee {
  position: relative;
  margin-top: 0;
  padding: 28px 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 45s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__group { display: flex; gap: 44px; padding-right: 44px; }
.marquee__group a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}
.marquee__group a:hover { color: var(--text); }
.marquee__group img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; filter: grayscale(1); opacity: 0.8; transition: filter 0.2s, opacity 0.2s; }
.marquee__group a:hover img { filter: none; opacity: 1; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ==========================================================================
   02 · ABOUT
   ========================================================================== */
.about { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.about__copy { display: grid; gap: 20px; color: var(--muted); font-size: 1.05rem; max-width: 680px; }
.about__lead { color: var(--text); font-size: clamp(1.3rem, 2vw, 1.65rem); line-height: 1.4; letter-spacing: -0.015em; }
.about__copy .link-arrow { justify-self: start; margin-top: 8px; }

.note {
  margin-top: 8px;
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  background: var(--surface);
}
.note__label { display: block; color: var(--accent); margin-bottom: 8px; }
.note p { font-size: 0.98rem; }

.facts { position: sticky; top: calc(var(--header-h) + 24px); border-top: 1px solid var(--line); }
.facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); padding-top: 3px; }
.facts dd { text-align: right; font-weight: 500; }

.skills { margin-top: clamp(72px, 9vw, 120px); }
.skills__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.skill { padding: 28px 26px 32px; background: var(--bg); transition: background 0.3s; }
.skill:hover { background: var(--surface); }
.skill--feature { background: linear-gradient(135deg, rgba(214, 255, 61, 0.08), transparent 60%), var(--bg); }
.skill__tag { color: var(--accent); display: block; margin-bottom: 18px; }
.skill h4 { font-size: 1.08rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; margin-bottom: 10px; }
.skill--feature h4 { font-size: 1.2rem; }
.skill p { font-size: 0.92rem; color: var(--muted); }

/* ==========================================================================
   03 · X PROFILE
   ========================================================================== */
.xgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }

.xcard {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-2);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8);
}
.xcard__banner {
  position: relative;
  aspect-ratio: 3 / 1;
  overflow: hidden;
  background: linear-gradient(120deg, #14141a, #1d1b2b);
}
.xcard__banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.xcard__body { padding: 0 28px 28px; }
.xcard__top { display: flex; justify-content: space-between; align-items: flex-end; margin-top: -48px; }
.xcard__avatar { position: relative; z-index: 1; width: 96px; height: 96px; border-radius: 50%; border: 4px solid var(--surface); object-fit: cover; background: var(--surface-2); }
.xcard__name { margin-top: 16px; display: flex; align-items: center; gap: 6px; font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; }
.xcard__verified { width: 20px; height: 20px; color: var(--accent); }
.xcard__handle { color: var(--dim); text-transform: none; font-size: 0.85rem; margin-top: 2px; }
.xcard__bio { margin-top: 16px; color: var(--text); font-size: 1rem; }
.xcard__meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; color: var(--muted); font-size: 0.88rem; }
.xcard__meta li { display: inline-flex; align-items: center; gap: 6px; }
.xcard__meta svg { width: 16px; height: 16px; }
.xcard__meta a { color: var(--accent); }
.xcard__top .btn svg { width: 15px; height: 15px; }
.xcard__top .btn:hover svg { transform: none; }
.xcard__stats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 16px; font-size: 0.92rem; }
.xcard__stats > div { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 5px; }
.xcard__stats dd { font-weight: 700; color: var(--text); }
.xcard__stats dt { color: var(--muted); }
[hidden] { display: none !important; }
.xtopics__intro strong { font-weight: 600; }
.xtopics__intro em { color: var(--accent); }
.xtopics__label { color: var(--dim); margin-bottom: 4px; font-weight: 400; }

.xtopics__intro { font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.45; letter-spacing: -0.01em; margin-bottom: 32px; }
.topic-list { border-top: 1px solid var(--line); }
.topic-list li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 4px 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  transition: padding 0.35s var(--ease);
}
.topic-list li:hover { padding-left: 10px; }
.topic-list .mono { grid-row: span 2; color: var(--accent); padding-top: 4px; }
.topic-list strong { font-size: 1.1rem; font-weight: 600; }
.topic-list p { color: var(--muted); font-size: 0.95rem; }

/* ==========================================================================
   05 · AI CREATIVE LAB
   ========================================================================== */
.section--lab { overflow: hidden; }
.section--lab::before {
  content: "";
  position: absolute;
  inset: 10% -10% auto auto;
  width: 60vw;
  height: 60vw;
  max-width: 800px;
  max-height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(155, 123, 255, 0.18), transparent 65%);
  pointer-events: none;
}
.section--lab .section__title em {
  background: linear-gradient(90deg, var(--ai), var(--ai-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.08em;
}


/* ==========================================================================
   06 · EXPERIENCE
   ========================================================================== */
.logos { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; margin-bottom: clamp(56px, 7vw, 88px); }
.logos a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  transition: border-color 0.3s, background 0.3s, transform 0.4s var(--ease);
}
.logos a:hover { border-color: var(--line-2); background: var(--surface); transform: translateY(-3px); }
.logos img { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; }
.logos span { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.06em; color: var(--muted); text-align: center; line-height: 1.3; }

.timeline { border-top: 1px solid var(--line); }
.job {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: clamp(32px, 4vw, 48px) 0;
  border-bottom: 1px solid var(--line);
}
.job__when { color: var(--dim); padding-top: 14px; }
.job__head { display: flex; align-items: center; gap: 18px; }
.job__head img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; border: 1px solid var(--line-2); }
.job__head h3 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.job__head h3 a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.4s var(--ease), color 0.2s; }
.job__head h3 a:hover { color: var(--accent); background-size: 100% 1px; }
.job__role { color: var(--text); font-weight: 500; margin-top: 2px; }
.job__role span { color: var(--dim); font-weight: 400; }
.job__meta { margin-top: 16px; color: var(--muted); font-family: var(--font-serif); font-style: italic; font-size: 1.2rem; }

.job__metrics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.job__metrics li {
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}
.job__metrics strong { color: var(--accent); font-weight: 600; margin-right: 4px; }

.job__list { margin-top: 22px; display: grid; gap: 10px; max-width: 760px; }
.job__list li { position: relative; padding-left: 22px; color: var(--muted); font-size: 0.98rem; }
.job__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 10px;
  height: 1px;
  background: var(--dim);
}

/* ==========================================================================
   07 · ACHIEVEMENTS
   ========================================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stat { position: relative; padding: clamp(28px, 3.4vw, 44px); background: var(--bg); transition: background 0.3s; }
.stat:hover { background: var(--surface); }
.stat--hl { background: linear-gradient(160deg, rgba(214, 255, 61, 0.12), transparent 70%), var(--bg); }
.stat__num {
  display: inline-block;
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.stat--hl .stat__num { color: var(--accent); }
.stat__unit { margin-left: 8px; font-family: var(--font-serif); font-style: italic; font-size: clamp(1.4rem, 2.4vw, 2rem); color: var(--muted); }
.stat h3 { margin-top: 20px; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }
.stat p { margin-top: 8px; font-size: 0.92rem; color: var(--muted); max-width: 320px; }

.events { margin-top: clamp(72px, 9vw, 120px); }
.events__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { padding: 32px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); display: grid; gap: 14px; align-content: start; }
.panel__tag { color: var(--accent); }
.panel h4 { font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; }
.panel p { color: var(--muted); }

.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.gallery__item {
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: zoom-in;
}
.gallery__item img { width: 100%; height: auto; transition: transform 0.8s var(--ease); }
.gallery__item:hover img { transform: scale(1.03); }

.partners { margin-top: clamp(72px, 9vw, 120px); }
.partners .sub-title { margin-bottom: 8px; }
.partners__sub { color: var(--muted); margin-bottom: 28px; }
.partners__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.partners__grid a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}
.partners__grid a:hover { border-color: var(--line-2); color: var(--text); background: var(--surface); }
.partners__grid img { width: 36px; height: 36px; flex: none; border-radius: 10px; object-fit: cover; filter: grayscale(1); transition: filter 0.3s; }
.partners__grid a:hover img { filter: none; }

/* ==========================================================================
   09 · CONTACT
   ========================================================================== */
.contact__box {
  position: relative;
  padding: clamp(40px, 7vw, 96px);
  border-radius: 36px;
  border: 1px solid var(--line-2);
  background:
    radial-gradient(ellipse 60% 80% at 100% 0%, rgba(155, 123, 255, 0.2), transparent 60%),
    radial-gradient(ellipse 50% 70% at 0% 100%, rgba(214, 255, 61, 0.12), transparent 60%),
    var(--surface);
  overflow: hidden;
}
.contact__title {
  font-size: clamp(2.8rem, 7.5vw, 6.5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.05em;
}
.contact__title em { color: var(--accent); font-weight: 400; }
.contact__text { margin-top: 28px; max-width: 560px; color: var(--muted); font-size: 1.1rem; }

.contact__links { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 14px; margin-top: 48px; }
.clink {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: rgba(8, 8, 10, 0.5);
  transition: border-color 0.3s, background 0.3s, transform 0.4s var(--ease);
  min-width: 0;
}
.clink:hover { border-color: var(--accent); transform: translateY(-3px); }
.clink__main { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.clink__icon { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); }
.clink__icon svg { width: 20px; height: 20px; }
.clink__label { display: flex; flex-direction: column; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clink__label small { color: var(--dim); font-weight: 400; font-size: 0.66rem; }
.clink__arrow { margin-left: auto; color: var(--dim); transition: color 0.2s, transform 0.3s var(--ease); }
.clink:hover .clink__arrow { color: var(--accent); transform: translate(2px, -2px); }
.clink__copy {
  flex: none;
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  font-size: 0.66rem;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}
.clink__copy:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Footer ---------- */
.footer { padding: 40px 0 32px; overflow: hidden; }
.footer__big {
  font-size: clamp(2.6rem, 11.5vw, 10.5rem);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.06em;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
}
.footer__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.88rem;
}
.footer__row a:hover { color: var(--accent); }

/* ---------- Lightbox & toast ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 4, 6, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img { max-width: min(1200px, 100%); max-height: 88vh; border-radius: var(--radius); transform: scale(0.96); transition: transform 0.4s var(--ease); }
.lightbox.is-open img { transform: none; }
.lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  font-size: 1.4rem;
  line-height: 1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 160;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.9rem;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.4s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .skills__grid { grid-template-columns: repeat(2, 1fr); }
  .logos { grid-template-columns: repeat(4, 1fr); }
  .partners__grid { grid-template-columns: repeat(4, 1fr); }
  .contact__links { grid-template-columns: 1fr; max-width: 520px; }
}

@media (max-width: 900px) {
  :root { --header-h: 64px; }

  .burger { display: block; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    height: calc(100dvh - var(--header-h));
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 24px var(--pad);
    background: rgba(8, 8, 10, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s var(--ease);
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 16px 4px; font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; color: var(--text); border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav a:hover, .nav a.is-active { background: none; color: var(--accent); }
  .nav .nav__cta { margin: 24px 0 0; text-align: center; border-radius: 999px; border: 0; font-size: 1.05rem; padding: 16px; }

  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { order: -1; justify-self: start; max-width: 300px; margin-left: 20px; }
  .portrait__badge { width: 96px; height: 96px; top: -24px; right: -24px; }
  .portrait__badge text { font-size: 9.6px; }
  .hero__stats { grid-template-columns: repeat(2, 1fr); }
  .hero__stats > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .hero__stats > div:nth-child(n + 3) { border-top: 1px solid var(--line); }

  .about { grid-template-columns: 1fr; }
  .facts { position: static; }
  .xgrid { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; gap: 12px; }
  .job__when { padding-top: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .events__grid, .gallery { grid-template-columns: 1fr; }
  .section__head--row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  .skills__grid { grid-template-columns: 1fr; }
  .skill--feature { grid-column: auto; }
  .logos { grid-template-columns: repeat(2, 1fr); }
  .partners__grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: 1fr; }
  .hero__actions .btn { flex: 1; justify-content: center; padding: 0 18px; }
  .portrait__tag { left: -12px; }
  .job__head img { width: 46px; height: 46px; }
  .contact__box { border-radius: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .marquee__track { animation: none; }
}

/* Let the email address wrap instead of truncating on narrow cards */
.clink--email .clink__label { white-space: normal; overflow-wrap: anywhere; }

/* ==========================================================================
   Subpage · About me (profile.html)
   ========================================================================== */
.subhero { padding: calc(var(--header-h) + clamp(48px, 7vw, 96px)) 0 clamp(72px, 9vw, 120px); }
.subhero__grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.subhero__copy { display: grid; gap: 20px; max-width: 700px; }
.subhero__copy .eyebrow { margin-bottom: 0; }
.back-link { justify-self: start; color: var(--muted); text-transform: none; font-size: 0.8rem; transition: color 0.2s; }
.back-link:hover { color: var(--accent); }
.subhero__title {
  font-size: clamp(3.2rem, 9vw, 8rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.055em;
}
.subhero__title em { color: var(--accent); font-weight: 400; }
.subhero__body { display: grid; gap: 18px; color: var(--muted); font-size: 1.05rem; }
.subhero__media { position: sticky; top: calc(var(--header-h) + 32px); width: 100%; max-width: 420px; justify-self: end; }

.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 0.92rem;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s, transform 0.3s var(--ease);
}
.pill svg { width: 18px; height: 18px; flex: none; }
.pill:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.interests { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: start; }
.interest {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.3s, transform 0.4s var(--ease);
}
.interest:hover { border-color: var(--line-2); transform: translateY(-4px); }
.interest[open] { border-color: rgba(214, 255, 61, 0.35); }
.interest summary { display: grid; gap: 8px; padding: 0 0 22px; cursor: pointer; list-style: none; }
.interest summary::-webkit-details-marker { display: none; }
.interest__img { display: block; aspect-ratio: 1 / 1; overflow: hidden; margin-bottom: 10px; }
.interest__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.interest:hover .interest__img img { transform: scale(1.05); }
.interest__title, .interest__short, .interest__toggle, .interest__detail { padding: 0 22px; }
.interest__title { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.interest__short { color: var(--muted); font-size: 0.92rem; }
.interest__toggle { color: var(--accent); margin-top: 6px; }
.interest__toggle::after { content: " +"; }
.interest[open] .interest__toggle { font-size: 0; }
.interest[open] .interest__toggle::after { content: "Show less −"; font-size: 0.75rem; }
.interest__detail { padding-bottom: 24px; margin-top: -6px; color: var(--text); font-size: 0.95rem; }

.subpage-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(48px, 6vw, 72px); }

@media (max-width: 1080px) {
  .interests { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .subhero__grid { grid-template-columns: 1fr; }
  .subhero__media { position: static; order: -1; justify-self: start; max-width: 280px; margin-left: 20px; }
  .interests { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .interests { gap: 10px; }
  .interest__title, .interest__short, .interest__toggle, .interest__detail { padding: 0 14px; }
  .interest__title { font-size: 1rem; }
  .interest__short { font-size: 0.85rem; }
  .pill { flex: 1 1 100%; justify-content: center; }
}

.inline-link { color: var(--text); border-bottom: 1px solid var(--line-2); transition: color 0.2s, border-color 0.2s; }
.inline-link:hover { color: var(--accent); border-color: var(--accent); }

/* ==========================================================================
   05 · AI CREATIVE LAB · cinematic gallery
   ========================================================================== */
.section--lab {
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(155, 123, 255, 0.12), transparent 70%),
    linear-gradient(180deg, transparent, #050507 18%, #050507 82%, transparent);
  isolation: isolate;
}

/* Giant outline ticker behind the heading */
.lab-ticker {
  position: absolute;
  top: clamp(24px, 4vw, 56px);
  left: 0;
  right: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.6;
}
.lab-ticker__track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.lab-ticker span {
  font-size: clamp(4rem, 11vw, 10rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(155, 123, 255, 0.16);
}

.lab__head { align-items: flex-end; }
.lab-stats { display: flex; gap: clamp(20px, 3vw, 40px); flex: none; }
.lab-stats div { display: flex; flex-direction: column-reverse; gap: 4px; }
.lab-stats dd {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, var(--text), rgba(242, 241, 236, 0.45));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lab-stats dt { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }

/* Featured "now showing" player */
.lab-feature:empty { display: none; }
.feature {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 21 / 9;
  border-radius: 32px;
  overflow: hidden;
  border: 1px solid rgba(155, 123, 255, 0.28);
  background: #000;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 60px 120px -60px rgba(155, 123, 255, 0.55);
}
.feature__media,
.feature__media img,
.feature__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feature__media img { transition: transform 1.6s var(--ease); }
@media (min-width: 901px) {
  /* keep the poster clear of the text column */
  .feature__media { left: 34%; width: auto; right: 0; }
  .feature::before {
    background:
      linear-gradient(90deg, rgba(5, 5, 7, 1) 0%, rgba(5, 5, 7, 1) 34%, rgba(5, 5, 7, 0.4) 46%, transparent 62%),
      linear-gradient(0deg, rgba(5, 5, 7, 0.6), transparent 35%);
  }
}
.feature__media video { opacity: 0; transition: opacity 0.6s; }
.feature.is-previewing .feature__media video { opacity: 1; }
.feature:hover .feature__media img { transform: scale(1.04); }
.feature::before {
  /* letterbox + vignette */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(5, 5, 7, 0.92) 0%, rgba(5, 5, 7, 0.6) 38%, transparent 70%),
    linear-gradient(0deg, rgba(5, 5, 7, 0.85), transparent 45%);
}
.feature::after {
  /* film grain */
  content: "";
  position: absolute;
  inset: -50%;
  z-index: 2;
  opacity: 0.07;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}
.feature__body {
  position: absolute;
  inset: auto auto 0 0;
  z-index: 3;
  display: grid;
  gap: 14px;
  max-width: 560px;
  padding: clamp(24px, 4vw, 52px);
}
.feature__badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(155, 123, 255, 0.16);
  border: 1px solid rgba(155, 123, 255, 0.4);
  color: #d9cdff;
}
.feature__badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 10px #ff4d6d; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }
.feature__title { font-size: clamp(1.8rem, 3.6vw, 3.2rem); font-weight: 700; line-height: 1; letter-spacing: -0.04em; }
.feature__desc { color: rgba(242, 241, 236, 0.75); font-size: clamp(0.92rem, 1.1vw, 1.02rem); max-width: 480px; }
.feature__play {
  position: absolute;
  top: 50%;
  left: 68%;
  z-index: 3;
  width: clamp(72px, 8vw, 104px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  transform: translate(-50%, -50%);
  transition: transform 0.5s var(--ease), background 0.3s, color 0.3s;
}
.feature__play::before,
.feature__play::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  animation: ripple 2.8s var(--ease) infinite;
}
.feature__play::after { animation-delay: 1.4s; }
@keyframes ripple { from { transform: scale(1); opacity: 0.8; } to { transform: scale(1.9); opacity: 0; } }
.feature__play svg { width: 34%; height: 34%; margin-left: 6%; }
.feature:hover .feature__play { transform: translate(-50%, -50%) scale(1.08); background: var(--accent); color: var(--accent-ink); }

.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-row li {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: rgba(242, 241, 236, 0.85);
}
.chips-row .is-tool { border-color: rgba(79, 209, 255, 0.35); color: var(--ai-2); background: rgba(79, 209, 255, 0.06); }

/* Filters */
.lab-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: clamp(40px, 5vw, 64px) 0 24px;
  padding: 6px;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.lab-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.25s, background 0.25s, box-shadow 0.25s;
}
.lab-filter span { font-family: var(--font-mono); font-size: 0.7rem; color: var(--dim); transition: color 0.25s; }
.lab-filter:hover { color: var(--text); }
.lab-filter.is-active {
  color: var(--accent-ink);
  background: linear-gradient(90deg, #b9a4ff, #7fe0ff);
  box-shadow: 0 8px 30px -8px rgba(155, 123, 255, 0.7);
}
.lab-filter.is-active span { color: rgba(11, 11, 11, 0.6); }

/* Grid */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: 16px;
}
.lab-card {
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: block;
  width: 100%;
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
  isolation: isolate;
  aspect-ratio: 1;
  transition: transform 0.5s var(--ease), border-color 0.3s, box-shadow 0.5s var(--ease);
  animation: cardIn 0.7s var(--ease) both;
  animation-delay: calc(var(--n, 0) * 50ms);
}
.lab-card--video { grid-column: span 2; aspect-ratio: 16 / 9; }
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
.lab-card:hover {
  transform: translateY(-6px);
  border-color: rgba(155, 123, 255, 0.45);
  box-shadow: 0 30px 60px -30px rgba(155, 123, 255, 0.5);
}
.lab-card::before {
  /* cursor spotlight */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  background: radial-gradient(400px circle at var(--mx) var(--my), rgba(185, 164, 255, 0.22), transparent 45%);
  transition: opacity 0.3s;
  pointer-events: none;
}
.lab-card:hover::before { opacity: 1; }
.lab-card__media,
.lab-card__media img,
.lab-card__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lab-card__media img { transition: transform 1.2s var(--ease); }
.lab-card:hover .lab-card__media img { transform: scale(1.06); }
.lab-card__media video { opacity: 0; transition: opacity 0.5s; }
.lab-card.is-previewing .lab-card__media video { opacity: 1; }
.lab-card__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, rgba(5, 5, 7, 0.97) 0%, rgba(5, 5, 7, 0.75) 28%, rgba(5, 5, 7, 0.15) 60%, transparent 75%);
}
.lab-card__top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.lab-card__cat,
.lab-card__time {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(5, 5, 7, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.lab-card__time { display: inline-flex; align-items: center; gap: 6px; }
.lab-card__time svg { width: 10px; height: 10px; }
.lab-card__body {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 3;
  display: grid;
  gap: 8px;
  padding: 18px;
}
.lab-card__title { font-size: 1.08rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.lab-card--video .lab-card__title { font-size: clamp(1.1rem, 1.6vw, 1.4rem); }
.lab-card__desc {
  color: rgba(242, 241, 236, 0.7);
  font-size: 0.86rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.5s var(--ease), opacity 0.4s;
}
.lab-card:hover .lab-card__desc,
.lab-card:focus-visible .lab-card__desc { max-height: 3em; opacity: 1; }
.lab-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: transform 0.4s var(--ease), opacity 0.3s, background 0.3s, color 0.3s;
}
.lab-card__play svg { width: 18px; height: 18px; margin-left: 3px; }
.lab-card:hover .lab-card__play { transform: translate(-50%, -50%) scale(1.1); background: var(--accent); color: var(--accent-ink); }
.lab-card.is-previewing .lab-card__play { opacity: 0; }
.lab-card__zoom {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(5, 5, 7, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s, transform 0.4s var(--ease);
}
.lab-card__zoom svg { width: 14px; height: 14px; }
.lab-card:hover .lab-card__zoom { opacity: 1; transform: none; }

.lab-empty {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 64px 24px;
  border-radius: 22px;
  border: 1px dashed var(--line-2);
  color: var(--muted);
  text-align: center;
}
.lab-empty .mono { color: var(--ai-2); }

/* Theater (full-screen viewer) */
.theater {
  position: fixed;
  inset: 0;
  z-index: 170;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: clamp(12px, 2.5vw, 28px);
  gap: 16px;
  background: rgba(3, 3, 5, 0.94);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}
.theater.is-open { opacity: 1; visibility: visible; }
.theater__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  filter: blur(80px) saturate(140%);
  opacity: 0.25;
  transform: scale(1.2);
}
.theater__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); }
.theater__count { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; }
.theater__btn {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.theater__btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.theater__btn svg { width: 18px; height: 18px; }
.theater__stage { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 0; }
.theater__frame {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 0;
  transform: scale(0.97);
  opacity: 0;
  transition: transform 0.5s var(--ease), opacity 0.4s;
}
.theater.is-open .theater__frame { transform: none; opacity: 1; }
.theater__frame video,
.theater__frame img {
  max-width: 100%;
  max-height: calc(100dvh - 300px);
  border-radius: 18px;
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.06);
  background: #000;
}
.theater__info {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 32px;
  align-items: end;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}
.theater__info h3 { font-size: clamp(1.3rem, 2.4vw, 2rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.theater__info p { grid-column: 1; color: var(--muted); font-size: 0.95rem; max-width: 720px; }
.theater__info .chips-row { grid-column: 1; }
.theater__link { grid-column: 2; grid-row: 1 / span 3; align-self: center; }

@media (max-width: 1080px) {
  .lab-grid { grid-template-columns: repeat(2, 1fr); }
  .feature { aspect-ratio: 16 / 9; }
}
@media (max-width: 900px) {
  .lab__head { align-items: flex-start; }
  .theater__stage { grid-template-columns: minmax(0, 1fr); }
  .theater__stage .theater__btn { position: absolute; top: 50%; z-index: 2; transform: translateY(-50%); background: rgba(5, 5, 7, 0.7); }
  .theater__stage .theater__btn--prev { left: 6px; }
  .theater__stage .theater__btn--next { right: 6px; }
  .theater__info { grid-template-columns: 1fr; }
  .theater__link { grid-column: 1; grid-row: auto; justify-self: start; }
}
@media (max-width: 640px) {
  .feature { aspect-ratio: auto; display: flex; flex-direction: column; border-radius: 24px; }
  .feature__media { position: relative; inset: auto; aspect-ratio: 16 / 9; flex: none; }
  .feature::before { background: linear-gradient(0deg, #050507 0%, transparent 30%); height: calc((100vw - 2 * var(--pad)) * 9 / 16); bottom: auto; }
  .feature__body { position: relative; inset: auto; padding: 4px 20px 24px; }
  .feature__play { top: calc((100vw - 2 * var(--pad)) * 9 / 32); left: 50%; width: 64px; }
  .lab-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .lab-card { border-radius: 16px; }
  .lab-card__body { padding: 12px; }
  .lab-card:not(.lab-card--video) .lab-card__title { font-size: 0.9rem; }
  .lab-card__desc { display: none; }
  .lab-filters { border-radius: 20px; }
  .lab-filter { padding: 8px 14px; font-size: 0.85rem; }
  .lab-stats dd { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .lab-ticker__track, .feature::after, .feature__play::before, .feature__play::after { animation: none; }
}

/* ==========================================================================
   Polish pass: cohesion, transitions, header, footer, socials
   ========================================================================== */

/* Typography rhythm */
h1, h2, h3, .section__title, .hero__title, .contact__title { text-wrap: balance; }
p, li { text-wrap: pretty; }
.section__sub { line-height: 1.65; }

/* Section transitions: hairline gradient divider + softer reveal */
main > .section:not(.hero) {
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1) 20%, rgba(155, 123, 255, 0.35) 50%, rgba(255, 255, 255, 0.1) 80%, transparent) 1;
}
.js [data-reveal] { filter: blur(6px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js [data-reveal].is-in { filter: none; }

/* Header hides while reading down, returns on scroll up */
.header { transition: transform 0.45s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease); }
.header.is-hidden { transform: translateY(-100%); }
body.is-locked .header { transform: none; }

/* Shared live dot */
.pulse { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ai-2); box-shadow: 0 0 0 0 rgba(79, 209, 255, 0.6); animation: pulse 2s infinite; }
.pulse--green { background: #3ddc84; box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6); }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(79, 209, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(79, 209, 255, 0); } }

/* Social icon rows (mobile menu + footer) */
.nav__socials,
.footer__socials { display: flex; gap: 10px; }
.nav__socials a,
.footer__socials a {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.3s var(--ease);
}
.nav__socials a:hover,
.footer__socials a:hover { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.nav__socials svg,
.footer__socials svg { width: 18px; height: 18px; }
.nav .nav__socials { display: none; }

/* Footer */
.footer__grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 40px;
}
.footer__nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer__nav a { color: var(--muted); font-size: 0.92rem; transition: color 0.2s; }
.footer__nav a:hover { color: var(--accent); }

/* Contact: four links in a 2x2 grid */
.contact__links { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 880px; }

/* X section cross-link */
.xtopics__more { margin-top: 28px; }

/* ---------- 04 · Made for X rail ---------- */
.rail-nav { display: flex; gap: 10px; flex: none; }
.rail-btn {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  color: var(--text);
  transition: background 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s;
}
.rail-btn svg { width: 18px; height: 18px; }
.rail-btn:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rail-btn:disabled { opacity: 0.3; cursor: default; }

.rail {
  --gutter: max(var(--pad), calc((100vw - var(--wrap)) / 2 + var(--pad)));
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(270px, 30vw, 400px);
  gap: 16px;
  padding: 8px var(--gutter) 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  cursor: grab;
}
.rail::-webkit-scrollbar { display: none; }
.rail.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.rail.is-dragging .post-card { pointer-events: none; }
.rail:focus-visible { outline-offset: -4px; }

.post-card {
  scroll-snap-align: start;
  display: grid;
  gap: 10px;
  align-content: start;
  text-align: left;
  cursor: pointer;
}
.post-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.3s, transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.post-card__media img,
.post-card__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-card__media img { transition: transform 1.2s var(--ease); }
.post-card__media video { opacity: 0; transition: opacity 0.5s; }
.post-card.is-previewing .post-card__media video { opacity: 1; }
.post-card.is-previewing .lab-card__play { opacity: 0; }
.post-card:hover .post-card__media { border-color: rgba(214, 255, 61, 0.45); transform: translateY(-4px); box-shadow: 0 24px 50px -28px rgba(214, 255, 61, 0.45); }
.post-card:hover .post-card__media img { transform: scale(1.05); }
.post-card:hover .lab-card__play { transform: translate(-50%, -50%) scale(1.1); background: var(--accent); color: var(--accent-ink); }
.post-card__meta { display: flex; justify-content: space-between; align-items: center; color: var(--dim); }
.post-card__handle { display: inline-flex; align-items: center; gap: 6px; text-transform: none; }
.post-card__handle svg { width: 12px; height: 12px; }
.post-card__title { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
.post-card__lang { color: var(--muted); font-size: 0.66rem; }

.rail-foot { display: flex; flex-wrap: wrap; gap: 16px 32px; }

/* ---------- 08 · Projects ---------- */
.repos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.repo-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.3s, transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.repo-card:hover { border-color: var(--line-2); transform: translateY(-4px); box-shadow: 0 40px 80px -50px rgba(155, 123, 255, 0.6); }
.repo-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0b0b10;
  border-bottom: 1px solid var(--line);
}
.repo-card__media img,
.repo-card__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.repo-card__media img { transition: transform 1.2s var(--ease), opacity 0.4s; }
.repo-card__media video { opacity: 0; transition: opacity 0.5s; }
.repo-card__media.is-previewing video { opacity: 1; }
.repo-card:hover .repo-card__media img { transform: scale(1.03); }
.repo-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(18, 18, 23, 0.6), transparent 40%);
  pointer-events: none;
}
.repo-card__live {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 8, 10, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-2);
  font-size: 0.66rem;
}
.repo-card__body { display: grid; gap: 16px; padding: clamp(22px, 3vw, 32px); flex: 1; align-content: start; }
.repo-card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.repo-card__head h3 { font-family: var(--font-mono); font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: 500; letter-spacing: -0.02em; }
.repo-card__tag { padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(155, 123, 255, 0.4); color: #cbbcff; font-size: 0.66rem; }
.repo-card__body > p { color: var(--muted); font-size: 0.97rem; }
.langbar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.langbar span { width: var(--w); min-width: 3px; background: var(--c); }
.langs { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 0.7rem; text-transform: none; }
.langs li { display: inline-flex; align-items: center; gap: 6px; }
.langs li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.repo-card__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.repo-card__links .btn svg { width: 16px; height: 16px; }

/* ---------- Responsive refinements ---------- */
@media (max-width: 1080px) {
  .contact__links { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
}
@media (max-width: 900px) {
  .nav .nav__socials { display: flex; margin-top: auto; padding-top: 24px; }
  .nav .nav__socials a { border-bottom: 1px solid var(--line-2); padding: 0; font-size: inherit; }
  .repos { grid-template-columns: 1fr; }
  .rail-nav { display: none; }
  .section__head--row .link-arrow { align-self: flex-start; }
}
@media (max-width: 640px) {
  .contact__links { grid-template-columns: 1fr; }
  .rail { grid-auto-columns: 78vw; gap: 12px; }
  .footer__grid { flex-direction: column; align-items: flex-start; }
  .footer__nav { gap: 10px 18px; }
}
@media (max-width: 380px) {
  :root { --pad: 16px; }
  .hero__title { font-size: 2.3rem; }
  .chips li { font-size: 0.76rem; padding: 6px 12px; }
  .hero__stats dd { font-size: 1.45rem; }
  .lab-filter { padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { filter: none; }
  .header.is-hidden { transform: none; }
}
@media (max-width: 380px) {
  .hero__media { margin-left: 4px; max-width: calc(100% - 32px); }
  .portrait__badge { width: 84px; height: 84px; top: -18px; right: -14px; }
  .portrait__tag { left: -4px; }
  .subhero__media { margin-left: 4px; max-width: calc(100% - 16px); }
}
.partners__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.partners__grid a { min-width: 0; }
.partners__grid span { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 1080px) { .partners__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) { .partners__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.portrait__badge { overflow: hidden; }
.hero, .subhero { overflow-x: clip; }
@media (max-width: 900px) {
  /* Nested backdrop-filters let page content bleed through in Chromium; use a solid sheet. */
  .nav { background: #08080a; backdrop-filter: none; -webkit-backdrop-filter: none; }
  body.is-locked .header { background: #08080a; backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Hero entrance: CSS-only and never fully transparent, so it paints immediately (good LCP). */
[data-rise] { animation: rise 1s var(--ease) both; animation-delay: calc(var(--r, 0) * 80ms); }
@keyframes rise { from { transform: translate3d(0, 22px, 0); filter: blur(5px); opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { [data-rise] { animation: none; } }
