/* site.css — shared "instrument plate" identity for the ral landing and docs.
   Tokens, base elements, menubar, window chrome, footer.
   Page-specific styles live in index.css (landing) and doc.css (docs).
   The exarch sub-site has its own chrome under exarch/ and is not styled here. */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink:      #1a160f;   /* page ground                       */
  --plate:    #221c13;   /* raised window / panel surface      */
  --panel:    #271f15;   /* inset code / label surface         */
  --line:     #3a3024;   /* hairlines and borders              */
  --title:    #2a2117;   /* window titlebar                    */
  --text:     #e9e2d2;   /* primary ink                        */
  --ink-2:    #c4b79e;   /* secondary ink                      */
  --muted:    #a2937a;
  --faint:    #6e624e;
  --accent:   #dc8a5a;   /* warm — command / effect / !        */
  --accent-2: #e8a878;   /* warm hover                         */
  --val:      #6fb6a4;   /* cool — value  / data    / $        */
  --str:      #6fb6a4;   /* strings read as values (cool)      */
  --kw:       #dc8a5a;   /* keywords read as commands (warm)   */
  --num:      #c9a24a;   /* numbers and constants (gold)       */
  --bevel-hi: rgba(255, 238, 214, 0.05);
  --bevel-lo: rgba(0, 0, 0, 0.45);
  --mono:  'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --serif: 'IBM Plex Serif', ui-serif, 'Iowan Old Style', 'Palatino Linotype',
           Palatino, Georgia, serif;
}

html {
  background: var(--ink);
  color: var(--text);
  font-family: var(--serif);
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: radial-gradient(130% 90% at 50% -10%, #221b12 0%, var(--ink) 62%) fixed;
}

::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--val); outline-offset: 3px; }

a { color: var(--accent); text-decoration: none; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-2); text-decoration: underline; }

/* ── menubar ── */
.menubar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: stretch;
  gap: 0.05rem;
  padding: 0.2rem 0.4rem;
  background: color-mix(in srgb, var(--ink) 84%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  line-height: 1.2;
}
.menubar .spacer { flex: 1 1 auto; }
.menubar .toc {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.68rem;
}
.menubar .toc a { color: var(--muted); letter-spacing: 0.06em; }
.menubar .toc a:hover { color: var(--accent); }

.menu-item {
  display: flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  transition: color 0.12s, border-color 0.12s;
}
.menu-item:hover { color: var(--text); text-decoration: none; border-color: var(--line); }
.menu-item.current { color: var(--text); }
.menu-item .ext { font-size: 0.7rem; opacity: 0.7; }

/* ── window ── */
.window {
  background: var(--plate);
  border: 1px solid var(--line);
  box-shadow:
    inset  1px  1px 0 var(--bevel-hi),
    inset -1px -1px 0 var(--bevel-lo);
}
.titlebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--title);
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  user-select: none;
  cursor: default;
}
.menu-box {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow:
    inset  1px  1px 0 var(--bevel-hi),
    inset -1px -1px 0 var(--bevel-lo);
}
.menu-box.app-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}
.title-text { flex: 0 1 auto; }
.titlebar .spacer { flex: 1 1 auto; }

/* ── footer ── */
.footer {
  position: relative;
  z-index: 1;
  max-width: 54rem;
  margin: 0 auto;
  padding: 1.4rem 1.2rem 2.4rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--faint);
  border-top: 1px solid var(--line);
}
.footer a { color: var(--muted); font-weight: 500; }
.footer a:hover { color: var(--accent); }

/* ── responsive ── */
@media (max-width: 36rem) {
  .menu-item { padding: 0.35rem 0.55rem; font-size: 0.76rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
