/* ============================================================
   QRID 신청 문서 사이트 — 공통 스타일
   밝은 배경 · 절제된 문서 톤 · Noto Sans KR
   ============================================================ */

:root {
  /* 색 토큰 */
  --paper: #fbfaf7;
  --surface: #ffffff;
  --ink: #191c20;
  --ink-soft: #3f444b;
  --ink-mute: #676d76;
  --line: #e5e2da;
  --line-soft: #eeece5;
  --accent: #1d4ed8;
  --accent-deep: #16308f;
  --accent-wash: #eef2fd;
  --ok: #0b7a48;
  --ok-wash: #e8f5ee;
  --warn: #9a5b00;
  --warn-wash: #fdf3e3;
  --neutral-badge: #5b6169;
  --neutral-wash: #eef0f2;

  /* 타이포 스케일 */
  --fs-hero: clamp(2rem, 1.2rem + 3.4vw, 3.4rem);
  --fs-h1: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem);
  --fs-h2: clamp(1.35rem, 1.1rem + 1.1vw, 1.8rem);
  --fs-h3: clamp(1.05rem, 0.95rem + 0.45vw, 1.2rem);
  --fs-body: clamp(0.98rem, 0.93rem + 0.2vw, 1.06rem);
  --fs-small: 0.86rem;
  --fs-overline: 0.78rem;

  /* 여백 리듬 */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.75rem;
  --space-4: 3rem;
  --space-5: clamp(3.5rem, 2.5rem + 4vw, 6rem);

  --content-width: 52rem;
  --wide-width: 74rem;
  --radius: 10px;

  --font-sans: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic",
    system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ------------------------------------------------------------
   공통 미니 내비
   ------------------------------------------------------------ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-nav nav {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0.65rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-brand {
  font-weight: 900;
  font-size: 1.02rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-brand:hover,
.nav-brand:focus-visible {
  color: var(--accent);
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.site-nav ul::-webkit-scrollbar {
  display: none;
}

.site-nav ul a {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav ul a:hover,
.site-nav ul a:focus-visible {
  background: var(--line-soft);
  color: var(--ink);
}

.site-nav ul a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}

:is(a, button, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   문서 공통 레이아웃
   ------------------------------------------------------------ */
.doc {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-4) clamp(1rem, 4vw, 2.5rem) var(--space-5);
}

.doc-header {
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
  border-bottom: 2px solid var(--ink);
}

.overline {
  display: inline-block;
  font-size: var(--fs-overline);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.doc-header h1 {
  font-size: var(--fs-h1);
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.doc-header .doc-lede {
  margin-top: var(--space-2);
  color: var(--ink-soft);
  max-width: 42rem;
}

.doc-meta {
  margin-top: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  font-size: var(--fs-small);
  color: var(--ink-mute);
}

.doc-meta a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.doc-meta a:hover {
  text-decoration: underline;
}

/* 섹션 */
.doc section + section {
  margin-top: var(--space-5);
}

.doc h2 {
  font-size: var(--fs-h2);
  font-weight: 900;
  line-height: 1.35;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: var(--space-3);
}

.sec-num {
  font-size: 0.8em;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.doc h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
  margin: var(--space-3) 0 var(--space-1);
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent);
  line-height: 1.4;
}

.doc h3:first-of-type {
  margin-top: 0;
}

.doc p {
  margin-bottom: var(--space-2);
  color: var(--ink-soft);
}

.doc ul,
.doc ol {
  margin: 0 0 var(--space-2);
  padding-left: 1.35rem;
  color: var(--ink-soft);
}

.doc li {
  margin-bottom: 0.4rem;
}

.doc li::marker {
  color: var(--ink-mute);
}

.doc strong {
  color: var(--ink);
  font-weight: 700;
}

.doc a {
  color: var(--accent);
}

/* 표 */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-2) 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 0.94em;
}

caption {
  text-align: left;
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--ink-mute);
  padding: 0.7rem 1rem 0;
}

th,
td {
  padding: 0.7rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
  line-height: 1.6;
}

thead th {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--ink-mute);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody tr:last-child :is(th, td) {
  border-bottom: none;
}

tbody th {
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

td .num {
  font-weight: 700;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}

/* 강조 인용/키 문장 */
.key-line {
  margin: var(--space-3) 0;
  padding: var(--space-2) var(--space-3);
  background: var(--accent-wash);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-weight: 700;
  color: var(--accent-deep);
  line-height: 1.6;
}

/* 상태 배지 */
.badge {
  display: inline-block;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}

.badge--live {
  background: var(--ok-wash);
  color: var(--ok);
}

.badge--done {
  background: var(--accent-wash);
  color: var(--accent-deep);
}

.badge--wait {
  background: var(--warn-wash);
  color: var(--warn);
}

.badge--todo {
  background: var(--neutral-wash);
  color: var(--neutral-badge);
}

/* 배지 범례 */
.badge-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  margin: var(--space-2) 0 var(--space-3);
  padding: var(--space-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: var(--fs-small);
  color: var(--ink-mute);
}

.badge-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

/* 지표 스탯 행 */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: var(--space-2) 0 var(--space-3);
}

.stat {
  background: var(--surface);
  padding: var(--space-2) var(--space-2);
}

.stat .stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.stat .stat-label {
  display: block;
  font-size: var(--fs-small);
  color: var(--ink-mute);
  margin-top: 0.2rem;
}

/* 3단계 흐름 */
.flow-steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: var(--space-2);
  margin: var(--space-2) 0 var(--space-3);
}

.flow-steps li {
  counter-increment: step;
  position: relative;
  padding: var(--space-2) var(--space-2) var(--space-2) 3.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 0;
}

.flow-steps li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1.05rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
}

/* 푸터 */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--space-5);
  padding: var(--space-3) clamp(1rem, 4vw, 2.5rem) var(--space-4);
}

.site-footer .inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--fs-small);
  color: var(--ink-mute);
}

.site-footer a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* 문서 하단 이전/다음 이동 */
.doc-pager {
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.doc-pager a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}

.doc-pager a:hover .pager-title {
  color: var(--accent);
}

.doc-pager .pager-dir {
  display: block;
  font-size: var(--fs-overline);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  margin-bottom: 0.2rem;
}

.doc-pager .next {
  text-align: right;
  margin-left: auto;
}

/* ============================================================
   허브(index)
   ============================================================ */
.hub {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: var(--space-5) clamp(1rem, 4vw, 2.5rem);
}

.hub-hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--ink);
}

.hub-hero h1 {
  font-size: var(--fs-hero);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-top: var(--space-2);
}

.hub-hero .hero-sub {
  margin-top: var(--space-3);
  color: var(--ink-soft);
  max-width: 36rem;
}

.hero-side {
  display: grid;
  gap: 0.6rem;
  font-size: var(--fs-small);
  color: var(--ink-mute);
  padding-bottom: 0.3rem;
}

.hero-side .hero-fact {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line-soft);
}

.hero-side .hero-fact:last-child {
  border-bottom: none;
}

.hero-side dt {
  font-weight: 700;
  color: var(--ink-mute);
  flex-shrink: 0;
  min-width: 4.6rem;
}

.hero-side dd {
  color: var(--ink);
  font-weight: 500;
}

.hero-side dd a {
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
  font-size: 1.05rem;
}

.hero-side dd a:hover {
  text-decoration: underline;
}

/* 문서 목록 — 번호 행 리스트 */
.doc-index {
  list-style: none;
  padding: 0;
  margin-top: var(--space-4);
}

.doc-index li + li {
  border-top: 1px solid var(--line);
}

.doc-index a {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.4rem, 3vw, 2.2rem) 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.doc-index a:hover,
.doc-index a:focus-visible {
  background: var(--surface);
}

.doc-index .idx-num {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.doc-index .idx-title {
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.7rem);
  font-weight: 900;
  line-height: 1.35;
}

.doc-index .idx-desc {
  display: block;
  font-size: var(--fs-small);
  font-weight: 400;
  color: var(--ink-mute);
  margin-top: 0.35rem;
}

.doc-index .idx-arrow {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--line);
  transition: color 0.15s ease, transform 0.15s ease;
}

.doc-index a:hover .idx-arrow,
.doc-index a:focus-visible .idx-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

/* ============================================================
   린캔버스 격자
   ============================================================ */
.canvas-page {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: var(--space-4) clamp(1rem, 3vw, 2.5rem) var(--space-5);
}

.canvas-grid {
  display: grid;
  gap: 0.6rem;
  margin-top: var(--space-4);
}

.canvas-cell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}

.canvas-cell h2 {
  font-size: 0.95rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.6rem;
  margin-bottom: 0.7rem;
  border-bottom: 1px solid var(--line-soft);
  line-height: 1.4;
}

.cell-num {
  display: inline-grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.74rem;
  font-weight: 700;
  flex-shrink: 0;
}

.canvas-cell ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.canvas-cell li {
  padding-left: 0.85rem;
  position: relative;
  margin-bottom: 0.55rem;
}

.canvas-cell li:last-child {
  margin-bottom: 0;
}

.canvas-cell li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line);
}

.canvas-cell strong {
  color: var(--ink);
}

.canvas-cell--uvp {
  background: var(--accent-wash);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}

.canvas-cell--uvp h2 {
  color: var(--accent-deep);
  border-bottom-color: color-mix(in srgb, var(--accent) 18%, transparent);
}

.canvas-cell--uvp .cell-num {
  background: var(--accent);
}

.canvas-cell--uvp li::before {
  background: color-mix(in srgb, var(--accent) 45%, transparent);
}

/* 데스크톱: 실제 린캔버스 배치 */
@media (min-width: 64rem) {
  .canvas-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    grid-template-areas:
      "pr pr so so uv uv ad ad sg sg"
      "pr pr km km uv uv ch ch sg sg"
      "co co co co co re re re re re";
  }

  .area-problem { grid-area: pr; }
  .area-solution { grid-area: so; }
  .area-metrics { grid-area: km; }
  .area-uvp { grid-area: uv; }
  .area-advantage { grid-area: ad; }
  .area-channels { grid-area: ch; }
  .area-segments { grid-area: sg; }
  .area-cost { grid-area: co; }
  .area-revenue { grid-area: re; }
}

/* ============================================================
   피치덱 — 세로 스크롤 슬라이드
   ============================================================ */
html:has(.page-deck) {
  scroll-snap-type: y proximity;
}

.page-deck .deck-header {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-3) clamp(1rem, 4vw, 2.5rem) 0;
}

.slide {
  min-height: 100svh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.slide-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  width: 100%;
  padding: clamp(4.5rem, 10vh, 7rem) clamp(1rem, 4vw, 2.5rem);
}

.slide-kicker {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  font-size: var(--fs-overline);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  margin-bottom: var(--space-2);
}

.slide-kicker .k-num {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.slide h2 {
  font-size: clamp(1.6rem, 1.1rem + 2.6vw, 2.7rem);
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
  max-width: 38rem;
}

.slide p,
.slide li {
  color: var(--ink-soft);
}

.slide ul {
  padding-left: 1.35rem;
  max-width: 40rem;
}

.slide li {
  margin-bottom: 0.6rem;
}

.slide--title {
  border-bottom-width: 2px;
  border-bottom-color: var(--ink);
}

.slide--title h1 {
  font-size: var(--fs-hero);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.015em;
  max-width: 44rem;
  margin-bottom: var(--space-3);
}

.slide--title .title-brand {
  color: var(--accent);
}

.slide-facts {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.slide-facts li {
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink-soft);
  margin: 0;
}

.slide .table-scroll {
  max-width: 44rem;
}

.slide .stat-row {
  max-width: 44rem;
}

.slide .flow-steps {
  max-width: 40rem;
}

.slide .key-line {
  max-width: 40rem;
}

/* 슬라이드 카운터 + 힌트 */
.deck-counter {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: 1.2rem;
  z-index: 30;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--fs-small);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  letter-spacing: 0.06em;
}

.deck-hint {
  position: fixed;
  left: clamp(1rem, 3vw, 2rem);
  bottom: 1.2rem;
  z-index: 30;
  font-size: var(--fs-overline);
  color: var(--ink-mute);
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
}

.deck-hint kbd {
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 0.35rem;
  background: var(--surface);
}

@media (max-width: 47.9rem) {
  .deck-hint {
    display: none;
  }
}

/* ============================================================
   반응형 보정
   ============================================================ */
@media (max-width: 63.9rem) {
  .hub-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 47.9rem) {
  .doc-index a {
    grid-template-columns: 2.6rem minmax(0, 1fr);
  }

  .doc-index .idx-arrow {
    display: none;
  }

  .doc h2 {
    flex-direction: column;
    gap: 0.15rem;
  }
}
