/*
  Shared stylesheet of the public legal pages (privacy.html, privacy-en.html, support.html).

  Audience: a store reviewer, or someone deciding whether to install - both want to confirm in half a minute what
  happens to their photo. So the page opens with the path one photo takes (device -> server -> result -> gone) and
  everything after it is a quiet, left-aligned reading column.
  Colours are the app tokens from constants/colors.ts and nothing else. The verdict colours (real / uncertain / ai)
  are deliberately absent: nothing on these pages is a verdict. "Kept" vs "not kept" is said in words and in the
  line style of the path (solid = travels, dashed = discarded), not in colour.
  No web fonts, no scripts, no third-party requests: a privacy page should not call anyone.
*/
:root {
  --bg: #FAFAFC;
  --surface2: #F1F2F7;
  --fg: #0F172A;
  --muted: #64748B;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --primary: #5B6BFF;
  --secondary: #06B6D4;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A0E1A;
    --surface2: #1F2937;
    --fg: #F9FAFB;
    --muted: #9CA3AF;
    --border: #1E293B;
    --border-strong: #334155;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  word-break: keep-all;       /* Korean breaks between words, not inside them */
  overflow-wrap: anywhere;
}

.page { max-width: 1040px; margin: 0 auto; padding: 40px 24px 96px; }

/* ---- top bar */
.bar { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.brand { font-weight: 800; letter-spacing: 0.08em; font-size: 0.95rem; text-decoration: none; color: var(--fg); }
.langs { display: flex; gap: 16px; font-size: 0.9rem; }
.langs [aria-current="page"] { color: var(--muted); text-decoration: none; }

/* links: text stays in the foreground colour (primary on the light background is 4:1, under AA), the brand
   colour carries the underline */
a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--primary);
    text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--secondary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 2px; }

/* ---- title block */
h1 { font-size: clamp(2rem, 5.2vw, 3.1rem); line-height: 1.18; letter-spacing: -0.03em; font-weight: 800;
     margin: 56px 0 12px; max-width: 16em; }
.lede { font-size: 1.12rem; line-height: 1.7; max-width: 34em; margin: 0 0 8px; }
.meta { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* ---- the path one photo takes */
.path { list-style: none; margin: 48px 0 64px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr);
        gap: 0; counter-reset: step; }
.path li { position: relative; padding: 30px 24px 0 0; }
.path li::before {            /* the line */
  content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 0;
  border-top: 2px solid var(--secondary);
}
.path li:nth-child(2)::before { border-image: linear-gradient(90deg, var(--secondary), var(--primary)) 1; }
.path li:nth-child(3)::before { border-top-color: var(--primary); }
.path li:last-child::before { border-top: 2px dashed var(--border-strong); }   /* discarded: nothing travels on */
.path li::after {             /* the node */
  content: ""; position: absolute; top: 0; left: 0; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--secondary);
}
.path li:nth-child(n+3)::after { border-color: var(--primary); }
.path li:last-child::after { border-color: var(--border-strong); border-style: dashed; }
.path h2 { font-size: 1.02rem; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.01em; }
.path p { margin: 0; font-size: 0.92rem; line-height: 1.6; color: var(--muted); }
.path strong { color: var(--fg); font-weight: 600; }

/* ---- reading layout */
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; }
.toc { position: sticky; top: 24px; font-size: 0.9rem; line-height: 1.5; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border-strong); }
.toc li { margin: 0; }
.toc a { display: block; padding: 6px 0 6px 16px; text-decoration: none; color: var(--muted); margin-left: -1px;
         border-left: 1px solid transparent; }
.toc a:hover { color: var(--fg); border-left-color: var(--primary); }

.doc { max-width: 38em; }
.doc section + section { margin-top: 56px; }
.doc h2 { font-size: 1.4rem; line-height: 1.35; letter-spacing: -0.02em; font-weight: 700; margin: 0 0 16px; }
.doc h3 { font-size: 1.02rem; font-weight: 700; margin: 28px 0 8px; }
.doc p { margin: 0 0 14px; }
.doc ul { margin: 0 0 14px; padding-left: 1.15em; }
.doc li { margin-bottom: 6px; }
.doc li::marker { color: var(--muted); }
.note { color: var(--muted); font-size: 0.93rem; }

/* ---- tables: rules, not boxes */
.table-wrap { margin: 20px 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; line-height: 1.6; }
th, td { text-align: left; vertical-align: top; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--border); }
thead th { font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border-strong); font-size: 0.86rem; }
tbody th { font-weight: 600; width: 34%; }
td:last-child, th:last-child { padding-right: 0; }

.foot { margin-top: 80px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted);
        font-size: 0.88rem; display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* ---- small screens: the path turns into a vertical line, the contents list goes inline, tables stack */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .page { padding: 28px 20px 72px; }
  h1 { margin-top: 40px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .toc { position: static; }
  .path { grid-template-columns: 1fr; margin: 36px 0 48px; }
  .path li { padding: 0 0 28px 34px; }
  .path li:last-child { padding-bottom: 0; }
  .path li::before { top: 8px; bottom: -8px; left: 7px; right: auto; height: auto; width: 0;
                     border-top: 0; border-left: 2px solid var(--secondary); border-image: none; }
  .path li:nth-child(2)::before { border-image: linear-gradient(180deg, var(--secondary), var(--primary)) 1; }
  .path li:nth-child(3)::before { border-left: 2px dashed var(--border-strong); }
  .path li:last-child::before { display: none; }
  .path li::after { top: 4px; }

  table, thead, tbody, tr, th, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tr { padding: 14px 0; border-bottom: 1px solid var(--border); }
  th, td { border: 0; padding: 0; }
  tbody th { width: auto; margin-bottom: 6px; }
  td { color: var(--fg); margin-top: 4px; }
  td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 0.82rem; margin-top: 8px; }
}

@media print {
  .toc, .langs { display: none; }
  .layout { grid-template-columns: 1fr; }
  body { font-size: 11pt; }
}
