/* Shared chrome for Riggle static pages (tutorial.html, faq.html):
   the color palette (light + dark), a top header with a language toggle
   (한국어 / EN) and a light/dark theme toggle, and language visibility rules.
   Theme + language sync with the main app via the same localStorage keys
   (vca.theme.v1 / vca.marketing_lang) — see page-chrome.js. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #475569;
  --faint: #94a3b8;
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.10);
  --accent-ink: #3730a3;
  --accent-ink-strong: #312e81;
  --radius: 14px;
  --font: "Inter", "Nanum Gothic", "Pretendard", "Apple SD Gothic Neo",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-2: #151d2d;
  --border: #2c384f;
  --border-strong: #46546e;
  --text: #f8fafc;
  --muted: #a9b4c7;
  --faint: #74829a;
  --accent: #8b8cff;
  --accent-soft: rgba(139, 140, 255, 0.18);
  --accent-ink: #c7c8ff;
  --accent-ink-strong: #e6e6ff;
}

/* Language visibility — the active <html data-lang> hides the other language. */
:root[data-lang="ko"] .lang-en { display: none !important; }
:root[data-lang="en"] .lang-ko { display: none !important; }

/* Top header */
.page-chrome {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: min(100%, 920px); margin: 0 auto; padding: 1.2rem 1.5rem;
}
.pc-brand {
  display: flex; align-items: center; gap: 0.14em; font-size: 1.05rem;
  font-family: "Space Grotesk", "Inter", sans-serif; font-weight: 700;
  letter-spacing: -0.01em; color: var(--text); text-decoration: none;
}
.pc-brand:hover { text-decoration: none; }
.pc-brand .dot { color: var(--accent); }
.pc-controls { display: flex; align-items: center; gap: 0.85rem; }
.pc-nav-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.pc-nav-link:hover { color: var(--text); }
.pc-lang { display: inline-flex; align-items: center; gap: 0.1rem; font-size: 0.85rem; }
.pc-lang button {
  background: none; border: 0; padding: 0.1rem 0.2rem; margin: 0; cursor: pointer;
  color: var(--faint); font: inherit; font-weight: 500; opacity: 0.55;
  transition: opacity 0.12s ease, color 0.12s ease;
}
.pc-lang button:hover { color: var(--text); opacity: 0.9; }
.pc-lang button.is-active { color: var(--text); opacity: 1; font-weight: 700; }
.pc-lang .pc-lang-div { color: var(--border-strong); }
.pc-theme {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; padding: 0; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text);
  cursor: pointer; font-size: 0.95rem; line-height: 1;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.pc-theme:hover { border-color: var(--border-strong); }

@media (max-width: 560px) {
  .page-chrome { padding: 1rem 1.1rem; }
  .pc-controls { gap: 0.6rem; }
  .pc-nav-link { font-size: 0.84rem; }
}

/* 사업자정보 (전자상거래법 §10) footer line for the doc pages — all 8 fields
   wrapping, pipe-separated, below the tagline (owner 2026-07-08). */
.page-biz {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.14rem 0;
  max-width: 900px;
  margin: 0.9rem auto 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--faint);
  text-align: center;
  letter-spacing: -0.01em;
  word-break: keep-all;
}
.page-biz > span:not(:last-child)::after {
  content: "|";
  margin: 0 0.5rem;
  color: var(--border);
}

/* ── Brand plates ────────────────────────────────────────────────────────────
   Editorial panels carrying the structure of the social posts (see
   docs/figma-social-why-we-charge.md) in RIGGLE'S palette: the site's own dark
   ground, its ink, and ONE accent element per plate. Deliberately
   theme-INDEPENDENT — a plate looks identical in light and dark mode, the way
   a printed insert does — but the colors are the site's, not a second brand.

   Built from HTML + CSS rather than a flat image or <svg> text, for three
   reasons that all bite on these pages: it reflows at 360px instead of
   shrinking type to nothing; the KO/EN .lang-ko/.lang-en toggle keeps working
   (display-toggling an SVG <tspan> is unreliable across browsers); and the
   words stay real text — selectable, translatable, and reachable by a screen
   reader. Korean rules from the same brief apply: keep-all wrapping, tight
   자간 on display lines, accent on one word only. */
.plate {
  /* Riggle's OWN dark-theme tokens, hard-coded rather than inherited, so the
     panel is the same object in light and dark mode. These four values are
     copied from :root[data-theme="dark"] above — --bg, --text, --muted,
     --accent — so the plate matches the site instead of importing a second
     palette. (It first shipped in the social posts' warm-black + gold; that
     read as a foreign insert on an indigo page. Owner 2026-08-15: match the
     colors.) If the dark theme is ever retuned, retune these with it. */
  --pl-ground: #0b1020;
  --pl-ink: #f8fafc;
  --pl-dim: #a9b4c7;
  --pl-gold: #8b8cff;
  --pl-rule: rgba(248, 250, 252, 0.14);
  background: var(--pl-ground);
  color: var(--pl-ink);
  border-radius: var(--radius);
  padding: 2.1rem 1.8rem;
  margin: 1.5rem 0 0;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: 1.6;
}
.plate-kicker {
  display: block; color: var(--pl-gold);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.09em;
  text-transform: uppercase; margin-bottom: 0.7rem;
}
.plate-line {
  margin: 0 0 1.5rem; font-size: 1.5rem; font-weight: 700; line-height: 1.3;
  letter-spacing: -0.045em; /* 자간 −4.5%: display lines read insistent, not loose */
  color: var(--pl-ink); text-wrap: balance;
}
.plate-line .gold { color: var(--pl-gold); }
.plate-foot {
  margin: 1.4rem 0 0; padding-top: 1rem; border-top: 1px solid var(--pl-rule);
  color: var(--pl-dim); font-size: 0.85rem; letter-spacing: -0.01em;
}
.plate-foot b { color: var(--pl-ink); font-weight: 600; }

/* Flow — numbered stations. 4 across on desktop, 2×2 on tablet, stacked on
   phones. The rule between stations is drawn, not typed, so it never wraps. */
.plate-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
.plate-flow .st { position: relative; padding-right: 1.1rem; }
.plate-flow .st:not(:last-child)::after {
  content: ""; position: absolute; right: 0.2rem; top: 0.62rem;
  width: 0.55rem; height: 1px; background: var(--pl-rule);
}
.plate-flow .n {
  display: block; color: var(--pl-gold); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.08em; margin-bottom: 0.35rem;
}
.plate-flow .t { display: block; font-weight: 600; font-size: 1rem; margin-bottom: 0.2rem; }
.plate-flow .d { display: block; color: var(--pl-dim); font-size: 0.87rem; }

/* Spine — one input branching into many outputs. The gold rule IS the brief. */
.plate-spine { margin: 0; padding: 0 0 0 1.4rem; list-style: none; border-left: 2px solid var(--pl-gold); }
.plate-spine li { position: relative; padding: 0.42rem 0; font-size: 0.95rem; }
.plate-spine li::before {
  content: ""; position: absolute; left: -1.4rem; top: 1.1rem;
  width: 0.85rem; height: 1px; background: var(--pl-rule);
}
.plate-spine b { font-weight: 600; }
.plate-spine .d { color: var(--pl-dim); }

/* Split — two or three labelled columns (a ladder, an in/out comparison). */
.plate-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1.3rem; }
.plate-split .col-h {
  display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--pl-dim); padding-bottom: 0.55rem;
  margin-bottom: 0.75rem; border-bottom: 1px solid var(--pl-rule);
}
.plate-split .col-h.is-gold { color: var(--pl-gold); }
.plate-split ul { margin: 0; padding: 0; list-style: none; }
.plate-split li { font-size: 0.92rem; padding: 0.22rem 0; color: var(--pl-ink); }
.plate-split li .d { color: var(--pl-dim); }
.plate-split .fig { display: block; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 0.5rem; }

@media (max-width: 760px) {
  .plate { padding: 1.7rem 1.3rem; }
  .plate-line { font-size: 1.28rem; }
  .plate-flow { grid-template-columns: repeat(2, 1fr); gap: 1.2rem 1rem; }
  .plate-flow .st:nth-child(2)::after { display: none; }
}
@media (max-width: 430px) {
  .plate-flow { grid-template-columns: 1fr; }
  .plate-flow .st::after { display: none !important; }
  .plate-flow .st { padding-right: 0; }
}
