/* Shared styling for the public pages (about / support / terms / privacy).
   These live OUTSIDE the React/Tailwind build — Cloudflare Pages serves them as
   static HTML at clean URLs (/about, /terms, …) before the SPA fallback. Plain
   CSS that mirrors the app's "Night Scroll" tokens (src/index.css): semantic
   colors with a light set here and a dark set under prefers-color-scheme, so the
   pages follow the device like the app does.

   Brand: the accent comes from the --brand-* ramp. It defaults to 연예견's coral;
   the 묘하냥 pages override the ramp on :root (pink, from src/brand/brands.ts), and
   every accent token below follows. Fonts: IBM Plex Sans KR for everything, Jua
   only for the wordmark. */

:root {
  color-scheme: light dark;

  /* brand ramp (연예견 coral — 묘하냥 pages override it) */
  --brand-50: #fff1ed;
  --brand-100: #ffe0d6;
  --brand-200: #ffc1ad;
  --brand-300: #ff9b7a;
  --brand-400: #ff6f47;
  --brand-500: #ff5a2c;
  --brand-600: #ed4517;
  --brand-700: #c5340e;

  /* surfaces & text */
  --page: #f6f3f1;
  --surface: #ffffff;
  --surface-2: #eeeae6;
  --line: #e3deda;
  --ink: #1c1820;
  --ink-soft: #6b6470;
  --dot: #d5cfca;
  /* the frosted labels that float over photos */
  --glass: rgb(255 255 255 / 0.8);
  --glass-ink: #1c1820;
  --glass-soft: #5e5763;
  --shade: rgb(60 40 30 / 0.22);
  /* the inverted pill (selected segmented tab, chips, the FAB bubble) */
  --inv: #1c1820;
  --on-inv: #ffffff;

  /* accent (follows the ramp; the dark set lifts it a step) */
  --accent: var(--brand-500);
  --accent-hover: var(--brand-400);
  --on-accent: #1c1820; /* dark text on the accent: white fails contrast */
  --accent-text: var(--brand-700);
  --accent-soft: var(--brand-100);
  --accent-soft-ink: var(--brand-700);

  /* meaning */
  --heart: #ff3b6b;
  --celeb: #6a4cf0; /* 연예인 */
  --celeb-soft: #eee9ff;
  --celeb-ink: #4a33b8;
  --public: #1f8a7e; /* 일반인 */
  --public-soft: #ddf5f1;
  --public-ink: #1c6e64;
  --flame-soft: #ffe6d8;
  --flame-ink: #a8380c;

  --float-shadow: 0 14px 30px -12px var(--shade);
  --font-sans: 'IBM Plex Sans KR', system-ui, -apple-system, 'Apple SD Gothic Neo', sans-serif;
  --font-display: 'Jua', 'IBM Plex Sans KR', system-ui, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e0d10;
    --surface: #1c1a1f;
    --surface-2: #26232a;
    --line: #2e2b33;
    --ink: #f4f0f6;
    --ink-soft: #a39da8;
    --dot: #3a3640;
    --glass: rgb(14 13 16 / 0.6);
    --glass-ink: #f4f0f6;
    --glass-soft: #d8d2dc;
    --shade: rgb(0 0 0 / 0.6);
    --inv: #f4f0f6;
    --on-inv: #0e0d10;

    --accent: var(--brand-400);
    --accent-hover: var(--brand-300);
    --on-accent: #0e0d10;
    --accent-text: var(--brand-300);
    --accent-soft: color-mix(in oklab, var(--brand-500) 20%, #0e0d10);
    --accent-soft-ink: var(--brand-200);

    --heart: #ff4d78;
    --celeb-soft: #2d2650;
    --celeb-ink: #cfc4ff;
    --public-soft: #173a35;
    --public-ink: #a6e8de;
    --flame-soft: #2b1a14;
    --flame-ink: #ffb08f;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Korean: break lines at spaces/punctuation, never between syllables. */
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: 1.7;
}

::selection { background: var(--accent-soft); color: var(--ink); }

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* the outline follows each control's own radius (pills stay pills) */
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }

/* top nav: the Jua wordmark + text links (44px tap rows) */
.nav {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px;
  max-width: 808px; margin: 0 auto; padding: 12px 24px;
}
.nav .brand {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--font-display); font-size: 26px; line-height: 1; color: var(--accent);
}
.nav a.brand:hover { text-decoration: none; }
.nav .links { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 2px; }
.nav .links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 999px;
  font-weight: 700; font-size: 14px; color: var(--ink-soft); white-space: nowrap;
  transition: color 0.18s var(--ease);
}
.nav .links a:hover { color: var(--ink); text-decoration: none; }

/* KOR / ENG language toggle — the app's Segmented control: a surface track with
   the inverted ink pill on the active option. 38px options in a 3px track = 44px. */
.lang-toggle {
  display: inline-flex; align-items: center; gap: 0; margin-left: 8px;
  padding: 3px; border-radius: 999px; background: var(--surface);
}
.lang-toggle .lang-opt {
  position: relative; height: 38px; padding: 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--font-sans); font-weight: 700; font-size: 12px; letter-spacing: 0.04em;
  color: var(--ink-soft); background: transparent;
  transition: color 0.22s var(--ease), background-color 0.22s var(--ease);
}
.lang-toggle .lang-opt::after { content: ""; position: absolute; inset: -3px 0; }
.lang-toggle .lang-opt:hover { color: var(--ink); }
.lang-toggle .lang-opt.is-on, .lang-toggle .lang-opt.is-on:hover { color: var(--on-inv); background: var(--inv); }

/* doc container (legal + support): one flat surface panel on the page */
.wrap {
  max-width: 760px; margin: 4px auto 0; padding: 36px 40px 40px;
  background: var(--surface); border-radius: 24px;
}
.doc h1 { font-size: 30px; font-weight: 700; line-height: 1.3; letter-spacing: -0.02em; margin: 0 0 6px; }
.doc .meta { color: var(--ink-soft); font-size: 13px; margin: 0 0 24px; }
.doc h2 { font-size: 18px; font-weight: 700; line-height: 1.45; letter-spacing: -0.01em; margin: 34px 0 10px; }
.doc h3 { font-size: 15.5px; font-weight: 700; line-height: 1.5; margin: 22px 0 6px; }
.doc p, .doc li { font-size: 15px; color: var(--ink); }
.doc p { margin: 0 0 12px; }
.doc ul, .doc ol { padding-left: 22px; margin: 0 0 12px; }
.doc li { margin: 5px 0; }
.doc li::marker { color: var(--ink-soft); }
.doc strong { font-weight: 700; }
/* in-text links are underlined, so they never rely on color alone */
.doc a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* callout: the accent-soft tint, ink text */
.callout {
  background: var(--accent-soft); border-radius: 16px;
  padding: 14px 18px; font-size: 14px; color: var(--ink); margin: 18px 0;
}
.callout a { color: inherit; font-weight: 700; }

/* table (privacy: 수집 항목 / 위탁) — hairlines inside one rounded frame */
.table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 14px 0;
  border: 1px solid var(--line); border-radius: 16px;
}
table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 480px; }
th, td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 11px 14px; text-align: left; vertical-align: top; }
th:last-child, td:last-child { border-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
th { background: var(--surface-2); font-weight: 700; }

/* footer */
.footer {
  max-width: 808px; margin: 0 auto; padding: 28px 24px 64px;
  color: var(--ink-soft); font-size: 13px;
}
.footer .brand { font-family: var(--font-display); color: var(--accent); font-size: 20px; line-height: 1; display: block; margin-bottom: 6px; }
.footer a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 24px; color: var(--ink-soft); font-weight: 700; margin-right: 18px; }
.footer a:hover { color: var(--ink); text-decoration: none; }
.footer p { margin: 4px 0 0; }

@media (max-width: 808px) {
  .wrap { margin-left: 16px; margin-right: 16px; padding: 28px 22px 30px; }
}
@media (max-width: 620px) {
  .nav { padding-left: 16px; padding-right: 16px; }
  .footer { padding-left: 16px; padding-right: 16px; }
  .doc h1 { font-size: 26px; }
}
/* small phones: tighten the nav so brand + links + toggle keep to one row */
@media (max-width: 420px) {
  .nav { column-gap: 8px; }
  .nav .links a { padding: 0 6px; font-size: 13px; }
  .lang-toggle { margin-left: 4px; }
  .lang-toggle .lang-opt { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.001ms !important; }
}
