/* ═══════════════════════════════════════════════════════
   남영동개발추진위원회 — namyeong.dev
   signature mark: the arrow from the team's Instagram
   ═══════════════════════════════════════════════════════ */

@property --sx {
  syntax: '<percentage>';
  initial-value: 100%;
  inherits: false;
}

:root {
  --blue: #0B0C70;
  --blue-deep: #06073F;
  --doumi: #0103C8;
  --red: #DF3134;
  --red-soft: #FF7079;
  --ink: #0C0C0F;
  --paper: #F5F5F7;
  --white: #FFFFFF;
  --text: #1D1D1F;
  --gray: #6E6E73;
  --hairline-dark: rgba(255, 255, 255, 0.1);
  --hairline-light: rgba(0, 0, 0, 0.08);
  --ease: cubic-bezier(0.22, 0.61, 0.21, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --mark-len: 113; /* path length of the arrow, for draw-on */
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    system-ui, 'Apple SD Gothic Neo', 'Segoe UI', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
em { font-style: normal; }

.mono { font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace; }
.pixel { font-family: 'Galmuri11', 'Galmuri9', ui-monospace, monospace; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--blue); color: #fff; }

section { scroll-margin-top: 56px; }

/* ═══════════ The mark ═══════════ */
/* The mark is only ever used large or bleeding off an edge — shown small and
   complete it reads as the numeral 7, which is why it stays out of eyebrows
   and buttons. */
.nav-mark,
.hero-arrow,
.footer-arrow,
.loader-mark {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  height: auto;
  flex: none;
}

/* ═══════════ Loader ═══════════ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--blue);
  display: grid;
  place-content: center;
  color: #fff;
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}

body.loaded .loader { opacity: 0; visibility: hidden; }

.loader-mark { width: clamp(72px, 12vw, 104px); stroke-width: 13.8; }

.loader-mark path {
  stroke-dasharray: 113;
  stroke-dashoffset: 113;
  animation: draw-fly 1.5s var(--ease) infinite;
}

@keyframes draw-fly {
  0%   { stroke-dashoffset: 113; }
  45%  { stroke-dashoffset: 0; }
  55%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -113; }
}

/* ═══════════ Inverting cursor ═══════════ */
/* JS adds .has-cursor on fine-pointer devices; difference blending makes the
   ring pick up the inversion motif the whole page is built on */
.cursor, .cursor-dot { display: none; }

/* the ring replaces the system pointer, so a dot rides along to keep
   aiming precise */
.has-cursor, .has-cursor * { cursor: none; }

.has-cursor .cursor,
.has-cursor .cursor-dot {
  display: grid;
  place-items: center;
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  mix-blend-mode: difference;
  pointer-events: none;
  translate: -50% -50%;
}

.has-cursor .cursor {
  width: 26px;
  height: 26px;
  border: 1.5px solid #fff;
  z-index: 90;
  transition: width 0.4s var(--spring), height 0.4s var(--spring),
    background 0.35s var(--ease), opacity 0.3s ease;
}

.has-cursor .cursor-dot {
  width: 5px;
  height: 5px;
  background: #fff;
  z-index: 91;
  transition: opacity 0.3s ease, scale 0.3s var(--spring);
}

.has-cursor .cursor.on {
  width: 62px;
  height: 62px;
  background: #fff;
}

.has-cursor .cursor.on ~ .cursor-dot { scale: 0; }

.cursor-label {
  font-size: 15px;
  font-weight: 800;
  color: #000;
  opacity: 0;
  scale: 0.4;
  transition: opacity 0.3s var(--ease), scale 0.35s var(--spring);
}

.has-cursor .cursor.link .cursor-label { opacity: 1; scale: 1; }

.has-cursor .cursor.idle,
.has-cursor .cursor.idle ~ .cursor-dot { opacity: 0; }

/* ═══════════ Leaving the site ═══════════ */
/* The clicked control grows into a browser window — same chrome language as
   the Doumi panel's mockup — which loads the destination and then hands over
   to a real tab. JS drives it by writing top/left/width/height straight onto
   .portal-win: these are laid out rather than transformed on purpose, because
   a scale would smear the rounded corners and the chrome inside them. It is
   one fixed element with nothing in flow behind it, so nothing else reflows. */
.portal {
  position: fixed;
  inset: 0;
  z-index: 95;
  /* never blocks the page underneath — the window is a send-off, not a modal */
  pointer-events: none;
  /* tied to .on with no transition of its own: a transitioned visibility can
     be left stranded visible if the tab is throttled mid-fade, and .on outlives
     the fade-out anyway */
  visibility: hidden;
  background: rgba(6, 7, 63, 0);
  transition: background 0.5s var(--ease);
}

.portal.on {
  visibility: visible;
  background: rgba(6, 7, 63, 0.8);
  transition: background 0.55s var(--ease);
}

/* geometry, radius and fill are driven by a Web Animations keyframe pair in
   js/main.js — explicit from/to values, rather than a CSS transition that has
   to guess its start from whatever style flush happened to land first.
   Only the entrance/exit fade stays here. */
.portal-win {
  position: fixed;
  overflow: hidden;
  opacity: 0;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.45);
  transition: opacity 0.18s linear, transform 0.4s var(--ease);
}

.portal.on .portal-win { opacity: 1; }

.portal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid #EFEFF4;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.portal-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #E3E3E8;
  flex: none;
}

.portal-url {
  margin: 0 auto;
  font-size: 12px;
  color: var(--gray);
  background: var(--paper);
  padding: 5px 20px;
  border-radius: 999px;
  max-width: 70%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.portal-body {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
}

.portal-load {
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  width: 0;
  background: var(--doumi);
  transition: width 0.72s cubic-bezier(0.22, 0.8, 0.3, 1);
}

/* the site's mark seeing you out — run off the corner so it stays a mark.
   Shown small and whole it reads as the numeral 7 (see README), which is why
   the body clips it rather than centring it. */
.portal-mark {
  position: absolute;
  right: -16%;
  bottom: 6%;
  width: 66%;
  height: auto;
  fill: none;
  stroke: var(--blue);
  stroke-width: 13.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  translate: 8% 8%;
  transition: opacity 0.45s var(--ease), translate 0.7s var(--ease);
}

/* .grow is set one frame after .on, so the browser has a start state to
   animate away from */
.portal.grow .portal-bar { opacity: 1; transition-delay: 0.3s; }
.portal.grow .portal-load { width: 100%; transition-delay: 0.36s; }
.portal.grow .portal-mark {
  opacity: 0.1;
  translate: 0 0;
  transition-delay: 0.34s;
}

/* handing back: the window drops away rather than folding back into a button
   nobody is looking at any more */
.portal.out { background: rgba(6, 7, 63, 0); }

.portal.out .portal-win {
  opacity: 0;
  transform: translateY(16px) scale(0.985);
}

/* ═══════════ Nav ═══════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 60px;
  padding: 0 max(24px, 4vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  transition: transform 0.45s var(--ease), background 0.4s ease,
    color 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}

.nav--hidden {
  transform: translateY(-110%);
  visibility: hidden; /* keep off-screen links out of the tab order */
  transition: transform 0.45s var(--ease), visibility 0s linear 0.45s;
}

.nav[data-theme-now='dark'] { color: #fff; }
.nav[data-theme-now='light'] { color: var(--text); }

.nav--scrolled[data-theme-now='dark'] {
  background: rgba(11, 12, 60, 0.5);
  border-color: var(--hairline-dark);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.nav--scrolled[data-theme-now='light'] {
  background: rgba(255, 255, 255, 0.65);
  border-color: var(--hairline-light);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.nav-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: currentColor;
  opacity: 0.45;
  transform: scaleX(var(--sp, 0));
  transform-origin: left;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.nav-mark {
  width: 21px;
  stroke-width: 14;
  transition: transform 0.5s var(--spring);
}

.nav-logo:hover .nav-mark { transform: translate(3px, -3px); }

.nav-links {
  position: relative;
  display: flex;
  gap: clamp(18px, 3vw, 36px);
  font-size: 14px;
  font-weight: 600;
}

/* one pill slides between the links instead of each growing its own */
.nav-pill {
  position: absolute;
  top: 50%;
  left: 0;
  height: 30px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
  pointer-events: none;
  translate: 0 -50%;
  transform: translateX(var(--px, 0px));
  width: var(--pw, 0px);
  transition: transform 0.45s var(--ease), width 0.45s var(--ease),
    opacity 0.3s ease;
}

.nav-links:hover .nav-pill { opacity: 0.14; }

.nav-links a {
  position: relative;
  padding: 6px 2px;
  opacity: 0.75;
  transition: opacity 0.25s ease;
  white-space: nowrap;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-insta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px solid currentColor;
  border-radius: 999px;
  opacity: 0.85;
  transition: opacity 0.25s ease, background 0.25s ease;
  white-space: nowrap;
}

.nav-social {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-insta:hover { opacity: 1; }
.nav[data-theme-now='dark'] .nav-insta:hover { background: rgba(255, 255, 255, 0.12); }
.nav[data-theme-now='light'] .nav-insta:hover { background: rgba(0, 0, 0, 0.05); }

/* ═══════════ Buttons ═══════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  /* transparent by default so a bordered variant sitting next to a solid one
     is not 2px taller than it */
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease,
    box-shadow 0.3s ease;
  will-change: transform;
}

.btn-lg { padding: 18px 34px; font-size: 16px; }

.btn-light { background: #fff; color: var(--blue); }
.btn-light:hover { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25); }

.btn-ghost-light {
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
}
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.12); }

.btn-blue { background: var(--doumi); color: #fff; }
.btn-blue:hover { box-shadow: 0 10px 30px rgba(1, 3, 200, 0.35); }

.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { box-shadow: 0 10px 30px rgba(223, 49, 52, 0.35); }

/* 아직 누를 수 없는 것 — 점선이라 버튼이 아니라는 게 형태로 읽힙니다 */
.btn-red-ghost {
  border: 1px dashed rgba(223, 49, 52, 0.55);
  color: var(--red-soft);
  /* cursor 를 여기서 지정하면 .has-cursor * 의 cursor:none 을 덮어써서
     커스텀 커서 위에 OS 커서가 겹쳐 보입니다. span 은 기본이 화살표라 불필요.
     크기도 .btn 그대로 둡니다 — 옆의 App Store 버튼과 높이가 어긋나서요. */
}

/* 스토어 두 개를 한 줄에. .panel-copy > * 의 등장 순서를 흐트러뜨리지 않도록
   버튼을 직계 자식으로 늘리지 않고 이 래퍼 하나로 묶습니다. */
.panel-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* magnetic follow (translate set inline by JS) — every animated property
   stays in one list so the inline value can't drop the others.
   .btn.magnetic outranks .panel-copy > * regardless of source order. */
.btn.magnetic {
  transition: translate 0.45s var(--spring), opacity 0.9s var(--ease),
    transform 0.9s var(--ease), background 0.3s ease, color 0.3s ease,
    border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ═══════════ Hero ═══════════ */
.hero {
  position: relative;
  background: var(--blue);
  color: #fff;
  overflow: hidden;
}

.hero-stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 120px 24px 110px;
}

/* cropped by the left edge, exactly like the Instagram tile —
   the stripe slices across it on its way past */
.hero-arrow {
  position: absolute;
  left: clamp(-250px, -14vw, -70px);
  top: 42%;
  width: clamp(220px, 34vw, 480px);
  stroke-width: 13.8;
  opacity: 0.22;
  z-index: 1;
  translate: 0 calc(var(--hp, 0) * 60px);
}

.hero-arrow path {
  stroke-dasharray: 113;
  stroke-dashoffset: 113;
  transition: stroke-dashoffset 1.7s var(--ease) 0.55s;
}

body.loaded .hero-arrow path { stroke-dashoffset: 0; }

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: clamp(20px, 3.2vh, 34px);
  /* --hp (0→1 across the first viewport) drives the scroll-away parallax;
     it lives on .hero so the stripe clone moves in lockstep */
  transform: translateY(calc(var(--hp, 0) * -70px));
  opacity: calc(1 - var(--hp, 0) * 0.8);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(10px, 1.4vw, 12.5px);
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.85;
}

.hero-eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 5.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.ht-line { display: block; perspective: 700px; }
.ht-word { display: inline-block; }

.hero-sub {
  font-size: clamp(1rem, 1.9vw, 1.25rem);
  font-weight: 500;
  opacity: 0.78;
  max-width: 560px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
}

/* ── signature stripe: white band that inverts everything it crosses ── */
.stripe {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #fff;
  pointer-events: none;
  --sh: clamp(110px, 20vh, 190px);
  --sy: -40px;
  /* var() fallback keeps this working where @property is unsupported */
  clip-path: inset(
    calc(50% - var(--sh) / 2 + var(--sy))
    var(--sx, 100%)
    calc(50% - var(--sh) / 2 - var(--sy))
    0
  );
  transition: --sx 1.1s var(--ease) 0.55s;
}

body.loaded .stripe { --sx: 0%; }

.stripe-clone {
  position: absolute;
  inset: 0;
  color: var(--blue);
}

.stripe-clone .hero-stage {
  position: absolute;
  inset: 0;
  min-height: 0;
}

.stripe-clone .hero-eyebrow { opacity: 0.9; }
.stripe-clone .hero-sub { opacity: 0.85; }
.stripe-clone .hero-arrow { opacity: 0.22; }

/* ── entrance choreography ── */
[data-load],
.stripe-clone .hero-eyebrow,
.stripe-clone .hero-sub {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

/* each word tips up out of the page on load */
.ht-word {
  opacity: 0;
  transform: translateY(44px) rotateX(-72deg);
  transform-origin: 50% 100%;
  filter: blur(7px);
  transition: opacity 0.95s var(--ease), transform 0.95s var(--ease),
    filter 0.95s var(--ease);
}

body.loaded [data-load],
body.loaded .stripe-clone .hero-eyebrow,
body.loaded .stripe-clone .hero-sub {
  opacity: 1;
  transform: none;
}

body.loaded .stripe-clone .hero-eyebrow { opacity: 0.9; }
body.loaded .hero-eyebrow { opacity: 0.85; }
body.loaded .hero-sub { opacity: 0.78; }
body.loaded .stripe-clone .hero-sub { opacity: 0.85; }
body.loaded .ht-word { opacity: 1; transform: none; filter: blur(0); }

[data-load='1'], .stripe-clone .hero-eyebrow { transition-delay: 0.15s; }
[data-load='3'], .stripe-clone .hero-sub { transition-delay: 0.85s; }
[data-load='4'] { transition-delay: 1s; }
[data-load='5'] { transition-delay: 1.6s; }

.ht-line:nth-child(1) .ht-word:nth-child(1) { transition-delay: 0.3s; }
.ht-line:nth-child(1) .ht-word:nth-child(2) { transition-delay: 0.38s; }
.ht-line:nth-child(1) .ht-word:nth-child(3) { transition-delay: 0.46s; }
.ht-line:nth-child(2) .ht-word:nth-child(1) { transition-delay: 0.56s; }
.ht-line:nth-child(2) .ht-word:nth-child(2) { transition-delay: 0.64s; }
.ht-line:nth-child(2) .ht-word:nth-child(3) { transition-delay: 0.72s; }

.hero-scrollcue {
  position: absolute;
  z-index: 4;
  bottom: 28px;
  left: 50%;
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.hero-scrollcue-bar {
  width: 1px;
  height: 44px;
  background: rgba(255, 255, 255, 0.25);
  position: relative;
  overflow: hidden;
}

.hero-scrollcue-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  animation: scrollcue 2s var(--ease) infinite;
}

@keyframes scrollcue {
  0% { transform: translateY(-100%); }
  60%, 100% { transform: translateY(100%); }
}

/* ═══════════ Reveal primitives ═══════════ */
/* the reveal slide rides on `translate`, leaving `transform` free for
   pointer-driven tilt on the same element */
[data-reveal] {
  opacity: 0;
  translate: 0 30px;
  transition: opacity 0.9s var(--ease) var(--rd, 0s),
    translate 0.9s var(--ease) var(--rd, 0s);
}

[data-reveal].revealed { opacity: 1; translate: 0 0; }

/* line mask: the text slides up from behind its own baseline */
.mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}

.mask > * {
  display: block;
  transform: translateY(115%);
  transition: transform 1.05s var(--ease) var(--rd, 0s);
}

.mask.revealed > * { transform: none; }

/* the mask itself never fades — only its contents move */
.mask[data-reveal] { opacity: 1; translate: 0 0; }

/* ═══════════ Intro ═══════════ */
.intro {
  background: var(--paper);
  padding: clamp(120px, 20vh, 220px) 24px 0;
  overflow: hidden;
}

.intro-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

/* monospaced so the scramble-in effect doesn't jitter the line width */
.sec-eyebrow {
  display: inline-flex;
  align-items: center;
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--blue);
  margin-bottom: 26px;
  white-space: pre;
}

.sec-eyebrow.on-dark { color: rgba(255, 255, 255, 0.7); }

.intro-copy {
  font-size: clamp(1.4rem, 3.2vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.45;
}

.intro-copy em { color: var(--blue); }

/* ═══════════ Brand tile marquee ═══════════ */
.marquee {
  margin-top: clamp(80px, 14vh, 150px);
  padding-bottom: clamp(40px, 7vh, 70px);
  overflow: hidden;
}

.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.marquee-set {
  display: flex;
  align-items: center;
  gap: clamp(44px, 7vw, 110px);
  padding-right: clamp(44px, 7vw, 110px);
}

/* logos sit straight on the paper — no chrome behind them */
.logo {
  --h: clamp(84px, 11vw, 132px);
  height: var(--h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.6vw, 22px);
  flex: none;
  animation: logo-wave 5.5s ease-in-out infinite alternate;
}

.logo:nth-child(2) { animation-delay: -1.8s; }
.logo:nth-child(3) { animation-delay: -3.6s; }

@keyframes logo-wave {
  from { transform: translateY(-9px); }
  to { transform: translateY(9px); }
}

.logo img { width: auto; }
.logo b {
  color: var(--text);
  font-size: calc(var(--h) * 0.3);
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* doumi has no wordmark beside it, so it carries the full lockup height */
.logo-doumi { height: calc(var(--h) * 0.46); }
.logo-beetree { height: calc(var(--h) * 0.36); }
.logo-songalock { height: calc(var(--h) * 0.52); }

/* ═══════════ Sections shared ═══════════ */
.sec-title {
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.sec-sub {
  margin-top: 16px;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  color: var(--gray);
  font-weight: 500;
}

/* ═══════════ Projects ═══════════ */
.projects { background: var(--paper); }

.projects-head {
  text-align: center;
  padding: clamp(120px, 18vh, 200px) 24px clamp(60px, 10vh, 120px);
}

.stack { position: relative; }

.panel-wrap { height: 175vh; }
.panel-wrap:last-child { height: 145vh; }

.panel {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.28);
  transform: scale(calc(1 - 0.055 * var(--exit, 0)));
  filter: brightness(calc(1 - 0.32 * var(--exit, 0)));
  transform-origin: center top;
}

.panel-grid {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(28px, 5vw, 64px);
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  align-items: center;
  gap: clamp(36px, 5vw, 72px);
  position: relative;
  z-index: 2;
}

.panel-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  margin-bottom: 22px;
}

.panel-logo { margin-bottom: 26px; }

.panel-title {
  font-size: clamp(1.9rem, 3.9vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.18;
  margin-bottom: 20px;
}

.panel-desc {
  font-size: clamp(0.98rem, 1.6vw, 1.1rem);
  line-height: 1.75;
  max-width: 470px;
  margin-bottom: 24px;
}

.panel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 34px;
}

.panel-tags li {
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid;
}

.panel-index {
  position: absolute;
  right: clamp(20px, 4vw, 56px);
  bottom: clamp(2px, 2vh, 24px);
  font-size: clamp(5rem, 11vw, 10rem);
  font-weight: 800;
  line-height: 1;
  opacity: 0.07;
  z-index: 1;
  user-select: none;
}

/* ── panel copy entrance (scroll-driven) ── */
.panel-copy > * {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.panel.in .panel-copy > * { opacity: 1; transform: none; }

.panel.in .panel-copy > *:nth-child(1) { transition-delay: 0.05s; }
.panel.in .panel-copy > *:nth-child(2) { transition-delay: 0.13s; }
.panel.in .panel-copy > *:nth-child(3) { transition-delay: 0.21s; }
.panel.in .panel-copy > *:nth-child(4) { transition-delay: 0.29s; }
.panel.in .panel-copy > *:nth-child(5) { transition-delay: 0.37s; }
.panel.in .panel-copy > *:nth-child(6) { transition-delay: 0.45s; }

.panel-visual {
  position: relative;
  animation: float 7s ease-in-out infinite alternate;
}

@keyframes float {
  from { transform: translateY(-8px); }
  to { transform: translateY(10px); }
}

.mock {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  will-change: transform;
  opacity: 0;
  translate: 0 40px;
  transition: opacity 0.9s var(--ease) 0.2s, translate 0.9s var(--ease) 0.2s;
}

.panel.in .mock { opacity: 1; translate: 0 0; }

/* ═══ Doumi panel ═══ */
.panel-doumi { background: #fff; color: var(--text); }

.panel-doumi .panel-eyebrow { color: var(--doumi); }
.panel-doumi .panel-desc { color: var(--gray); }
.panel-doumi .panel-tags li { border-color: rgba(1, 3, 200, 0.25); color: var(--doumi); }
.panel-doumi .panel-index { color: var(--doumi); }

.doumi-logo { height: 58px; width: auto; }

.panel-doumi::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(52% 44% at 82% 18%, rgba(1, 3, 200, 0.08), transparent 70%),
    radial-gradient(40% 36% at 12% 88%, rgba(1, 3, 200, 0.05), transparent 70%);
}

.mock-doumi { position: relative; }

.mock-browser {
  background: #fff;
  border: 1px solid #E8E8ED;
  border-radius: 20px;
  box-shadow: 0 34px 90px rgba(1, 3, 200, 0.16);
  overflow: hidden;
}

.mb-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid #EFEFF4;
}

.mb-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #E3E3E8;
}

.mb-url {
  margin: 0 auto;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11.5px;
  color: var(--gray);
  background: var(--paper);
  padding: 5px 18px;
  border-radius: 999px;
}

/* the address types itself as the panel scrubs past */
.mb-url > span {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  width: calc(clamp(0, (var(--p, 0) - 0.02) / 0.14, 1) * 16ch);
}

.mb-body {
  padding: 22px 20px 26px;
  display: grid;
  gap: 12px;
}

.chat {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition: opacity 0.55s var(--spring), transform 0.55s var(--spring);
}

.chat-user {
  justify-self: end;
  background: #F0F0F5;
  border-bottom-right-radius: 6px;
}

.chat-bot {
  justify-self: start;
  background: var(--doumi);
  color: #fff;
  border-bottom-left-radius: 6px;
}

.chat-bot b {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.75;
  margin-bottom: 5px;
}

.chat-typing {
  justify-self: start;
  display: flex;
  gap: 5px;
  align-items: center;
  background: #F0F0F5;
  border-bottom-left-radius: 6px;
  height: 38px;
  padding: 0 18px;
  overflow: hidden;
  /* collapses out of the grid row when the real reply lands */
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease),
    height 0.45s var(--ease), margin-top 0.45s var(--ease);
}

.chat-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #B4B4BE;
  animation: typing 1.2s ease-in-out infinite;
}

.chat-typing i:nth-child(2) { animation-delay: 0.16s; }
.chat-typing i:nth-child(3) { animation-delay: 0.32s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.chat-action {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--doumi);
  border: 1.5px dashed rgba(1, 3, 200, 0.4);
  padding: 9px 15px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.ca-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--doumi);
  animation: pulse 1.4s ease-in-out infinite;
}

.panel-doumi.s1 .chat-user { opacity: 1; transform: none; }
.panel-doumi.s1 .chat-typing { opacity: 1; transform: none; transition-delay: 0.35s; }
.panel-doumi.s2 .chat-typing {
  opacity: 0;
  transform: translateY(-6px) scale(0.9);
  height: 0;
  margin-top: -12px; /* cancels the grid gap it leaves behind */
  transition-delay: 0s;
}
.panel-doumi.s2 .chat-bot { opacity: 1; transform: none; transition-delay: 0.12s; }
.panel-doumi.s3 .chat-action { opacity: 1; transform: none; }

.mock-cursor {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(1, 3, 200, 0.9);
  box-shadow: 0 0 0 5px rgba(1, 3, 200, 0.18);
  top: 34%;
  left: 68%;
  opacity: 0;
  transition: top 0.9s var(--ease), left 0.9s var(--ease), opacity 0.4s ease;
}

.panel-doumi.s3 .mock-cursor {
  opacity: 1;
  top: 78%;
  left: 34%;
  animation: cursor-click 1.6s var(--ease) infinite 0.9s;
}

@keyframes cursor-click {
  0%, 100% { box-shadow: 0 0 0 5px rgba(1, 3, 200, 0.18); }
  18% { box-shadow: 0 0 0 12px rgba(1, 3, 200, 0.08); }
}

/* ═══ BeeTREE panel ═══ */
.panel-beetree {
  background:
    radial-gradient(60% 50% at 20% 0%, #1C1C21, transparent 70%),
    #0E0E10;
  color: #fff;
}

.panel-beetree .panel-eyebrow { color: rgba(255, 255, 255, 0.55); }
.panel-beetree .panel-desc { color: rgba(255, 255, 255, 0.66); }
.panel-beetree .panel-tags li { border-color: rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.8); }
.panel-beetree .panel-index { color: #fff; }

.beetree-logo { height: 46px; width: auto; }

.mock-beetree .judge {
  background: #17171B;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.5);
}

.judge-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.judge-head img { width: 22px; height: auto; }

.judge-num {
  margin-left: auto;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
}

/* ── the solution types itself out while the judge runs ──
   Each line owns a slice of the panel scrub (--p): --s is where it starts,
   --d how much scroll it takes, --n how many characters it holds. The line
   is a fixed-width window over pre-formatted text, widened a character at a
   time — the same trick the doumi address bar uses.
   letter-spacing must stay 0: the window is measured in `ch`, and the
   inherited -0.01em would drift the two apart over a long line. */
.judge-code {
  padding: 18px 0 8px;
  font-size: 12.5px;
  line-height: 1.62;
  letter-spacing: 0;
}

.jc-line {
  position: relative;
  display: block;
  white-space: pre;
  color: rgba(255, 255, 255, 0.82);
  /* how far this line has been typed — the window's width and the caret's
     position are the same number, so they can never drift apart */
  --typed: calc(clamp(0, (var(--p, 0) - var(--s)) / var(--d), 1) * var(--n) * 1ch);
}

.jc-win {
  display: inline-block;
  overflow: hidden;
  white-space: pre;
  vertical-align: bottom;
  width: var(--typed);
}

/* The caret sits out of the inline flow on purpose. In flow it would align to
   the bottom of the line box, which line-height 1.62 leaves well below the
   text; centring it on the line box puts it on the text instead, and stays
   right whatever the line-height becomes.
   It shows at full opacity once its line starts and drops to zero the moment
   the line finishes, so exactly one caret is ever visible. */
.jc-line::after {
  content: '';
  position: absolute;
  left: var(--typed);
  top: 50%;
  translate: 0 -50%;
  width: 2px;
  height: 1.15em;
  background: #F5B301;
  opacity: calc(
    clamp(0, (var(--p, 0) - var(--s)) / 0.004, 1) -
    clamp(0, (var(--p, 0) - var(--s) - var(--d)) / 0.004, 1)
  );
}

.jc-pre { color: #F5B301; }
.jc-key { color: #7FB0FF; }
.jc-ns  { color: #7FDBCA; }
.jc-fn  { color: #E5C07B; }
.jc-str { color: #98C379; }
.jc-op  { color: rgba(255, 255, 255, 0.5); }

.judge-status {
  position: relative;
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.js-progress {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.js-progress i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: #F5B301;
  width: calc(clamp(0, (var(--p, 0) - 0.18) / 0.42, 1) * 100%);
  transition: background 0.4s ease;
}

.js-label {
  font-size: 13.5px;
  font-weight: 600;
  transition: opacity 0.4s ease, transform 0.4s var(--spring);
}

.js-running { color: #F5B301; }

.js-accept {
  color: #30D158;
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  position: absolute;
  left: 0;
  bottom: 0;
}

.panel-beetree.s3 .js-progress i { background: #30D158; }
.panel-beetree.s3 .js-running { opacity: 0; }
.panel-beetree.s3 .js-accept { opacity: 1; transform: none; }

/* ═══ 손가Lock panel ═══ */
.panel-songalock {
  background:
    radial-gradient(56% 48% at 80% 10%, rgba(223, 49, 52, 0.16), transparent 70%),
    radial-gradient(40% 40% at 10% 90%, rgba(223, 49, 52, 0.08), transparent 70%),
    #100708;
  color: #fff;
}

.panel-songalock .panel-eyebrow { color: var(--red-soft); }
.panel-songalock .panel-desc { color: rgba(255, 255, 255, 0.66); }
.panel-songalock .panel-tags li { border-color: rgba(223, 49, 52, 0.4); color: #FF8B85; }
.panel-songalock .panel-index { color: var(--red); opacity: 0.12; }

.songalock-logo { height: 40px; width: auto; }
.panel-songalock .panel-desc em { color: #FF8B85; font-weight: 700; }

/* Two real app screens, drifting apart as the panel scrubs. The phones carry
   this panel on their own, so it hands the wider half of the grid to them —
   max-width was never the limit, the column was. */
.panel-songalock .panel-grid { grid-template-columns: 0.86fr 1.14fr; }

.phones {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  aspect-ratio: 1 / 0.94;
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  will-change: transform;
}

.phone-img {
  position: absolute;
  width: auto;
  filter: drop-shadow(0 34px 60px rgba(0, 0, 0, 0.55));
  opacity: 0;
  transition: opacity 1s var(--ease), translate 0.55s var(--ease),
    rotate 0.55s var(--ease);
}

/* Heights are tuned against each file's own padding so the two phones read as
   one scene. Measured fill: before 86.3%, after 92.1% of its own canvas — the
   values below cancel that difference out. Re-measure when a mockup changes
   (the alpha bounding box is what matters, not the canvas size). */
/* the left phone is the one in front: nearer, larger, sitting lower.
   Rendered size is height x that file's own fill, so the two percentages are
   not comparable on their own — 92 x 0.863 vs 73 x 0.921 puts the front phone
   about 18% bigger, which is what reads as depth. */
.phone-before {
  left: -7%;
  bottom: 0;
  height: 92%;
  z-index: 2;
  translate: 40px 26px;
  rotate: 4deg;
}

.phone-after {
  right: -2%;
  top: 0;
  height: 73%;
  z-index: 1;
  translate: -40px -24px;
  rotate: -6deg;
}

.panel-songalock.in .phone-img { opacity: 1; }

.panel-songalock.in .phone-before {
  translate: calc(var(--p, 0) * -20px) calc(var(--p, 0) * 16px);
  rotate: calc(var(--p, 0) * -2deg);
}

/* the one behind drifts less — parallax, not two phones sliding in step */
.panel-songalock.in .phone-after {
  translate: calc(var(--p, 0) * 10px) calc(var(--p, 0) * -12px);
  rotate: calc(var(--p, 0) * 1.4deg);
}

.phone-glow {
  position: absolute;
  inset: 8% 4%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(223, 49, 52, 0.42), transparent 72%);
  filter: blur(46px);
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}

.panel-songalock.in .phone-glow { opacity: 1; animation: glow-breathe 5s ease-in-out infinite alternate; }

@keyframes glow-breathe {
  from { transform: scale(0.94); opacity: 0.75; }
  to { transform: scale(1.06); opacity: 1; }
}

/* the AI sweeping the frame for anything sensitive */
.phone-scan {
  position: absolute;
  left: 2%;
  right: 2%;
  height: 2px;
  z-index: 3;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  box-shadow: 0 0 26px 5px rgba(223, 49, 52, 0.45);
  opacity: 0;
  pointer-events: none;
}

.panel-songalock.in .phone-scan { animation: scan 3.6s var(--ease) infinite; }

@keyframes scan {
  0%   { top: 4%;  opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { top: 94%; opacity: 0; }
}

/* ═══════════ Team ═══════════ */
.team {
  position: relative;
  background: #fff;
  padding: clamp(120px, 18vh, 200px) max(24px, 5vw) clamp(120px, 16vh, 180px);
}

/* the committee's own seal — it turns on its own and spins up while you scroll */
.seal {
  position: absolute;
  top: clamp(86px, 13vh, 150px);
  right: max(20px, 4vw);
  width: clamp(88px, 12vw, 158px);
  aspect-ratio: 1;
  opacity: 0;
  translate: 0 0; /* the base reveal slide would fight the stamp landing */
  scale: 1.5;
  rotate: -18deg;
  transition: opacity 0.8s var(--ease), scale 0.7s var(--spring),
    rotate 0.7s var(--spring);
}

/* lands like a stamp when the roster comes into view */
.seal.revealed { opacity: 1; scale: 1; rotate: 0deg; }

.seal svg { width: 100%; height: 100%; }

.seal-ring {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.5;
  opacity: 0.3;
}

/* only the lettering turns — the emblem stays upright, like a real seal */
.seal-text {
  font-size: 10.6px;
  font-weight: 700;
  letter-spacing: 0.12em;
  fill: var(--blue);
  opacity: 0.78;
  transform-box: view-box;
  transform-origin: 50% 50%;
  transform: rotate(var(--seal, 0deg));
}

.seal-mark {
  fill: none;
  stroke: var(--blue);
  stroke-width: 13.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.team-head {
  text-align: center;
  margin-bottom: clamp(50px, 7vh, 80px);
}

.team-grid {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(14px, 1.8vw, 20px);
}

/* a nameplate, not a photo card — the roster reads on its own.
   Photo sits beside the name rather than above it: two of the four have no
   photo, and stacking would leave their cards with a hole where it would be.
   Side by side the picture can be big without making any card taller. */
.member {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: 'meta' 'work' 'links';
  align-content: start;
  column-gap: 16px;
  row-gap: 13px;
  padding: 20px 18px 22px;
  border: 1px solid var(--hairline-light);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(11, 12, 112, 0.04), rgba(11, 12, 112, 0) 62%);
  transition: border-color 0.4s var(--ease), box-shadow 0.5s var(--ease);
}

/* the card tilts toward the pointer (--rx/--ry come from the tilt engine) */
.member.revealed {
  transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

.member:hover {
  border-color: rgba(11, 12, 112, 0.22);
  box-shadow: 0 18px 40px rgba(11, 12, 112, 0.11);
}

.member-meta { grid-area: meta; }
.member-work { grid-area: work; }
.member-links { grid-area: links; }

/* the frame only exists once a real photo loads (JS adds .has-photo) —
   see README for the file names */
.member-photo { display: none; }

/* the photo spans the whole card, so everything written about the person
   lines up on one edge instead of stepping back under the picture */
.member.has-photo {
  grid-template-columns: auto 1fr;
  grid-template-areas:
    'photo meta'
    'photo work'
    'photo links';
  align-items: start;
}

/* 카드 폭을 꽉 채우는 세로 사진이 아니라 아바타 크기입니다. 네 명 중 두
   명만 사진이 있어서, 큰 사진이면 카드끼리 높이가 크게 어긋납니다. */
.member.has-photo .member-photo {
  grid-area: photo;
  align-self: start;
  display: block;
  position: relative;
  width: clamp(84px, 8.6vw, 104px);
  aspect-ratio: 1 / 1.16;
  border-radius: 15px;
  overflow: hidden;
  background: linear-gradient(150deg, var(--blue), var(--doumi));
}

/* curtain wipe on reveal */
.member-photo::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: #fff;
  z-index: 3;
  transition: transform 0.9s var(--ease) var(--rd, 0s);
}

.member.revealed .member-photo::after { transform: translateY(-101%); }

.member-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
  z-index: 2;
}

.member:hover .member-photo img { transform: scale(1.055); }

.member-photo:active { scale: 0.95; }

.member-meta {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    'name role'
    'en   en';
  justify-content: start;
  align-items: center;
  column-gap: 8px;
  row-gap: 1px;
}

.member-role {
  grid-area: role;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  color: var(--gray);
  white-space: nowrap;
}

.member-role-lead {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.member-name {
  grid-area: name;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.member-en {
  grid-area: en;
  font-size: 12px;
  color: var(--gray);
  font-weight: 500;
}

/* what each person actually worked on. Everyone gets a line, so the roster
   reads as credits rather than a ranking — the scope itself is the difference. */
.member-work {
  display: grid;
  gap: 3px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--gray);
  text-align: left;
}

.member-work li {
  position: relative;
  padding-left: 9px;
}

.member-work li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0.45;
}

/* not every member has a link, and the leader has two — the row just holds
   whatever is there. Cards stay level because everything above is identical. */
.member-links {
  display: flex;
  gap: 8px;
}

.member-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--hairline-light);
  color: var(--gray);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease),
    background 0.3s var(--ease);
}

/* pads the tap target out to 44px without moving anything */
.member-link::after {
  content: '';
  position: absolute;
  inset: -6px;
}

.member-link svg { width: 15px; height: 15px; }

.member-link:hover {
  color: var(--blue);
  border-color: rgba(11, 12, 112, 0.28);
  background: rgba(11, 12, 112, 0.06);
}

/* ═══════════ Footer ═══════════ */
.footer {
  position: relative;
  background: var(--ink);
  color: #A0A0A8;
  padding: clamp(110px, 16vh, 180px) max(24px, 5vw) 36px;
  overflow: hidden;
}

/* bleeds off the right edge so it reads as a mark, not a numeral */
.footer-arrow {
  position: absolute;
  right: clamp(-190px, -9vw, -60px);
  top: 0;
  translate: 0 -14%;
  width: min(46vw, 500px);
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 13.8;
  pointer-events: none;
}

.footer-arrow path {
  stroke-dasharray: 113;
  stroke-dashoffset: 113;
  transition: stroke-dashoffset 2s var(--ease);
}

.footer-arrow.revealed path { stroke-dashoffset: 0; }

/* the arrow draws itself in place — it must not fade or slide */
.footer-arrow[data-reveal] { opacity: 1; translate: 0 0; }

.footer-top {
  position: relative;
  max-width: 1180px;
  margin: 0 auto clamp(70px, 12vh, 130px);
}

.footer-kicker {
  font-size: clamp(13px, 1.5vw, 15px);
  font-weight: 600;
  color: #6E6E78;
  margin-bottom: 14px;
}

.footer-insta {
  display: block;
  width: max-content;
  max-width: 100%;
  font-size: clamp(2rem, 6.4vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #fff;
}

.footer-insta > span {
  display: block;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 3px;
  transition: background-size 0.55s var(--ease);
}

.footer-insta:hover > span { background-size: 100% 3px; }

/* per-character lift, JS wraps each glyph in an <i> and sets --i */
.footer-insta i {
  display: inline-block;
  font-style: normal;
  white-space: pre;
  transition: transform 0.5s var(--spring);
  transition-delay: calc(var(--i, 0) * 22ms);
}

.footer-insta:hover i { transform: translateY(-14px); }

.footer-row {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 48px;
}

.footer-name {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}

.footer-en { font-size: 13px; }

.footer-links {
  display: flex;
  gap: clamp(18px, 3vw, 34px);
  flex-wrap: wrap;
  font-size: 13.5px;
  font-weight: 600;
}

.footer-links a {
  opacity: 0.75;
  transition: opacity 0.25s ease, color 0.25s ease;
}

.footer-links a:hover { opacity: 1; color: #fff; }

.footer-bottom {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 26px;
  font-size: 12.5px;
}

.footer-lab { height: 15px; width: auto; opacity: 0.65; }

/* ═══════════ Responsive ═══════════ */
@media (max-width: 960px) {
  .panel-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 96px;
    padding-bottom: 44px;
  }

  /* no room to pin the whole panel — let panels flow naturally */
  .panel-wrap,
  .panel-wrap:last-child { height: auto; }

  .panel {
    position: relative;
    height: auto;
    min-height: 100svh;
    align-items: stretch;
    transform: none;
    filter: none;
    border-radius: 24px;
    box-shadow: none;
    /* overflow:hidden would make this the sticky mock's scrollport and cancel
       the pin outright; clip crops identically without becoming one */
    overflow: clip;
  }

  .panel-desc { max-width: none; }

  /* Unpinned, the whole scrub ran before the mock even reached the screen — by
     the time it appeared the animation had already finished. So the mock holds
     still while the rest of this box scrolls past it, and the scroll-driven
     animation plays against a stationary target: the desktop pin, scaled to a
     phone.
     It has to be min-height, not padding: a sticky child may only travel
     inside its containing block's *content* box, and padding is outside it —
     as padding this box would give the mock exactly zero room to stick. */
  .panel-visual {
    min-height: 118svh;
    animation: none; /* the float drift would fight the pin */
  }

  .mock, .phones {
    position: sticky;
    top: 14svh;
    max-width: 440px;
  }

  /* one column here, so the phones are free to take more of it */
  .panel-songalock .panel-grid { grid-template-columns: 1fr; }
  .phones { max-width: 520px; }

  .panel-index { font-size: 4.6rem; bottom: 12px; }

  .team-grid { max-width: 560px; }
}

@media (max-width: 760px) {
  .nav {
    height: 54px;
    gap: 12px;
    /* landscape notches bite into the sides */
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
  }

  .nav-insta span { display: none; }
  .nav-insta { padding: 10px; border: 0; }
  .nav-logo { gap: 8px; }
  .nav-logo-text { font-size: 11.5px; }
  .nav-mark { width: 18px; }
  .nav-links { gap: 14px; font-size: 13px; }
  /* the pill is a hover affordance; on touch it only shrinks the tap targets */
  .nav-pill { display: none; }
  .nav-links a { padding: 12px 4px; }

  section { scroll-margin-top: 54px; }
}

@media (max-width: 600px) {
  .hero-stage { padding: 96px 20px 104px; }

  /* the eyebrow wraps here, and as a flex row that stranded the dot at the
     far left of a full-width line — inline flow keeps it with the text */
  .hero-eyebrow {
    display: block;
    line-height: 1.75;
    letter-spacing: 0.22em;
  }

  .hero-eyebrow-dot {
    display: inline-block;
    vertical-align: middle;
    margin: -2px 8px 0 0;
  }

  /* one size down so "기술로 누군가의 하루를" holds its own line */
  .hero-title { font-size: clamp(1.8rem, 8.6vw, 2.25rem); }
  .hero-sub { font-size: 1rem; max-width: 24em; }
  .hero-cta { gap: 10px; }
  .hero-cta .btn { padding: 13px 20px; font-size: 14.5px; }
  .stripe { --sh: clamp(96px, 15vh, 140px); }

  .intro { padding-left: 20px; padding-right: 20px; }
  .projects-head { padding-left: 20px; padding-right: 20px; }
  .panel-grid { padding-top: 84px; padding-bottom: 36px; gap: 32px; }
  .panel-tags { margin-bottom: 26px; }
  .panel-logo { margin-bottom: 20px; }

  /* tuck the seal into the corner so it clears the centred heading */
  .seal { top: 58px; width: 74px; }
  /* centred type leaves no room beside it — drop the arrow below the copy */
  .hero-arrow { width: 74vw; top: auto; bottom: -6vh; left: -26vw; opacity: 0.16; }

  .team { padding-left: 20px; padding-right: 20px; }
  .footer { padding-left: 20px; padding-right: 20px; }
  .footer-row { flex-direction: column; gap: 26px; padding-bottom: 36px; }
  .footer-links { gap: 14px 20px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 14px; }
}

@media (max-width: 470px) {
  .team-grid { grid-template-columns: 1fr; max-width: 420px; gap: 12px; }
  .member { padding: 16px 14px 18px; border-radius: 15px; }
  .marquee { margin-top: clamp(64px, 10vh, 110px); }
  .logo { --h: 74px; }
  .marquee-set { gap: 34px; padding-right: 34px; }
}

/* 375px is a real and common phone, so everything above has to survive it —
   only below that does the layout give things up */
@media (max-width: 344px) {
  /* the wordmark no longer fits beside the links */
  .nav-logo-text { display: none; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .team-grid { max-width: 300px; }
}

/* ═══════════ Touch devices ═══════════ */
/* Everything below is scroll cost with no payoff where there is no pointer:
   a live backdrop blur under a fixed bar, permanent compositor layers for a
   tilt that never fires, and three ambient loops repainting behind the
   scroll. Dropping them is what stops the stutter. */
@media (hover: none) {
  .nav--scrolled[data-theme-now='dark'] {
    background: rgba(11, 12, 60, 0.94);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .nav--scrolled[data-theme-now='light'] {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  /* these only transform under a pointer tilt that never happens here —
     the marquee keeps its layer, it really does move every frame */
  .mock, .phones { will-change: auto; }

  .panel-visual { animation: none; }
  .logo { animation: none; }
  .panel-songalock.in .phone-glow { animation: none; opacity: 0.9; }
  .phone-glow { filter: blur(32px); }
  /* the sweep stays — only its 26px halo, repainted every frame, goes */
  .phone-scan { box-shadow: 0 0 10px 2px rgba(223, 49, 52, 0.4); }

  .member:hover {
    border-color: var(--hairline-light);
    box-shadow: none;
  }
}

/* ═══════════ QA mode: everything in final state ═══════════ */
.qa *, .qa *::before, .qa *::after {
  transition: none !important;
  animation: none !important;
}

.qa [data-load], .qa .ht-word, .qa [data-reveal],
.qa .stripe-clone .hero-eyebrow, .qa .stripe-clone .hero-sub,
.qa .panel-copy > *, .qa .mock, .qa .chat, .qa .chat-action,
.qa .mock-cursor, .qa .phone-img, .qa .phone-glow {
  opacity: 1 !important;
  transform: none !important;
  translate: 0 0 !important;
  scale: 1 !important;
}

.qa .ht-word { filter: blur(0) !important; }
.qa .stripe { --sx: 0%; }
.qa .hero { --hp: 0 !important; }
.qa .hero-arrow path,
.qa .footer-arrow path { stroke-dashoffset: 0 !important; }
.qa .mask > * { transform: none !important; }
.qa .member-photo::after { transform: translateY(-101%) !important; }
.qa .jc-win { width: calc(var(--n) * 1ch) !important; }
.qa .jc-line::after { opacity: 0 !important; }
.qa .js-progress i { width: 100% !important; background: #30D158; }
.qa .js-running { opacity: 0; }
.qa .js-accept { opacity: 1 !important; transform: none !important; }
.qa .mock-cursor { top: 78%; left: 34%; }
.qa .chat-typing { opacity: 0 !important; height: 0; margin-top: -12px; }
.qa .phone-scan { opacity: 0; }
.qa .seal { rotate: 0deg !important; scale: 1 !important; }
.qa .phone-before { rotate: -1.8deg !important; }
.qa .phone-after { rotate: 1.4deg !important; }
.qa .cursor, .qa .cursor-dot { display: none !important; }

/* ═══════════ Reduced motion ═══════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .stripe { --sx: 0%; }

  [data-load], .ht-word, [data-reveal],
  .stripe-clone .hero-eyebrow, .stripe-clone .hero-sub,
  .panel-copy > *, .mock, .chat, .chat-action, .mask > *,
  .phone-img, .phone-glow {
    opacity: 1 !important;
    transform: none !important;
    translate: 0 0 !important;
  }

  .hero-arrow path,
  .footer-arrow path { stroke-dashoffset: 0 !important; }
  .ht-word { filter: none !important; }
  .member-photo::after { transform: translateY(-101%) !important; }
  /* the typing is driven by scroll position, not a transition, so the rules
     above can't stop it — the solution just sits there finished instead */
  .jc-win { width: calc(var(--n) * 1ch) !important; }
  .jc-line::after { opacity: 0 !important; }
  .chat-typing, .phone-scan, .cursor, .cursor-dot { display: none !important; }
  .seal { rotate: 0deg !important; scale: 1 !important; }
}
