/* ==========================================================================
   PORTFOLIO · Apple-inspired interface studies
   Tokens → Layout → Components → Motion → Responsive
   ========================================================================== */

:root {
  --bg: #FBFBFD;
  --ink: #1D1D1F;
  --ink-2: #6E6E73;
  --ink-3: #86868B;
  --line: rgba(29, 29, 31, .09);
  --line-2: rgba(29, 29, 31, .16);
  --blue: #0071E3;
  --violet: #6C63FF;

  --wrap: 1180px;
  --pad: clamp(20px, 4vw, 40px);
  --nav-h: 58px;

  --r-lg: clamp(24px, 3vw, 38px);
  --r-md: 20px;
  --r-sm: 14px;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.4, 0, .2, 1);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI Variable Display", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei UI", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC",
    sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.lb-open { overflow: hidden; }

img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

::selection { background: rgba(108, 99, 255, .22); }

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

/* ── film grain ─────────────────────────────────────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: .032;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── scroll progress ────────────────────────────────────────────────────── */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 95;
  background: transparent;
}
.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6C63FF, #C06BFF 45%, #4FC3F7);
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}

/* ══════════════════════════════════════════════════════════════════════════
   NAV
   ══════════════════════════════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 80;
  border-bottom: 1px solid transparent;
  transition: background .45s var(--ease-io), border-color .45s, color .45s;
}
.nav.scrolled {
  background: rgba(251, 251, 253, .84);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--line);
}
body.nav-dark .nav.scrolled {
  background: rgba(9, 9, 13, .74);
  border-bottom-color: rgba(255, 255, 255, .1);
  color: #F5F5F7;
}

.nav-inner {
  max-width: var(--wrap);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: conic-gradient(from 210deg, #6C63FF, #C06BFF, #4FC3F7, #6C63FF);
  box-shadow: 0 2px 8px rgba(108, 99, 255, .35);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 3px;
  background: #fff;
}
.brand-text {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.brand-text em {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--ink-3);
}
body.nav-dark .brand-text em { color: rgba(255, 255, 255, .5); }

.nav-links { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); }
.nav-links a {
  font-size: 12.5px;
  color: var(--ink-2);
  letter-spacing: .02em;
  transition: color .3s, opacity .3s;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .45s var(--ease);
  opacity: .5;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--ink); }
body.nav-dark .nav-links a { color: rgba(255, 255, 255, .62); }
body.nav-dark .nav-links a:hover,
body.nav-dark .nav-links a.active { color: #fff; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--ink);
  transition: background .35s, border-color .35s, transform .5s var(--ease);
  white-space: nowrap;
}
.nav-cta svg {
  width: 13px; height: 13px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform .45s var(--ease);
}
.nav-cta:hover { background: rgba(29, 29, 31, .05); }
.nav-cta:hover svg { transform: translateX(3px); }
body.nav-dark .nav-cta { color: #F5F5F7; border-color: rgba(255, 255, 255, .22); }
body.nav-dark .nav-cta:hover { background: rgba(255, 255, 255, .1); }

/* ══════════════════════════════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + clamp(40px, 6.2vw, 76px)) 0 clamp(32px, 5vw, 70px);
  overflow: hidden;
  isolation: isolate;
}

.aurora { position: absolute; inset: -10% 0 auto; height: 110%; pointer-events: none; z-index: 0; }
.aurora-layer {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  will-change: transform;
}
.a1 {
  width: 62vw; height: 62vw; left: -14vw; top: -18vw;
  background: radial-gradient(circle at 50% 50%, #A9C0FF 0%, rgba(169, 192, 255, 0) 66%);
  animation: drift1 26s var(--ease-io) infinite alternate;
}
.a2 {
  width: 58vw; height: 58vw; right: -16vw; top: -22vw;
  background: radial-gradient(circle at 50% 50%, #F2C9FF 0%, rgba(242, 201, 255, 0) 64%);
  animation: drift2 32s var(--ease-io) infinite alternate;
}
.a3 {
  width: 78vw; height: 40vw; left: 8vw; top: 6vw;
  background: radial-gradient(circle at 50% 50%, #D3F3FF 0%, rgba(211, 243, 255, 0) 70%);
  animation: drift3 38s var(--ease-io) infinite alternate;
}
@keyframes drift1 { to { transform: translate3d(6vw, 5vw, 0) scale(1.12); } }
@keyframes drift2 { to { transform: translate3d(-5vw, 6vw, 0) scale(1.08); } }
@keyframes drift3 { to { transform: translate3d(3vw, -4vw, 0) scale(1.15); } }

.hero-spot {
  position: absolute;
  width: 620px; height: 620px;
  left: 50%; top: 40%;
  margin: -310px 0 0 -310px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 120, 255, .16), rgba(80, 190, 255, .08) 42%, transparent 68%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity .8s ease;
  will-change: transform;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 clamp(18px, 2.2vw, 28px);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .24em;
  color: var(--ink-3);
}
.eyebrow .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6C63FF, #4FC3F7);
  box-shadow: 0 0 0 4px rgba(108, 99, 255, .1);
}

.hero-title {
  margin: 0;
  font-size: clamp(38px, 6.4vw, 88px);
  line-height: 1.03;
  font-weight: 620;
  letter-spacing: -.045em;
}
.hero-title .line { display: block; }
.hero-title .grad {
  background: linear-gradient(102deg, #544CF0 0%, #9A6BFF 18%, #EE8FBE 36%, #6FC4F4 54%, #544CF0 72%, #9A6BFF 88%, #EE8FBE 100%);
  background-size: 150% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: flow 22s var(--ease-io) infinite;
}
@keyframes flow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 34% 50%; }
}

.lede {
  margin: clamp(18px, 2.2vw, 26px) auto 0;
  max-width: 620px;
  font-size: clamp(15.5px, 1.45vw, 18px);
  line-height: 1.75;
  color: var(--ink-2);
  letter-spacing: .005em;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.6vw, 22px);
  margin-top: clamp(24px, 3vw, 34px);
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: .01em;
  border: 1px solid transparent;
  transition: transform .5s var(--ease), background .35s, box-shadow .5s, border-color .35s, color .35s;
  white-space: nowrap;
}
.btn svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform .45s var(--ease);
}
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 28px -10px rgba(0, 113, 227, .65);
}
.btn-primary:hover {
  background: #0077ED;
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -12px rgba(0, 113, 227, .7);
}
.btn-primary:hover svg { transform: translateX(3px); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); background: rgba(29, 29, 31, .05); }
.btn-ghost span { transition: transform .45s var(--ease); display: inline-block; }
.btn-ghost:hover span { transform: translateX(3px); }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: clamp(24px, 4vw, 54px);
  margin-top: clamp(26px, 3.4vw, 40px);
}
.hero-stats div { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.hero-stats strong {
  font-size: clamp(19px, 2.1vw, 24px);
  font-weight: 600;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #1D1D1F, #4A4A55);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-stats span { font-size: 11.5px; color: var(--ink-3); letter-spacing: .06em; }

/* ── hero stage ─────────────────────────────────────────────────────────── */
.hero-stage {
  position: relative;
  margin: clamp(28px, 4vw, 48px) auto 0;
  max-width: 1000px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 12px;
  --px: 0;
  --py: 0;
}

.stage-aura {
  position: absolute;
  left: 50%; top: 52%;
  width: min(760px, 92%);
  height: 380px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at 50% 50%, rgba(108, 99, 255, .3), rgba(79, 195, 247, .18) 42%, rgba(255, 255, 255, 0) 72%);
  filter: blur(42px);
  pointer-events: none;
}

.stage-floor {
  position: absolute;
  left: 50%; bottom: -6px;
  width: 78%; height: 90px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 0%, rgba(29, 20, 70, .16), transparent 70%);
  filter: blur(18px);
  pointer-events: none;
}

.phone {
  position: relative;
  margin: 0;
  transform: translate3d(
    calc(var(--px) * var(--depth, 1) * 1px),
    calc(var(--py) * var(--depth, 1) * .72px),
    0
  ) rotate(var(--rot, 0deg));
  transition: transform .9s var(--ease);
  will-change: transform;
}
.phone-a { z-index: 3; width: clamp(186px, 21vw, 246px); }
.phone-b {
  z-index: 2;
  width: clamp(142px, 14.6vw, 186px);
  margin-right: clamp(-30px, -2vw, -14px);
  margin-bottom: clamp(34px, 5.4vw, 76px);
  --rot: -7deg;
  --depth: -26;
}
.phone-c {
  z-index: 1;
  width: clamp(142px, 14.6vw, 186px);
  margin-left: clamp(-30px, -2vw, -14px);
  margin-bottom: clamp(22px, 4vw, 56px);
  --rot: 7deg;
  --depth: -38;
}

.device {
  position: relative;
  border-radius: clamp(26px, 3.4vw, 40px);
  padding: 7px;
  background: linear-gradient(155deg, #46464F 0%, #16161B 22%, #0B0B0F 52%, #1B1B22 78%, #3A3A44 100%);
  box-shadow:
    0 1px 1px rgba(255, 255, 255, .4) inset,
    0 0 0 1px rgba(0, 0, 0, .35),
    0 18px 34px -18px rgba(16, 12, 40, .55),
    0 46px 80px -40px rgba(16, 12, 40, .55);
}
.device img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(clamp(26px, 3.4vw, 40px) - 6px);
  background: #0A0A0E;
}
.device-lg { border-radius: clamp(32px, 4vw, 48px); padding: 9px; }
.device-lg img { border-radius: calc(clamp(32px, 4vw, 48px) - 8px); }

.device-sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(116deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .03) 14%, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0) 76%, rgba(255, 255, 255, .07) 100%);
  mix-blend-mode: screen;
  opacity: .5;
}

.phone .device { animation: floaty 9s ease-in-out infinite; }
.phone-b .device { animation-duration: 11s; animation-delay: -3s; }
.phone-c .device { animation-duration: 13s; animation-delay: -6s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-9px) rotate(.25deg); }
}

.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: clamp(28px, 4vw, 46px);
  font-size: 9px;
  letter-spacing: .28em;
  color: var(--ink-3);
}
.scroll-cue i {
  display: block;
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--ink-3), transparent);
  animation: cue 2.4s var(--ease-io) infinite;
  transform-origin: top;
}
@keyframes cue {
  0% { transform: scaleY(0); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ══════════════════════════════════════════════════════════════════════════
   SHARED SECTION
   ══════════════════════════════════════════════════════════════════════════ */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.kicker {
  margin: 0 0 clamp(14px, 1.8vw, 20px);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .26em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.dark-section .kicker { color: rgba(255, 255, 255, .42); }

.section-title {
  margin: 0;
  font-size: clamp(32px, 4.6vw, 58px);
  line-height: 1.08;
  font-weight: 620;
  letter-spacing: -.04em;
}
.section-sub {
  margin: clamp(16px, 2vw, 24px) 0 0;
  max-width: 560px;
  font-size: clamp(15px, 1.3vw, 17.5px);
  line-height: 1.75;
  color: var(--ink-2);
}
.dark-section .section-title { color: #F5F5F7; }
.dark-section .section-sub { color: rgba(255, 255, 255, .55); }

/* ── work index ─────────────────────────────────────────────────────────── */
.work {
  position: relative;
  padding: clamp(70px, 9vw, 120px) 0 clamp(30px, 4vw, 50px);
}

.section-head { max-width: 720px; }

.work-index { margin-top: clamp(38px, 5vw, 60px); border-top: 1px solid var(--line); }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) minmax(0, 1.15fr) 62px 34px;
  align-items: center;
  gap: clamp(12px, 2.4vw, 30px);
  padding: clamp(18px, 2.2vw, 26px) 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  isolation: isolate;
  transition: padding-left .6s var(--ease), color .4s;
}
.row::before {
  content: "";
  position: absolute;
  inset: 0 -10px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(108, 99, 255, .06), rgba(79, 195, 247, .04) 60%, transparent);
  opacity: 0;
  transition: opacity .5s var(--ease-io);
  z-index: -1;
}
.row:hover::before { opacity: 1; }
.row:hover { padding-left: 22px; }

.row-num {
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.row-title {
  font-size: clamp(20px, 2.5vw, 30px);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.2;
}
.row-title small {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  color: var(--ink-3);
  margin-left: 10px;
  vertical-align: 2px;
}
.row-sub {
  font-size: 13.5px;
  color: var(--ink-2);
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-count {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.row-arrow {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  transition: background .4s, color .4s, border-color .4s, transform .6s var(--ease);
}
.row-arrow svg {
  width: 13px; height: 13px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.row:hover .row-arrow {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  transform: rotate(45deg);
}

.work-note {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin: clamp(26px, 3vw, 38px) 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.7;
}
.work-note-key {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  font-size: 10px;
  transform: translateY(2px);
}

/* cursor preview */
.row-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 158px;
  aspect-ratio: .4615;
  border-radius: 16px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-999px, -999px, 0) scale(.9);
  box-shadow: 0 30px 60px -24px rgba(20, 14, 40, .5), 0 0 0 1px rgba(255, 255, 255, .5) inset;
  transition: opacity .35s var(--ease-io), transform .5s var(--ease);
  will-change: transform;
}
.row-preview img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.row-preview.on { opacity: 1; }

/* ══════════════════════════════════════════════════════════════════════════
   CHAPTER
   ══════════════════════════════════════════════════════════════════════════ */
.chapter {
  position: relative;
  padding: clamp(64px, 8vw, 110px) 0 0;
  --accent: #8E8BFF;
}
.chapter:first-of-type { padding-top: clamp(40px, 5vw, 60px); }

.chap-head {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}
.chap-top {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 10.5px;
  letter-spacing: .24em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.chap-num {
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.chap-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-2), var(--line) 70%, transparent);
}
.chap-cat { white-space: nowrap; }

.chap-grid {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 64px);
  align-items: end;
  margin-top: clamp(18px, 2.4vw, 28px);
}

.chap-title {
  margin: 0;
  font-size: clamp(36px, 5.2vw, 68px);
  line-height: 1.02;
  font-weight: 620;
  letter-spacing: -.045em;
}
.chap-title-en {
  display: block;
  margin-top: 10px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .28em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.chap-copy p {
  margin: 0;
  font-size: clamp(14.5px, 1.25vw, 16.5px);
  line-height: 1.85;
  color: var(--ink-2);
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 20px 0 0; padding: 0; list-style: none; }
.chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .7);
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--ink-2);
  transition: border-color .4s, color .4s, background .4s;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip-num { color: var(--ink-3); }

/* ── stage panel ────────────────────────────────────────────────────────── */
.stage {
  position: relative;
  max-width: var(--wrap);
  margin: clamp(26px, 4vw, 44px) auto 0;
  border-radius: var(--r-lg);
  padding: clamp(24px, 4.4vw, 52px) clamp(18px, 4vw, 52px) clamp(18px, 3vw, 34px);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(62% 46% at 50% -8%, var(--g1) 0%, transparent 68%),
    radial-gradient(42% 42% at 97% 104%, var(--g2) 0%, transparent 70%),
    radial-gradient(70% 40% at 3% 96%, var(--g3) 0%, transparent 72%),
    linear-gradient(180deg, #0B0B13 0%, #06060B 100%);
  box-shadow:
    0 40px 90px -46px rgba(18, 12, 46, .55),
    0 0 0 1px rgba(255, 255, 255, .06) inset,
    0 1px 0 rgba(255, 255, 255, .14) inset;
}
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), transparent 30%, transparent 70%, rgba(0, 0, 0, .25));
  pointer-events: none;
  z-index: 1;
}
.stage-grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: .09;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.stage-top {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}
.stage-top b { font-weight: 600; color: rgba(255, 255, 255, .82); }

.stage-phones {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(8px, 1.6vw, 22px);
  padding: clamp(18px, 3vw, 34px) 0;
}
.stage-phones .device {
  border-radius: clamp(22px, 2.6vw, 34px);
  padding: 6px;
}
.stage-phones .device img { border-radius: calc(clamp(22px, 2.6vw, 34px) - 5px); }
.stage-phones .device-lg { border-radius: clamp(26px, 3vw, 40px); padding: 8px; }
.stage-phones .device-lg img { border-radius: calc(clamp(26px, 3vw, 40px) - 7px); }

.stage-phone {
  position: relative;
  width: clamp(124px, 16.4vw, 222px);
  transition: transform .9s var(--ease);
}
.stage-phone.main { width: clamp(190px, 24.4vw, 328px); z-index: 2; }
.stage-phone.side-l { transform: rotate(-5deg) translateY(6px); }
.stage-phone.side-r { transform: rotate(5deg) translateY(2px); }
.stage-phones:hover .stage-phone.side-l { transform: rotate(-7deg) translate(-4px, 2px); }
.stage-phones:hover .stage-phone.side-r { transform: rotate(7deg) translate(4px, -2px); }
.stage-phones:hover .stage-phone.main { transform: translateY(-6px); }

.stage-phone .device {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .1),
    0 24px 48px -20px rgba(0, 0, 0, .7),
    0 60px 100px -50px rgba(0, 0, 0, .8);
}

.stage-bot {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: clamp(6px, 1.4vw, 12px);
  font-size: 11.5px;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .45);
}
.stage-bot em { font-style: normal; color: rgba(255, 255, 255, .8); }
.stage-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-size: 11.5px;
  cursor: pointer;
  transition: background .35s, border-color .35s, transform .5s var(--ease);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.stage-btn:hover { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .3); transform: translateY(-1px); }
.stage-btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── gallery ────────────────────────────────────────────────────────────── */
.gal {
  max-width: var(--wrap);
  margin: clamp(14px, 2vw, 22px) auto 0;
  padding: 0 var(--pad);
  columns: 5;
  column-gap: clamp(9px, 1.2vw, 16px);
}

.shot {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 clamp(9px, 1.2vw, 16px);
  padding: 0;
  border: 0;
  break-inside: avoid;
  border-radius: clamp(12px, 1.3vw, 18px);
  overflow: hidden;
  background: var(--c, #E8E8ED);
  cursor: zoom-in;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 0 0 1px rgba(29, 29, 31, .05);
  transition: transform .7s var(--ease), box-shadow .7s var(--ease), opacity 1s var(--ease);
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  transform: translateY(16px);
}
.shot img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 1.3s var(--ease), opacity .6s ease;
  opacity: 0;
}
.shot img.ready { opacity: 1; }
.shot.in { opacity: 1; transform: none; }
.shot:hover, .shot:focus-visible {
  transform: translateY(-7px);
  box-shadow:
    0 26px 46px -24px rgba(18, 12, 46, .45),
    0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}
.shot:hover img { transform: scale(1.04); }

.shot-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 34px 12px 11px;
  font-size: 11.5px;
  letter-spacing: .01em;
  color: #fff;
  text-align: left;
  background: linear-gradient(transparent, rgba(0, 0, 0, .62));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .45s var(--ease-io), transform .45s var(--ease);
  pointer-events: none;
}
.shot:hover .shot-cap, .shot:focus-visible .shot-cap { opacity: 1; transform: none; }

/* ══════════════════════════════════════════════════════════════════════════
   CRAFT (dark)
   ══════════════════════════════════════════════════════════════════════════ */
.dark-section {
  position: relative;
  background: #06060A;
  color: #F5F5F7;
  overflow: hidden;
  isolation: isolate;
}

.craft { padding: clamp(80px, 10vw, 150px) 0 clamp(70px, 8vw, 110px); }
.craft-glow {
  position: absolute;
  left: 50%; top: -30%;
  width: 120%; height: 90%;
  transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(108, 99, 255, .26), rgba(79, 195, 247, .08) 45%, transparent 70%);
  filter: blur(30px);
  pointer-events: none;
  z-index: 0;
}
.craft .wrap { position: relative; z-index: 1; }

.craft-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(36px, 5vw, 64px);
  border-radius: clamp(20px, 2.4vw, 28px);
  overflow: hidden;
  background: rgba(255, 255, 255, .09);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), 0 40px 80px -50px rgba(0, 0, 0, .9);
}
.craft-card {
  position: relative;
  padding: clamp(26px, 3.4vw, 44px);
  background: #09090E;
  transition: background .55s var(--ease-io);
  overflow: hidden;
}
.craft-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(155, 140, 255, .5), transparent);
  opacity: 0;
  transition: opacity .55s;
}
.craft-card:hover { background: #0D0D15; }
.craft-card:hover::after { opacity: 1; }
.craft-icon {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  margin-bottom: clamp(18px, 2.4vw, 26px);
  background: linear-gradient(150deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .02));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset, 0 8px 18px -10px rgba(0, 0, 0, .8);
}
.craft-icon svg {
  width: 21px; height: 21px;
  fill: none;
  stroke: #B4AAFF;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.craft-card:nth-child(2) .craft-icon svg { stroke: #8FD5FF; }
.craft-card:nth-child(3) .craft-icon svg { stroke: #F5B8DA; }
.craft-card:nth-child(4) .craft-icon svg { stroke: #9CE6C4; }
.craft-card h3 {
  margin: 0 0 10px;
  font-size: clamp(16px, 1.35vw, 19px);
  font-weight: 600;
  letter-spacing: -.01em;
}
.craft-card p {
  margin: 0;
  font-size: clamp(13.5px, 1.1vw, 14.5px);
  line-height: 1.8;
  color: rgba(255, 255, 255, .5);
}

/* ── end ────────────────────────────────────────────────────────────────── */
.end {
  padding: clamp(70px, 9vw, 130px) 0 clamp(34px, 4vw, 48px);
  border-top: 1px solid rgba(255, 255, 255, .08);
  text-align: center;
}
.end-title {
  margin: 0;
  font-size: clamp(34px, 5.4vw, 76px);
  line-height: 1.06;
  font-weight: 620;
  letter-spacing: -.045em;
}
.grad-end {
  background: linear-gradient(100deg, #8E86FF, #F0A6D8 40%, #7FD4FF 70%, #8E86FF);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: flow 26s var(--ease-io) infinite;
}
.end-sub {
  margin: clamp(18px, 2.4vw, 26px) auto 0;
  max-width: 460px;
  font-size: clamp(14px, 1.2vw, 15.5px);
  line-height: 1.8;
  color: rgba(255, 255, 255, .55);
}
.end-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: clamp(30px, 4vw, 44px);
  flex-wrap: wrap;
}
.btn-light { background: #F5F5F7; color: #1D1D1F; }
.btn-light:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(255, 255, 255, .4); }
.btn-outline { border-color: rgba(255, 255, 255, .22); color: #F5F5F7; }
.btn-outline:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .4); }

.end-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(56px, 7vw, 90px);
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 11px;
  letter-spacing: .06em;
  color: rgba(255, 255, 255, .38);
  text-align: left;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════════════════════════════════════ */
.lb {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s var(--ease-io), visibility .4s;
}
.lb.open { opacity: 1; visibility: visible; }

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 8, .92);
  -webkit-backdrop-filter: blur(30px) saturate(115%);
  backdrop-filter: blur(30px) saturate(115%);
}

.lb-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(14px, 2.4vw, 26px) clamp(16px, 3vw, 32px);
  z-index: 4;
  color: rgba(255, 255, 255, .72);
}
.lb-meta { display: flex; align-items: baseline; gap: 14px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.lb-project { color: #fff; font-weight: 600; }
.lb-count { color: rgba(255, 255, 255, .45); font-variant-numeric: tabular-nums; }

.lb-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .3s, transform .4s var(--ease);
}
.lb-icon:hover { background: rgba(255, 255, 255, .16); transform: rotate(90deg); }
.lb-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.lb-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: clamp(38px, 4.4vw, 54px);
  height: clamp(38px, 4.4vw, 54px);
  margin-top: -27px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .05);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .3s, transform .45s var(--ease), opacity .3s;
}
.lb-arrow:hover { background: rgba(255, 255, 255, .16); }
.lb-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lb-prev { left: clamp(10px, 2.6vw, 34px); }
.lb-next { right: clamp(10px, 2.6vw, 34px); }
.lb-prev:hover { transform: translateX(-3px); }
.lb-next:hover { transform: translateX(3px); }

.lb-figure {
  position: relative;
  z-index: 3;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 60px 70px 84px;
  transform: scale(.965) translateY(10px);
  opacity: 0;
  transition: transform .55s var(--ease), opacity .45s var(--ease-io);
}
.lb.open .lb-figure { transform: none; opacity: 1; }

.lb-frame img {
  display: block;
  max-height: min(70vh, 900px);
  max-width: min(46vw, 440px);
  width: auto;
  height: auto;
  border-radius: 18px;
  background: #12121A;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .1);
}

.lb-cap {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, .55);
}
.lb-cap strong { color: #fff; font-weight: 500; letter-spacing: .02em; }
.lb-hint { font-size: 10.5px; letter-spacing: .12em; color: rgba(255, 255, 255, .34); }

.lb-strip {
  position: absolute;
  bottom: clamp(10px, 2vw, 20px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 6px;
  max-width: min(88vw, 720px);
  padding: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: 999px;
}
.lb-strip::-webkit-scrollbar { display: none; }
.lb-strip button {
  flex: none;
  width: 30px; height: 56px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, .08);
  opacity: .42;
  cursor: pointer;
  transition: opacity .3s, transform .4s var(--ease);
}
.lb-strip button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-strip button:hover { opacity: .8; }
.lb-strip button.active { opacity: 1; transform: translateY(-3px); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .85); }

/* ══════════════════════════════════════════════════════════════════════════
   REVEAL / MOTION
   ══════════════════════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1180px) {
  .gal { columns: 4; }
}

/* short laptop screens: pull the composition up so more of the phones shows */
@media (min-width: 900px) and (max-height: 830px) {
  .hero { padding-top: calc(var(--nav-h) + 30px); }
  .hero-title { font-size: clamp(36px, 5.6vw, 76px); }
  .hero-stats { margin-top: 22px; }
  .hero-stage { margin-top: 22px; }
  .phone-a { width: clamp(168px, 17.5vw, 214px); }
  .scroll-cue { margin-top: 20px; }
}

@media (max-width: 1024px) {
  .chap-grid { grid-template-columns: 1fr; gap: 22px; align-items: start; }
  .row { grid-template-columns: 44px minmax(0, 1fr) minmax(0, .9fr) 30px; }
  .row-count { display: none; }
}

@media (max-width: 820px) {
  :root { --nav-h: 54px; }
  body { font-size: 16px; }
  .nav-links { display: none; }
  .nav-cta { height: 30px; padding: 0 12px; font-size: 11.5px; }
  .nav-cta svg { display: none; }

  .row { grid-template-columns: 36px minmax(0, 1fr) 30px; padding-left: 4px; }
  .row-sub { display: none; }
  .row:hover { padding-left: 12px; }
  .row-title small { display: block; margin: 4px 0 0; }

  .stage { padding: 20px 14px 16px; }
  .stage-phone.side-l, .stage-phone.side-r { display: none; }
  .stage-phone.main { width: min(62%, 240px); }
  .stage-bot { font-size: 11px; }
  .stage-top { font-size: 9px; letter-spacing: .16em; }

  .gal { columns: 3; column-gap: 8px; }
  .shot { margin-bottom: 8px; }

  .craft-grid { grid-template-columns: 1fr; }
  .end-foot { flex-direction: column; gap: 8px; }

  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
  .lb-frame img { max-width: 78vw; max-height: 66vh; }
  .lb-figure { padding: 56px 12px 78px; }
  .lb-hint { display: none; }
}

@media (max-width: 560px) {
  .hero-stats { gap: 20px; }
  .hero-actions .btn { height: 44px; }
  .phone-b, .phone-c { display: none; }
  .hero-stage { padding-bottom: 4px; }
  .phone-a { width: min(58vw, 240px); }
  .stage-aura { height: 240px; }
  .chap-top { letter-spacing: .16em; font-size: 9.5px; }
  .work-note { font-size: 11.5px; }
  .stage-phones { padding: 12px 0; }
  .stage-bot .stage-btn { height: 30px; padding: 0 12px; font-size: 11px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero-title .grad, .grad-end { background-position: 0 50%; }
}