/* =============================================================================
   Launchvox brand theme — for HTML progress walkthroughs / decks
   -----------------------------------------------------------------------------
   Derived from the launchvox-website design system
   (app/assets/styles/{theme,global,typography}.css). Single source of brand
   tokens + primitives so every internal HTML deck/walkthrough looks on-brand.
   See docs/STYLE-GUIDE.md for the rationale and usage.

   NOTE ON FONTS: Liebling / Autaut Grotesk / MediumLLWeb are LICENSED webfonts
   (Lineto et al.) restricted to the launchvox.com domain — they are intentionally
   NOT bundled here. The stacks below name them first (so they apply wherever the
   brand fonts are installed/self-hosted) and fall back to a clean grotesk so the
   deck stays on-brand without them. To self-host, add @font-face rules pointing
   at the licensed files and nothing else changes.
   ============================================================================= */

:root {
  /* Core palette */
  --lvx-dark: #121212;          /* primary canvas */
  --lvx-green: #61c695;         /* signature accent — active / hover / highlight */
  --lvx-light: #84b39c;         /* muted sage — borders, secondary accents */
  --lvx-mint: #a0ffdb;          /* bright gradient stop A */
  --lvx-cyan: #6afff0;          /* bright gradient stop B */
  --lvx-ink: #f1f1f1;           /* primary text on dark (matches LVX mark fill) */

  /* Derived surfaces / text */
  --lvx-bg: var(--lvx-dark);
  --lvx-surface: #1a1a1a;       /* cards */
  --lvx-surface-2: #202020;     /* nested / hover */
  --lvx-border: rgba(241, 241, 241, 0.12);
  --lvx-border-strong: rgba(132, 179, 156, 0.45); /* sage, for outline pills */
  --lvx-line: #6f9181;          /* solid sage — diagram connector lines (crisp, gap-free) */
  --lvx-text: var(--lvx-ink);
  --lvx-text-muted: #9aa6a0;    /* desaturated sage-gray for body/secondary */
  --lvx-text-dim: #6c726e;

  /* Signature accent gradients (from the site's card gradients) */
  --lvx-gradient-a: linear-gradient(180deg, #a0ffdb 0%, #6afff0 100%);
  --lvx-gradient-b: linear-gradient(303.58deg, #a0ffdb 9.19%, #6afff0 91.69%);

  /* Radius — STRAIGHT CORNERS (brand directive 2026-06-22). Tokens kept at 0 so
     existing var(--lvx-radius*) references resolve to square edges everywhere. */
  --lvx-radius: 0;
  --lvx-radius-sm: 0;
  --lvx-radius-lg: 0;

  /* Type stacks — brand fonts first, graceful fallback */
  --lvx-font-display: 'Liebling', ui-sans-serif, system-ui, 'Segoe UI', sans-serif;
  --lvx-font-body: 'Autaut Grotesk', 'MediumLLWeb', ui-sans-serif, system-ui, 'Segoe UI', sans-serif;
}

/* -------- Base -------- */
.lvx,
.lvx * { box-sizing: border-box; }

.lvx {
  background: var(--lvx-bg);
  color: var(--lvx-text);
  font-family: var(--lvx-font-body);
  font-weight: 400;
  line-height: 1.55;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* -------- Scrollbars — themed, adapt to light/dark via --lvx-* tokens --------
   Applied to the root viewport, the deck body, and every inner scroll container
   (.slide, .mono, modal panels…). Standard props (Firefox / Chrome 121+) and the
   WebKit pseudo-elements both point at the same tokens, so the bar stays subtle
   sage in either mode and turns brand-green on hover. */
html,
.lvx,
.lvx * {
  scrollbar-width: thin;
  scrollbar-color: var(--lvx-border-strong) transparent;
}
html::-webkit-scrollbar,
.lvx::-webkit-scrollbar,
.lvx *::-webkit-scrollbar { width: 10px; height: 10px; }
html::-webkit-scrollbar-track,
.lvx::-webkit-scrollbar-track,
.lvx *::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb,
.lvx::-webkit-scrollbar-thumb,
.lvx *::-webkit-scrollbar-thumb {
  background: var(--lvx-border-strong);
  border-radius: 0;
  border: 2px solid transparent;   /* inset the thumb via a transparent gutter */
  background-clip: padding-box;
}
html::-webkit-scrollbar-thumb:hover,
.lvx::-webkit-scrollbar-thumb:hover,
.lvx *::-webkit-scrollbar-thumb:hover {
  background: var(--lvx-green);
  background-clip: padding-box;
}
html::-webkit-scrollbar-corner,
.lvx::-webkit-scrollbar-corner,
.lvx *::-webkit-scrollbar-corner { background: transparent; }

/* -------- Type scale (mirrors the site's h2–h5 conventions) -------- */
.lvx h1, .lvx h2, .lvx h3, .lvx h4 { font-family: var(--lvx-font-display); margin: 0; }
.lvx h1 { font-size: clamp(2.1rem, 4.5vw, 3rem); font-weight: 300; line-height: 1.08; letter-spacing: -0.01em; }
.lvx h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; line-height: 1.15; }
.lvx h3 { font-size: 1.1rem; font-weight: 600; }

/* Signature small uppercase label (the site's h2 role) */
.lvx-eyebrow {
  font-family: var(--lvx-font-body);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--lvx-green);
  margin: 0 0 0.5rem;
}

.lvx-muted { color: var(--lvx-text-muted); }
.lvx a { color: var(--lvx-green); text-decoration: none; }
.lvx a:hover { text-decoration: underline; }
.lvx code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 0.88em; background: rgba(132, 179, 156, 0.12);
  color: #b9e6cf; padding: 0.1em 0.4em; border-radius: 0;
}

/* -------- Outline pill (the site's signature .text-outline) -------- */
.lvx-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  border: 1px solid var(--lvx-border-strong);
  border-radius: 0;
  padding: 0.2rem 0.7rem;
  font-size: 0.72rem; font-weight: 600;
  color: var(--lvx-light);
  transition: color 0.5s, border-color 0.5s, background 0.5s;
}
.lvx-pill:hover, .lvx-pill.active { color: var(--lvx-green); border-color: var(--lvx-green); }
.lvx-pill.solid { background: var(--lvx-green); color: #0c1f17; border-color: var(--lvx-green); }
.lvx-pill.mint { background: var(--lvx-gradient-a); color: #0c1f17; border: none; }

/* -------- Cards -------- */
.lvx-card {
  background: var(--lvx-surface);
  border: 1px solid var(--lvx-border);
  border-radius: var(--lvx-radius);
  padding: 1.1rem 1.25rem;
}
.lvx-card.accent { border-left: 3px solid var(--lvx-green); }
.lvx-card.gradient { background: var(--lvx-gradient-b); color: #0c1f17; border: none; }

/* -------- Logomark -------- */
.lvx-mark { color: var(--lvx-ink); display: inline-block; }
.lvx-mark.green { color: var(--lvx-green); }

/* -------- Diagrams (reusable HTML diagramming base) ----------------------
   Box-and-connector primitives so decks stop relying on ASCII-art <pre>.
   Compose: .lvx-diagram wraps; .lvx-node is a box; .lvx-rail / .lvx-branch /
   .lvx-flow draw the connectors. All square-cornered, brand-colored.
   See docs/STYLE-GUIDE.md §"Diagrams" for the markup recipe.            */
.lvx-diagram {
  display: flex; flex-direction: column; align-items: stretch;
  gap: 0; width: 100%; font-size: 0.9rem;
}

/* A node = one box in the diagram */
.lvx-node {
  background: var(--lvx-surface);
  border: 1px solid var(--lvx-border);
  border-radius: 0;
  padding: 0.85rem 1.05rem;
  position: relative;
}
.lvx-node__label {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--lvx-green); margin-bottom: 0.3rem;
}
.lvx-node__title {
  font-family: var(--lvx-font-display); font-weight: 700;
  font-size: 1rem; color: var(--lvx-ink); margin: 0 0 0.35rem;
}
.lvx-node__meta { color: var(--lvx-text-muted); font-size: 0.82rem; line-height: 1.5; margin: 0; }

/* Variants */
.lvx-node.control { border-top: 2px solid var(--lvx-green); border-color: var(--lvx-border-strong); }
.lvx-node.accent  { border-left: 3px solid var(--lvx-green); }
.lvx-node.ghost   { border-style: dashed; background: transparent; color: var(--lvx-text-muted); }
.lvx-node.ghost .lvx-node__title { color: var(--lvx-light); font-weight: 600; }

/* Inline tag chips inside a node (square, sage outline) */
.lvx-node__tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.lvx-tag {
  font-size: 0.72rem; color: var(--lvx-light);
  border: 1px solid var(--lvx-border); padding: 0.14rem 0.5rem;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

/* Vertical connector rail; optional centered label via data-label */
.lvx-rail { width: 100%; display: flex; flex-direction: column; align-items: center; }
.lvx-rail::before { content: ''; width: 2px; height: 1.7rem; background: var(--lvx-line); }
.lvx-rail:not([data-label])::after {   /* simple arrowhead at the foot of a plain rail */
  content: ''; width: 0; height: 0; margin-top: -1px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--lvx-line);
}
.lvx-rail[data-label] { position: relative; }
.lvx-rail[data-label]::after {
  content: attr(data-label);
  position: absolute; left: 50%; top: 50%; transform: translate(0.7rem, -50%);
  white-space: nowrap; font-size: 0.7rem; color: var(--lvx-text-muted); letter-spacing: 0.01em;
}

/* Fan-out: a parent rail splits to a row of children (tuned for 3 columns) */
.lvx-branch {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  position: relative; padding-top: 1.9rem;
}
.lvx-branch::before {        /* parent stem: centre, from the top down to the bus */
  content: ''; position: absolute; top: 0; left: 50%;
  width: 2px; height: 0.95rem; background: var(--lvx-line); transform: translateX(-1px);
}
.lvx-branch > * { position: relative; }
.lvx-branch > *::before {    /* middle child: straight drop from the bus into the child */
  content: ''; position: absolute; top: -0.95rem; left: 50%;
  width: 2px; height: calc(0.95rem + 1px); background: var(--lvx-line); transform: translateX(-1px);
}
.lvx-branch > *:first-child::before,
.lvx-branch > *:last-child::before {   /* outer children: rounded elbow (bus segment + drop) */
  width: calc(100% + 1rem); height: 0.95rem; background: none; transform: none;
  border-top: 2px solid var(--lvx-line);
}
.lvx-branch > *:first-child::before { left: calc(50% - 1px); border-left: 2px solid var(--lvx-line); border-top-left-radius: 8px; }
.lvx-branch > *:last-child::before  { left: auto; right: calc(50% - 1px); border-right: 2px solid var(--lvx-line); border-top-right-radius: 8px; }
.lvx-branch > *::after {     /* simple arrowhead into each child */
  content: ''; position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--lvx-line);
}

/* Horizontal flow: node ⇄ node with a labeled link between them */
.lvx-flow { display: flex; align-items: stretch; gap: 0.5rem 1.25rem; justify-content: center; flex-wrap: wrap; }
.lvx-flow > .lvx-node { flex: 1 1 0; min-width: 0; }
.lvx-link {
  flex: 0 0 auto; align-self: center; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 2.6rem; max-width: 9rem; color: var(--lvx-green); font-size: 1.1rem;
}
.lvx-link[data-label]::after {    /* caption stacks under the arrow, never over a neighbor card */
  content: attr(data-label); white-space: normal; text-align: center;
  max-width: 9rem; margin-top: 0.2rem; line-height: 1.25;
  font-size: 0.66rem; color: var(--lvx-text-muted); letter-spacing: 0.02em;
}

/* On narrow screens the fan-out collapses to one column; hide its connectors. */
@media (max-width: 760px) {
  .lvx-branch { grid-template-columns: 1fr; }
  .lvx-branch::before, .lvx-branch > *::before, .lvx-branch > *::after,
  .lvx-rail:not([data-label])::after { display: none; }
}

/* -------- Motion (the site's `reveal`) -------- */
@keyframes lvx-reveal {
  from { opacity: 0; transform: translateY(0.4em); }
  to { opacity: 1; transform: none; }
}
.lvx-reveal { animation: lvx-reveal 0.45s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .lvx, .lvx * { scroll-behavior: auto; }
  .lvx-reveal { animation: none; }
}
