/*
 * Lore docs-site theme — translates the rac-localview design system
 * (rac/.. rac-localview/src/styles/tokens.css) onto MkDocs Material's slate
 * scheme, and styles the custom splash home (overrides/home.html).
 *
 * Five rules carried over from rac-localview/DESIGN.md:
 *   1. Three surfaces, warm near-black, never pure black.
 *   2. One hue dominates: the lantern amber. Teal/green are semantic only.
 *   3. Dashed borders = container chrome; solid borders = interactive.
 *   4. Mono everywhere (JetBrains Mono, weights 400/700).
 *   5. Sharp corners.
 */

/* ---- fonts (self-hosted, no external requests) ---------------------- */
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---- tokens --------------------------------------------------------- */
:root {
  --lore-bg: #121212;
  --lore-bg-panel: #1a1a18;
  --lore-bg-element: #242420;
  --lore-text: #d6d4cc;
  --lore-text-muted: #8f8d84;
  --lore-border-subtle: #2a2a26;
  --lore-border: #3d3b34;
  --lore-border-active: #a8762a;
  --lore-accent: #f5a623;
  --lore-accent-bright: #ffb84d;
  --lore-accent-muted: #3d2f14;
  --lore-info: #4ec9b0;
  --lore-success: #57c97a;
  --lore-mono: "JetBrains Mono", ui-monospace, "Courier New", monospace;
}

/* Drive Material's slate scheme from the lore palette. */
[data-md-color-scheme="slate"] {
  --md-default-bg-color: var(--lore-bg);
  --md-default-fg-color: var(--lore-text);
  --md-default-fg-color--light: var(--lore-text-muted);
  --md-default-fg-color--lighter: var(--lore-text-muted);
  --md-default-fg-color--lightest: var(--lore-border-subtle);

  --md-primary-fg-color: var(--lore-bg-panel);
  --md-primary-bg-color: var(--lore-text);
  --md-primary-bg-color--light: var(--lore-text-muted);

  --md-accent-fg-color: var(--lore-accent-bright);

  --md-typeset-color: var(--lore-text);
  --md-typeset-a-color: var(--lore-info);

  --md-code-bg-color: var(--lore-bg-panel);
  --md-code-fg-color: var(--lore-text);

  --md-footer-bg-color: var(--lore-bg-panel);
  --md-footer-bg-color--dark: var(--lore-bg);

  --md-text-font-family: var(--lore-mono);
  --md-code-font-family: var(--lore-mono);
}

body,
.md-typeset {
  font-family: var(--lore-mono);
}

/* Headings in amber, the dominant hue. */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  color: var(--lore-accent);
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* Search field and header tuned to the panel surface. */
.md-header {
  border-bottom: 1px dashed var(--lore-border);
}

/* ===================================================================== */
/* Splash home (overrides/home.html)                                     */
/* ===================================================================== */
.lore-splash {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 0 2rem;
  text-align: left;
}

/* Lead row: mascot left, headline + subhead right, top-aligned so the
   mascot's top sits with the first line of the headline. */
.lore-splash__lead {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
}

.lore-splash__mascot {
  flex: 0 0 auto;
  width: 220px;
  height: auto;
  display: block;
  margin-top: -0.5rem;
  padding: 1rem;
  border-radius: 1.25rem;
  background: radial-gradient(
    60% 55% at 50% 45%,
    rgba(245, 166, 35, 0.1),
    transparent 70%
  );
}

.lore-splash__intro {
  flex: 1 1 auto;
  min-width: 0;
}

.lore-splash__title {
  color: var(--lore-accent) !important;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.5rem;
}

.lore-splash__sub {
  color: var(--lore-text-muted);
  font-size: 1rem;
  margin: 0;
}

/* Actions band: full width beneath the lead row. */
.lore-splash__actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Install command — dashed terminal chrome, teal command text. */
.lore-install {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  background: var(--lore-bg-panel);
  border: 1px dashed var(--lore-border);
  padding: 0.65rem 0.85rem;
  margin: 0;
}
.lore-install code {
  flex: 1 1 auto;
}
.lore-install__copy {
  flex: 0 0 auto;
}
.lore-install__prompt {
  color: var(--lore-text-muted);
  user-select: none;
}
.lore-install code,
.lore-install__copy {
  font-family: var(--lore-mono);
  font-size: 0.9rem;
}
.lore-install code {
  color: var(--lore-info);
  font-weight: 700;
  background: none;
  padding: 0;
  white-space: nowrap;
}
.lore-install__copy {
  border: 1px solid var(--lore-border);
  border-radius: 2px;
  background: var(--lore-bg-element);
  color: var(--lore-text);
  padding: 0.1rem 0.5rem;
  cursor: pointer;
  transition: border-color 120ms, color 120ms;
}
.lore-install__copy:hover {
  border-color: var(--lore-border-active);
  color: var(--lore-accent);
}
.lore-install__copy.is-copied {
  color: var(--lore-success);
  border-color: var(--lore-success);
}

.lore-splash__note {
  color: var(--lore-text-muted);
  font-size: 0.8rem;
  margin: 0;
}
.lore-splash__note code {
  background: none;
  color: var(--lore-text);
  padding: 0;
}

/* CTA row — first button is the amber primary; rest are outlined. */
.lore-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-start;
}
.lore-btn {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--lore-border);
  border-radius: 2px;
  color: var(--lore-text) !important;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.lore-btn:hover {
  border-color: var(--lore-border-active);
  color: var(--lore-accent) !important;
}
.lore-btn--primary {
  background: var(--lore-accent);
  border-color: var(--lore-accent);
  color: #121212 !important;
}
.lore-btn--primary:hover {
  background: var(--lore-accent-bright);
  border-color: var(--lore-accent-bright);
  color: #121212 !important;
}
.lore-btn--ghost {
  color: var(--lore-text-muted) !important;
}

/* ---- below-the-fold marketing sections ----------------------------- */
.lore-below {
  max-width: 46rem;
  margin: 1.5rem auto 0;
}
/* Each H2 section reads as a panel divider in the lore chrome. */
.lore-below h2 {
  border-top: 1px dashed var(--lore-border-subtle);
  padding-top: 1.5rem;
  margin-top: 2rem;
}
.lore-below > h2:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.lore-below blockquote {
  border-left: 2px solid var(--lore-accent);
  color: var(--lore-text-muted);
}
.lore-below table {
  font-size: 0.8rem;
}

/* Hide the splash page's empty title/edit chrome. */
.md-content__button {
  display: none;
}

@media screen and (max-width: 48rem) {
  .lore-splash {
    text-align: center;
  }
  .lore-splash__lead {
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
  }
  .lore-splash__mascot {
    margin-top: 0;
  }
  .lore-cta {
    justify-content: center;
  }
}

@media screen and (max-width: 30rem) {
  .lore-splash__title {
    font-size: 1.35rem;
  }
  .lore-install code {
    white-space: normal;
  }
}
