/* Ristamo 웹: 앱의 "나이트 짐" 한 테마 그대로 (docs/DESIGN.md). 어두운 바탕, 라임 포인트, 넓은 숫자 글꼴.
   레이아웃: 위에서 아래로 "기능 하나 = 앱 화면 + 그 기능만의 숫자" 구간을 쌓는다. */
:root {
  --bg: #0b0c0e;
  --surface: #15171b;
  --raised: #1e2126;
  --line: #23262c;
  --line-strong: #2a2e35;
  --text: #f4f5f7;
  --text2: #9298a2;
  --text3: #7a808a;
  --accent: #c6f432;
  --on-accent: #0b0c0e;
  --info: #7cc4ff;
  --warning: #ffb547;
  --display: "Archivo", "Noto Sans KR", system-ui, sans-serif;
  --body: "Noto Sans KR", system-ui, -apple-system, sans-serif;
  --radius-card: 22px;
  --radius-hero: 28px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all; /* 한국어는 낱말 중간에서 줄을 바꾸지 않는다 */
  overflow-wrap: anywhere;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------- 글자 ---------- */
.num { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
h1, h2, h3 { margin: 0; font-weight: 900; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(34px, 5.4vw, 62px); line-height: 1.14; }
h2 { font-size: clamp(28px, 4.2vw, 46px); line-height: 1.18; }
h3 { font-size: 19px; line-height: 1.4; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
.lead { color: var(--text2); font-size: clamp(16px, 1.6vw, 19px); max-width: 34em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; color: var(--accent);
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.muted { color: var(--text2); }
.accent { color: var(--accent); }

/* ---------- 상단 ---------- */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.logo { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 22px; text-decoration: none; letter-spacing: -0.02em; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 15px; color: var(--text2); }
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 640px) { .nav-links .hide-sm { display: none; } }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 54px; padding: 0 26px; border-radius: 18px;
  font-family: var(--body); font-size: 17px; font-weight: 800; text-decoration: none;
  border: 0; cursor: pointer; transition: transform 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: #d4ff4a; }
.btn-ghost { background: var(--raised); color: var(--text); }
.btn-ghost:hover { background: var(--line-strong); }
.btn-sm { height: 40px; padding: 0 16px; border-radius: 14px; font-size: 15px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- 기기 틀 ---------- */
.phone {
  position: relative; width: min(100%, 300px); aspect-ratio: 496 / 1080;
  border-radius: 46px; padding: 10px; background: #1a1c21;
  box-shadow: 0 0 0 1.5px #2e3239, 0 40px 80px -30px rgba(0, 0, 0, 0.9), 0 0 120px -40px rgba(198, 244, 50, 0.18);
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 37px; }
.phone::after { /* 다이내믹 아일랜드 */
  content: ""; position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 31%; height: 3.2%; border-radius: 99px; background: #000;
}
.watch {
  position: relative; width: 168px; aspect-ratio: 416 / 496; border-radius: 44px; padding: 9px;
  background: #1a1c21; box-shadow: 0 0 0 1.5px #2e3239, 0 30px 60px -20px rgba(0, 0, 0, 0.9);
}
.watch img { width: 100%; height: 100%; object-fit: cover; border-radius: 35px; }
.watch::after { /* 크라운 */
  content: ""; position: absolute; right: -7px; top: 26%; width: 7px; height: 22%; border-radius: 0 6px 6px 0; background: #2a2d33;
}

/* ---------- 첫 화면 ---------- */
.hero { padding-block: clamp(48px, 8vw, 96px) clamp(40px, 6vw, 72px); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 48px; align-items: center; }
.hero-copy { display: grid; gap: 22px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.hero-note { font-size: 14px; color: var(--text3); }
.hero-stage { position: relative; display: flex; justify-content: center; min-height: 560px; }
.hero-stage .phone { width: 280px; transform: rotate(-3deg); }
.hero-stage .watch { position: absolute; right: max(0px, calc(50% - 250px)); bottom: 36px; transform: rotate(5deg); }
.rest-chip {
  position: absolute; left: max(0px, calc(50% - 270px)); top: 64px;
  display: flex; align-items: center; gap: 14px; padding: 14px 18px 14px 14px;
  background: rgba(21, 23, 27, 0.92); border: 1px solid var(--line-strong); border-radius: 22px;
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.8);
}
.ring { --p: 0.62; position: relative; width: 58px; height: 58px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 360deg), var(--line) 0); }
.ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.rest-chip .label { font-size: 12px; color: var(--text2); line-height: 1.3; }
.rest-chip .time { font-size: 28px; line-height: 1; }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .hero-stage { min-height: 520px; }
}
@media (max-width: 480px) {
  .hero-stage .phone { width: 240px; }
  .hero-stage .watch { width: 132px; right: 0; bottom: 20px; }
  .rest-chip { left: 0; top: 30px; }
}

/* ---------- 사실 띠 ---------- */
.facts { border-block: 1px solid var(--line); }
.facts .wrap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fact { padding: 22px 18px 22px 0; display: grid; gap: 2px; }
.fact b { font-size: 16px; }
.fact span { font-size: 14px; color: var(--text2); }
@media (max-width: 760px) { .facts .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 구간 ---------- */
.section { padding-block: clamp(64px, 9vw, 120px); scroll-margin-top: 64px; }
.section-head { display: grid; gap: 16px; max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } .split .order-first-sm { order: -1; } }
.device-row { display: flex; gap: 20px; justify-content: center; align-items: flex-end; flex-wrap: wrap; }

/* 음식: 세 단계 */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.step { display: grid; gap: 18px; align-content: start; }
.step .phone { width: 100%; max-width: 280px; margin-inline: auto; }
.step-num { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 15px; color: var(--accent); }
.step h3 { margin-top: -10px; }
.step p { color: var(--text2); font-size: 15px; }
@media (max-width: 860px) { .steps { grid-template-columns: minmax(0, 1fr); gap: 48px; } }
.scan { position: relative; overflow: hidden; border-radius: 37px; }
.scan::after {
  content: ""; position: absolute; left: 0; right: 0; height: 18%; top: 14%;
  background: linear-gradient(transparent, rgba(198, 244, 50, 0.38), transparent);
  animation: scan 2.6s ease-in-out infinite alternate;
}
@keyframes scan { from { top: 13%; } to { top: 33%; } }

.kcal-change {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 18px;
  margin-top: clamp(40px, 6vw, 64px); padding: 28px 30px; border-radius: var(--radius-hero);
  background: var(--surface); border: 1px solid var(--line);
}
.kcal-change .from { font-size: clamp(40px, 7vw, 80px); color: var(--text3); text-decoration: line-through; text-decoration-thickness: 3px; }
.kcal-change .arrow { font-size: clamp(28px, 4vw, 44px); color: var(--text2); }
.kcal-change .to { font-size: clamp(52px, 9vw, 104px); color: var(--accent); line-height: 1; }
.kcal-change .unit { font-size: 20px; color: var(--text2); font-weight: 700; }
.kcal-change p { flex-basis: 100%; color: var(--text2); font-size: 15px; }
.kcal-change mark { background: none; color: var(--text); font-weight: 700; }

/* 코치: 상황 카드 */
.cases { display: grid; gap: 12px; margin-top: 28px; }
.case { display: grid; grid-template-columns: 138px minmax(0, 1fr); gap: 16px; align-items: center;
  padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.case .num { font-size: 26px; line-height: 1; white-space: nowrap; }
@media (max-width: 480px) { .case { grid-template-columns: 112px minmax(0, 1fr); } .case .num { font-size: 21px; } }
.case .up { color: var(--accent); }
.case .down { color: var(--warning); }
.case b { display: block; font-size: 15px; }
.case span { font-size: 14px; color: var(--text2); }

/* 워치 */
.checks { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.checks li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; }
.checks li::before {
  content: "✓"; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-weight: 900; font-size: 14px;
}
.checks b { display: block; }
.checks span { color: var(--text2); font-size: 15px; }

/* 무료 / 요금 */
.free-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 64px; }
.free-item { padding: 18px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 4px; }
.free-item b { font-size: 16px; }
.free-item span { font-size: 14px; color: var(--text2); }
@media (max-width: 760px) {
  .free-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 48px; }
  .free-item { padding: 14px 14px; }
  .free-item b { font-size: 15px; }
  .free-item span { font-size: 13px; }
}

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan {
  position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: 18px;
  padding: 28px 24px 24px; border-radius: var(--radius-hero); background: var(--surface); border: 1px solid var(--line);
}
.plan.featured { border: 1.5px solid var(--accent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface) 46%); }
.plan .badge { position: absolute; top: -13px; left: 24px; padding: 3px 12px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 800; }
.plan h3 { font-size: 22px; font-weight: 900; }
.plan .for { color: var(--text2); font-size: 14px; margin-top: 2px; }
.price { display: flex; align-items: baseline; gap: 6px; }
.price .num { font-size: 40px; line-height: 1; }
.price span { color: var(--text2); font-size: 15px; font-weight: 700; }
.limits { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; align-content: start; }
.limits li { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; padding-bottom: 10px; border-bottom: 1px dashed var(--line-strong); }
.limits li:last-child { border-bottom: 0; }
.limits li span { color: var(--text2); }
.limits li b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.limits li.off b, .limits li.off span { color: var(--text3); font-weight: 400; }
.plan .btn { width: 100%; }
.plans-note { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--text2); font-size: 14px; }
@media (max-width: 960px) { .plans { grid-template-columns: minmax(0, 1fr); max-width: 480px; margin-inline: auto; } }

/* 개인정보 */
.privacy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.privacy-card { padding: 26px 24px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 10px; align-content: start; }
.privacy-card .num { font-size: 15px; color: var(--accent); }
.privacy-card p { color: var(--text2); font-size: 15px; }
@media (max-width: 860px) { .privacy-grid { grid-template-columns: minmax(0, 1fr); } }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 22px; font-weight: 700; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 900; font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 22px 20px; color: var(--text2); font-size: 15px; }

/* 마지막 */
.closing { text-align: center; }
.closing .wrap { display: grid; gap: 22px; justify-items: center; }
.closing .big { font-size: clamp(60px, 13vw, 168px); line-height: 0.9; color: var(--accent); }
footer { border-top: 1px solid var(--line); padding-block: 36px 48px; color: var(--text3); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
footer a { text-decoration: none; color: var(--text2); }
footer a:hover { color: var(--text); }

/* 문서 페이지 (개인정보 처리방침·이용약관·문의) */
.doc { padding-block: 56px 96px; }
.doc .wrap { max-width: 760px; display: grid; gap: 28px; }
.doc h1 { font-size: clamp(30px, 5vw, 44px); }
.doc h2 { font-size: 21px; margin-top: 12px; }
.doc p, .doc li { color: var(--text2); font-size: 16px; }
.doc ul, .doc ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text2); }
.doc th { color: var(--text); font-weight: 700; background: var(--surface); }
.doc .table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.doc .note { padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--text2); font-size: 15px; }
.doc section { display: grid; gap: 12px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scan::after { animation: none; top: 22%; }
  .btn { transition: none; }
}

/* 좁은 화면: 표를 행마다 카드로 (열 이름은 칸 위에 작게) */
@media (max-width: 600px) {
  .doc table, .doc tbody, .doc tr, .doc td { display: block; width: 100%; }
  .doc thead { display: none; }
  .doc tr { display: grid; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .doc tr:last-child { border-bottom: 0; }
  .doc td { padding: 0; border: 0; }
  .doc td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 700; color: var(--text3); margin-bottom: 2px; }
  .doc td:first-child { color: var(--text); font-weight: 700; }
}

/* ---------- 언어 (한국어 원문 + Web/<언어>/ 번역, DECISIONS #59) ---------- */
/* 일본어·중국어는 그 언어 글꼴. keep-all은 한국어용이라 다른 언어는 보통 줄바꿈, 일본어·중국어는 금칙 처리 */
html:lang(ja) { --display: "Archivo", "Noto Sans JP", system-ui, sans-serif; --body: "Noto Sans JP", system-ui, -apple-system, sans-serif; }
html:lang(zh-Hans) { --display: "Archivo", "Noto Sans SC", system-ui, sans-serif; --body: "Noto Sans SC", system-ui, -apple-system, sans-serif; }
html:lang(zh-Hant) { --display: "Archivo", "Noto Sans TC", system-ui, sans-serif; --body: "Noto Sans TC", system-ui, -apple-system, sans-serif; }
html:not(:lang(ko)) body { word-break: normal; }
html:lang(ja) body, html:lang(zh) body { line-break: strict; }
html:lang(ja) .eyebrow, html:lang(zh) .eyebrow { letter-spacing: 0.04em; }

.lang-link { display: inline-flex; align-items: center; gap: 6px; }
.lang-link svg { width: 17px; height: 17px; flex: none; }
.logo, .nav-links a { white-space: nowrap; }
@media (max-width: 480px) { .nav-links { gap: 14px; } .lang-link .code { display: none; } }
@media (max-width: 400px) { .nav-links .hide-xs { display: none; } }
footer .langs { flex-basis: 100%; gap: 8px 18px; padding-top: 16px; border-top: 1px solid var(--line); }
footer .langs a[aria-current="page"] { color: var(--text); font-weight: 700; }

/* 번역 페이지: 사진 분석 두 단계, 가격은 App Store의 현지 통화로 */
.steps.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; margin-inline: auto; }
@media (max-width: 860px) { .steps.two { grid-template-columns: minmax(0, 1fr); } }
.price.local { display: grid; gap: 4px; }
.price.local b { font-size: 26px; font-weight: 900; line-height: 1.1; color: var(--text); }
.price.local span { font-weight: 500; font-size: 14px; }
html:lang(ja) h1, html:lang(ja) h2, html:lang(ja) h3 { word-break: auto-phrase; } /* 문절 단위 줄바꿈 (지원하는 브라우저만) */
