/* Idéorama manual — same "Gallery wall" tokens as style.css: the app's neutral
   grays, Inter only, square corners, space and tone before lines. Tuned for
   long reading: ~75-character measure, 28px body line height. */

:root {
  --bg: #f2f2f2; --surface: #ffffff; --text: #121212; --muted: #6e6e6e; --faint: #858585;
  --line: #dcdcdc; --chip: #e8e8e8; --accent: var(--text);
  --invert-bg: #121212; --invert-text: #f2f2f2;
  --show-light: block; --show-dark: none;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --disp: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0d; --surface: #171717; --text: #f5f5f5; --muted: #9b9b9b; --faint: #6e6e6e;
    --line: #242424; --chip: #242424;
    --invert-bg: #f5f5f5; --invert-text: #0d0d0d;
    --show-light: none; --show-dark: block;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d0d; --surface: #171717; --text: #f5f5f5; --muted: #9b9b9b; --faint: #6e6e6e;
  --line: #242424; --chip: #242424;
  --invert-bg: #f5f5f5; --invert-text: #0d0d0d;
  --show-light: none; --show-dark: block;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/28px var(--disp);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--invert-bg); color: var(--invert-text); }
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--faint); }
a:hover { text-decoration-color: currentColor; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.only-light { display: var(--show-light); }
.only-dark { display: var(--show-dark); }
.gutter { padding-left: max(16px, env(safe-area-inset-left), 4.5vw); padding-right: max(16px, env(safe-area-inset-right), 4.5vw); }

header.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
header.top .bar { display: flex; align-items: center; gap: 16px; height: 64px; max-width: 1200px; margin: 0 auto; box-sizing: content-box; }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 700 18px/1 var(--disp); letter-spacing: -0.03em; text-decoration: none; }
/* Same square mark as the landing page. */
.brand::before {
  content: ""; width: 20px; height: 20px;
  background:
    linear-gradient(var(--muted), var(--muted)) 100% 100% / 60% 60% no-repeat,
    linear-gradient(var(--bg), var(--bg)) 100% 100% / 65% 65% no-repeat,
    linear-gradient(var(--text), var(--text)) 0 0 / 75% 75% no-repeat;
}
.brand span { margin-left: 4px; font: 400 18px/1 var(--disp); letter-spacing: -0.02em; color: var(--muted); }
.bar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; font: 500 14px/1 var(--disp); }
.bar .right > a { padding: 8px 12px; text-decoration: none; color: var(--muted); }
.bar .right > a:hover { color: var(--text); background: var(--surface); }
.theme-btn { height: 32px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); font: 500 13px/1 var(--disp); cursor: pointer; }
.theme-btn:hover { color: var(--text); background: var(--surface); }

.layout { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 64px; box-sizing: content-box; }
aside.toc { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto; padding: 48px 0; font-size: 14px; line-height: 20px; }
aside.toc p { font: 500 14px/24px var(--disp); color: var(--muted); margin: 0 0 8px; }
aside.toc ol { list-style: none; margin: 0; padding: 0; }
aside.toc li { margin: 0; }
aside.toc a { display: block; padding: 6px 12px; text-decoration: none; color: var(--muted); box-shadow: inset 2px 0 0 var(--line); }
aside.toc a:hover { color: var(--text); }
aside.toc a.active { color: var(--text); background: var(--surface); box-shadow: inset 2px 0 0 var(--text); }
details.toc-sm { display: none; }

main { padding: 48px 0 96px; min-width: 0; max-width: 680px; }
h1 { font: 700 clamp(40px, 6vw, 64px)/1.05 var(--disp); letter-spacing: -0.04em; margin: 0 0 24px; }
.lede { color: var(--muted); font-size: 19px; line-height: 32px; margin: 0 0 8px; }
section { padding-top: 64px; }
h2 { font: 700 32px/40px var(--disp); letter-spacing: -0.03em; margin: 0 0 16px; }
h3 { font: 600 19px/28px var(--disp); margin: 32px 0 8px; letter-spacing: -0.01em; }
p { margin: 0 0 16px; }
ul, ol { padding-left: 24px; margin: 0 0 16px; }
li { margin: 4px 0; }
ul li::marker { content: "■  "; font-size: 0.6em; color: var(--faint); }
ol li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
kbd { font: 500 12px/1 var(--disp); background: var(--chip); border: 1px solid var(--line); border-bottom-width: 2px; padding: 3px 6px; white-space: nowrap; color: var(--text); }
code { font: 0.88em var(--mono); background: var(--chip); padding: 1px 5px; }
pre { margin: 8px 0 16px; background: var(--surface); padding: 16px; overflow-x: auto; font: 14px/24px var(--mono); }
pre code { background: none; padding: 0; }
figure { margin: 24px 0 32px; }
figure .frame { padding: 8px; overflow: hidden; background: var(--surface); }
figcaption { font: 400 14px/20px var(--disp); color: var(--muted); margin-top: 8px; }
.note { background: var(--surface); box-shadow: inset 4px 0 0 var(--text); padding: 16px 24px; font-size: 15px; line-height: 24px; margin: 24px 0; }
.note p:last-child { margin: 0; }
.table-wrap { overflow-x: auto; margin: 16px 0 24px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 20px; }
th, td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-weight: 600; background: var(--chip); font-size: 13px; }
td:first-child { white-space: nowrap; }
.keys-group { margin-top: 32px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  aside.toc { display: none; }
  details.toc-sm { display: block; margin: 24px 0 0; background: var(--surface); }
  details.toc-sm summary { padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 15px; }
  details.toc-sm ol { margin: 0; padding: 0 16px 16px 40px; font-size: 15px; }
  .bar .right .hide-sm { display: none; }
  main { padding-top: 32px; }
  section { padding-top: 48px; }
}

/* Language switch */
.lang { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); font: 500 13px/1 var(--disp); cursor: pointer; }
.lang-btn svg { width: 9px; height: 6px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.lang-btn:hover, .lang[data-open] .lang-btn { color: var(--text); background: var(--surface); }
.lang-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; display: none; min-width: 160px; margin: 0; padding: 8px; list-style: none; background: var(--surface); box-shadow: 0 24px 48px -32px rgba(0, 0, 0, 0.5); }
.lang[data-open] .lang-menu { display: block; }
.lang-menu li { margin: 0; }
.lang-menu a { display: block; padding: 8px 12px; font: 500 14px/20px var(--disp); color: var(--muted); text-decoration: none; }
.lang-menu a:hover { background: var(--chip); color: var(--text); }
.lang-menu a[aria-current="true"] { color: var(--text); font-weight: 600; }

/* Page footer (contact) */
.page-footer { max-width: 1200px; margin: 0 auto; padding-top: 32px; padding-bottom: 48px; box-sizing: content-box; background: var(--surface); box-shadow: 0 0 0 100vmax var(--surface); clip-path: inset(0 -100vmax); font: 400 13px/24px var(--disp); color: var(--muted); }
.page-footer .inner { display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; }
.page-footer a { color: var(--text); text-decoration-color: var(--faint); }
.page-footer a:hover { text-decoration-color: currentColor; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
