/* 테마 A — 프리미엄
   조사한 수상작들이 공통으로 쓰는 기법을 라이브러리 없이 구현한다.
     · 히어로 WebGL 셰이더 (premium.js, 손으로 쓴 GLSL)
     · 네이티브 스크롤 타임라인 animation-timeline: view()/scroll()
     · 붙박이 가로 스크롤 구간
     · 글자 단위 등장, 자석 버튼, 커스텀 커서, 그레인
   자바스크립트나 WebGL 이 없어도 내용은 전부 읽힌다. */

:root {
  --ink-900: #07090d;
  --ink-800: #0e1218;
  --ink-700: #171c25;
  --ink-500: #4b5464;
  --ink-400: #6e7889;
  --ink-300: #9aa4b5;
  --line: #e7e9ee;
  --line-dark: rgba(255, 255, 255, 0.1);

  --paper: #ffffff;
  --paper-soft: #f6f7f9;

  --brand: #1f6fd0;
  --brand-bright: #5aa2ff;
  --brand-soft: rgba(31, 111, 208, 0.08);

  --radius: 14px;
  --radius-lg: 24px;
  --header-h: 68px;

  --wide: 76rem;
  --measure: 44rem;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── 그레인 — 화면 전체에 아주 옅은 입자 ─────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── 커스텀 커서 ─────────────────────────────────────────── */
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 500;
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(90, 162, 255, 0.7);
  border-radius: 50%;
  pointer-events: none;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease),
    scale 0.25s var(--ease);
}

.cursor-ring.on {
  background: rgba(90, 162, 255, 0.16);
  border-color: rgba(90, 162, 255, 1);
  scale: 1.35;
}

/* ── 읽기 진행 막대 — 스크롤 타임라인 ────────────────────── */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  z-index: 401;
  background: var(--brand-bright);
  transform-origin: 0 50%;
  scale: 0 1;
  animation: growX linear;
  animation-timeline: scroll(root block);
}

body.has-theme-bar .progress {
  top: 46px;
}

@keyframes growX {
  to {
    scale: 1 1;
  }
}

/* ── 히어로 ──────────────────────────────────────────────── */
.pa-hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: clip;
  background: var(--ink-900);
}

.pa-hero-media {
  position: absolute;
  inset: 0;
}

.pa-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.34;
  /* 스크롤에 따라 확대되며 흐려진다 (시차) */
  animation: heroPan linear both;
  animation-timeline: view();
  animation-range: exit-crossing 0% exit 100%;
}

@keyframes heroPan {
  to {
    scale: 1.14;
    filter: blur(6px);
    opacity: 0.12;
  }
}

#heroGL {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}

.gl-on #heroGL {
  opacity: 1;
}

.pa-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 88% at 50% 42%, transparent 0%, rgba(7, 9, 13, 0.9) 74%);
}

.pa-hero-in {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1.5rem;
  color: #fff;
  max-width: 60rem;
}

.pa-eyebrow {
  margin: 0 0 1.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--brand-bright);
  animation: fadeUp 0.9s var(--ease) 0.1s both;
}

.pa-title {
  margin: 0;
  font-size: clamp(2.75rem, 8.4vw, 6.75rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

/* 글자 단위 등장 — premium.js 가 .ln/.ch 로 쪼갠다 */
.pa-title .ln {
  display: block;
  overflow: hidden;
}

.pa-title .ch {
  display: inline-block;
  translate: 0 110%;
  animation: chIn 0.85s var(--ease) both;
  animation-delay: calc(0.24s + var(--i) * 0.028s);
}

@keyframes chIn {
  to {
    translate: 0 0;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    translate: 0 14px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

.pa-sub {
  margin: 2rem auto 0;
  max-width: 30rem;
  color: rgba(255, 255, 255, 0.7);
  animation: fadeUp 0.9s var(--ease) 0.85s both;
}

.pa-cta {
  margin-top: 2.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeUp 0.9s var(--ease) 1s both;
}

.pa-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  translate: -50% 0;
  z-index: 2;
  width: 1px;
  height: 54px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.55));
  animation: fadeUp 1s var(--ease) 1.3s both;
}

/* ── 섹션 공통 ───────────────────────────────────────────── */
.pa-sec {
  padding: clamp(5rem, 12vw, 10rem) 1.5rem;
}

.pa-in {
  max-width: var(--wide);
  margin: 0 auto;
}

.pa-dark {
  background: var(--ink-900);
  color: #fff;
}

.pa-label {
  margin: 0 0 1.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--brand);
}

.pa-dark .pa-label {
  color: var(--brand-bright);
}

.pa-h2 {
  margin: 0;
  font-size: clamp(1.75rem, 4.6vw, 3.25rem);
  letter-spacing: -0.045em;
  line-height: 1.14;
}

/* 스크롤로 들어올 때 나타난다. 네이티브 타임라인이라 JS 가 필요 없다. */
.reveal {
  animation: revealIn linear both;
  animation-timeline: view();
  animation-range: entry 8% cover 26%;
}

@keyframes revealIn {
  from {
    opacity: 0;
    translate: 0 26px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

/* 타임라인을 못 쓰는 브라우저에서는 그냥 보이게 둔다 */
@supports not (animation-timeline: view()) {
  .reveal,
  .pa-quote-line,
  .pa-hero-img {
    animation: none;
    opacity: 1;
    translate: none;
  }
  .pa-hero-img {
    opacity: 0.34;
  }
  .pa-quote-line {
    color: #fff;
  }
  .progress {
    display: none;
  }
}

/* ── 붙박이 인용 — 줄이 차례로 밝아진다 ──────────────────── */
.pa-quote {
  min-height: 220svh;
  position: relative;
}

.pa-quote-stick {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  place-items: center;
  padding: 0 1.5rem;
}

.pa-quote-lines {
  max-width: 46rem;
  text-align: center;
  font-size: clamp(1.375rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.35;
}

.pa-quote-line {
  display: block;
  color: rgba(255, 255, 255, 0.16);
  animation: lineLit linear both;
  animation-timeline: view(block);
}

.pa-quote-line:nth-child(1) {
  animation-range: entry 30% contain 26%;
}
.pa-quote-line:nth-child(2) {
  animation-range: entry 30% contain 46%;
}
.pa-quote-line:nth-child(3) {
  animation-range: entry 30% contain 66%;
}

@keyframes lineLit {
  to {
    color: #fff;
  }
}

/* ── 가로 스크롤 구간 ────────────────────────────────────── */
.pa-rail {
  position: relative;
  height: 320svh;
  background: var(--paper-soft);
}

.pa-rail-stick {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.pa-rail-track {
  display: flex;
  gap: 1.5rem;
  padding: 0 clamp(1.5rem, 6vw, 6rem);
  animation: railMove linear both;
  animation-timeline: view();
  animation-range: contain 0% contain 100%;
}

@keyframes railMove {
  to {
    translate: calc(-100% + 92vw) 0;
  }
}

.pa-card {
  position: relative;
  flex: 0 0 clamp(17rem, 30vw, 26rem);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  aspect-ratio: 3 / 4;
  background: var(--ink-800);
}

.pa-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale 0.7s var(--ease);
}

.pa-card:hover img {
  scale: 1.06;
}

.pa-card-in {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.75rem;
  background: linear-gradient(0deg, rgba(7, 9, 13, 0.92) 6%, rgba(7, 9, 13, 0.05) 62%);
}

.pa-card-no {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--brand-bright);
}

.pa-card h3 {
  margin: 0.625rem 0 0.5rem;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.pa-card p {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
}

.pa-rail-head {
  position: absolute;
  top: clamp(3rem, 8vh, 6rem);
  left: 50%;
  translate: -50% 0;
  text-align: center;
  z-index: 1;
  pointer-events: none;
}

@media (max-width: 56rem) {
  .pa-rail {
    height: auto;
  }
  .pa-rail-stick {
    position: static;
    height: auto;
    padding: clamp(3rem, 10vw, 6rem) 0;
    flex-direction: column;
  }
  .pa-rail-track {
    flex-direction: column;
    animation: none;
    padding: 0 1.5rem;
    width: 100%;
  }
  .pa-card {
    flex: none;
    aspect-ratio: 16 / 10;
  }
  .pa-rail-head {
    position: static;
    translate: none;
    padding: 0 1.5rem 2rem;
  }
}

/* ── 숫자 ────────────────────────────────────────────────── */
.pa-nums {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: 3.5rem;
  background: var(--line-dark);
  border-block: 1px solid var(--line-dark);
}

.pa-num {
  padding: 2.75rem 1.75rem;
  background: var(--ink-900);
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
  transition: background 0.35s var(--ease);
}

.pa-num::before {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--brand-bright);
  scale: 0 1;
  transform-origin: 0 50%;
  transition: scale 0.45s var(--ease);
}

.pa-num:hover {
  background: var(--ink-800);
}

.pa-num:hover::before {
  scale: 1 1;
}

.pa-num b {
  display: block;
  font-size: clamp(2.5rem, 5.4vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.pa-num em {
  font-style: normal;
  font-size: 0.38em;
  color: var(--brand-bright);
  margin-left: 0.2rem;
}

.pa-num span {
  display: block;
  margin-top: 1rem;
  color: var(--ink-300);
  font-size: 0.9375rem;
}

.pa-num small {
  display: block;
  margin-top: 0.25rem;
  color: var(--ink-500);
  font-size: 0.8125rem;
}

.pa-vision {
  margin: 4rem 0 0;
  font-size: clamp(1.375rem, 3.4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.pa-vision strong {
  color: var(--brand-bright);
}

/* ── 흐르는 띠 ───────────────────────────────────────────── */
.pa-marquee {
  overflow: hidden;
  padding: 1.25rem 0;
  border-block: 1px solid var(--line);
  background: var(--paper);
}

.pa-marquee-in {
  display: flex;
  gap: 3.5rem;
  width: max-content;
  white-space: nowrap;
  animation: marq 30s linear infinite;
  font-size: 0.875rem;
  color: var(--ink-400);
}

.pa-marquee b {
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}

@keyframes marq {
  to {
    translate: -50% 0;
  }
}

/* ── 재정 ────────────────────────────────────────────────── */
.pa-fin {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  margin-top: 3rem;
}

@media (max-width: 56rem) {
  .pa-fin {
    grid-template-columns: 1fr;
  }
}

.pa-fin dl {
  margin: 0;
}

.pa-fin dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.125rem 0;
  border-bottom: 1px solid var(--line-dark);
}

.pa-fin dt {
  color: var(--ink-300);
}

.pa-fin dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}

.pa-fin-note {
  color: var(--ink-400);
  font-size: 0.9375rem;
}

/* ── 마무리 ──────────────────────────────────────────────── */
.pa-end {
  text-align: center;
  padding: clamp(6rem, 14vw, 11rem) 1.5rem;
  background: var(--ink-900);
  color: #fff;
}

.pa-end h2 {
  margin: 0 0 2.5rem;
  font-size: clamp(1.875rem, 5.4vw, 3.75rem);
  letter-spacing: -0.05em;
  line-height: 1.1;
}

/* 마우스가 있는 화면에서만 기본 커서를 숨긴다 */
@media (pointer: fine) {
  .cursor-on,
  .cursor-on a,
  .cursor-on button {
    cursor: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pa-title .ch,
  .pa-eyebrow,
  .pa-sub,
  .pa-cta,
  .pa-scroll,
  .pa-hero-img {
    animation: none;
    translate: none;
    opacity: 1;
  }
  .pa-hero-img {
    opacity: 0.34;
  }
  .pa-marquee-in {
    animation: none;
  }
  .pa-quote {
    min-height: auto;
  }
  .pa-quote-stick {
    position: static;
    height: auto;
    padding: 5rem 1.5rem;
  }
  .pa-quote-line {
    color: #fff;
    animation: none;
  }
  .pa-rail {
    height: auto;
  }
  .pa-rail-stick {
    position: static;
    height: auto;
  }
  .pa-rail-track {
    animation: none;
    flex-direction: column;
  }
}
