/* ═══════════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── V2 Home palette ── */
  --bg:          #1A1030;
  --surface:     #22133C;
  --surface2:    #2C1A52;
  --purple:      #7C3AED;
  --pink:        #DB2777;
  --text:        #FFFFFF;
  --text2:       #B6A6D6;
  --nav-active:  #DB2777;
  --nav-muted:   #6B5D8B;

  /* ── Per-test theme (overridden by JS) ── */
  --primary:      #7C3AED;
  --accent:       #DB2777;
  --text-color:   #F0EBFF;
  --text-second:  rgba(240,235,255,0.68);
  --card-bg:      rgba(255,255,255,0.08);
  --card-border:  rgba(255,255,255,0.16);

  /* ── Tokens ── */
  --radius:    20px;
  --radius-sm: 12px;
  --ease:      0.22s cubic-bezier(0.4,0,0.2,1);
  --ease-pop:  0.38s cubic-bezier(0.34,1.56,0.64,1);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh; /* iOS Chrome 동적 뷰포트 적응 */
  -webkit-font-smoothing: antialiased;
}

body.theme-active {
  background: transparent;
  color: var(--text-color);
}

button { font-family: inherit; }

/* ═══════════════════════════════════════════════════════════
   FIXED LAYERS
═══════════════════════════════════════════════════════════ */

/* Subtle noise grain — adds texture on dark home */
.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 300px 300px;
}

/*
  Background layer: JS injects per-test theme gradient here.
  FUTURE: swap background-image to AI-generated image URL.
*/
.bg-image-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  transition: background 0.5s ease;
}

/* 배경 이미지 위에 어두운 오버레이 — 텍스트 가독성 확보 */
.bg-image-layer.has-bg-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   FULL-WIDTH PAGE HEADER
   화면 전체 폭으로 깔리는 헤더 — 컨테이너 밖에 렌더링됨
   탐색·카테고리 페이지: position:sticky (스크롤 고정)
   홈 페이지: 일반 흐름 (스크롤과 함께)
═══════════════════════════════════════════════════════════ */
.full-header {
  width: 100%;
  background: #0F0820;
  /* 탐색·카테고리: sticky로 오버라이드 */
  position: relative;
  z-index: 100;
}

.full-header--sticky {
  position: sticky;
  top: 0;
}

.full-header-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  gap: 12px;
}

@media (min-width: 1024px) {
  .full-header-inner {
    max-width: 1280px;
    padding: 26px 48px 14px;
  }
  /* 홈 헤더 로고 크게 */
  .full-header-inner .v2-logo-icon { width: 38px; height: 38px; border-radius: 10px; }
  .full-header-inner .v2-logo-text { font-size: 22px; }
  /* 카테고리 헤더 뒤로가기: viewport 좌측 끝으로 (full-header가 position:relative, width:100%) */
  .full-header-inner .sub-back-btn {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
  }
}

/* ═══════════════════════════════════════════════════════════
   V2 HOME — SHELL
═══════════════════════════════════════════════════════════ */
.v2-home {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); /* clears fixed nav + iOS home indicator */
  max-width: 800px;
  margin: 0 auto;
}

/* ── Legacy header (홈 전체폭 헤더로 대체됨, 하위 호환용) ── */
.v2-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 10px;
}

.v2-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.v2-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
}

.v2-logo-text {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ── TODAY'S PICK Hero ────────────────────────── */
.hero-section {
  padding: 4px 16px 24px;
}

.hero-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  min-height: 228px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(150deg, var(--h-s, #3D2660) 0%, var(--h-e, #5B3D8B) 100%);
  cursor: pointer;
  transition: transform var(--ease-pop);
}

.hero-card:hover { transform: scale(1.01); }
.hero-card:active { transform: scale(0.995); transition-duration: 0.1s; }

/* Decorative circle */
.hero-card::before {
  content: '';
  position: absolute;
  top: -64px; right: -64px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  pointer-events: none;
}

.hero-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 55%);
  pointer-events: none;
}

.hero-badge {
  position: absolute;
  top: 18px; left: 18px;
  z-index: 1;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--pink);
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
}

.hero-body {
  position: relative;
  z-index: 1;
  padding: 16px 18px 20px;
}

.hero-cat {
  font-size: 10px;
  font-weight: 700;
  color: var(--pink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.hero-title {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: white;
  line-height: 1.3;
  word-break: keep-all;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.hero-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
  transition: -webkit-line-clamp 0.2s ease;
}

.hero-card.hero-expanded .hero-desc {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.hero-btns {
  display: flex;
  gap: 10px;
  align-items: center;
}

.hero-btn-primary {
  background: linear-gradient(90deg, var(--purple) 0%, var(--pink) 100%);
  color: white;
  border: none;
  border-radius: 24px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: filter var(--ease), transform var(--ease);
  letter-spacing: 0.01em;
}

.hero-btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); }
.hero-btn-primary:active { transform: translateY(0); transition-duration: 0.1s; }

.hero-btn-info {
  background: transparent;
  color: rgba(255,255,255,0.82);
  border: 1.5px solid rgba(255,255,255,0.42);
  border-radius: 24px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--ease), background var(--ease);
}

.hero-btn-info:hover {
  border-color: rgba(255,255,255,0.72);
  background: rgba(255,255,255,0.06);
}

/* 데스크탑 가로형 레이아웃용 우측 영역 — 모바일에서는 숨김 */
.hero-visual { display: none; }

/* ── WEEKLY PICK — 배경 이미지 통합 ──────────── */

/* 이미지가 카드 전체를 채움
   z-index 스태킹: img(1) → ::after scrim(2) → hero-badge/hero-body(이미 z-index:1이지만 위) */
.hero-bg-img {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0; /* 구형 iOS 호환 */
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 1;
  display: block;
  pointer-events: none;
}

/* 데코 원 숨김 (이미지와 충돌) */
.hero-card--has-bg::before {
  display: none;
}

/* scrim이 이미지 위에 오도록 */
.hero-card--has-bg::after {
  z-index: 2;
}

/* 모바일: 위→아래 그라데이션
   상단은 이미지가 보이고, 하단(텍스트 영역)은 어두워짐 */
.hero-card--has-bg::after {
  background: linear-gradient(
    to top,
    rgba(10, 5, 25, 0.97) 0%,
    rgba(10, 5, 25, 0.75) 35%,
    rgba(10, 5, 25, 0.18) 62%,
    transparent 100%
  );
}

/* hero-badge, hero-body가 scrim 위에 오도록 */
.hero-card--has-bg .hero-badge,
.hero-card--has-bg .hero-body {
  z-index: 3;
}

/* ── Home Main ─────────────────────────────────── */
.home-main {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 8px;
}

/* ── Section Head ──────────────────────────────── */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 16px;
  margin-bottom: 10px;
}

.section-title {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.section-more {
  font-size: 13px;
  color: var(--text2);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: color var(--ease);
}
.section-more:hover { color: var(--text); }

/* ── Scroll Wrapper (arrow buttons sit outside the flow) ── */
.scroll-wrap {
  position: relative;
}

.scroll-arrow {
  display: none; /* visible only on desktop via media query */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(15,8,32,0.88);
  border: 1px solid rgba(255,255,255,0.18);
  color: white;
  font-size: 18px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--ease);
}
.scroll-arrow:hover { background: rgba(124,58,237,0.65); }
.scroll-arrow-left  { left:  4px; }
.scroll-arrow-right { right: 4px; }

@media (min-width: 600px) {
  .scroll-arrow { display: flex; }
}

/* ── Horizontal Scroll Row ─────────────────────── */
/* overflow-x: scroll → 카드 수와 무관하게 일관된 padding-left
   scroll-padding-left → scroll-snap이 padding 안쪽을 스냅 기준으로 삼도록 명시 */
.scroll-row {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  overflow-x: scroll;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 6px 16px 10px;
}
.scroll-row::-webkit-scrollbar { display: none; }

/* ── V2 Cards — 130 × 175 ──────────────────────── */
.v2-card {
  position: relative;
  width: 130px;
  height: 175px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  scroll-snap-align: start;
  box-shadow: 0 4px 18px rgba(0,0,0,0.45);
  transition: transform var(--ease-pop), box-shadow var(--ease);
}

.v2-card:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 10px 32px rgba(0,0,0,0.55);
}
.v2-card:active { transform: translateY(-2px) scale(1.01); transition-duration: 0.1s; }

/* Gradient background layer */
.v2-card-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--c-s, #3D2660) 0%, var(--c-e, #5B3D8B) 100%);
}

/* Decorative circle in top-right */
.v2-card-bg::before {
  content: '';
  position: absolute;
  top: -26px; right: -26px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
}

/* Bottom scrim for text legibility */
.v2-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.76) 0%, transparent 56%);
  pointer-events: none;
}

/* 썸네일 이미지가 있는 카드:
   img(z-index:1) → ::after scrim(z-index:2) → v2-card-body(z-index:3) 순서 */
.v2-card--has-img .v2-card-img {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0; /* inset 미지원 구형 iOS 대응 */
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  z-index: 1; /* scrim(::after z-index:2)보다 아래 */
}

/* scrim이 이미지 위에 오도록 z-index 명시 */
.v2-card--has-img::after {
  z-index: 2;
}

/* 텍스트가 scrim 위에 오도록 */
.v2-card--has-img .v2-card-body {
  z-index: 3;
}

.v2-card-body {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 10px 10px 12px;
  z-index: 1;
}

.v2-card-cat {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--pink);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.v2-card-title {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: white;
  line-height: 1.45;
  word-break: keep-all;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Popular Section — Netflix-style numbered ── */
.popular-row {
  display: flex;
  justify-content: flex-start;
  gap: 4px;
  overflow-x: scroll;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 6px 16px 10px;
}
.popular-row::-webkit-scrollbar { display: none; }

.popular-item {
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* Large hollow rank number behind card */
.rank-num {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-weight: 800;
  font-size: 88px;
  line-height: 0.85;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255,255,255,0.20);
  width: 52px;
  text-align: right;
  flex-shrink: 0;
  z-index: 0;
  user-select: none;
  padding-bottom: 12px; /* aligns baseline with card bottom */
}

/* Card overlaps the number slightly */
.popular-item .v2-card {
  margin-left: -12px;
  z-index: 1;
  position: relative;
}

/* ── Bottom Nav Bar ────────────────────────────── */
.v2-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(8,3,18,0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
}

/* On wide screens, keep nav within 800px */
@media (min-width: 800px) {
  .v2-nav {
    max-width: 800px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    border-radius: 20px 20px 0 0;
  }
}

.v2-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  padding: 6px 18px;
  min-width: 64px;
  font-family: inherit;
  cursor: pointer;
  transition: opacity var(--ease);
}
.v2-nav-btn:active { opacity: 0.7; }

.nav-icon {
  width: 22px; height: 22px;
  fill: none;
  stroke: var(--nav-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke var(--ease);
  display: block;
}

.v2-nav-btn.is-active .nav-icon { stroke: var(--nav-active); }

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--nav-muted);
  letter-spacing: 0.02em;
  transition: color var(--ease);
}
.v2-nav-btn.is-active .nav-label { color: var(--nav-active); }

/* ── Empty State ────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text2);
}
.empty-emoji { font-size: 56px; margin-bottom: 16px; }
.empty-state p { font-size: 15px; line-height: 1.8; }
.empty-hint { font-size: 13px; margin-top: 6px; font-style: italic; }

/* ═══════════════════════════════════════════════════════════
   검색창 (탐색 페이지)
═══════════════════════════════════════════════════════════ */
.search-wrap {
  padding: 10px 16px 4px;
  /* 탐색 페이지에서는 explore-bar가 대체 — 레거시 보존 */
}

.search-input-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  padding: 12px 16px;
  transition: border-color var(--ease);
}

.search-input-box:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

.search-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text2);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  caret-color: var(--purple);
  min-width: 0;
}

.search-input::placeholder { color: var(--nav-muted); }

/* 브라우저 기본 clear 버튼 제거 (자체 UX 사용) */
.search-input::-webkit-search-cancel-button { display: none; }

/* ── 탐색 바 ("← 홈" + 검색창 한 줄) ──────────
   본문과 동일 배경 — 별도 헤더 구분 없이 자연스럽게 */
.explore-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: var(--bg);   /* 본문과 동일 배경색 */
}

.explore-bar-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 10px;
}

/* 검색창: 남은 공간 모두 채움 — 오른쪽 끝이 그리드 오른쪽과 일치 */
.explore-bar-inner .search-input-box {
  flex: 1;
  margin: 0;
}

@media (min-width: 1024px) {
  .explore-bar-inner {
    max-width: 1280px;
    padding: 12px 48px;
  }
  /* 데스크탑: 버튼을 viewport 좌측 끝으로 (explore-bar가 full-width sticky이므로 left=24px = 화면 좌측 24px) */
  .explore-bar-inner .sub-back-btn {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
  }
}

/* ── 검색 결과 영역 ──────────────────────────── */
.explore-results {
  padding: 8px 16px 12px;
}

.search-count {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 12px;
  padding: 0 2px;
}

/* 결과 그리드 — 카드 동일 디자인 유지 */
.search-result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* 그리드 안 카드: 열 너비 채움 */
.search-result-grid .v2-card {
  width: 100%;
  height: 160px;
  flex-shrink: unset;
  scroll-snap-align: none;
}

/* 검색 결과 없음 */
.search-empty {
  padding: 48px 0 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.search-empty-msg {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.search-empty-hint {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}

.search-empty-browse {
  margin-top: 16px;
  background: rgba(124, 58, 237, 0.20);
  border: 1.5px solid rgba(124, 58, 237, 0.40);
  color: var(--text);
  border-radius: 24px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--ease);
}
.search-empty-browse:hover { background: rgba(124, 58, 237, 0.32); }

/* 데스크탑 검색 */
@media (min-width: 768px) {
  .search-result-grid { grid-template-columns: repeat(3, 1fr); }
  .search-result-grid .v2-card { height: 180px; }
  .search-wrap      { padding: 14px 48px 4px; }
  .explore-results  { padding: 8px 48px 12px; }
}

@media (min-width: 1024px) {
  .search-result-grid { grid-template-columns: repeat(4, 1fr); }
  .search-result-grid .v2-card { height: 200px; }
}

/* ═══════════════════════════════════════════════════════════
   STORY PAGE — 인터랙티브 픽션 (타이프라이터 + 다음 버튼)
═══════════════════════════════════════════════════════════ */

/* 전체 화면 — 메인 배경 위에 어두운 오버레이로 영화 분위기 */
.story-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  background: rgba(0, 0, 0, 0.30);  /* 메인 배경보다 살짝 어둡게 */
}

/* 텍스트 영역 — 세로 가운데 정렬, 클릭으로 타이핑 스킵 */
.story-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  cursor: pointer;   /* "클릭하면 건너뛰기" 신호 */
  width: 100%;
}

/* 스토리 텍스트 — 큰 글씨, 가운데 정렬, Pretendard 500 */
.story-text {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.85;
  color: var(--text-color);
  text-align: center;
  word-break: keep-all;
  letter-spacing: -0.01em;
  max-width: 520px;
  width: 100%;
}

/* 타이핑 중 커서 깜빡임 */
.story-text::after {
  content: '▋';
  font-size: 0.85em;
  color: var(--accent);
  animation: story-cursor 0.8s step-end infinite;
  display: inline;
  vertical-align: -0.05em;
  margin-left: 2px;
}

/* 타이핑 완료 → 커서 숨김 */
.story-text.typing-done::after {
  display: none;
}

@keyframes story-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* 하단 버튼 영역 */
.story-footer {
  padding: 20px 24px 52px;
  display: flex;
  justify-content: center;
}

/* "다음 ▶" / "질문으로 ▶" 버튼 — 타이핑 끝나야 페이드인 */
.story-next-btn {
  background: linear-gradient(90deg, var(--primary, #7C3AED) 0%, var(--accent, #DB2777) 100%);
  color: white;
  border: none;
  border-radius: 28px;
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.02em;
  /* opacity는 JS에서 제어 (0→1 페이드인) */
  transition: opacity 0.4s ease, filter 0.2s ease, transform 0.2s ease;
}
.story-next-btn:hover  { filter: brightness(1.12); transform: translateY(-2px); }
.story-next-btn:active { transform: translateY(0); transition-duration: 0.08s; }

@media (min-width: 600px) {
  .story-text { font-size: 22px; }
  .story-next-btn { padding: 15px 52px; font-size: 17px; }
}

/* 후속 스토리(response) — 선택 직후, 좌측에 미묘한 accent 라인으로 차별화 */
.story-page--response .story-text {
  border-left: 3px solid var(--accent, #DB2777);
  padding-left: 20px;
  text-align: left;
}

/* ═══════════════════════════════════════════════════════════
   TEST PAGE — LAYOUT
═══════════════════════════════════════════════════════════ */
.test-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 40px;
  position: relative;
  z-index: 2;
}

.test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 10px;
}

.back-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-color);
  cursor: pointer;
  transition: background var(--ease);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.back-btn:hover { opacity: 0.8; }

.test-counter {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-second);
  letter-spacing: 0.04em;
}

/* Progress bar */
.progress-track {
  height: 3px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 20px 36px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.48s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 0 8px var(--accent);
}

/* ═══════════════════════════════════════════════════════════
   QUESTION CARD (FROSTED GLASS)
═══════════════════════════════════════════════════════════ */
.question-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 16px;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

.question-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 28px 24px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.question-card.visible { opacity: 1; transform: translateY(0); }

.question-number {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.question-text {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text-color);
}

/* ═══════════════════════════════════════════════════════════
   OPTIONS
═══════════════════════════════════════════════════════════ */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  width: 100%;
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 15px 18px;
  text-align: left;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-color);
  cursor: pointer;
  transition: border-color var(--ease), transform var(--ease), background var(--ease);
}
.option-btn:hover:not(:disabled) {
  border-color: var(--accent);
  transform: translateX(6px);
}
.option-btn.selected {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  transform: translateX(6px);
}
.option-btn:disabled { cursor: default; }

/* ═══════════════════════════════════════════════════════════
   RESULT PAGE
═══════════════════════════════════════════════════════════ */
.result-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 64px;
  position: relative;
  z-index: 2;
  gap: 16px;
}

/* ── 결과 카드 (스크린샷 영역) ───────────────────
   headline + caption + 이모지가 한 화면에 들어가게 설계
*/
.result-card {
  background: var(--card-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 30px 22px 22px;
  width: 100%;
  max-width: 380px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(28px) scale(0.97);
  transition: opacity 0.42s ease, transform 0.42s cubic-bezier(0.34,1.56,0.64,1);
}
.result-card.visible { opacity: 1; transform: none; }

/* Ambient glow */
.result-card-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(ellipse at 50% 20%, var(--accent) 0%, transparent 65%);
  opacity: 0.12;
  pointer-events: none;
}

.result-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.result-emoji {
  font-size: 84px;
  line-height: 1;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.18));
}

/* 임팩트 한 줄 헤드라인 */
.result-headline {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-color);
  letter-spacing: -0.02em;
  word-break: keep-all;
}

/* 1~2문장 캐릭터 묘사 */
.result-caption {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-second);
  word-break: keep-all;
  margin-top: 2px;
}

.result-watermark {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--card-border);
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-second);
  opacity: 0.60;
}

/* ── 결과 카드 — 캐릭터 이미지 ──────────────── */
.result-card--has-img {
  padding-top: 0;
  overflow: hidden;
}

.result-card-image-wrap {
  width: calc(100% + 44px); /* card의 양쪽 padding 22px씩 상쇄 */
  margin-left: -22px;
  margin-top: 0;
  margin-bottom: 10px;
  border-radius: 28px 28px 0 0;
  overflow: hidden;
  flex-shrink: 0;
}

.result-card--has-img .result-badge {
  margin-top: 22px;
}

.result-card-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: cover;
  object-position: center top;
}

/* 이미지 로드 실패 시 숨김 */
.result-card-image-wrap.img-error {
  display: none;
}

/* ── 더 알아보기 버튼 ────────────────────────── */
.result-expand-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-second);
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
  font-family: inherit;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.result-expand-btn:hover { background: rgba(255,255,255,0.14); color: var(--text-color); }

.expand-icon {
  display: inline-block;
  transition: transform 0.32s cubic-bezier(0.34,1.56,0.64,1);
  font-style: normal;
}

/* ── 상세 설명 패널 (max-height 애니메이션) ────── */
.result-details-panel {
  width: 100%;
  max-width: 380px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.44s ease, opacity 0.32s ease;
}
.result-details-panel.open {
  max-height: 600px;
  opacity: 1;
}

.result-details-text {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-second);
  word-break: keep-all;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 18px 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── 공유용 한 줄 (share_text) ───────────────── */
.result-share-quote {
  font-size: 13px;
  color: var(--text-second);
  text-align: center;
  line-height: 1.65;
  max-width: 340px;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════
   RESULT — SHARE & NAV BUTTONS
═══════════════════════════════════════════════════════════ */
.result-actions {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 공통 share-btn */
.share-btn {
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: filter var(--ease), transform var(--ease), opacity var(--ease);
}

/* 이미지 카드 — 준비 중 (disabled) */
.share-btn--soon {
  background: var(--card-bg);
  color: var(--text-second);
  border: 1.5px solid var(--card-border);
  cursor: not-allowed;
  opacity: 0.60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
}
.share-btn--soon:hover { opacity: 0.60; }

.soon-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 2px 8px;
  color: var(--text-second);
}

/* 링크 공유 — 활성 */
.share-btn--link {
  background: transparent;
  color: var(--text-second);
  border: 1.5px solid var(--card-border);
  font-size: 14px;
  font-weight: 600;
}
.share-btn--link:hover {
  background: var(--card-bg);
  color: var(--text-color);
  transform: translateY(-1px);
}
.share-btn--link:active { transform: translateY(0); transition-duration: 0.1s; }

.result-nav {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 380px;
}

.nav-btn {
  flex: 1;
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), opacity var(--ease);
  border: 1.5px solid var(--card-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: inherit;
}
.btn-retry { background: var(--card-bg); color: var(--text-color); }
.btn-retry:hover { opacity: 0.85; }
.btn-home { background: transparent; color: var(--text-second); border-color: var(--card-border); }
.btn-home:hover { color: var(--text-color); opacity: 0.85; }

/* ═══════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 88px; /* above nav bar */
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(20,8,48,0.92);
  color: #fff;
  padding: 11px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.24s ease, transform 0.24s ease;
  z-index: 999;
  white-space: nowrap;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════════════════════════
   정보 버튼 SVG 아이콘  (작업 3)
═══════════════════════════════════════════════════════════ */
.info-icon-svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  display: block;
}

.hero-btn-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ═══════════════════════════════════════════════════════════
   정보 모달  (작업 3)
═══════════════════════════════════════════════════════════ */
.info-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.60);
  display: flex;
  align-items: flex-end;     /* 모바일: 아래서 올라오는 시트 */
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.info-modal-backdrop.open { opacity: 1; }

.info-modal {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 600px;
  padding: 28px 24px 40px;
  position: relative;
  transform: translateY(48px);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.info-modal-backdrop.open .info-modal { transform: translateY(0); }

/* 데스크탑 — 중앙 팝업 */
@media (min-width: 600px) {
  .info-modal-backdrop { align-items: center; padding: 20px; }
  .info-modal {
    border-radius: 24px;
    max-width: 480px;
  }
}

.info-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--ease);
}
.info-modal-close:hover { background: rgba(255, 255, 255, 0.18); }
.info-modal-close svg {
  width: 15px; height: 15px;
}

.info-modal-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pink);
  margin-bottom: 8px;
}

.info-modal-title {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  word-break: keep-all;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  padding-right: 36px; /* X 버튼 겹침 방지 */
}

.info-modal-desc {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.65;
  margin-bottom: 18px;
}

.info-modal-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.info-modal-meta-item {
  font-size: 13px;
  color: var(--text2);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 6px 14px;
  border-radius: 20px;
}

.info-modal-start {
  width: 100%;
  background: linear-gradient(90deg, var(--purple) 0%, var(--pink) 100%);
  color: white;
  border: none;
  border-radius: 24px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: filter var(--ease), transform var(--ease);
}
.info-modal-start:hover  { filter: brightness(1.12); transform: translateY(-1px); }
.info-modal-start:active { transform: translateY(0); transition-duration: 0.1s; }

/* ── 인포 모달 — 썸네일 히어로 ──────────────── */
.info-modal--has-img {
  padding-top: 0;
}

.info-modal-hero {
  width: calc(100% + 48px);
  margin-left: -24px;
  margin-top: 0;
  margin-bottom: 20px;
  border-radius: 24px 24px 0 0;
  overflow: hidden;
  max-height: 220px;
}

.info-modal-hero img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center top;
}

.info-modal--has-img .info-modal-cat {
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   서브 페이지 공통 (탐색·카테고리)
═══════════════════════════════════════════════════════════ */
.sub-page {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); /* clears nav + iOS home indicator */
  max-width: 800px;
  margin: 0 auto;
}

/* 고정 서브 헤더 (레거시 — full-header로 대체됨) */
.sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0F0820;
  border-bottom: none;
  gap: 12px;
}

/* 탐색·카테고리 뒤로가기 버튼 — 테스트 페이지 back-btn과 동일한 frosted-glass 스타일 */
.sub-back-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background var(--ease);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}
.sub-back-btn:hover { background: rgba(255, 255, 255, 0.14); }

.sub-title {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  flex: 1;
  letter-spacing: -0.02em;
}

.sub-header-spacer { min-width: 60px; }

/* ═══════════════════════════════════════════════════════════
   탐색 페이지 그리드  (작업 4)
   모바일 1열 → 태블릿 2열 → 데스크탑 3열
═══════════════════════════════════════════════════════════ */
.explore-main { padding-top: 4px; }

.explore-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px;
}

@media (min-width: 540px) {
  .explore-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .explore-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 48px;
    gap: 20px;
  }
}

/* 카테고리 카드 (탐색 페이지) */
.cat-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 148px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  transition: transform var(--ease-pop), box-shadow var(--ease);
}
.cat-card:hover  { transform: translateY(-4px) scale(1.02); box-shadow: 0 10px 32px rgba(0,0,0,0.55); }
.cat-card:active { transform: scale(0.99); transition-duration: 0.1s; }

.cat-card-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--c-s, #3D2660) 0%, var(--c-e, #5B3D8B) 100%);
}

/* Decorative circle */
.cat-card-bg::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  pointer-events: none;
}

/* Scrim */
.cat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.50) 0%, transparent 60%);
  pointer-events: none;
}

.cat-card-body {
  position: relative;
  z-index: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: 100%;
}

.cat-card-emoji {
  font-size: 30px;
  line-height: 1;
  margin-bottom: 4px;
}

.cat-card-title {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: white;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.cat-card-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.55;
}

.cat-card-count {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.50);
  margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════
   카테고리 전체 페이지  (작업 5 + 6)
   모바일 2열 → 태블릿 3열 → 데스크탑 4열
   .cat-grid .v2-card { width: 100% } → 그리드 열 자동 채움
═══════════════════════════════════════════════════════════ */
.cat-main { padding-top: 4px; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

@media (min-width: 768px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}

@media (min-width: 1024px) {
  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 48px;
    gap: 16px;
  }
}

/* 작업 6 — 그리드 안 카드는 열 너비를 채우도록 */
.cat-grid .v2-card {
  width: 100%;
  height: 160px;
  flex-shrink: unset;
  scroll-snap-align: none;
}

@media (min-width: 768px) {
  .cat-grid .v2-card { height: 180px; }
}

@media (min-width: 1024px) {
  .cat-grid .v2-card { height: 200px; }
}

.empty-cat {
  grid-column: 1 / -1;
  padding: 48px 0;
  text-align: center;
  color: var(--text2);
  font-size: 15px;
}

/* ═══════════════════════════════════════════════════════════
   서브 페이지 데스크탑 max-width 확장
═══════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  .sub-page  { max-width: 1280px; }
  .sub-title { font-size: 22px; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — TABLET  768px – 1023px
   모바일 디자인 유지하되 카드 조금 크게, 폰트 살짝 키움
═══════════════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1023px) {
  .v2-home    { max-width: 720px; }

  /* 카드 */
  .v2-card         { width: 150px; height: 200px; border-radius: 16px; }
  .v2-card-title   { font-size: 13px; }

  /* 인기 번호 */
  .rank-num { font-size: 96px; width: 58px; }

  /* 히어로 */
  .hero-card  { min-height: 260px; }
  .hero-title { font-size: 26px; }

  /* 섹션 제목 */
  .section-title { font-size: 19px; }

  /* 스크롤 간격 */
  .scroll-row  { gap: 14px; }
  .popular-row { gap: 4px; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — DESKTOP  1024px+
   진짜 데스크탑다운 넓은 레이아웃
═══════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {

  /* ── 전체 컨테이너 ── */
  .v2-home { max-width: 1280px; }

  /* nav도 동일 너비로 */
  .v2-nav {
    max-width: 1280px;
    /* 800px 브레이크포인트에서 설정한 left/transform 유지, width만 확장 */
  }

  /* ── 헤더: full-header-inner 에서 처리 ── */

  /* ── TODAY'S PICK — 가로형 레이아웃 ── */
  .hero-section { padding: 8px 48px 40px; }

  .hero-card {
    flex-direction: row;        /* 세로→가로 전환 */
    justify-content: flex-start;
    align-items: stretch;
    min-height: 320px;
  }

  /* 스크림: 세로(아래→위) → 가로(왼쪽→오른쪽) */
  .hero-card::after {
    background: linear-gradient(
      to right,
      rgba(0,0,0,0.82) 0%,
      rgba(0,0,0,0.40) 50%,
      transparent 80%
    );
  }

  /* 배경 이미지 있을 때: 좌→우 페이드 (좌측 완전 불투명, 우측 투명) */
  /* z-index: 2 는 모바일 규칙에서 이미 설정됨 */
  .hero-card--has-bg::after {
    background: linear-gradient(
      to right,
      rgba(10, 5, 25, 0.97) 0%,
      rgba(10, 5, 25, 0.80) 30%,
      rgba(10, 5, 25, 0.35) 58%,
      transparent 100%
    );
  }

  /* 텍스트 영역: 좌측 55% */
  .hero-body {
    flex: 0 0 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 52px 64px;
  }

  .hero-title { font-size: 34px; }
  .hero-desc  { font-size: 15px; -webkit-line-clamp: 3; }
  .hero-btns  { gap: 14px; margin-top: 4px; }
  .hero-btn-primary { padding: 12px 30px; font-size: 15px; }
  .hero-btn-info    { padding: 11px 26px; font-size: 15px; }

  /* 시각 영역: 우측 나머지 (장식용 원) */
  .hero-visual {
    display: block;
    flex: 1;
    position: relative;
    overflow: hidden;
    pointer-events: none;
  }
  .hero-vis-1 {
    position: absolute;
    width: 280px; height: 280px;
    top: -60px; right: -60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
  }
  .hero-vis-2 {
    position: absolute;
    width: 140px; height: 140px;
    bottom: 36px; right: 90px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
  }

  /* ── 홈 메인 ── */
  .home-main     { gap: 48px; }
  .section-head  { padding: 0 48px; }
  .section-title { font-size: 22px; }

  /* ── 스크롤 행 ── */
  .scroll-row  { gap: 16px; padding: 8px 48px 14px; scroll-padding-left: 48px; }
  .popular-row { gap: 4px;  padding: 8px 48px 14px; scroll-padding-left: 48px; }

  /* ── 카드 180 × 240 ── */
  .v2-card       { width: 180px; height: 240px; border-radius: 18px; }
  .v2-card-title { font-size: 14px; line-height: 1.4; }
  .v2-card-cat   { font-size: 10px; }

  /* ── 인기 순위 번호 ── */
  .rank-num { font-size: 120px; width: 76px; padding-bottom: 16px; }
  .popular-item .v2-card { margin-left: -18px; }

  /* ── 스크롤 화살표 — 카드 영역 좌우 끝에 오버레이 ── */
  .scroll-arrow        { width: 44px; height: 44px; font-size: 20px; }
  .scroll-arrow-left   { left:  48px; }   /* scroll-row padding과 동일 */
  .scroll-arrow-right  { right: 48px; }
}
