/* Oniden app: shared tokens, type, header and controls. Dark is the default; [data-theme=light] overrides. */
@font-face { font-family: "Literata"; src: url("fonts/literata-var.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: dark;
  --ink: #efece4; --night: #120f0c; --bark: #2a1e15; --wood: #6b4a31; --leaf: #86a96f; --ember: #c9a66b;
  --mute: #aba392;
  --grain-deep: #2e1d12; --grain-hi: #4a3120;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Atkinson Hyperlegible", system-ui, "Segoe UI", sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --ink: #1a1713; --night: #fbfaf6; --bark: #e9e2d6; --wood: #5b3d27; --leaf: #3f6d31; --ember: #8a5a1c;
  --mute: #5f584d;
  --grain-deep: #3a2618; --grain-hi: #4a3120;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding-bottom: 10px; background: var(--night); color: var(--ink); font: 400 1rem/1.55 var(--sans); }
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.25; margin: 0; }
h1 { font-size: clamp(1.7rem, 5.5vw, 2.3rem); }
h2 { font-size: 1.44rem; }
p { margin: 0 0 1rem; max-width: none; }
a { color: var(--leaf); text-underline-offset: .2em; }
.mute { color: var(--mute); }
code { font: .9em ui-monospace, Consolas, monospace; background: var(--bark); padding: .1em .35em; border-radius: 4px; white-space: nowrap; }
pre { margin: 0 0 .75rem; padding: .8rem 1rem; background: var(--bark); border-radius: 4px; overflow-x: auto; font: .9rem/1.5 ui-monospace, Consolas, monospace; }
:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }
button, input { font: inherit; color: var(--ink); background: transparent; border: 1px solid var(--mute); border-radius: 4px; min-height: 44px; padding: .5rem 1rem; }
button { cursor: pointer; }
button:hover { border-color: var(--leaf); }
button:disabled { opacity: .6; cursor: default; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The one signature: a dark-wood edge and a single leaf mark. */
.edge { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; pointer-events: none; height: 10px; background: repeating-linear-gradient(92deg, var(--wood) 0 7px, var(--grain-deep) 7px 9px, var(--wood) 9px 21px, var(--grain-hi) 21px 22px); }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; max-width: 64rem; margin: 0 auto; padding: .75rem 16px; }
.brand { display: flex; align-items: center; gap: .5rem; margin-inline-end: auto; min-height: 44px; }
.brand .mark { width: 1.75rem; height: 1.75rem; color: var(--leaf); flex: none; }
.brand .word { font: 600 1.44rem/1 var(--serif); letter-spacing: .01em; }
.brand .ja { font-size: .85rem; color: var(--mute); margin-inline-start: .1rem; }

/* Korean (docs/i18n.md 8). System Hangul fonts only, no font files. Latin letters and digits still come from Atkinson. */
:root:lang(ko) {
  --sans: "Atkinson Hyperlegible", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", system-ui, sans-serif;
  --ja: "Yu Gothic", "Hiragino Sans", "Noto Sans CJK JP", "Meiryo", sans-serif;
}
/* No dependable Hangul serif: headings use the sans stack at 700. The wordmark stays Literata. */
:lang(ko) :is(h1, h2, h3) { font-family: var(--sans); font-weight: 700; }
:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }
:lang(ko) body { line-height: 1.7; }
:lang(ko) code, :lang(ko) pre { word-break: normal; overflow-wrap: normal; }
/* The mark is not text to read: draw the Japanese glyph forms even on a Korean page. */
.brand .ja:lang(ja) { font-family: var(--ja, inherit); }
bdi { unicode-bidi: isolate; }

button.icon { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; padding: 0; }
button.icon svg { display: block; }
