/*
 * 스퀘어 톡 웹 — po24lio 디자인 언어(포폴·블로그·루이보스와 같은 토큰).
 * 기준 보드: https://claude.ai/artifact/EvG1U5TZAE6kDm6uLq7btD
 * 새 색·길이·곡선을 만들지 않는다. 필요하면 보드와 이 표를 먼저 바꾼다.
 *
 * 모션 (Devouring Details 실측, po24lio 와 공유)
 *   --dur-instant 150ms  포인터 아래 피드백(호버·눌림)
 *   --dur-fast    200ms  실제로 바뀐 상태
 *   --dur         320ms  중간 전환
 *   --dur-slow    640ms  등장(fadeInBlur) — 70ms 간격, 히어로에서 한 번만
 *   --ease-out    등장 / --ease 테마 원형 확산(360ms) / --ease-state 상태 변화
 *
 * 스퀘어만의 것: 강조색 대신 '내 위치' 점 하나만 좋아요 빨강(--me),
 * 헤드라인 800(스토어 이미지와 같음), 반경 링 모티프.
 */

:root {
  --bg: #fcfcfc;
  --bg-hover: #f3f3f3;
  --bg-card: #f6f6f6;
  --ink: #0f0f0f;
  --ink-secondary: #6b6b6b;
  --ink-tertiary: #9c9c9c;
  --line: #e8e8e8;
  --line-strong: #cfcfcf;
  --me: #ef4444;

  --radius: 10px;
  --radius-sm: 6px;
  --frame: 960px;
  --header-h: 56px;
  --control-h: 44px;

  --dur-instant: 150ms;
  --dur-fast: 200ms;
  --dur: 320ms;
  --dur-slow: 640ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-state: cubic-bezier(0.23, 0.88, 0.26, 0.92);

  --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --font-mono: 'JetBrains Mono', 'Pretendard Variable', Pretendard, ui-monospace, SFMono-Regular, Menlo, monospace;

  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #0d0d0d;
  --bg-hover: #161616;
  --bg-card: #141414;
  --ink: #f2f2f2;
  --ink-secondary: #9a9a9a;
  --ink-tertiary: #6a6a6a;
  --line: #222222;
  --line-strong: #3a3a3a;
  --me: #f26b6b;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; }
h1, h2, h3, p, dl, dd { margin: 0; }

::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: var(--radius-sm); }

/* 테마를 바꾸는 순간 호버·상태 전환이 따라 움직이지 않게 */
[data-theme-switching] *, [data-theme-switching] *::before, [data-theme-switching] *::after { transition: none !important; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

.frame { width: 100%; max-width: var(--frame); margin: 0 auto; padding: 0 24px; }
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--ink-tertiary);
  font-variant-numeric: tabular-nums;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 링 그림이 화면 밖으로 넘쳐도 가로 스크롤이 생기지 않게 */
main { overflow-x: hidden; overflow-x: clip; } /* clip 미지원(iOS 15 이하)은 hidden */

/* ── 헤더: 바탕 80% + 블러, 스크롤하면 헤어라인 ── */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  background: var(--bg); /* color-mix 미지원 브라우저 */
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
}
.header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--line);
  opacity: 0;
  transition: opacity var(--dur-instant) var(--ease-out);
}
.header[data-scrolled]::after { opacity: 1; }
.header-row { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: flex; align-items: center; gap: 8px; min-height: var(--control-h); }
.brand-mark { width: 22px; height: 22px; color: var(--ink); }
.brand-name { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }

.nav { display: flex; align-items: center; gap: 20px; }
.nav a { font-size: 14px; font-weight: 500; color: var(--ink-secondary); transition: color var(--dur-instant) var(--ease-out); }
.nav a.nav-strong { color: var(--ink); }
.nav-sep { width: 1px; height: 14px; background: var(--line-strong); }
.theme-toggle {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin-right: -15px;
  width: var(--control-h);
  height: var(--control-h);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-secondary);
  transition: color var(--dur-instant) var(--ease-out);
}
.theme-toggle::before { content: '●'; }
:root[data-theme='dark'] .theme-toggle::before { content: '○'; }

/* ── 버튼: 주 = ink 채움, 보조 = 선. 기기 스토어가 주버튼 ── */
.stores { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  height: var(--control-h);
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  transition: opacity var(--dur-instant) var(--ease-out), background-color var(--dur-instant) var(--ease-out), transform var(--dur-instant) var(--ease-out);
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:active { transform: scale(0.97); }
.btn-primary,
:root:not([data-os='android']) .store-apple,
:root[data-os='android'] .store-play { background: var(--ink); border-color: var(--ink); color: var(--bg); }
:root[data-os='android'] .store-play { order: -1; }

@media (hover: hover) {
  .nav a:hover, .theme-toggle:hover, .footer a:hover, .back:hover { color: var(--ink); }
  .btn:hover { background: var(--bg-hover); }
  .btn-primary:hover,
  :root:not([data-os='android']) .store-apple:hover,
  :root[data-os='android'] .store-play:hover { background: var(--ink); opacity: 0.85; }
  .toc a:hover { color: var(--ink); }
}

/* ── 글자 ── */
.display { font-size: 64px; line-height: 1.14; font-weight: 800; letter-spacing: -0.035em; }
.title { font-size: 32px; line-height: 1.25; font-weight: 800; letter-spacing: -0.035em; }
.lead { font-size: 18px; line-height: 1.6; color: var(--ink-secondary); max-width: 30em; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-tertiary); display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-tertiary); }

/* ── 등장: fadeInBlur, 히어로에서 한 번만 ── */
.rise { animation: fadeInBlur var(--dur-slow) var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes fadeInBlur {
  from { opacity: 0; filter: blur(4px); transform: translateY(6px); }
}

/* ── 히어로 + 반경 링 ── */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 24px; align-items: center; padding: 96px 0 104px; }
.hero-copy { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.hero-copy .stores { margin-top: 8px; }
.ring-art { width: 640px; height: 640px; margin: -100px -180px -100px 0; overflow: visible; }
.ring-art .ring { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.ring-art .ring-faint { fill: none; stroke: var(--line); stroke-width: 1; }
.ring-art .axis { stroke: var(--line); stroke-width: 1; }
.ring-art .post { fill: var(--ink-secondary); }
.ring-art .dist { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; fill: var(--ink-tertiary); }
.ring-art .me { fill: var(--me); }
.ring-art .me-halo { fill: none; stroke: var(--me); stroke-opacity: 0.3; }

/* ── 기능 줄: 01/05 ~ 05/05 ── */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; align-items: center; padding: 80px 0; border-top: 1px solid var(--line); }
.feature.flip { grid-template-columns: 300px minmax(0, 1fr); }
.feature.flip .feature-copy { order: 2; }
.feature-copy { display: flex; flex-direction: column; gap: 16px; }
.capture { width: 280px; justify-self: center; border-radius: 36px; border: 1px solid var(--line-strong); background: var(--bg-card); overflow: hidden; }
.capture img { width: 100%; height: auto; }
.capture .cap-dark { display: none; }
:root[data-theme='dark'] .capture .cap-light { display: none; }
:root[data-theme='dark'] .capture .cap-dark { display: block; }

.open-diagram { width: 300px; justify-self: center; display: flex; flex-direction: column; gap: 28px; }
.open-step { display: flex; flex-direction: column; }
.open-step .mono { padding-bottom: 8px; }
.open-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); }
.open-row:last-of-type { border-bottom: 1px solid var(--line); }
.open-who { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.open-who::before { content: ''; width: 28px; height: 28px; border-radius: 50%; border: 1px dashed var(--line-strong); }
.open-step.is-open .open-who::before { border: 0; background: var(--ink); }
.open-row .mono.on { color: var(--ink); }
.open-result { font-size: 14px; color: var(--ink-secondary); padding-top: 10px; }
.open-step.is-open .open-result { color: var(--ink); font-weight: 500; }

/* ── 안전: 사실 행 ── */
.safety { border-top: 1px solid var(--line); padding-top: 96px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 40px; }
.safety-head { display: flex; flex-direction: column; gap: 16px; }
.facts { display: grid; grid-template-columns: 96px minmax(0, 1fr); border-top: 1px solid var(--line); }
.facts dt, .facts dd { padding: 18px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; color: var(--ink-tertiary); padding-top: 21px; }
.facts dd span { display: block; font-size: 14px; color: var(--ink-secondary); margin-top: 2px; }
.text-link { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: text-decoration-color var(--dur-instant) var(--ease-out); }
@media (hover: hover) { .text-link:hover { text-decoration-color: currentColor; } }

/* ── 마무리 ── */
.closing { border-top: 1px solid var(--line); padding: 112px 0 120px; display: flex; flex-direction: column; align-items: flex-start; gap: 28px; }

/* ── 푸터 ── */
.footer { border-top: 1px solid var(--line); padding: 40px 0 48px; }
.footer .frame { display: flex; flex-direction: column; gap: 20px; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 14px; }
.footer a { color: var(--ink-secondary); transition: color var(--dur-instant) var(--ease-out); }

/* ── 문서(약관·개인정보): 680 읽기 칼럼 + 조항 목차 ── */
.back { color: var(--ink-secondary); transition: color var(--dur-instant) var(--ease-out); }
.doc-head { padding-top: 56px; display: flex; flex-direction: column; gap: 20px; }
.doc-title { font-size: 32px; line-height: 1.25; font-weight: 500; letter-spacing: -0.02em; }
.seg { display: inline-flex; align-self: flex-start; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 3px; gap: 2px; }
.seg a { height: 36px; padding: 0 14px; border-radius: var(--radius-sm); display: flex; align-items: center; font-size: 14px; font-weight: 500; color: var(--ink-secondary); }
.seg a[aria-current='page'] { background: var(--ink); color: var(--bg); }
.doc-layout { display: grid; grid-template-columns: 200px minmax(0, 680px); gap: 56px; padding: 56px 0 112px; align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 24px); display: flex; flex-direction: column; }
.toc .mono { padding-bottom: 8px; }
.toc a { font-size: 14px; color: var(--ink-secondary); padding: 6px 0; transition: color var(--dur-instant) var(--ease-out); }
.doc-body > p { color: var(--ink-secondary); padding-bottom: 24px; }
.article { padding: 32px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.article h2 { font-size: 18px; line-height: 1.4; font-weight: 500; letter-spacing: -0.01em; display: flex; gap: 12px; align-items: baseline; }
.article p, .article ul, .article ol { margin: 0; color: var(--ink-secondary); }
.article ul, .article ol { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.article strong { color: var(--ink); font-weight: 500; }
.article h3 { font-size: 15px; line-height: 1.5; font-weight: 500; color: var(--ink); margin: 10px 0 0; display: flex; gap: 8px; align-items: baseline; }
.article .sub { display: inline-block; padding-left: 12px; }

/* ── 공유 글 링크 ── */
.share { min-height: 100dvh; display: flex; flex-direction: column; overflow: hidden; overflow: clip; } /* clip: 헤더 sticky 가 이 상자에 갇히지 않게 */
.share-body { flex: 1 1 auto; position: relative; padding-top: 48px; display: flex; flex-direction: column; gap: 16px; }
.share-body > :not(svg) { position: relative; }
.share-ring { position: absolute; width: 420px; height: 420px; right: -150px; top: 150px; }
.share-ring .ring { fill: none; stroke: var(--line-strong); }
.share-ring .ring-faint { fill: none; stroke: var(--line); }
.share-ring .me { fill: var(--me); }
.share-title { font-size: 32px; line-height: 1.2; font-weight: 800; letter-spacing: -0.035em; }
.share-actions { position: relative; background: var(--bg); padding-top: 24px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 12px; max-width: 480px; }
.share-actions .btn { width: 100%; }
.share-stores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.share-stores .btn { background: none; border-color: var(--line-strong); color: var(--ink); }

@media (max-width: 760px) {
  .display { font-size: 40px; }
  .title { font-size: 26px; }
  .lead { font-size: 16px; }
  .nav .nav-wide { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 56px 0 24px; gap: 8px; }
  .ring-art { width: 420px; height: 420px; margin: 0 auto -40px; justify-self: center; }
  .feature, .feature.flip { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 56px 0; }
  .feature.flip .feature-copy { order: 0; }
  .capture { width: 240px; }
  .safety { padding-top: 56px; padding-bottom: 56px; }
  .facts { grid-template-columns: 72px minmax(0, 1fr); }
  .closing { padding: 72px 0; }
  .footer-row { flex-direction: column; align-items: flex-start; }
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 32px; }
  .toc { display: none; }
}

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