/* 사방 소개 페이지
   방(벽)은 앱 배경색, 그 아래는 바닥. 캐릭터가 선 선이 벽과 바닥의 경계다. */

:root {
  --room: #f2f2f7;
  --floor: #ffffff;
  --ink: #262121;
  --soft: #6c6c70;
  --line: #d9d9de;
  --paper: #ffffff;
  --pink: #fa6b95;
  --cta-bg: #262121;
  --cta-ink: #ffffff;
  --shadow: rgba(38, 33, 33, 0.1);

  --serif: "Gowun Batang", "Noto Serif KR", "Nanum Myeongjo", "AppleMyungjo", serif;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;

  --fig-h: clamp(270px, 44vh, 400px);
  --gutter: clamp(1.25rem, 5vw, 3rem);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --room: #000000;
    --floor: #1c1c1e;
    --ink: #f2f2f7;
    --soft: #98989f;
    --line: #3a3a3c;
    --paper: #2c2c2e;
    --cta-bg: #f2f2f7;
    --cta-ink: #1c1c1e;
    --shadow: rgba(0, 0, 0, 0.5);
  }
}

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

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

body {
  margin: 0;
  background: var(--floor);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: break-word;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
p { text-wrap: pretty; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 70rem; margin-inline: auto; padding-inline: var(--gutter); }

/* ── 방 ─────────────────────────────────────────── */

.wall { background: var(--room); }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
}
.brand img { width: 2.25rem; height: 2.25rem; border-radius: 0.6rem; }
.lang { font-size: 0.9375rem; color: var(--soft); text-underline-offset: 0.25em; }
.lang:hover { color: var(--ink); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  padding-top: clamp(1.5rem, 5vh, 3.5rem);
}

.pitch h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.75rem, 0.9rem + 2.9vw, 3.25rem);
  line-height: 1.32;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
/* 구절 단위로만 줄을 바꾼다 */
.pitch h1 span { display: inline-block; }
.lede {
  margin-top: 1.25rem;
  max-width: 30em;
  color: var(--soft);
  font-size: 1.125rem;
}

.stores { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.75rem 1.5rem;
  border: 1.5px solid var(--cta-bg);
  border-radius: 999px;
  background: var(--cta-bg);
  color: var(--cta-ink);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.store:hover { transform: translateY(-2px); }
.store:active { transform: none; }

/* 내 기기의 스토어가 아니면 한 발 물러난다 */
[data-platform="ios"] .store[data-store="android"],
[data-platform="android"] .store[data-store="ios"] {
  order: 2;
  background: transparent;
  color: var(--ink);
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  width: min(100%, 26rem);
}

.bubble {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 5.75rem;
  padding: 1.125rem 1.5rem;
  border-radius: 1.375rem;
  background: var(--paper);
  box-shadow: 0 10px 30px -12px var(--shadow);
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.0625rem, 0.95rem + 0.5vw, 1.25rem);
  line-height: 1.5;
  text-align: center;
}
.bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.55rem;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: -0.625rem;
  border-radius: 0 0 0.3rem 0;
  background: var(--paper);
  transform: rotate(45deg);
}
.bubble-text { position: relative; z-index: 1; }
.bubble-text.in { animation: say 0.45s ease both; }
@keyframes say { from { opacity: 0; transform: translateY(0.35rem); } }

.figure {
  position: relative;
  z-index: 1;
  width: calc(var(--fig-h) * 220 / 300);
  height: var(--fig-h);
  margin: 1.25rem 0 calc(var(--fig-h) * -0.12);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.figure svg { width: 100%; height: 100%; overflow: visible; }
.fig-shadow { fill: #000; opacity: 0.13; }
.fig-back, .fig-front {
  fill: none;
  stroke: var(--ink);
  stroke-width: 6.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fig-back { opacity: 0.55; }
.fig-head { fill: #fff; stroke: #262121; stroke-width: 5.5; }
.fig-face { fill: none; stroke: #262121; stroke-linecap: round; }
.fig-face .eye { fill: #262121; stroke: none; }

@media (prefers-color-scheme: dark) {
  .fig-shadow { fill: #fff; opacity: 0.1; }
}

.figure .fallback { width: 60%; margin: 20% auto 0; border-radius: 22%; }

/* ── 바닥: 세션 조작 ─────────────────────────────── */

.ground-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding-top: calc(var(--fig-h) * 0.12 + 1rem);
}

.controls {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.625rem;
  justify-self: center;
  width: min(100%, 26rem);
  min-height: 8.5rem;
  text-align: center;
}
.dots { display: flex; gap: 0.5rem; height: 0.5rem; }
.dots span { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--line); }
.dots span.on { background: var(--pink); }
.hint, .premium-note { color: var(--soft); font-size: 0.875rem; }
.ask { font-family: var(--serif); font-weight: 700; font-size: 1.125rem; }
.escalate {
  min-height: 3rem;
  padding: 0.625rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--pink);
  color: #262121;
  font: 600 1rem/1.3 var(--sans);
  cursor: pointer;
}
.escalate:hover { filter: brightness(1.05); }

.controls[data-state="playing"] .when-finished,
.controls[data-state="finished"] .when-playing { display: none; }

.scan {
  display: none;
  align-items: center;
  gap: 1.25rem;
  align-self: start;
  color: var(--soft);
  font-size: 0.9375rem;
}
.scan img { width: 6.5rem; height: 6.5rem; padding: 0.5rem; border-radius: 0.75rem; background: #fff; border: 1px solid var(--line); }
.scan strong { display: block; color: var(--ink); font-weight: 600; }

/* ── 본문 ───────────────────────────────────────── */

.block { padding-block: clamp(3.5rem, 9vw, 6.5rem); }
.block + .block { border-top: 1px solid var(--line); }

.block h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.625rem, 1.2rem + 1.8vw, 2.375rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.block .sub { margin-top: 0.875rem; max-width: 34em; color: var(--soft); }

.steps {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(68vw, 17rem);
  gap: 1.25rem;
  margin: 2.5rem calc(var(--gutter) * -1) 0;
  padding: 0 var(--gutter) 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  counter-reset: step;
}
.steps li { scroll-snap-align: start; counter-increment: step; }
.steps img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 1.75rem;
  background: #f2f2f7;
}
.steps h3 { margin-top: 1.25rem; font-size: 1.125rem; font-weight: 700; }
.steps h3::before {
  content: counter(step) ".";
  margin-right: 0.4em;
  font-family: var(--serif);
  color: var(--pink);
}
.steps p { margin-top: 0.375rem; color: var(--soft); font-size: 0.9688rem; }

.rooms-grid { display: grid; gap: 2.5rem; }
.rooms li { padding-block: 1.25rem; border-top: 1px solid var(--line); }
.rooms li:last-child { border-bottom: 1px solid var(--line); }
.rooms h3 { font-family: var(--serif); font-weight: 700; font-size: 1.3125rem; }
.rooms p { margin-top: 0.25rem; color: var(--soft); }
.plan { margin-top: 1.5rem; max-width: 30em; font-size: 0.9688rem; color: var(--soft); }
.plan strong { color: var(--ink); font-weight: 600; }

.promises { display: grid; gap: 2rem; margin-top: 2.5rem; }
.promises h3 { font-size: 1.125rem; font-weight: 700; }
.promises p { margin-top: 0.375rem; color: var(--soft); font-size: 0.9688rem; }

.closing { background: var(--room); border-top: 0; }
.block + .closing { border-top: 0; }
.closing .stores { margin-top: 1.75rem; }

.foot { padding-block: 2rem 3rem; background: var(--room); color: var(--soft); font-size: 0.875rem; }
.foot .wrap { display: grid; gap: 0.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.foot a { text-underline-offset: 0.25em; }
.foot a:hover { color: var(--ink); }

/* ── 넓은 화면 ──────────────────────────────────── */

@media (min-width: 64rem) {
  .hero-grid, .ground-grid {
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
    column-gap: clamp(2rem, 4vw, 4rem);
  }
  .hero-grid { align-items: end; min-height: min(70svh, 40rem); }
  .pitch { align-self: center; padding-bottom: 3rem; }
  .ground-grid > .controls { grid-column: 2; grid-row: 1; }
  .ground-grid > .scan { grid-column: 1; grid-row: 1; }
}

@media (min-width: 52rem) {

  .steps {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1.5rem, 4vw, 3.5rem);
    margin-inline: 0;
    padding: 0;
    overflow: visible;
  }
  .steps img { max-width: 17rem; }

  .rooms-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(2rem, 6vw, 5rem); align-items: start; }
  .promises { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3.5rem); }
}

@media (min-width: 64rem) and (hover: hover) {
  .scan { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  .bubble-text.in { animation: none; }
  .store { transition: none; }
  .store:hover { transform: none; }
}
