/* ponin.app: one stylesheet for every page. The CSP allows no inline style, so nothing lives in the HTML. */
:root {
  --paper: #F7F3EA;
  --card: #FFFDF8;
  --ink: #2B2A28;
  --ink-muted: #6B655C;
  --line: #E4DCCB;
  --shu: #C8392B;
  --shu-ink: #FFFFFF;
  --shu-soft: #F6E3DC;
  --mincho: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "BIZ UDPMincho", serif;
  --gothic: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", "Noto Sans JP", system-ui, sans-serif;
  --latin: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1C1B19;
    --card: #262421;
    --ink: #EDE7DA;
    --ink-muted: #ADA597;
    --line: #3A3631;
    --shu: #E0614F;
    --shu-ink: #1C1B19;
    --shu-soft: #3A2622;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--gothic);
  font-size: 16px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}
html:lang(vi) body, html:lang(en) body { font-family: var(--latin); line-height: 1.7; }
/* An element in VI or EN on a JA page (the footer links to the VI / EN articles, the language switch): Yu Gothic and Meiryo
   lack the precomposed Vietnamese letters (ấ, ế, ...), so the browser stacks the accents apart ("dâ´u"). :where() keeps the
   rule at zero specificity, so any rule that names the element itself (mincho headings, .lang a) still wins. The same the
   other way: JA links on a VI / EN page get the Japanese font, not the browser's fallback for CJK. */
:where(:lang(ja)) { font-family: var(--gothic); }
:where(:lang(vi), :lang(en)) { font-family: var(--latin); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--shu); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--shu); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-family: var(--mincho); font-weight: 700; font-size: 20px; }
.brand img { width: 28px; height: 28px; }
.lang { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.lang a { font-family: var(--latin); font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink-muted); padding: 6px 10px; border-radius: 999px; }
.lang a[aria-current="true"] { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

/* Hero */
.hero { padding: 40px 0 28px; text-align: center; }
.hero h1 { font-family: var(--mincho); font-size: clamp(34px, 8vw, 54px); line-height: 1.3; margin: 0 0 18px; letter-spacing: 0.04em; }
html:lang(vi) .hero h1, html:lang(en) .hero h1 { font-family: var(--latin); letter-spacing: 0; font-weight: 800; }
.hero .sub { max-width: 36em; margin: 0 auto 26px; color: var(--ink); font-size: 17px; }
.hero .seal { width: 112px; margin: 0 auto 18px; }
.actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cta { display: inline-block; background: var(--shu); color: var(--shu-ink); font-weight: 700; font-size: 17px; text-decoration: none; padding: 14px 28px; border-radius: 12px; min-height: 48px; }
.cta:hover { filter: brightness(1.06); }
.soon { display: inline-block; color: var(--ink-muted); font-size: 14px; padding: 8px 16px; border: 1px dashed var(--line); border-radius: 12px; }

/* Sections */
section { padding: 28px 0; border-top: 1px solid var(--line); }
h2 { font-family: var(--mincho); font-size: 24px; line-height: 1.45; margin: 0 0 16px; }
html:lang(vi) h2, html:lang(en) h2 { font-family: var(--latin); font-weight: 800; font-size: 22px; }
h3 { font-size: 17px; margin: 0 0 4px; }
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
@media (min-width: 640px) { .points { grid-template-columns: repeat(3, 1fr); } }
.points li { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.points p { margin: 0; color: var(--ink-muted); font-size: 15px; }

.styles-fig { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.styles-fig ol { list-style: none; padding: 0; margin: 6px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; font-family: var(--mincho); font-weight: 700; }
.note { color: var(--ink-muted); font-size: 14px; }
.wip { background: var(--shu-soft); border-radius: 14px; padding: 14px 16px; margin: 0; }

.faq dt { font-weight: 700; margin-top: 18px; }
.faq dt:first-child { margin-top: 0; }
.faq dd { margin: 4px 0 0; }
.faq dd p { margin: 0 0 6px; }

/* Footer */
footer { border-top: 1px solid var(--line); margin-top: 24px; padding: 24px 0 40px; font-size: 14px; color: var(--ink-muted); }
footer ul { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer a { color: var(--ink-muted); }
footer .guides-title { font-weight: 700; margin: 12px 0 6px; }

/* Documents (privacy, terms, support) and guides */
.doc { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px 20px; margin: 8px 0 24px; }
.doc h1 { font-family: var(--mincho); font-size: 28px; line-height: 1.4; margin: 0 0 8px; }
html:lang(vi) .doc h1, html:lang(en) .doc h1 { font-family: var(--latin); font-weight: 800; }
.doc h2 { font-size: 20px; margin: 28px 0 8px; }
.doc h3 { margin-top: 18px; }
.doc ul, .doc ol { padding-left: 1.4em; }
.doc li { margin: 4px 0; }
.doc .meta { color: var(--ink-muted); font-size: 14px; margin: 0 0 16px; }
.draft { display: inline-block; background: var(--shu); color: var(--shu-ink); font-weight: 700; font-size: 13px; padding: 2px 10px; border-radius: 999px; margin-bottom: 10px; }
.disclaimer { border-left: 4px solid var(--shu); background: var(--shu-soft); padding: 12px 14px; border-radius: 0 10px 10px 0; margin: 20px 0; }
.disclaimer p { margin: 0 0 6px; }
.disclaimer p:last-child { margin-bottom: 0; }
.doc figure { margin: 18px auto; max-width: 360px; }
.doc figure.wide { max-width: 100%; }
.doc figcaption { font-size: 13px; color: var(--ink-muted); text-align: center; margin-top: 6px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 12px 0; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc th { background: var(--paper); }
.table-scroll { overflow-x: auto; }
.doc .cta-box { text-align: center; margin: 28px 0 8px; }
.back { display: inline-block; margin-top: 8px; }
.crumbs { font-size: 13px; color: var(--ink-muted); margin: 4px 0 0; }
.crumbs a { color: var(--ink-muted); }
kbd { font-family: inherit; font-size: 0.92em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--paper); }
