/* 김도영 포트폴리오 — a butterfly (after SK's happiness wings) flies from night to sunrise
   through eight projects. Sky, flight line and butterfly are drawn by js/*.js. */

@property --r {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 0%;
}

@property --spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

:root {
  --text: #f6f1ea;
  --muted: rgba(246, 241, 234, 0.72);
  --faint: rgba(246, 241, 234, 0.45);
  --line: rgba(255, 255, 255, 0.12);
  --glass: rgba(18, 16, 40, 0.42);
  --or: #ff8a1f;
  --or-l: #ffc46b;
  --rd: #e8112d;
  --rd-l: #ff5a45;
  --grad: linear-gradient(100deg, #ffe0a8 0%, #ffb25c 22%, #ff7a1a 48%, #ff3d4d 76%, #e8112d 100%);
  --sky-top: #060a1c;
  --sky-mid: #0b1230;
  --sky-bot: #1a1c48;
  --night: 1;
  --sun: 0;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", system-ui, sans-serif;
  color-scheme: dark;
}

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

html {
  background: #060a1c;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: relative;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

p,
dd,
li {
  text-wrap: pretty;
}

:focus-visible {
  outline: 3px solid var(--or-l);
  outline-offset: 3px;
}

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

.skip {
  position: fixed;
  z-index: 60;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #fff;
  color: #1a0f14;
  font-weight: 800;
  font-size: 0.85rem;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip:focus {
  transform: none;
}

/* ============ sky ============ */

.sky {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.sky-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 52%, var(--sky-bot) 100%);
}

.sky-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.aurora {
  position: absolute;
  inset: -20%;
  opacity: calc(0.35 + var(--night) * 0.4);
}

.aurora i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(70px);
  mix-blend-mode: screen;
  will-change: transform;
}

.aurora i:nth-child(1) {
  top: 8%;
  left: 52%;
  width: 46vw;
  height: 32vw;
  background: radial-gradient(closest-side, rgba(255, 122, 26, 0.34), transparent);
  animation: drift-a 26s ease-in-out infinite alternate;
}

.aurora i:nth-child(2) {
  top: 40%;
  left: 4%;
  width: 40vw;
  height: 36vw;
  background: radial-gradient(closest-side, rgba(232, 17, 45, 0.26), transparent);
  animation: drift-b 31s ease-in-out infinite alternate;
}

.aurora i:nth-child(3) {
  top: 62%;
  left: 58%;
  width: 36vw;
  height: 30vw;
  background: radial-gradient(closest-side, rgba(120, 90, 255, 0.22), transparent);
  animation: drift-a 37s ease-in-out infinite alternate-reverse;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-8vw, 6vh, 0) scale(1.18); }
}

@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.1); }
  to { transform: translate3d(9vw, -7vh, 0) scale(0.92); }
}

.sun {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(120vw, 1500px);
  aspect-ratio: 1;
  opacity: var(--sun);
  transform: translate3d(-50%, calc(78% - var(--sun) * 36%), 0);
  will-change: transform, opacity;
}

.sun i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgba(255, 244, 214, 0.95) 0%,
    rgba(255, 196, 107, 0.85) 16%,
    rgba(255, 122, 26, 0.55) 34%,
    rgba(232, 17, 45, 0.22) 56%,
    transparent 72%
  );
}

/* ============ flight line ============ */

.flightpath {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  overflow: visible;
  pointer-events: none;
}

.fp {
  fill: none;
  stroke: url(#fpGrad);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fp-glow {
  stroke-width: 16;
  opacity: 0.12;
}

.fp-mid {
  stroke-width: 5;
  opacity: 0.4;
}

.fp-core {
  stroke-width: 1.8;
  opacity: 0.95;
}

/* ============ rail ============ */

.rail {
  position: fixed;
  z-index: 40;
  top: 50%;
  right: clamp(12px, 2vw, 28px);
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 400ms ease;
}

.rail[data-on="true"] {
  opacity: 1;
}

.rail ol {
  position: relative;
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-line {
  position: absolute;
  top: 6px;
  bottom: 6px;
  right: 6px;
  width: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
}

.rail-line i {
  position: absolute;
  inset: 0 0 auto;
  height: calc(var(--rail, 0) * 100%);
  border-radius: inherit;
  background: linear-gradient(180deg, var(--or-l), var(--rd));
  box-shadow: 0 0 10px rgba(255, 122, 26, 0.8);
}

.rail a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 14px;
  text-decoration: none;
}

.rail a::after {
  content: "";
  width: 14px;
  height: 14px;
  flex: none;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: #0c0d24;
  transition: transform 220ms ease, background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.rail a span {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(10, 10, 30, 0.6);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.rail a:hover span,
.rail a:focus-visible span,
.rail a[aria-current] span {
  opacity: 1;
  transform: none;
}

.rail a[data-done="true"]::after {
  border-color: var(--or);
  background: var(--or);
}

.rail a[aria-current]::after {
  border-color: #fff;
  background: var(--grad);
  box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.25), 0 0 16px rgba(255, 122, 26, 0.9);
  transform: scale(1.25);
}

/* ============ shared type ============ */

main {
  position: relative;
  z-index: 2;
  overflow-x: clip;
}

.kicker {
  margin: 0;
  color: var(--or-l);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* hero kicker: 30% larger than other kickers, brand casing kept (SK hynix) */
.hero-kicker {
  font-size: 1.04rem;
  letter-spacing: 0.04em;
  text-transform: none;
}

.grad-text {
  background: var(--grad);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 6s ease-in-out infinite alternate;
}

@keyframes sheen {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px 0 8px;
  border: 0;
  border-radius: 999px;
  background: #fff6ea;
  color: #1b1014;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.14), 0 16px 36px -18px rgba(255, 140, 60, 0.8);
  transition: box-shadow 260ms ease;
}

.btn::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 196, 107, 0.45), transparent);
  transform: skewX(-18deg);
  transition: left 700ms ease;
}

.btn:hover::after {
  left: 130%;
}

.btn-ico {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1b1014;
  color: #ffc46b;
}

.btn small {
  color: rgba(27, 16, 20, 0.5);
  font-size: 0.74rem;
  font-weight: 700;
}

.btn--big {
  min-height: 58px;
  padding: 0 26px 0 10px;
  font-size: 1rem;
}

.btn--big .btn-ico {
  width: 40px;
  height: 40px;
}

[data-magnet] {
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 200ms ease;
}

/* ============ hero ============ */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 72px clamp(20px, 5vw, 72px) 80px;
}

.hero h1 {
  margin: 22px 0 26px;
  font-size: clamp(2.6rem, 5.2vw, 4.9rem);
  font-weight: 880;
  line-height: 1.1;
  letter-spacing: -0.05em;
}

.hero h1 > span {
  display: block;
  white-space: nowrap;
}

/* the chef line crackles (지직) and drops out; "AI 전문가" takes its place */
.hero h1 > .hero-swap {
  display: grid;
}

.hero-swap > span {
  display: block;
  grid-area: 1 / 1;
  white-space: nowrap;
}

.hero-to {
  --d: 1900ms;
  padding-bottom: 0.06em;
}

:root:not([data-motion="on"]) .hero-from {
  display: none;
}

.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.glitch::before {
  color: #ff3d6e;
}

.glitch::after {
  color: #3de4ff;
}

[data-motion="on"] .hero-from.in {
  animation: glitch-out 820ms steps(1, end) 1250ms forwards;
}

[data-motion="on"] .hero-from.in::before {
  animation: slice-a 820ms steps(1, end) 1250ms forwards;
}

[data-motion="on"] .hero-from.in::after {
  animation: slice-b 820ms steps(1, end) 1250ms forwards;
}

[data-motion="on"] .hero-to.in::before {
  animation: slice-a 480ms steps(1, end) 1850ms forwards;
}

[data-motion="on"] .hero-to.in::after {
  animation: slice-b 480ms steps(1, end) 1850ms forwards;
}

@keyframes glitch-out {
  0% { transform: translate(2px, 0) skewX(-8deg); opacity: 1; }
  12% { transform: translate(-3px, 1px) skewX(5deg); opacity: 0.5; }
  25% { transform: translate(1px, -1px); opacity: 1; }
  37% { transform: translate(-4px, 0) skewX(-4deg); opacity: 0.35; }
  50% { transform: translate(3px, 1px); opacity: 0.8; }
  62% { transform: translate(-2px, 0); opacity: 0.2; }
  75% { transform: translate(5px, 0) skewX(6deg); opacity: 0.45; }
  87% { transform: translate(-1px, 0); opacity: 0.1; }
  100% { transform: none; opacity: 0; visibility: hidden; }
}

@keyframes slice-a {
  0% { opacity: 0.9; clip-path: inset(8% 0 72% 0); transform: translate(-6px, 0); }
  14% { clip-path: inset(58% 0 18% 0); transform: translate(7px, 0); }
  28% { clip-path: inset(30% 0 48% 0); transform: translate(-9px, 0); }
  42% { clip-path: inset(78% 0 6% 0); transform: translate(5px, 0); }
  57% { clip-path: inset(2% 0 86% 0); transform: translate(-4px, 0); }
  71% { clip-path: inset(44% 0 34% 0); transform: translate(8px, 0); }
  85% { clip-path: inset(20% 0 62% 0); transform: translate(-3px, 0); }
  100% { opacity: 0; clip-path: inset(0 0 100% 0); transform: none; }
}

@keyframes slice-b {
  0% { opacity: 0.85; clip-path: inset(64% 0 14% 0); transform: translate(6px, 0); }
  14% { clip-path: inset(12% 0 70% 0); transform: translate(-8px, 0); }
  28% { clip-path: inset(82% 0 2% 0); transform: translate(5px, 0); }
  42% { clip-path: inset(36% 0 40% 0); transform: translate(-6px, 0); }
  57% { clip-path: inset(52% 0 26% 0); transform: translate(9px, 0); }
  71% { clip-path: inset(6% 0 80% 0); transform: translate(-5px, 0); }
  85% { clip-path: inset(70% 0 10% 0); transform: translate(4px, 0); }
  100% { opacity: 0; clip-path: inset(0 0 100% 0); transform: none; }
}

.hero-lede {
  max-width: 34em;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.4vw, 1.22rem);
  line-height: 1.75;
}

.hero-proof {
  margin-top: 12px;
  color: rgba(255, 248, 238, 0.94);
  font-weight: 650;
}

.cue {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 40px;
  padding: 12px 20px 12px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.cue-mouse {
  position: relative;
  width: 22px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
}

.cue-mouse i {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 4px;
  height: 7px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--or-l);
  animation: cue 1.6s ease-in-out infinite;
}

@keyframes cue {
  0% { opacity: 0; transform: translateY(-2px); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(10px); }
}

.hero-stage {
  position: relative;
  align-self: stretch;
  min-height: 420px;
}

.hero-halo {
  position: absolute;
  top: 46%;
  left: 50%;
  width: min(420px, 36vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 150, 60, 0.28), rgba(232, 17, 45, 0.08) 60%, transparent);
  transform: translate(-50%, -50%);
}

.fly {
  position: absolute;
  left: var(--fx);
  top: var(--fy);
  width: 0;
  height: 0;
  pointer-events: none;
}

/* ============ projects ============ */

.proj {
  --accent: #ffc857;
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: 16vh clamp(20px, 5vw, 72px);
}

.proj-inner {
  width: min(1220px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(36px, 6vw, 96px);
}

.proj.is-flip .proj-inner {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
}

.proj.is-flip .visual {
  order: 2;
}

.proj.is-flip .fly {
  left: calc(100% - var(--fx));
}

.bignum {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: 1vw;
  color: transparent;
  font-size: clamp(10rem, 30vw, 28rem);
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.06em;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.14);
  transform: translate3d(0, calc(-86% + var(--par, 0) * 140px), 0);
  pointer-events: none;
  user-select: none;
}

/* the number sits on the copy side, so the image or phone never covers it */
.proj.is-flip .bignum {
  right: auto;
  left: 1vw;
}

.proj.is-landed .bignum {
  -webkit-text-stroke-color: color-mix(in srgb, var(--accent) 52%, transparent);
  transition: -webkit-text-stroke-color 900ms ease;
}

.visual {
  position: relative;
  margin: 0;
}

.frame {
  --lx: 16%;
  --ly: 0%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 26px;
  background: #0d0e22;
  box-shadow:
    0 40px 90px -40px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: perspective(1100px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 900ms ease;
}

/* spinning conic rim in the project colour */
.frame::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--spin), transparent 0 55%, var(--accent) 70%, #fff 76%, var(--or) 82%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  animation: spin 5s linear infinite;
  transition: opacity 800ms ease;
  pointer-events: none;
}

/* pointer glare */
.frame::after {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.18), transparent 46%);
  opacity: var(--glare, 0);
  transition: opacity 300ms ease;
  pointer-events: none;
}

@keyframes spin {
  to { --spin: 360deg; }
}

.proj.is-landed .frame::before {
  opacity: 1;
}

.proj.is-landed .frame {
  box-shadow:
    0 40px 90px -40px rgba(0, 0, 0, 0.9),
    0 0 70px -20px color-mix(in srgb, var(--accent) 70%, transparent),
    0 0 0 1px rgba(255, 255, 255, 0.12);
}

.frame img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  filter: saturate(0.25) brightness(0.62);
  transform: scale(1.06);
  transition: filter 1200ms ease, transform 1600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.proj.is-landed .frame img {
  filter: none;
  transform: none;
}

/* real app screens: show the whole capture, no crop */
/* real screenshots keep their own ratio (set per image as --ar) so space is reserved before lazy load */
.frame--ui img {
  aspect-ratio: var(--ar, 16 / 10);
  height: auto;
  object-fit: contain;
  transform: none;
}

.phone-screen img.fit {
  object-fit: contain;
  background: #e9e5df;
}

/* the butterfly lands, and colour spreads out from where it touched */
.frame-veil {
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--lx) var(--ly), transparent var(--r), rgba(6, 8, 24, 0.66) calc(var(--r) + 22%));
  transition: --r 1400ms cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.proj.is-landed .frame-veil {
  --r: 170%;
}

.note {
  position: absolute;
  z-index: 5;
  right: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(8, 8, 20, 0.6);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.64rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visual-cap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--faint);
  font-size: 0.78rem;
  font-weight: 600;
}

.copy {
  position: relative;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.tag b {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #120a0c;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.title {
  margin: 18px 0 16px;
  font-size: clamp(2.3rem, 4.6vw, 4.4rem);
  font-weight: 880;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.proj.is-landed .title {
  animation: title-glow 1800ms ease 150ms both;
}

@keyframes title-glow {
  0% { text-shadow: 0 0 0 transparent; }
  35% { text-shadow: 0 0 34px var(--accent), 0 0 70px color-mix(in srgb, var(--accent) 60%, transparent); }
  100% { text-shadow: 0 0 22px color-mix(in srgb, var(--accent) 38%, transparent); }
}

.lead {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.1rem, 1.5vw, 1.32rem);
  font-weight: 650;
  line-height: 1.55;
}

.body {
  max-width: 36em;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(0.96rem, 1.15vw, 1.04rem);
  line-height: 1.8;
}

.nums {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0 0;
}

.nums--one {
  grid-template-columns: minmax(0, 1fr);
}

.nums > div {
  position: relative;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.nums dt {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  font-weight: 880;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.nums dt > span:not(.rotator):not(.sr-only) {
  background: linear-gradient(100deg, #fff, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nums dt small.pre {
  margin-right: 4px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
}

.nums dt small {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.nums dd {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.45;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

/* ============ one spot, words take turns ============ */

.rotator {
  position: relative;
  display: inline-block;
  height: 1.45em;
  vertical-align: -0.34em;
  overflow: hidden;
  transition: width 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.rotator::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.08em;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
  opacity: 0.8;
}

.rot-word {
  position: absolute;
  top: 0;
  left: 0;
  line-height: 1.45em;
  font-weight: 800;
  white-space: nowrap;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: translateY(100%);
  transition: transform 560ms cubic-bezier(0.22, 1, 0.36, 1), opacity 360ms ease;
}

.rot-word.is-on {
  position: relative;
  opacity: 1;
  transform: none;
}

.rot-word.is-out {
  opacity: 0;
  transform: translateY(-100%);
}

.body .rotator {
  margin-left: 0.12em;
  font-size: 1.08em;
}

/* word + particle: only the word glows, the particle stays plain */
.rotator--josa::after {
  display: none;
}

.rotator--josa .rot-word {
  background: none;
  color: var(--muted);
  font-weight: 600;
}

.rotator--josa .rot-word b {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  box-shadow: inset 0 -2px 0 rgba(255, 138, 31, 0.85);
}

.rotator--num {
  font-size: clamp(1.3rem, 2vw, 1.75rem);
  letter-spacing: -0.03em;
}

.rotator--num::after {
  display: none;
}

.num-rotate dt {
  min-height: clamp(1.9rem, 3vw, 2.7rem);
  align-items: center;
}

/* ============ QR tiles (instead of store buttons) ============ */

.qrs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-top: 26px;
}

.qr {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  width: 124px;
  padding: 9px 9px 8px;
  border-radius: 18px;
  background: #fff;
  color: #1b1014;
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 22px 44px -22px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.5);
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 360ms ease;
}

.qr::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -2px;
  border-radius: 20px;
  background: conic-gradient(from var(--spin), #ffc46b, #ff7a1a, #e8112d, #ff7a1a, #ffc46b);
  opacity: 0;
  filter: blur(10px);
  animation: spin 4s linear infinite;
  transition: opacity 360ms ease;
}

.qr img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* ============ phone (JinJJa-K real screens) ============ */

.visual--phone {
  display: grid;
  justify-items: center;
}

.phone {
  position: relative;
  isolation: isolate;
  display: block;
  width: min(100%, 330px, 36svh);
  aspect-ratio: 390 / 832;
  margin: 0;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 14.6% / 6.85%;
  background: linear-gradient(145deg, #77787b 0%, #1b1b1d 16%, #09090a 55%, #3b3b3e 86%, #76777a 100%);
  box-shadow: 0 50px 90px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.5);
  color: inherit;
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  transition: box-shadow 900ms ease;
}

.proj.is-landed .phone {
  box-shadow: 0 50px 90px -40px rgba(0, 0, 0, 0.9), 0 0 90px -10px rgba(255, 200, 87, 0.55);
}

.phone::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 3px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14% / 6.6%;
  pointer-events: none;
}

.phone-btn {
  position: absolute;
  z-index: -1;
  width: 4px;
  border-radius: 3px;
  background: #2d2d30;
}

.phone-btn--a { top: 15.6%; left: -3px; height: 3.8%; }
.phone-btn--b { top: 21.8%; left: -3px; height: 6.9%; }
.phone-btn--c { top: 30%; left: -3px; height: 6.9%; }
.phone-btn--d { top: 24.2%; right: -3px; height: 10.9%; }

.phone-screen {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 13.1% / 6%;
  background: #0d0e22;
}

.phone-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 420ms ease, transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.phone-screen img.is-on {
  opacity: 1;
  transform: none;
}

.phone .frame-veil {
  --lx: 30%;
  --ly: 0%;
  inset: 7px;
  border-radius: 13.1% / 6%;
}

.dots {
  display: inline-flex;
  gap: 5px;
}

.dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  transition: width 240ms ease, background 240ms ease;
}

.dots i.is-on {
  width: 18px;
  background: var(--or-l);
}

.ripple {
  position: absolute;
  z-index: 4;
  width: 70px;
  height: 70px;
  margin: -35px 0 0 -35px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 87, 0.8), rgba(255, 122, 26, 0.3) 60%, transparent 70%);
  pointer-events: none;
  animation: ripple 600ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes ripple {
  from { opacity: 1; transform: scale(0.2); }
  to { opacity: 0; transform: scale(1.8); }
}

/* ============ film ============ */

.proj--film {
  display: block;
  padding-top: 18vh;
  padding-bottom: 18vh;
}

.film-head,
.film-body {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.film-head {
  text-align: center;
}

.film-head .lead {
  max-width: 32em;
  margin: 0 auto;
}

.visual--screen {
  width: min(1100px, 100%);
  margin: 56px auto 0;
}

.projector {
  position: absolute;
  z-index: -1;
  top: -46%;
  left: 50%;
  width: 150%;
  height: 150%;
  background: conic-gradient(from 180deg at 50% 0%, transparent 160deg, rgba(255, 214, 150, 0.14) 172deg, rgba(255, 234, 200, 0.22) 180deg, rgba(255, 214, 150, 0.14) 188deg, transparent 200deg);
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 1200ms ease;
  pointer-events: none;
}

.proj--film.is-landed .projector {
  opacity: 1;
}

.frame--screen {
  border-radius: 18px;
  aspect-ratio: 16 / 9;
}

.frame--screen .frame-veil {
  --lx: 50%;
  --ly: 0%;
}

.film-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
  filter: saturate(0.3) brightness(0.6);
  transition: filter 1200ms ease;
}

.proj.is-landed .film-video {
  filter: none;
}

.film-big {
  position: absolute;
  z-index: 6;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  padding: 0 0 0 5px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 246, 234, 0.92);
  color: #1b1014;
  box-shadow: 0 0 0 10px rgba(255, 246, 234, 0.14), 0 20px 50px -10px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: opacity 300ms ease, transform 300ms ease;
}

.frame--screen[data-playing="true"] .film-big {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.8);
}

.film-ui {
  position: absolute;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 36px 16px 14px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.72));
  opacity: 0;
  transition: opacity 300ms ease;
}

.frame--screen:hover .film-ui,
.frame--screen:focus-within .film-ui,
.frame--screen[data-playing="false"][data-started="true"] .film-ui {
  opacity: 1;
}

@media (hover: none) {
  .frame--screen[data-started="true"] .film-ui {
    opacity: 1;
  }
}

.film-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  min-width: 36px;
  justify-content: center;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.film-toggle .i-pause,
.frame--screen[data-playing="true"] .film-toggle .i-play,
.film-sound .i-on,
.film-sound[aria-pressed="true"] .i-off {
  display: none;
}

.frame--screen[data-playing="true"] .film-toggle .i-pause,
.film-sound[aria-pressed="true"] .i-on {
  display: block;
}

.film-bar {
  position: relative;
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
}

.film-bar::before {
  content: "";
  position: absolute;
  inset: -10px 0;
}

.film-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  border-radius: inherit;
  background: var(--grad);
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
}

.film-time {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.grain {
  position: absolute;
  z-index: 3;
  inset: -50%;
  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%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.06;
  mix-blend-mode: overlay;
  animation: grain 0.9s steps(6) infinite;
  pointer-events: none;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); }
  60% { transform: translate(-6%, -2%); }
  80% { transform: translate(5%, 4%); }
  100% { transform: translate(0, 0); }
}

.film-body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  grid-template-areas: "body nums" "flow flow" "rules links";
  gap: 22px 56px;
  margin-top: 48px;
}

.film-body .body {
  grid-area: body;
  margin: 0;
}

.film-body .nums {
  grid-area: nums;
  margin: 0;
  align-self: start;
}

.rules-box {
  grid-area: rules;
}

.rules-title {
  margin: 0 0 8px;
  color: var(--faint);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

/* production flow: eight steps light up in order */
.flow {
  grid-area: flow;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 6px;
  margin: 4px 0 6px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.flow li {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  counter-increment: step;
  transition: color 400ms ease, border-color 400ms ease, background-color 400ms ease, box-shadow 400ms ease;
  transition-delay: calc(var(--i, 0) * 160ms);
}

.flow li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 850;
}

.flow li + li {
  margin-left: 16px;
}

.flow li + li::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -17px;
  width: 12px;
  height: 1.5px;
  background: linear-gradient(90deg, rgba(255, 196, 107, 0.2), rgba(255, 138, 31, 0.8));
}

.flow.in li {
  border-color: rgba(255, 138, 31, 0.55);
  background: rgba(255, 138, 31, 0.1);
  color: var(--text);
  box-shadow: 0 0 22px -8px rgba(255, 122, 26, 0.9);
}

.flow.in li::before {
  background: var(--grad);
  color: #1b1014;
}

.rules {
  display: grid;
  gap: 0;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: rule;
  border-top: 1px solid var(--line);
}

.rules li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 600;
  counter-increment: rule;
}

.rules li::before {
  content: "규칙 " counter(rule);
  flex: none;
  color: var(--or-l);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.film-body .links {
  grid-area: links;
  align-self: start;
  margin-top: 6px;
}

.outro-head {
  position: relative;
}

/* ============ tools + numbers ============ */

.band {
  position: relative;
  padding: 22vh 0 16vh;
  text-align: center;
}

.band-title {
  margin: 0 auto 42px;
  padding: 0 20px;
  font-size: clamp(2rem, 4.4vw, 3.8rem);
  font-weight: 880;
  letter-spacing: -0.045em;
}

.marquee {
  display: grid;
  gap: 14px;
  overflow: hidden;
  -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-row {
  display: flex;
  gap: 14px;
  width: max-content;
  transform: translate3d(var(--mq, 0px), 0, 0) skewX(var(--skew, 0deg));
  will-change: transform;
}

.marquee-row span {
  padding: 14px 26px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.marquee-row--alt span {
  background: transparent;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.55);
}

.marquee-row span:nth-child(3n + 1) {
  border-color: rgba(255, 138, 31, 0.5);
  box-shadow: inset 0 0 24px rgba(255, 122, 26, 0.18);
}

.stats {
  width: min(1100px, calc(100% - 40px));
  margin: 72px auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stats > div {
  padding: 26px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.stats dt {
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.stats dt span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stats dd {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

/* ============ outro ============ */

.outro {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 26vh 20px 0;
  text-align: center;
}

.outro-title {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.05em;
  text-shadow: 0 6px 40px rgba(120, 10, 20, 0.45);
}

/* finale: numbers → 100 people → 1명 → last line (steps added by js/outro.js) */
.outro-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.15em 0.8em;
  margin: 0 0 clamp(64px, 11vh, 110px);
  color: rgba(255, 248, 238, 0.92);
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  font-weight: 800;
}

.os {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22em;
}

.os-n {
  color: #ffd24d;
  font-size: 2.2em;
  font-weight: 900;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 26px rgba(255, 196, 64, 0.35);
}

.os small {
  font-size: 1em;
  font-weight: 750;
}

.outro-stage {
  position: relative;
}

.outro-crowd {
  position: absolute;
  top: -105px;
  left: 50%;
  width: min(1100px, 100vw);
  height: calc(100% + 255px);
  transform: translateX(-50%);
  pointer-events: none;
}

.outro-title {
  position: relative;
}

.outro-l1,
.outro-l2 {
  display: block;
}

.outro-l1 {
  margin-bottom: 0.3em;
  color: rgba(255, 248, 238, 0.94);
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.03em;
}

.outro-100 {
  color: #fff;
  font-weight: 900;
}

/* the sunrise behind the outro is red-orange: solid cream text, only "1명" in gold */
.outro-l2 {
  color: #fff8ee;
  font-size: clamp(2.3rem, 8vw, 5.6rem);
}

.outro-one {
  display: inline-block;
  color: #ffd24d;
  text-shadow: 0 0 30px rgba(255, 196, 64, 0.55), 0 6px 40px rgba(120, 10, 20, 0.45);
}

[data-motion="on"] .outro .os,
[data-motion="on"] .outro-l1,
[data-motion="on"] .outro-l2,
[data-motion="on"] .outro-lede,
[data-motion="on"] .outro-actions {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  filter: blur(8px);
  transition: opacity 700ms ease, transform 900ms cubic-bezier(0.22, 1, 0.36, 1), filter 700ms ease;
}

.outro.is-s1 .os,
.outro.is-s2 .outro-l1,
.outro.is-s3 .outro-l2,
.outro.is-s4 .outro-lede,
.outro.is-s4 .outro-actions {
  opacity: 1;
  transform: none;
  filter: none;
}

.outro.is-s1 .os:nth-child(2) {
  transition-delay: 260ms;
}

.outro.is-s1 .os:nth-child(3) {
  transition-delay: 520ms;
}

.outro.is-s4 .outro-actions {
  transition-delay: 450ms;
}

[data-motion="on"] .outro.is-s3 .outro-one {
  animation: one-pop 1100ms cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

@keyframes one-pop {
  0% { transform: scale(2.4); filter: blur(10px) brightness(2); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: none; filter: none; opacity: 1; }
}

.outro-lede {
  margin: 22px 0 0;
  color: rgba(255, 248, 238, 0.9);
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  font-weight: 600;
  line-height: 1.7;
}

.outro-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 36px;
}

.outro .btn {
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.14), 0 18px 44px -14px rgba(120, 20, 10, 0.7);
}

.foot {
  align-self: end;
  width: 100%;
  margin-top: 14vh;
  padding: 18px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  color: rgba(92, 22, 18, 0.72);
  font-size: 0.82rem;
  font-weight: 700;
}

.foot p {
  margin: 4px 0;
}

/* ============ butterfly ============ */

.flyer-layer {
  position: absolute;
  z-index: 30;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}

.bf {
  --s: 120px;
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  perspective: 700px;
  will-change: transform;
}

.bf[data-mode="intro"] .bf-rig {
  opacity: 0;
  transform: rotate(var(--hd, 0deg)) rotateX(var(--tilt, 16deg)) scale(0.6);
}

.bf[data-mode="fly"] .bf-rig {
  animation: bf-pop 800ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes bf-pop {
  from { scale: 0.35; }
  to { scale: 1; }
}

.bf-rig {
  position: absolute;
  left: calc(var(--s) * -0.5);
  top: calc(var(--s) * -0.3);
  width: var(--s);
  height: calc(var(--s) * 0.6);
  transform-style: preserve-3d;
  transform: rotate(var(--hd, 0deg)) rotateX(var(--tilt, 16deg));
  transition: opacity 500ms ease;
  cursor: pointer;
  pointer-events: auto;
}

/* while it follows the pointer it never catches clicks meant for the page */
.bf[data-follow="on"] .bf-rig {
  pointer-events: none;
}

.bf-wing {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
}

.bf-wing svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 7px rgba(255, 110, 40, 0.7));
}

.bf-wing--r {
  left: 50%;
  transform-origin: 0 50%;
  transform: rotateY(calc(var(--flap, 30deg) * -1));
}

.bf-wing--l {
  right: 50%;
  transform-origin: 100% 50%;
  transform: rotateY(var(--flap, 30deg));
}

.bf-wing--l svg {
  transform: scaleX(-1);
}

.bf-body {
  position: absolute;
  left: 50%;
  top: 20%;
  width: 9%;
  height: 76%;
  transform: translate3d(-50%, 0, 2px);
}

.bf-body svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.bf-glow {
  position: absolute;
  left: calc(var(--s) * -1.1);
  top: calc(var(--s) * -1.1);
  width: calc(var(--s) * 2.2);
  height: calc(var(--s) * 2.2);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 160, 70, 0.42), rgba(255, 60, 60, 0.12) 55%, transparent);
  opacity: var(--glow, 0.8);
  pointer-events: none;
}

.fx-front {
  position: fixed;
  z-index: 31;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ============ reveal + split text ============ */

[data-motion="on"] [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  filter: blur(6px);
}

[data-motion="on"] [data-reveal].in {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 900ms ease, transform 900ms cubic-bezier(0.22, 1, 0.36, 1), filter 900ms ease;
  transition-delay: var(--d, 0ms);
}

.ch {
  display: inline-block;
  white-space: pre;
}

[data-motion="on"] [data-split] .ch {
  opacity: 0;
  transform: translate3d(0, 0.6em, 0) rotate(8deg);
  filter: blur(8px);
}

[data-motion="on"] [data-split].in .ch {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 700ms ease, transform 900ms cubic-bezier(0.22, 1, 0.36, 1), filter 700ms ease;
  transition-delay: calc(var(--i) * 28ms + var(--d, 0ms));
}

/* gradient text keeps its fill per character */
.grad-text .ch {
  background: var(--grad);
  background-size: calc((var(--n) + 1) * 100%) 100%;
  background-position: calc(var(--i) / var(--n) * 100%) 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.grad-text {
  animation: none;
}


/* ============ responsive ============ */

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.14), 0 0 0 4px rgba(255, 196, 107, 0.22), 0 18px 44px -14px rgba(255, 110, 40, 0.95);
  }

  .qr:hover {
    transform: translateY(-5px) rotate(-1.5deg);
  }

  .qr:hover::before {
    opacity: 0.9;
  }

  .film-btn:hover {
    background: rgba(255, 255, 255, 0.26);
  }
}

@media (max-width: 1100px) {
  .rail {
    display: none;
  }
}

/* while the rail shows and the side margins are narrow, keep the current rail label off the copy */
@media (min-width: 1101px) and (max-width: 1650px) {
  .proj {
    padding-right: calc(clamp(20px, 5vw, 72px) + 140px);
  }

  /* the film block is centred, so it gets the same gutter on both sides */
  .proj--film {
    padding-left: calc(clamp(20px, 5vw, 72px) + 140px);
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: start;
    min-height: 100svh;
    padding-top: calc(48px + env(safe-area-inset-top, 0px));
    padding-bottom: 40px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 9.4vw, 4rem);
  }

  .hero-stage {
    min-height: 300px;
  }

  .hero-halo {
    width: min(78vw, 380px);
  }

  .proj {
    min-height: 0;
    padding: 18vh 20px 14vh;
  }

  .proj-inner,
  .proj.is-flip .proj-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .proj.is-flip .visual {
    order: 0;
  }

  .proj.is-flip .fly {
    left: var(--fx);
  }

  .bignum,
  .proj.is-flip .bignum {
    top: 1vh;
    right: auto;
    left: 3vw;
    font-size: 34vw;
    transform: translate3d(0, calc(var(--par, 0) * 80px), 0);
  }

  .film-body {
    grid-template-columns: 1fr;
    grid-template-areas: "body" "flow" "nums" "rules" "links";
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .qr {
    width: 112px;
  }

  .film-time {
    display: none;
  }

  .film-sound span {
    display: none;
  }

  .film-big {
    width: 64px;
    height: 64px;
  }

  .hero h1 > span {
    white-space: normal;
  }

  .nums {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .nums > div {
    padding: 14px;
  }

  .note {
    font-size: 0.58rem;
  }

  .btn--big {
    width: 100%;
    justify-content: center;
  }

  .outro-actions {
    width: 100%;
    max-width: 360px;
  }
}

/* ============ reduced motion ============ */

@media (prefers-reduced-motion: reduce) {
  .aurora i,
  .grain,
  .qr::before,
  .frame::before,
  .cue-mouse i,
  .grad-text {
    animation: none !important;
  }

  .frame img,
  .proj .frame img {
    filter: none;
    transform: none;
  }

  .frame-veil {
    display: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* film in full screen keeps its controls */
.frame--screen:fullscreen {
  border-radius: 0;
  background: #000;
}

.frame--screen:fullscreen .film-video {
  object-fit: contain;
}

/* ============ sound button ============ */

.snd {
  position: fixed;
  z-index: 45;
  left: clamp(12px, 2vw, 24px);
  bottom: calc(clamp(12px, 2vw, 24px) + env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 15px 0 13px;
  border: 0;
  border-radius: 999px;
  background: rgba(14, 12, 34, 0.55);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 14px 34px -18px rgba(0, 0, 0, 0.8);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 750;
  cursor: pointer;
}

.snd-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.snd-bars i {
  width: 3px;
  height: 4px;
  border-radius: 2px;
  background: var(--or-l);
  transition: height 300ms ease;
}

[data-sound="on"] .snd-bars i {
  animation: snd-bar 900ms ease-in-out infinite alternate;
}

[data-sound="on"] .snd-bars i:nth-child(2) { animation-delay: -300ms; }
[data-sound="on"] .snd-bars i:nth-child(3) { animation-delay: -600ms; }
[data-sound="on"] .snd-bars i:nth-child(4) { animation-delay: -150ms; }

@keyframes snd-bar {
  from { height: 3px; }
  to { height: 14px; }
}

.snd:focus-visible {
  outline: 2px solid var(--or-l);
  outline-offset: 3px;
}

/* ============ small screens: progress + where am I (the rail is hidden there) ============ */

.progress,
.chip-now {
  display: none;
}

@media (max-width: 1100px) {
  .progress {
    position: fixed;
    z-index: 44;
    top: 0;
    left: 0;
    right: 0;
    display: block;
    height: 3px;
    pointer-events: none;
  }

  .progress i {
    display: block;
    height: 100%;
    background: var(--grad);
    transform: scaleX(var(--rail, 0));
    transform-origin: 0 50%;
    box-shadow: 0 0 10px rgba(255, 122, 26, 0.7);
  }

  .chip-now {
    position: fixed;
    z-index: 44;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 50%;
    display: block;
    margin: 0;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(14, 12, 34, 0.62);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 750;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, -8px);
    transition: opacity 300ms ease, transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
  }

  .chip-now.is-on {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  .chip-now b {
    margin-right: 6px;
    color: var(--or-l);
  }
}

/* ============ smooth scrolling (lenis, pointer devices only) ============ */

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
  overflow: hidden;
}
