/* ============================================================
   RAGBAZ — Design System Tokens
   Warm solarized-dark / gruvbox-dark-warm
   Primary: orange ember.  Secondary: cyan-blue.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Intel+One+Mono:ital,wght@0,300..700;1,300..700&family=Noto+Sans:ital,wght@0,300..900;1,300..900&family=Noto+Serif:ital,wght@0,300..900;1,300..900&family=Hanken+Grotesk:ital,wght@0,300..900;1,300..900&family=Spectral:ital,wght@0,200..800;1,200..800&display=swap");

:root {
  /* ── BACKDROP — deepest to shallowest ────────────────────── */
  --bg-0:        #0a0908;   /* under everything, page void */
  --bg-1:        #0f0f10;   /* main app surface */
  --bg-2:        #121212;   /* panel */
  --bg-3:        #151515;   /* timeline / well */
  --bg-4:        #181818;   /* panel header */
  --bg-5:        #1a1a1a;   /* top chrome / app bar */
  --bg-elev:    #1d1812;   /* warm-tinted elevated surface */

  /* ── BORDERS — hairline → soft → strong ──────────────────── */
  --border-1:    #222222;   /* hairline (inside panels) */
  --border-2:    #2a2a2a;   /* default panel edge */
  --border-3:    #2d2d2d;   /* strong divider */
  --border-warm: #3a2a18;   /* warm amber border (HUD chips) */

  /* ── TEXT — warm cream scale ─────────────────────────────── */
  --fg-1:        #f6d7a7;   /* hi-emphasis warm cream — primary copy on dark */
  --fg-2:        #d8c29d;   /* default body text */
  --fg-3:        #d4c19a;   /* numeric / data */
  --fg-4:        #9f9f9f;   /* secondary label */
  --fg-5:        #737373;   /* tertiary / comments */
  --fg-on-warm:  #1a1208;   /* text on orange fills */

  /* ── BRAND — orange ember (primary) ──────────────────────── */
  --orange-1:    #f3c46c;   /* signature accent — section heads, carets, key lines */
  --orange-2:    #f2a77a;   /* warm/right-side, "move" tokens */
  --orange-3:    #ff9900;   /* hot accent — wordmark, money figures */
  --orange-4:    #d97742;   /* deeper ember, hover/active */

  /* ── BRAND — cyan-blue (secondary) ───────────────────────── */
  --blue-1:      #7ab8ff;   /* keyword / left-side, info */
  --blue-2:      #4fb3c7;   /* logo teal-cyan */
  --blue-3:      #2a8d9e;   /* deeper teal, pressed */

  /* ── SEMANTIC — gruvbox-dark palette ─────────────────────── */
  --green-1:     #b8bb26;   /* gruvbox bright green — success */
  --green-2:     #98971a;   /* gruvbox neutral green */
  --red-1:       #fb4934;   /* gruvbox bright red — error */
  --red-2:       #cc241d;   /* gruvbox neutral red */
  --yellow-1:    #fabd2f;   /* gruvbox bright yellow — warning */
  --yellow-2:    #d79921;   /* gruvbox neutral yellow */
  --purple-1:    #d3869b;   /* gruvbox bright purple — rare */
  --aqua-1:      #8ec07c;   /* gruvbox bright aqua — info, expression tokens */
  --gruv-orange: #fe8019;   /* gruvbox bright orange — sits between our orange-3/orange-4 */
  --magenta-1:   var(--purple-1); /* legacy alias */

  /* ── RADIUS — square-leaning, except buttons + pills ─────── */
  --r-0:         0px;       /* default — most chrome is squared */
  --r-1:         2px;       /* subtle softening on chips */
  --r-2:         6px;       /* buttons — slightly rounded */
  --r-3:         8px;       /* cards / panels */
  --r-pill:      999px;     /* pills — fully rounded */

  /* ── BUTTON / PILL CHROME ────────────────────────────────── */
  --btn-border:        #3a3a3a;        /* 2px dark gray, default */
  --btn-border-hover:  #5a5a5a;        /* lifts on hover */
  --btn-border-warm:   var(--orange-1);/* contextual: brand-warm */
  --btn-border-cool:   var(--blue-1);  /* contextual: brand-cool */
  --btn-border-w:      2px;

  /* ── SHADOW — minimal, prefer borders ────────────────────── */
  --shadow-1:    0 1px 0 rgba(0,0,0,0.4);
  --shadow-2:    0 4px 18px rgba(0,0,0,0.45);
  --shadow-glow: 0 0 0 1px rgba(243,196,108,0.25);  /* orange caret/active */
  --shadow-glow-blue: 0 0 0 1px rgba(122,184,255,0.25);

  /* ── SPACING — 4px grid ──────────────────────────────────── */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  10px;
  --s-4:  12px;
  --s-5:  16px;
  --s-6:  20px;
  --s-7:  24px;
  --s-8:  32px;
  --s-9:  48px;
  --s-10: 64px;

  /* ── FONT FAMILIES ───────────────────────────────────────── */
  --font-mono:   "Intel One Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --font-sans:   "Hanken Grotesk", "Noto Sans", "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-serif:  "Spectral", "Noto Serif", "Iowan Old Style", Georgia, serif;

  /* ── TYPE SCALE ──────────────────────────────────────────── */
  --t-display:  44px;
  --t-h1:       28px;
  --t-h2:       20px;
  --t-h3:       16px;
  --t-body:     14px;
  --t-small:    12px;
  --t-micro:    11px;

  --lh-tight:   1.15;
  --lh-snug:    1.35;
  --lh-body:    1.55;
  --lh-prose:   1.7;

  --tracking-tight:  -0.01em;
  --tracking-normal:  0em;
  --tracking-wide:    0.06em;
  --tracking-allcaps: 0.12em;

  /* ── MOTION ──────────────────────────────────────────────── */
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --ease-snap:  cubic-bezier(0.55, 0, 0.1, 1);
  --dur-fast:   120ms;
  --dur-base:   200ms;
  --dur-slow:   400ms;
}

/* ============================================================
   SEMANTIC TYPE — drop into elements directly
   ============================================================ */

.rb-display {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: var(--t-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--blue-1);
}

.rb-h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--t-h1);
  line-height: var(--lh-tight);
  color: var(--blue-1);
}

.rb-h2 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--t-h2);
  line-height: var(--lh-snug);
  color: var(--orange-1);
  letter-spacing: var(--tracking-wide);
}

.rb-h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--t-h3);
  line-height: var(--lh-snug);
  color: var(--orange-2);
}

.rb-eyebrow {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--t-small);
  letter-spacing: var(--tracking-allcaps);
  text-transform: uppercase;
  color: var(--orange-3);
}

.rb-body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--t-body);
  line-height: var(--lh-body);
  color: var(--fg-2);
}

.rb-prose {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--t-body);
  line-height: var(--lh-prose);
  color: var(--fg-2);
}

.rb-em {
  font-family: var(--font-serif);
  font-style: italic;
}

.rb-mono {
  font-family: var(--font-mono);
  font-size: var(--t-body);
  color: var(--fg-3);
}

.rb-label {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-4);
}

.rb-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--orange-3);
}

.rb-code {
  font-family: var(--font-mono);
  font-size: 0.94em;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  color: var(--orange-2);
  padding: 1px 6px;
  border-radius: var(--r-1);
}

/* ============================================================
   BASELINE — reset-y, dark by default
   ============================================================ */

body.rb {
  margin: 0;
  background: var(--bg-1);
  color: var(--fg-2);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.rb a {
  color: var(--blue-1);
  text-decoration-color: rgba(122, 184, 255, 0.35);
  text-underline-offset: 2px;
}
.rb a:hover { color: var(--orange-1); }

.rb hr {
  border: 0;
  border-top: 1px solid var(--border-2);
  margin: var(--s-5) 0;
}

/* selection */
.rb ::selection {
  background: rgba(243, 196, 108, 0.28);
  color: var(--fg-1);
}

/* ============================================================
   BUTTONS & PILLS
   All buttons and pills share a 2px dark-gray border and slight
   rounding. Background is *contextual* — pick the modifier that
   matches the surface meaning. Default fill is panel-warm.
   ============================================================ */

.rb-btn,
.rb-pill {
  --_bg:     var(--bg-4);
  --_fg:     var(--fg-1);
  --_border: var(--btn-border);

  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 6px 12px;
  background: var(--_bg);
  color: var(--_fg);
  border: var(--btn-border-w) solid var(--_border);
  border-radius: var(--r-2);
  font-family: var(--font-mono);
  font-size: var(--t-small);
  line-height: 1.2;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.rb-pill { border-radius: var(--r-pill); padding: 4px 12px; }

.rb-btn:hover,
.rb-pill:hover {
  --_border: var(--btn-border-warm);
  --_fg: var(--orange-1);
}

.rb-btn:active,
.rb-pill:active {
  --_fg: var(--orange-4);
}

.rb-btn:focus-visible,
.rb-pill:focus-visible {
  outline: none;
  box-shadow: var(--shadow-glow);
}

/* contextual fills — set on the element, e.g. <button class="rb-btn rb-btn--warm"> */
.rb-btn--warm,  .rb-pill--warm  { --_bg: #2a1d12; --_fg: var(--orange-1); --_border: var(--orange-4); }
.rb-btn--cool,  .rb-pill--cool  { --_bg: #122230; --_fg: var(--blue-1);   --_border: var(--blue-3);   }
.rb-btn--good,  .rb-pill--good  { --_bg: #16241a; --_fg: var(--green-1);  --_border: #4a6a3a;         }
.rb-btn--bad,   .rb-pill--bad   { --_bg: #2a1818; --_fg: var(--red-1);    --_border: #6a3a3a;         }
.rb-btn--ghost, .rb-pill--ghost { --_bg: transparent; --_fg: var(--fg-2); --_border: var(--btn-border); }

/* solid "primary" — orange fill, rare; for hero CTAs */
.rb-btn--primary {
  --_bg: var(--orange-3);
  --_fg: var(--fg-on-warm);
  --_border: var(--orange-3);
  font-weight: 700;
}
.rb-btn--primary:hover { --_bg: var(--orange-1); --_fg: var(--fg-on-warm); --_border: var(--orange-1); }

/* ============================================================
   CARDS
   Same chassis as buttons — 2px dark-gray border, slightly
   rounded corners — plus a soft blur shadow. All slots optional:
   .rb-card__media   (image / 3D thumb / placeholder)
   .rb-card__title   (mono, fg-1)
   .rb-card__body    (sans, fg-2)
   .rb-card__menu    (three-dot ⋮ button, top-right)
   ============================================================ */

.rb-card {
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 4 / 5;
  background: var(--bg-2);
  border: var(--btn-border-w) solid var(--btn-border);
  border-radius: var(--r-3);
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.55),
              0 1px 3px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  will-change: transform, box-shadow;
  transition:
    transform var(--dur-base) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}

.rb-card:hover {
  transform: translateY(-4px);
  border-color: var(--btn-border-hover);
  box-shadow: 0 22px 48px -14px rgba(0, 0, 0, 0.7),
              0 8px 18px -6px rgba(0, 0, 0, 0.5),
              0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Override the default aspect — inline `style="aspect-ratio: 16/9"` or
   apply one of these modifiers. */
.rb-card--ar-16x9  { aspect-ratio: 16 / 9; }
.rb-card--ar-1x1   { aspect-ratio: 1 / 1; }
.rb-card--ar-3x4   { aspect-ratio: 3 / 4; }
.rb-card--ar-auto  { aspect-ratio: auto; }   /* let content size it */


.rb-card__media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-3) center / cover no-repeat;
  border-bottom: 1px solid var(--border-2);
  /* user can override aspect-ratio inline if image is portrait */
}

.rb-card__body-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  min-width: 0;
}

.rb-card__title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--t-h3);
  line-height: var(--lh-snug);
  color: var(--fg-1);
  margin: 0;
}

.rb-card__body {
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  color: var(--fg-2);
  margin: 0;
}

.rb-card__menu {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.55);
  color: var(--fg-2);
  border: 2px solid var(--btn-border);
  border-radius: var(--r-2);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1;
  transition: border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.rb-card__menu::before { content: "⋮"; }
.rb-card__menu:hover { border-color: var(--orange-1); color: var(--orange-1); }

/* Contextual fills — same naming as buttons */
.rb-card--warm  { background: #1a130c; border-color: var(--orange-4); }
.rb-card--cool  { background: #0c1820; border-color: var(--blue-3);   }
.rb-card--ghost { background: transparent; }


