/* 달려보자 site styles. Values follow DESIGN.md (v1.2: "치앙마이 아침" for the
   weather pages, two-ink riso for the home picture): change DESIGN.md first,
   then the tokens here. */
:root {
  --canvas: #f1f4ee;
  --surface: #ffffff;
  --surface-2: #eaf0e7;
  --line: #dce4d8;
  --ink: #1e2521;
  --ink-2: #48524b;
  --ink-3: #5f6a63;
  --primary: #1e2521;
  --on-primary: #ffffff;
  --primary-pressed: #36403a;
  --focus: #1e2521;
  --go: #256b43;
  --go-weak: #e2f1e5;
  --caution: #855a00;
  --caution-weak: #f7edd3;
  --rest: #4f5f66;
  --rest-weak: #e5ecec;
  --warning: #a33a27;
  --warning-weak: #f7e5e0;
  --ridge-far: #e3ebe1;
  --ridge-mid: #d3e1d4;
  --ridge-near: #c2d6c6;
  --shadow-float: 0 2px 10px rgba(30, 37, 33, 0.12), 0 0 0 1px rgba(30, 37, 33, 0.04);
  /* The home picture is a paper print, so these stay the same in dark mode. */
  --riso-paper: #f4efe4;
  --riso-pink: #ff48b0;
  --riso-blue: #0078bf;

  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-card: 20px;
  --touch-min: 44px;
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  /* Phones and Macs: the device font. Windows: Pretendard (see the head script). */
  --font-device: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", system-ui, sans-serif;
  --font-sans: var(--font-device);
  color-scheme: light;
}
.pc-font { --font-sans: "Pretendard Variable", Pretendard, "Malgun Gothic", system-ui, sans-serif; }

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0e1411;
    --surface: #161e1a;
    --surface-2: #1e2823;
    --line: #2a3630;
    --ink: #eef2ec;
    --ink-2: #b7c2ba;
    --ink-3: #8c9890;
    --primary: #eef2ec;
    --on-primary: #0e1411;
    --primary-pressed: #d3dbd5;
    --focus: #eef2ec;
    --go: #63c98f;
    --go-weak: #14291d;
    --caution: #e9b65a;
    --caution-weak: #2c2414;
    --rest: #a2b1b5;
    --rest-weak: #1e2629;
    --warning: #f0806a;
    --warning-weak: #33201b;
    --ridge-far: #1a231e;
    --ridge-mid: #1f2b25;
    --ridge-near: #26352d;
    --shadow-float: 0 0 0 1px rgba(255, 255, 255, 0.08);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; text-wrap: balance; }
p { margin: 0; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding-left: max(var(--space-lg), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-lg), env(safe-area-inset-right, 0px));
}
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: var(--space-md); top: var(--space-md); z-index: 10; padding: var(--space-xs) var(--space-sm); background: var(--surface); border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* The home picture: one canvas over the whole screen, on paper (DESIGN.md, 메인 그림). */
body.art { background: var(--riso-paper); color-scheme: light; overflow: hidden; }
.home-art { position: fixed; inset: 0; display: block; width: 100%; height: 100%; }
/* Blue on paper is 4.1:1, so both lines are large text (3:1 needed). */
.nf-art { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: var(--space-md); padding: var(--space-xl); color: var(--riso-blue); text-align: center; }
.nf-art h1 { font-size: 22px; line-height: 30px; font-weight: 700; }
.nf-art a { display: inline-block; min-height: var(--touch-min); padding: 0 var(--space-md); font-size: 24px; line-height: var(--touch-min); font-weight: 700; text-underline-offset: 4px; }

/* Header and footer */
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding-top: env(safe-area-inset-top, 0px); }
.site-nav { display: flex; gap: var(--space-xxs); }
.site-nav a { display: inline-flex; align-items: center; min-height: var(--touch-min); padding: 0 var(--space-sm); border-radius: var(--radius-full); font-size: 15px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.site-nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
main.wrap { display: grid; gap: var(--space-sm); padding-top: var(--space-xs); padding-bottom: var(--space-2xl); }
main:focus { outline: none; }
.site-footer { padding-bottom: max(var(--space-2xl), env(safe-area-inset-bottom, 0px)); }
.site-footer nav { display: flex; flex-wrap: wrap; column-gap: var(--space-md); }
.site-footer a { display: inline-flex; align-items: center; min-height: var(--touch-min); font-size: 13px; color: var(--ink-3); }
.site-footer p { font-size: 12px; line-height: 16px; color: var(--ink-3); }

/* Logo: the wordmark and the signal dot in today's verdict colour */
.dr-logo { position: relative; display: inline-flex; align-items: center; min-height: var(--touch-min); padding-right: 12px; font-size: 22px; line-height: 30px; font-weight: 800; letter-spacing: -0.44px; color: var(--ink); text-decoration: none; }
.dr-logo::after { content: ""; position: absolute; top: 9px; right: 0; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--go); }
.dr-logo.is-caution::after { background: var(--caution); }
.dr-logo.is-rest::after { background: var(--rest); }

/* Cards */
.dr-card { background: var(--surface); color: var(--ink); border-radius: var(--radius-lg); padding: var(--space-card); }
.dr-card-title { margin: 0 0 var(--space-sm); font-size: 18px; line-height: 26px; font-weight: 600; letter-spacing: -0.18px; }
.card-text { margin-bottom: var(--space-md); color: var(--ink-2); font-size: 15px; line-height: 22px; }

/* The verdict card and its ridges, the site's one decoration */
.dr-verdict { position: relative; display: grid; gap: var(--space-sm); }
.dr-ridge { position: absolute; top: var(--space-md); right: var(--space-md); width: 132px; height: 54px; pointer-events: none; clip-path: inset(0 round var(--radius-sm)); }
.dr-ridge .r1 { fill: var(--ridge-far); }
.dr-ridge .r2 { fill: var(--ridge-mid); }
.dr-ridge .r3 { fill: var(--ridge-near); }
.dr-verdict > *:not(.dr-ridge) { position: relative; }
.dr-when { margin: 0; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-2); }
.dr-feel { color: var(--ink-2); font-size: 15px; line-height: 22px; }
.home-title { font-size: 28px; line-height: 36px; font-weight: 700; letter-spacing: -0.56px; max-width: 14em; }

/* Facts in tiles */
.dr-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xs); margin: 0; }
/* The label row takes any spare height, so values line up even if one label wraps. */
.dr-fact { display: grid; grid-template-rows: 1fr auto; gap: 2px; padding: 10px var(--space-sm); border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.dr-fact dt { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-3); }
.dr-fact dd { margin: 0; font-size: 20px; line-height: 1.1; font-weight: 500; font-variant-numeric: tabular-nums; }
.dr-fact dd small { margin-left: 2px; font-size: 12px; font-weight: 500; color: var(--ink-2); }

/* Buttons */
.dr-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); border: 0; border-radius: var(--radius-md); font: inherit; font-size: 17px; line-height: 24px; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform 120ms var(--ease), background-color 240ms var(--ease); }
.dr-btn-primary { min-height: 56px; padding: 0 var(--space-lg); background: var(--primary); color: var(--on-primary); }
.dr-btn-primary:active { background: var(--primary-pressed); transform: scale(0.97); }
.dr-btn-secondary { min-height: 48px; padding: 0 var(--space-md); background: var(--surface-2); color: var(--ink); }
.dr-btn-secondary:active { transform: scale(0.97); }
.dr-btn-block { width: 100%; }
.nf-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-xs); }

/* Promise lists */
.promise, .promise-list { margin: 0; padding-left: 1.2em; display: grid; gap: var(--space-xs); color: var(--ink-2); font-size: 15px; line-height: 22px; }
.promise b, .promise-list b { color: var(--ink); }

/* Long text below a tool, and the about/privacy pages */
.page { display: grid; gap: var(--space-sm); }
.tool-head { display: grid; gap: var(--space-xxs); padding: var(--space-xs) 0 var(--space-xxs); }
.tool-head h1 { font-size: 22px; line-height: 30px; font-weight: 700; letter-spacing: -0.44px; }
.lead { color: var(--ink-2); font-size: 15px; line-height: 22px; }
.prose { padding: var(--space-xs) var(--space-xxs) 0; color: var(--ink-2); font-size: 15px; line-height: 24px; }
.prose h1 { font-size: 22px; line-height: 30px; font-weight: 700; color: var(--ink); margin-bottom: var(--space-xs); }
.prose h2 { margin: var(--space-xl) 0 var(--space-xs); font-size: 18px; line-height: 26px; font-weight: 600; color: var(--ink); }
.prose p, .prose ul, .prose ol, .prose dl, .prose table { margin: 0 0 var(--space-sm); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: var(--space-xxs); }
.prose a { color: var(--ink); }
.faq dt, .qa-terms dt { margin-top: var(--space-md); font-weight: 600; color: var(--ink); }
.faq dd, .qa-terms dd { margin: var(--space-xxs) 0 0; }
.muted { color: var(--ink-3); font-size: 13px; }
.prose-page { padding-top: var(--space-md); }

/* Tables, inputs and states shared by tools and question pages */
.dr-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.dr-table caption { text-align: left; padding: var(--space-md) 0 var(--space-xs); font-size: 15px; font-weight: 600; color: var(--ink); }
.dr-table th, .dr-table td { padding: 10px var(--space-xs); text-align: left; border-bottom: 1px solid var(--line); font-size: 16px; }
.dr-table thead th { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.dr-table tbody th { font-weight: 500; color: var(--ink-2); }
.dr-table td { font-weight: 500; color: var(--ink); }
.dr-table tr.is-finish th, .dr-table tr.is-finish td { font-weight: 700; color: var(--ink); border-bottom: 0; }
.dr-label { display: block; margin-bottom: var(--space-xxs); font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-2); }
.dr-input { width: 100%; height: 56px; padding: 0 var(--space-md); border: 1px solid transparent; border-radius: var(--radius-md); background: var(--surface-2); color: var(--ink); font: inherit; font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.dr-input:focus { outline: none; border-color: var(--ink); background: var(--surface); }
.dr-input::placeholder { color: var(--ink-3); }
.dr-hint { margin-top: var(--space-xxs); font-size: 13px; line-height: 18px; color: var(--ink-3); }
.dr-error { margin-top: var(--space-xs); padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-sm); background: var(--caution-weak); color: var(--caution); font-size: 14px; font-weight: 600; }
.is-stale { opacity: 0.35; transition: opacity 240ms var(--ease); }

/* Question pages: the answer first, then reasons, then what is known versus said */
.qa-kicker { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-3); }
.qa-kicker a { text-decoration: none; }
.qa-answer { display: grid; gap: var(--space-sm); }
.qa-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-xs); }
.qa-num { font-size: 72px; line-height: 0.95; font-weight: 300; letter-spacing: -1.44px; font-variant-numeric: tabular-nums; }
.qa-unit { font-size: 17px; color: var(--ink-2); }
.qa-line { color: var(--ink-2); font-size: 15px; line-height: 22px; }
.qa-calc { padding-top: var(--space-xxs); }
.qa-calc-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); }
.qa-evidence h3 { margin-bottom: var(--space-xs); font-size: 15px; line-height: 22px; font-weight: 600; color: var(--ink); }
.qa-columns { display: grid; gap: var(--space-lg); }
.qa-columns ul { margin: 0; padding-left: 1.1em; display: grid; gap: var(--space-xs); color: var(--ink-2); font-size: 15px; line-height: 22px; }
.qa-tag { display: inline-block; margin-left: var(--space-xxs); padding: 0 var(--space-xs); border-radius: var(--radius-full); background: var(--surface-2); font-size: 12px; line-height: 20px; font-weight: 500; color: var(--ink-2); vertical-align: 1px; }
.qa-sources { padding: var(--space-xs) var(--space-xxs) 0; font-size: 13px; line-height: 20px; color: var(--ink-3); }
.qa-sources h2 { margin-bottom: var(--space-xs); font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-2); }
.qa-sources ol { margin: 0 0 var(--space-xs); padding-left: 1.2em; display: grid; gap: var(--space-xxs); }
.qa-sources a { color: var(--ink-2); }
.qa-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); }
.qa-item { display: grid; gap: var(--space-xxs); text-decoration: none; }
.qa-q { font-size: 17px; line-height: 24px; font-weight: 600; color: var(--ink); }
.qa-a { font-size: 15px; line-height: 22px; color: var(--ink-2); }

/* End of content and the one ad */
.dr-end { display: flex; align-items: center; gap: var(--space-xs); margin-top: var(--space-sm); font-size: 12px; line-height: 16px; color: var(--ink-3); }
.dr-end::before, .dr-end::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dr-ad { min-height: 280px; border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; }

@media print {
  .site-header, .site-footer, .dr-end, .dr-ad { display: none !important; }
  body { background: #fff; color: #000; }
}
