/* ═══════════════════════════════════════════════════════════════════
   Foundry Manual — presentation system
   Scope: all classes are .fnd-* and only appear in Foundry Manual pages.
   Tokens derive from the Echo DS palette (silent cyan / discreet dark).
   Signature element: the "rig frame" — every product screenshot sits in
   a dark app-window chrome with a provenance badge (LIVE RIG / DESIGN
   MOCK). The frame is dark in BOTH color schemes on purpose: Foundry's
   UI is dark, and the frame is the product's own material.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --fnd-cyan: #00a9dd;
  --fnd-cyan-bright: #36d0ff;
  --fnd-cyan-soft: #9edff7;
  --fnd-ink-950: #001b25;
  --fnd-panel: #0f131b;
  --fnd-panel-2: #141923;
  --fnd-panel-3: #1b212c;
  --fnd-line: #222834;
  --fnd-line-2: #3f4658;
  --fnd-text-dim: #8f99ad;
  --fnd-text-soft: #c0c9d6;
  --fnd-green: #66bb6a;
  --fnd-amber: #ffa726;
}

/* ── Part eyebrow ─────────────────────────────────────────────── */
.md-typeset .fnd-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fnd-cyan);
  margin: 0 0 0.2rem;
}
.md-typeset .fnd-eyebrow::before {
  content: "";
  width: 1.4em;
  height: 2px;
  background: var(--fnd-cyan);
  border-radius: 2px;
}

/* ── The rig frame ────────────────────────────────────────────── */
.md-typeset figure.fnd-shot {
  display: block;
  margin: 1.4rem 0 1.8rem;
  padding: 0;
  background: var(--fnd-panel);
  border: 1px solid var(--fnd-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(2, 3, 5, 0.28),
    0 12px 32px -12px rgba(2, 3, 5, 0.45);
}
.md-typeset figure.fnd-shot > .fnd-chrome {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.42rem 0.8rem;
  background: var(--fnd-panel-2);
  border-bottom: 1px solid var(--fnd-line);
}
.md-typeset figure.fnd-shot .fnd-dots,
.md-typeset figure.fnd-shot .fnd-dots::before,
.md-typeset figure.fnd-shot .fnd-dots::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--fnd-line-2);
  position: relative;
}
.md-typeset figure.fnd-shot .fnd-dots::before {
  position: absolute;
  left: 13px;
}
.md-typeset figure.fnd-shot .fnd-dots::after {
  position: absolute;
  left: 26px;
}
.md-typeset figure.fnd-shot .fnd-dots {
  margin-right: 18px;
}
.md-typeset figure.fnd-shot .fnd-title {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--fnd-text-dim);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.md-typeset figure.fnd-shot img {
  display: block;
  width: 100%;
  margin: 0;
  border-radius: 0;
}
.md-typeset figure.fnd-shot > figcaption {
  display: block;
  max-width: none;
  margin: 0;
  padding: 0.55rem 0.8rem 0.6rem;
  background: var(--fnd-panel-2);
  border-top: 1px solid var(--fnd-line);
  font-size: 0.62rem;
  font-style: normal;
  line-height: 1.5;
  color: var(--fnd-text-soft);
  text-align: left;
}

/* provenance badges */
.md-typeset .fnd-badge {
  display: inline-block;
  vertical-align: 1px;
  margin-right: 0.55em;
  padding: 0.1em 0.65em 0.12em;
  border-radius: 999px;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.md-typeset .fnd-badge.fnd-live {
  color: var(--fnd-green);
  background: rgba(102, 187, 106, 0.12);
  border: 1px solid rgba(102, 187, 106, 0.35);
}
.md-typeset .fnd-badge.fnd-mock {
  color: var(--fnd-amber);
  background: rgba(255, 167, 38, 0.1);
  border: 1px solid rgba(255, 167, 38, 0.35);
}

/* narrow variant for crops — don't let a 400px crop stretch to 900px */
.md-typeset figure.fnd-shot.fnd-narrow {
  max-width: 34rem;
}
.md-typeset figure.fnd-shot.fnd-narrow img {
  background: var(--fnd-panel);
}

/* crops keep their own padding so tight cutouts get breathing room */
.md-typeset figure.fnd-shot.fnd-pad img {
  width: calc(100% - 2rem);
  margin: 1rem auto;
  border-radius: 6px;
}

/* ── Landing hero ─────────────────────────────────────────────── */
.md-typeset .fnd-hero {
  position: relative;
  margin: 0.4rem 0 1.6rem;
  padding: 2.2rem 2rem 2rem;
  border-radius: 14px;
  background:
    radial-gradient(52rem 22rem at 12% -30%, rgba(0, 169, 221, 0.28), transparent 60%),
    linear-gradient(160deg, var(--fnd-panel-3), var(--fnd-panel) 55%, #020305);
  border: 1px solid var(--fnd-line);
  overflow: hidden;
}
.md-typeset .fnd-hero::after {
  /* the forge line — a hairline of light running through the hero */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--fnd-cyan) 30%, var(--fnd-cyan-bright) 50%, var(--fnd-cyan) 70%, transparent);
  opacity: 0.9;
}
.md-typeset .fnd-hero .fnd-hero-kicker {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fnd-cyan-soft);
  margin: 0 0 0.7rem;
}
.md-typeset .fnd-hero h1,
.md-typeset .fnd-hero .fnd-hero-title {
  margin: 0 0 0.6rem;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: #f9fbfc;
}
.md-typeset .fnd-hero .fnd-hero-title em {
  font-style: normal;
  color: var(--fnd-cyan-bright);
}
.md-typeset .fnd-hero p.fnd-hero-sub {
  max-width: 42rem;
  margin: 0 0 1.2rem;
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--fnd-text-soft);
}
.md-typeset .fnd-hero .fnd-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.md-typeset .fnd-hero a.fnd-cta {
  display: inline-block;
  padding: 0.42rem 1.1rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  text-decoration: none;
  background: var(--fnd-cyan);
  color: var(--fnd-ink-950);
  border: 1px solid transparent;
  transition: background 0.15s;
}
.md-typeset .fnd-hero a.fnd-cta:hover {
  background: var(--fnd-cyan-bright);
  color: var(--fnd-ink-950);
}
.md-typeset .fnd-hero a.fnd-cta.fnd-cta-ghost {
  background: transparent;
  color: var(--fnd-cyan-soft);
  border-color: var(--fnd-line-2);
}
.md-typeset .fnd-hero a.fnd-cta.fnd-cta-ghost:hover {
  border-color: var(--fnd-cyan);
  color: var(--fnd-cyan-bright);
}

/* ── Card grids (feature cards + part navigation) ─────────────── */
.md-typeset .fnd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.7rem;
  margin: 1rem 0 1.6rem;
}
.md-typeset .fnd-card {
  padding: 0.95rem 1rem 0.9rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 12px;
  background: var(--md-default-bg-color);
  transition: border-color 0.15s, transform 0.15s;
}
.md-typeset a.fnd-card {
  display: block;
  color: inherit;
  text-decoration: none;
}
.md-typeset a.fnd-card:hover {
  border-color: var(--fnd-cyan);
  transform: translateY(-2px);
}
.md-typeset .fnd-card .fnd-card-kicker {
  display: block;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fnd-cyan);
  margin-bottom: 0.3rem;
}
.md-typeset .fnd-card .fnd-card-title {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--md-default-fg-color);
  margin-bottom: 0.25rem;
}
.md-typeset .fnd-card p {
  margin: 0;
  font-size: 0.66rem;
  line-height: 1.55;
  color: var(--md-default-fg-color--light);
}

/* dark scheme: cards sit on slate */
[data-md-color-scheme="slate"] .md-typeset .fnd-card {
  background: var(--fnd-panel-2);
  border-color: var(--fnd-line);
}

/* ── Mermaid diagrams get the panel treatment ─────────────────── */
.md-typeset .fnd-diagram {
  padding: 1rem 1rem 0.6rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 12px;
  background: var(--md-default-bg-color);
  margin: 1.2rem 0 1.6rem;
}
.md-typeset .fnd-diagram > p:last-child {
  margin: 0.2rem 0 0.4rem;
  font-size: 0.62rem;
  color: var(--md-default-fg-color--light);
}
[data-md-color-scheme="slate"] .md-typeset .fnd-diagram {
  background: var(--fnd-panel-2);
  border-color: var(--fnd-line);
}

/* ── Small print / at-a-glance strip under page titles ────────── */
.md-typeset .fnd-lede {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--md-default-fg-color--light);
  margin: 0.3rem 0 1.4rem;
}

@media (max-width: 44rem) {
  .md-typeset .fnd-hero {
    padding: 1.5rem 1.2rem 1.4rem;
  }
  .md-typeset .fnd-hero h1,
  .md-typeset .fnd-hero .fnd-hero-title {
    font-size: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .md-typeset a.fnd-card,
  .md-typeset .fnd-hero a.fnd-cta {
    transition: none;
  }
  .md-typeset a.fnd-card:hover {
    transform: none;
  }
}
