/* 소개 페이지 (app/landing/). 색과 글꼴은 앱(css/app.css)의 토큰을 그대로 쓴다: 종이와 먹, 잎색 강조.
   테마는 앱과 같이 설정에서 고른 것(localStorage 'ctb-theme'), 없으면 기기 설정을 따른다(index.html의 첫 스크립트). */

:root {
  color-scheme: light;
  --font-sans: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
  --font-serif: 'Noto Serif KR', 'Nanum Myeongjo', 'AppleMyungjo', 'Batang', serif;

  --bg: #f6f3ec;
  --surface: #fffdf8;
  --surface-2: #eee9df;
  --ink: #1d1f1e;
  --ink-2: #474b49;
  --muted: #666963;
  --line: #e2dccf;
  --accent: #2f6a55;
  --accent-ink: #ffffff;
  --accent-soft: #e1eee7;
  --bezel: #1d1f1e;
  --shadow: 0 1px 2px rgb(40 30 10 / 6%), 0 8px 28px rgb(40 30 10 / 8%);
  /* 그래프: 장 수로 나눈 것(황토)과 맛있는만나(초록). 색 구분 검사를 거친 값 */
  --series-naive: #b06f1f;
  --series-plan: #0f7d5a;
  --grid: #e8e2d6;

  --radius: 16px;
  --wrap: 1080px;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #191714;
  --surface: #211f1b;
  --surface-2: #2b2823;
  --ink: #ebe5d9;
  --ink-2: #c5bdaf;
  --muted: #9c9386;
  --line: #36322b;
  --accent: #8db89c;
  --accent-ink: #14201a;
  --accent-soft: #24332b;
  --bezel: #3a362f;
  --shadow: 0 1px 2px rgb(0 0 0 / 35%);
  --series-naive: #c08236;
  --series-plan: #2fa27a;
  --grid: #34302a;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.7 var(--font-sans);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.3;
}

p {
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 10;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── 머리 ─────────────────────────────────────────────── */

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.top.is-scrolled {
  border-bottom-color: var(--line);
}
.top .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}
.brand img {
  width: 30px;
  height: 30px;
}
.top nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.top nav a {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 15px;
  text-decoration: none;
}
.top nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
}
@media (max-width: 860px) {
  .top nav {
    display: none;
  }
  .top .btn {
    margin-left: auto;
  }
}

/* ── 버튼 ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: 600 16px/1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
}
.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  filter: brightness(1.08);
}
.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover {
  background: var(--surface-2);
}
.btn-sm {
  min-height: 38px;
  padding: 0 14px;
  font-size: 15px;
  border-radius: 10px;
}
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── 휴대폰 화면 ──────────────────────────────────────── */

.phone {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  border: 9px solid var(--bezel);
  border-radius: 40px;
  overflow: hidden;
  background: var(--bezel);
  box-shadow: var(--shadow);
}
.phone img {
  width: 100%;
  height: auto; /* height 속성(844)이 그대로 남지 않게: 너비에 맞춰 비율대로 */
  aspect-ratio: 390 / 844;
  object-fit: cover;
  object-position: top;
  border-radius: 31px;
}

/* ── 첫 화면 ──────────────────────────────────────────── */

.hero {
  padding: 48px 0 64px;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 48px;
}
.eyebrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.hero h1 {
  margin: 12px 0 18px;
  font: 700 clamp(2.1rem, 5.4vw, 3.4rem) / 1.25 var(--font-serif);
  letter-spacing: -0.01em;
}
.lead {
  color: var(--ink-2);
  font-size: 18.5px;
  max-width: 34em;
}
.hero .buttons {
  margin-top: 28px;
}
.hero .note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
}
@media (max-width: 860px) {
  .hero {
    padding-top: 28px;
  }
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero .phone {
    max-width: 270px;
  }
}

/* ── 이름 (말씀) ──────────────────────────────────────── */

.verses {
  background: var(--accent-soft);
  padding: 56px 0;
}
.verses .wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 48px;
}
.verses figure,
.verses blockquote {
  margin: 0;
}
.verses blockquote {
  font: 500 clamp(1.15rem, 2.4vw, 1.4rem) / 1.75 var(--font-serif);
}
.verses cite {
  display: block;
  margin-top: 10px;
  color: var(--ink-2);
  font: 600 15px var(--font-sans);
  font-style: normal;
}
.verses .why {
  grid-column: 1 / -1;
  color: var(--ink-2);
  border-top: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  padding-top: 24px;
}
@media (max-width: 720px) {
  .verses .wrap {
    grid-template-columns: 1fr;
  }
}

/* ── 구역 ─────────────────────────────────────────────── */

.section {
  padding: 88px 0;
}
.section + .section {
  border-top: 1px solid var(--line);
}
.section-head {
  max-width: 40em;
  margin-bottom: 40px;
}
.section-head h2 {
  margin-top: 8px;
  font-size: clamp(1.65rem, 3.6vw, 2.3rem);
  letter-spacing: -0.01em;
}
.section-head p {
  margin-top: 14px;
  color: var(--ink-2);
}
@media (max-width: 720px) {
  .section {
    padding: 64px 0;
  }
}

/* 글과 휴대폰 화면을 나란히 (번갈아 좌우) */
.split {
  display: grid;
  grid-template-columns: 1fr 300px;
  align-items: center;
  gap: 56px;
}
.split.is-flipped {
  grid-template-columns: 300px 1fr;
}
.split.is-flipped .phone {
  order: -1;
}
.split .section-head {
  margin-bottom: 28px;
}
@media (max-width: 860px) {
  .split,
  .split.is-flipped {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .split.is-flipped .phone {
    order: 0;
  }
  .split .phone {
    max-width: 260px;
  }
}

/* 기능 목록 */
.points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
}
.points li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: start;
}
.points b {
  display: block;
  font-size: 17.5px;
}
.points span {
  color: var(--ink-2);
  font-size: 16px;
}
.icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── 세 단계 ──────────────────────────────────────────── */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 18px 64px;
  position: relative;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 18px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}
.steps b {
  display: block;
  font-size: 17.5px;
}
.steps span {
  color: var(--ink-2);
  font-size: 16px;
}
.after-steps {
  margin-top: 18px;
  color: var(--ink-2);
}

/* ── 고르게 나누기 그래프 ─────────────────────────────── */

.chart-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 24px 18px;
}
@media (max-width: 480px) {
  .chart-card {
    padding: 18px 14px 14px;
  }
}
.chart-title {
  font-size: 17px;
  font-weight: 700;
}
.chart-sub {
  color: var(--muted);
  font-size: 14.5px;
  margin-top: 2px;
}
.chart {
  position: relative;
  margin-top: 18px;
  touch-action: pan-y;
}
.chart:focus-visible {
  outline-offset: 6px;
  border-radius: 8px;
}
.series-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 14px 0 4px;
  font-size: 15.5px;
}
.series-head:first-child {
  margin-top: 0;
}
.series-head .key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.series-head .key::before {
  content: '';
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--key);
}
.series-head .range {
  color: var(--ink-2);
}
.series-head .range b {
  color: var(--ink);
}
.chart svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.chart svg text {
  fill: var(--muted);
  font: 12px var(--font-sans);
  font-variant-numeric: tabular-nums;
}
.chart .grid {
  stroke: var(--grid);
  stroke-width: 1;
}
.chart .cross {
  stroke: var(--ink-2);
  stroke-width: 1;
}
.chart .dot {
  stroke: var(--surface);
  stroke-width: 2;
}
.chart-tip {
  position: absolute;
  z-index: 2;
  min-width: 220px;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.5;
  pointer-events: none;
}
.chart-tip[hidden] {
  display: none;
}
.chart-tip .day {
  font-weight: 700;
  margin-bottom: 4px;
}
.chart-tip .row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px;
  align-items: baseline;
}
.chart-tip .row i {
  width: 10px;
  height: 3px;
  border-radius: 2px;
  background: var(--key);
  transform: translateY(-3px);
}
.chart-tip .row span {
  color: var(--ink-2);
  overflow-wrap: normal; /* "31–33장"이 숫자 가운데서 갈라지지 않게 띄어쓰기에서만 */
}
.chart-tip .row b {
  font-variant-numeric: tabular-nums;
}
.chart-hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}
.chart-table {
  margin-top: 12px;
  font-size: 15px;
}
.chart-table summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}
.chart-table table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.chart-table th,
.chart-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}
.chart-table th:first-child,
.chart-table td:first-child {
  text-align: left;
}
.chart-table thead th {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

/* ── 작은 카드 격자 ───────────────────────────────────── */

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.cards article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.cards .icon {
  margin-bottom: 14px;
}
.cards h3 {
  font-size: 18px;
}
.cards p {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 16px;
}
@media (max-width: 720px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

/* ── 설치 ─────────────────────────────────────────────── */

.install {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.install article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.install h3 {
  font-size: 18px;
}
.install ol {
  margin: 10px 0 0;
  padding-left: 1.3em;
  color: var(--ink-2);
}
.install li + li {
  margin-top: 4px;
}
.install .aside {
  grid-column: 1 / -1;
  color: var(--ink-2);
  font-size: 16px;
}
@media (max-width: 720px) {
  .install {
    grid-template-columns: 1fr;
  }
}

/* ── 자주 묻는 질문 ───────────────────────────────────── */

.faq {
  max-width: 760px;
}
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq details:first-child {
  border-top: 1px solid var(--line);
}
.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 2px;
  font-weight: 600;
  font-size: 17.5px;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '+';
  color: var(--accent);
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
}
.faq details[open] summary::after {
  content: '−';
}
.faq details p {
  padding: 0 2px 20px;
  color: var(--ink-2);
}

/* ── 마지막 ───────────────────────────────────────────── */

.closing {
  text-align: center;
  padding: 88px 0 96px;
  border-top: 1px solid var(--line);
}
.closing h2 {
  font: 700 clamp(1.7rem, 4vw, 2.4rem) / 1.35 var(--font-serif);
}
.closing p {
  margin: 14px auto 0;
  color: var(--ink-2);
}
.closing .buttons {
  justify-content: center;
  margin-top: 28px;
}

footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 48px;
  color: var(--muted);
  font-size: 14.5px;
}
footer .wrap {
  display: grid;
  gap: 10px;
}
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
footer a {
  color: var(--ink-2);
}
