/* ============================================================================
   RogerLe shared chrome — header + footer of rogerle.com, for every RL app.
   V1.0.1 · source: /home/rogerle.com/rlchrome/ · served as /rlchrome/ on each app.

   Namespaced on purpose: every selector starts with .rlc- and every token is
   --rlc-*, so this file can sit next to any app stylesheet without touching it.
   The tokens READ the host page's own variables when they exist (rogerle.com's
   --bg/--ink/--line, the apps' --bg/--tx/--brd) so the chrome sits on the page
   in the page's own colours; the --rlc-d-* values are the rogerle.com Paper/Ink
   palette and only apply when the host defines nothing.
   Dark is either data-theme="ink" (rogerle.com) or data-theme="dark" (apps).
   ============================================================================ */

@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-tight-normal-400.woff2") format("woff2"); }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/inter-tight-normal-500.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-normal-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/jetbrains-mono-normal-500.woff2") format("woff2"); }

/* Paper (light) defaults — the rogerle.com palette */
:root {
  --rlc-d-bg: oklch(0.975 0.008 85);
  --rlc-d-bg-2: oklch(0.955 0.010 85);
  --rlc-d-surface: oklch(0.99 0.005 85);
  --rlc-d-ink: oklch(0.22 0.012 60);
  --rlc-d-ink-2: oklch(0.34 0.012 60);
  --rlc-d-ink-3: oklch(0.52 0.012 60);
  --rlc-d-line: oklch(0.88 0.010 70);
  --rlc-d-line-2: oklch(0.80 0.010 70);
  --rlc-d-accent: oklch(0.66 0.15 55);
  --rlc-d-accent-ink: oklch(0.99 0.010 80);
  --rlc-d-green: oklch(0.62 0.12 145);
}
/* Ink (dark) defaults */
[data-theme="ink"], [data-theme="dark"] {
  --rlc-d-bg: oklch(0.16 0.012 260);
  --rlc-d-bg-2: oklch(0.20 0.014 260);
  --rlc-d-surface: oklch(0.19 0.013 260);
  --rlc-d-ink: oklch(0.96 0.008 90);
  --rlc-d-ink-2: oklch(0.82 0.010 90);
  --rlc-d-ink-3: oklch(0.64 0.012 90);
  --rlc-d-line: oklch(0.30 0.014 260);
  --rlc-d-line-2: oklch(0.40 0.015 260);
  --rlc-d-accent: oklch(0.74 0.14 60);
  --rlc-d-accent-ink: oklch(0.16 0.012 260);
  --rlc-d-green: oklch(0.72 0.14 145);
}

.rlc-nav, .rlc-mm, .rlc-footer {
  --rlc-bg:         var(--bg,         var(--rlc-d-bg));
  --rlc-bg-2:       var(--bg-2,       var(--bg2,  var(--rlc-d-bg-2)));
  --rlc-surface:    var(--surface,    var(--card, var(--rlc-d-surface)));
  --rlc-ink:        var(--ink,        var(--tx,   var(--rlc-d-ink)));
  --rlc-ink-2:      var(--ink-2,      var(--tx2,  var(--rlc-d-ink-2)));
  --rlc-ink-3:      var(--ink-3,      var(--tx3,  var(--rlc-d-ink-3)));
  --rlc-line:       var(--line,       var(--brd,  var(--rlc-d-line)));
  --rlc-line-2:     var(--line-2,     var(--inpB, var(--rlc-d-line-2)));
  --rlc-accent:     var(--accent,     var(--acc,  var(--rlc-d-accent)));
  --rlc-accent-ink: var(--accent-ink, var(--rlc-d-accent-ink));
  --rlc-green:      var(--green,      var(--grn,  var(--rlc-d-green)));
  --rlc-sans: "Inter Tight", "Inter", ui-sans-serif, system-ui, sans-serif;
  --rlc-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --rlc-gutter: clamp(20px, 4vw, 48px);

  font-family: var(--rlc-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--rlc-ink);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

/* ---- local reset: the host may style a, ul, h4, button, img globally ---- */
/* :where() keeps these at zero specificity: they beat the host's bare `a {}` / `ul {}`
   rules only by source order, and never outrank the .rlc-* component rules below. */
:where(.rlc-nav, .rlc-mm, .rlc-footer) :where(*) { box-sizing: border-box; }
:where(.rlc-nav, .rlc-mm, .rlc-footer) :where(a) { color: inherit; text-decoration: none; }
:where(.rlc-nav, .rlc-mm, .rlc-footer) :where(a:hover) { color: inherit; }
:where(.rlc-nav, .rlc-footer) :where(ul) { list-style: none; margin: 0; padding: 0; }
:where(.rlc-nav, .rlc-footer) :where(p, h4) { margin: 0; }
:where(.rlc-nav, .rlc-mm, .rlc-footer) :where(button) { font-family: inherit; }
.rlc-inner { width: min(1280px, 100% - var(--rlc-gutter) * 2); margin-inline: auto; }
.rlc-mono { font-family: var(--rlc-mono); letter-spacing: 0; }
.rlc-tiny { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.rlc-muted { color: var(--rlc-ink-3); }

/* ---- buttons ---- */
.rlc-btn-primary, .rlc-btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 6px; line-height: 1.2;
  font-family: var(--rlc-sans); font-size: 14px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; transition: all .15s ease;
  white-space: nowrap;
}
.rlc-btn-primary { background: var(--rlc-ink); color: var(--rlc-bg); }
.rlc-btn-primary:hover { background: var(--rlc-accent); color: var(--rlc-accent-ink); }
.rlc-btn-ghost { background: transparent; color: var(--rlc-ink-2); }
.rlc-btn-ghost:hover { color: var(--rlc-ink); background: var(--rlc-bg-2); }
.rlc-nav .rlc-user { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--rlc-ink-2); white-space: nowrap; }

/* ============================================================================
   HEADER
   ============================================================================ */
.rlc-nav {
  position: sticky; top: 0; z-index: 300;
  background: color-mix(in oklab, var(--rlc-bg), transparent 8%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.rlc-nav.rlc-scrolled { border-bottom-color: var(--rlc-line); }
.rlc-nav .rlc-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }

.rlc-brand { display: flex; align-items: center; color: var(--rlc-ink); }
.rlc-brand-img { height: 36px; width: auto; max-width: none; display: block; }
[data-theme="ink"] .rlc-brand-img, [data-theme="dark"] .rlc-brand-img { filter: invert(1) hue-rotate(180deg); }

.rlc-links { display: flex; gap: 22px; }
.rlc-dd { position: relative; padding-bottom: 8px; margin-bottom: -8px; }
.rlc-dd-btn {
  background: none; border: 0; margin: 0; cursor: pointer;
  font-family: inherit; font-size: 14px; color: var(--rlc-ink-2);
  display: flex; align-items: center; gap: 5px; padding: 4px 0;
}
.rlc-dd-btn:hover { color: var(--rlc-ink); }
.rlc-chev::after { content: "\25BE"; font-size: 10px; opacity: .5; display: inline-block; transition: transform .2s; }
.rlc-dd.open .rlc-chev::after { transform: rotate(180deg); }
.rlc-dd-menu {
  display: none; position: absolute; top: 100%; left: 0;
  min-width: 200px; padding: 8px 0;
  background: var(--rlc-surface); border: 1px solid var(--rlc-line);
  border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.12); z-index: 1000;
}
.rlc-dd.open .rlc-dd-menu { display: block; }
[data-theme="ink"] .rlc-dd-menu, [data-theme="dark"] .rlc-dd-menu { box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.rlc-dd-link { display: block; padding: 9px 18px; font-size: 13px; color: var(--rlc-ink-2); transition: all .15s; white-space: nowrap; }
.rlc-dd-link:hover { background: color-mix(in oklab, var(--rlc-accent), transparent 92%); color: var(--rlc-ink); }
.rlc-dd-link.on { color: var(--rlc-accent); font-weight: 600; }

.rlc-right { display: flex; align-items: center; gap: 10px; }
.rlc-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--rlc-mono); font-size: 11px; letter-spacing: .06em;
  color: var(--rlc-ink-2); padding: 6px 10px;
  border: 1px solid var(--rlc-line); border-radius: 100px; background: var(--rlc-surface);
  white-space: nowrap;
}
.rlc-status:hover { border-color: var(--rlc-line-2); color: var(--rlc-ink); }
.rlc-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--rlc-green);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--rlc-green), transparent 70%);
  animation: rlc-pulse 2.4s infinite;
}
@keyframes rlc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.rlc-locale { display: inline-flex; border: 1px solid var(--rlc-line); border-radius: 6px; padding: 2px; background: var(--rlc-surface); }
.rlc-locale-btn {
  font-family: var(--rlc-mono); font-size: 11px; letter-spacing: .06em; line-height: 1.4;
  padding: 4px 8px; border: 0; background: transparent; color: var(--rlc-ink-3);
  border-radius: 4px; cursor: pointer;
}
.rlc-locale-btn:hover { color: var(--rlc-ink); }
.rlc-locale-btn.on { background: var(--rlc-ink); color: var(--rlc-bg); cursor: default; }

.rlc-theme-btn {
  width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rlc-line); border-radius: 999px;
  background: var(--rlc-surface); color: var(--rlc-ink-2); cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .2s ease;
}
.rlc-theme-btn:hover { color: var(--rlc-ink); border-color: var(--rlc-line-2); transform: rotate(-12deg); }
.rlc-theme-btn svg { display: block; }
.rlc-theme-form { margin: 0; display: inline-flex; }

.rlc-burger {
  display: none; background: none; border: 0; cursor: pointer;
  width: 36px; height: 36px; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; padding: 6px; margin-left: 8px;
}
.rlc-burger span { display: block; width: 22px; height: 2px; background: var(--rlc-ink); border-radius: 2px; }

/* ============================================================================
   MOBILE MENU (full-screen panel, own top bar so the header can stay at z 300)
   ============================================================================ */
.rlc-mm { display: none; position: fixed; inset: 0; background: var(--rlc-bg); z-index: 9000; overflow-y: auto; }
.rlc-mm.open { display: block; }
.rlc-mm-bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; padding: 0 var(--rlc-gutter); border-bottom: 1px solid var(--rlc-line);
}
.rlc-mm-close {
  background: none; border: 1px solid var(--rlc-line); border-radius: 999px;
  width: 36px; height: 36px; padding: 0; color: var(--rlc-ink); font-size: 16px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.rlc-mm-body { padding: 12px var(--rlc-gutter) 40px; }
.rlc-mm-group {
  padding: 18px 0 8px; color: var(--rlc-ink-3);
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
  border-top: 1px solid var(--rlc-line);
}
.rlc-mm-group:first-child { border-top: 0; padding-top: 6px; }
.rlc-mm-link { display: block; padding: 14px 0; font-size: 16px; color: var(--rlc-ink); border-bottom: 1px solid var(--rlc-line); }
.rlc-mm-link:hover, .rlc-mm-link:active, .rlc-mm-link.on { color: var(--rlc-accent); }
.rlc-mm-divider { height: 1px; background: var(--rlc-line); margin: 20px 0; }
.rlc-mm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 4px 0 16px; }
.rlc-mm-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.rlc-mm-actions > * { flex: 1; justify-content: center; text-align: center; padding: 14px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.rlc-mm-actions .rlc-btn-ghost { border-color: var(--rlc-line); }
body.rlc-mm-open { overflow: hidden; }

/* ---- responsive ---- */
@media (max-width: 991px) {
  .rlc-links, .rlc-right { display: none !important; }
  .rlc-burger { display: flex; }
}
@media (max-width: 1100px) and (min-width: 992px) {
  .rlc-status-text { display: none; }
  .rlc-locale { display: none; }
}

/* ============================================================================
   FOOTER
   ============================================================================ */
.rlc-footer { padding: clamp(48px, 6vw, 80px) 0 32px; background: var(--rlc-bg-2); margin-top: auto; }
.rlc-f-top {
  display: grid; grid-template-columns: 1.2fr 2.2fr; gap: 48px;
  padding-bottom: 36px; border-bottom: 1px solid var(--rlc-line);
}
@media (max-width: 900px) { .rlc-f-top { grid-template-columns: 1fr; } }
.rlc-f-brand .rlc-brand-img { height: 26px; margin-bottom: 14px; }
.rlc-f-tag { color: var(--rlc-ink-3); margin: 4px 0 14px; font-size: 14px; }
.rlc-f-flags { display: flex; flex-direction: column; gap: 4px; }
.rlc-f-flags a { color: var(--rlc-ink-2); }
.rlc-f-flags a:hover { color: var(--rlc-ink); }

.rlc-f-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 560px) { .rlc-f-cols { grid-template-columns: repeat(2, 1fr); gap: 32px 24px; } }
.rlc-f-cols h4 {
  font-family: var(--rlc-mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--rlc-ink-3);
  margin: 0 0 14px; font-weight: 500;
}
.rlc-f-cols li { padding: 4px 0; }
.rlc-f-cols a { color: var(--rlc-ink-2); font-size: 14.5px; }
.rlc-f-cols a:hover { color: var(--rlc-ink); }

.rlc-f-mid { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; flex-wrap: wrap; gap: 16px; }
.rlc-theme-toggle { display: inline-flex; align-items: center; gap: 12px; }
.rlc-theme-switch { display: inline-flex; border: 1px solid var(--rlc-line); border-radius: 999px; padding: 3px; background: var(--rlc-surface); }
.rlc-theme-switch a, .rlc-theme-switch button, .rlc-theme-switch span {
  display: inline-block; border: 0; background: transparent; color: var(--rlc-ink-3);
  font: 500 12px/1 var(--rlc-sans); letter-spacing: .04em;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  transition: color .18s ease, background .18s ease;
}
.rlc-theme-switch a:hover, .rlc-theme-switch button:hover { color: var(--rlc-ink); }
.rlc-theme-switch .on { background: var(--rlc-ink); color: var(--rlc-bg); cursor: default; }

.rlc-f-timeline { color: var(--rlc-ink-3); overflow: hidden; white-space: nowrap; padding: 28px 0 14px; font-size: 11px; line-height: 1.2; }
@media (max-width: 700px) { .rlc-f-timeline { font-size: 9px; } }
.rlc-f-bot { display: flex; justify-content: space-between; padding-top: 18px; border-top: 1px solid var(--rlc-line); flex-wrap: wrap; gap: 12px; }

/* ---- host helpers ---- */
/* Put class="rlc-body" on <body> in apps whose body is not already a flex column,
   so the footer stays at the bottom of short pages. */
.rlc-body { display: flex; flex-direction: column; min-height: 100vh; }
.rlc-body > * { flex-shrink: 0; }
:where(.rlc-nav, .rlc-mm, .rlc-footer) :focus-visible { outline: 2px solid var(--rlc-accent); outline-offset: 2px; }
@media print { .rlc-nav, .rlc-mm, .rlc-footer { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .rlc-dot { animation: none; } .rlc-theme-btn:hover { transform: none; } }
