/* GoodHabit site. One stylesheet, no external fonts, no scripts.
   Visual language follows the app (docs/decisions.md E-010): a blue-charcoal page, cards one lightness step up,
   depth from lightness never shadows, one calm accent used on key values only. Light version via prefers-color-scheme. */

:root {
  color-scheme: dark light;
  --bg: #0B0E14;
  --surface: #1A1E28;
  --surface-2: #252B39;
  --line: #2E3545;
  --text: #E8ECF4;
  --text-muted: #A9B2C3;
  --accent: #8DB4F5;
  --accent-fill: #3767C9;
  --on-accent: #FFFFFF;
  --focus: #B7CCF5;
  /* drawing palette: fixed figure colours, the same idea in both themes */
  --art-skin: #F2C9A5;
  --art-hair: #3B3A4A;
  --art-body: #5B7FC7;
  --art-phone: #39414F;
  --art-screen: #3767C9;
  --art-screen-2: #8DB4F5;
  --art-line: #8DB4F5;

  --radius-l: 20px;
  --radius-m: 14px;
  --radius-s: 10px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;
  --content: 960px;
  --font: system-ui, -apple-system, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F2F4F7;
    --surface: #FFFFFF;
    --surface-2: #E8ECF2;
    --line: #D9DFE8;
    --text: #141A26;
    --text-muted: #4E596B;
    --accent: #2456B5;
    --accent-fill: #2A5FC4;
    --on-accent: #FFFFFF;
    --focus: #204EA8;
    --art-phone: #C9D1DE;
    --art-hair: #4A4858;
    --art-screen: #2A5FC4;
    --art-screen-2: #E3EBF9;
    --art-line: #2456B5;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: break-word;
}

svg { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  padding: var(--space-2) var(--space-4);
  background: var(--accent-fill);
  color: var(--on-accent);
  border-radius: var(--radius-s);
  z-index: 10;
}
.skip-link:focus { top: var(--space-4); }

.wrap {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Header */
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}
.brand svg { width: 28px; height: 28px; }
.lang-switch {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-4);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
}
.lang-switch:hover { background: var(--surface-2); }

/* Sections */
main { display: block; }
section { padding: var(--space-7) 0; }
.section-head { max-width: 640px; margin-bottom: var(--space-5); }
.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
h1, h2, h3 { line-height: 1.3; margin: 0; }
h1 { font-size: clamp(30px, 6vw, 46px); letter-spacing: -0.02em; }
h2 { font-size: clamp(24px, 4vw, 30px); letter-spacing: -0.01em; }
h3 { font-size: 18px; }
p { margin: var(--space-3) 0 0; }
.lead { color: var(--text-muted); font-size: 18px; }

/* Hero */
.hero { padding-top: var(--space-5); }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
}
.hero-art {
  background: var(--surface);
  border-radius: var(--radius-l);
  padding: var(--space-5);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-5);
  min-height: 44px;
  padding: 0 var(--space-4);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}
.status::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Cards on a real grid; cards in one row stretch to the same height */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  align-items: stretch;
  margin: 0;
  padding: 0;
  list-style: none;
}
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--surface);
  border-radius: var(--radius-m);
  padding: var(--space-5);
}
.card p { margin: 0; color: var(--text-muted); }
.card .icon { width: 44px; height: 44px; margin-bottom: var(--space-2); }

.trust-panel {
  background: var(--surface);
  border-radius: var(--radius-l);
  padding: var(--space-5);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  align-items: center;
}
.trust-panel .shield { width: 112px; margin: 0 auto; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.checks li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: var(--space-3);
  align-items: start;
}
.checks li::before {
  content: "";
  width: 24px; height: 24px; margin-top: 3px;
  border-radius: 50%;
  background: var(--surface-2) no-repeat center / 14px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.5l3 3 6-7' fill='none' stroke='%238DB4F5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: light) {
  .checks li::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.5l3 3 6-7' fill='none' stroke='%232456B5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}

.step-no {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.quote {
  margin-top: auto;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-s);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}
.card .quote { color: var(--text); }
.grid + .lead { margin-top: var(--space-5); }

.limits { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.limits li {
  background: var(--surface);
  border-radius: var(--radius-m);
  padding: var(--space-4) var(--space-5);
}

/* Footer */
.site-footer {
  margin-top: var(--space-6);
  padding: var(--space-6) 0 var(--space-7);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 15px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
.footer-grid p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin: 0; padding: 0; list-style: none; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* Privacy document */
.doc { max-width: 760px; padding-top: var(--space-5); padding-bottom: var(--space-7); }
.doc h1 { font-size: clamp(28px, 5vw, 38px); }
.doc h2 { font-size: 22px; margin-top: var(--space-7); }
.doc .summary {
  margin-top: var(--space-5);
  background: var(--surface);
  border-radius: var(--radius-m);
  padding: var(--space-5);
}
.doc .summary h2 { margin-top: 0; }
.doc ul { padding-left: 1.2em; margin: var(--space-3) 0 0; }
.doc li + li { margin-top: var(--space-2); }
.table-scroll {
  margin-top: var(--space-4);
  overflow-x: auto;
  border-radius: var(--radius-m);
  background: var(--surface);
}
.doc table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
.doc th, .doc td {
  text-align: left;
  vertical-align: top;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
}
.doc thead th { color: var(--text-muted); font-weight: 600; background: var(--surface-2); }
.doc tbody th { width: 28%; }
.doc tbody tr:last-child th, .doc tbody tr:last-child td { border-bottom: 0; }
.doc dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-5); margin: var(--space-4) 0 0; }
.doc dt { color: var(--text-muted); }
.doc dd { margin: 0; }
.doc .date { color: var(--text-muted); }

@media (min-width: 720px) {
  body { font-size: 18px; }
  .wrap { padding: 0 var(--space-5); }
  section { padding: var(--space-8) 0; }
  .hero-grid { grid-template-columns: 1.1fr 1fr; gap: var(--space-7); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .trust-panel { grid-template-columns: 160px 1fr; padding: var(--space-6); }
  .trust-panel .shield { width: 140px; }
  .footer-grid { grid-template-columns: 1fr auto; align-items: start; }
}

/* 제목 줄바꿈: 마지막 줄에 한 단어만 남지 않게 */
h1, h2, h3 { text-wrap: balance; }
