/* ==========================================================================
   baldur.sh landing — standalone stylesheet ("black premium" design
   language, 2026-08).

   This file styles the hand-authored landing (web/root/index.html) end to end:
   its own header/footer/skip-link plus the hero (code + incident log), the
   healing-ledger band, and the three-step band. It ships ONLY on the landing
   (served under /landing/), never on docs pages.

   Token drift note: the `:root` block below is the landing's own copy. The
   docs-surface chrome (web/overrides/assets/brand.css) keeps a minimal copy of
   the shared chrome tokens and re-authors the header-nav rules; a brand-look
   change touches both files. See brand.css's header comment.

   Design language: fully monochrome chrome — near-black ground, bone text,
   dark hairlines — with color living ONLY inside the product artifacts, and
   only two data hues: fail red and heal jade. The ledger's open-count series
   is neutral (never amber); code syntax is monochrome (weight and brightness,
   not hue). Same rule the admin console follows. Type: Schibsted Grotesk
   (self-hosted variable font) for display + body, IBM Plex Mono (self-hosted
   400/500) for code, logs, and data tokens.

   Alignment contract (do not change these values without changing brand.css):
   72rem content rail, 1.2rem side insets, header padding 0.85rem 1.2rem
   (57px height), wordmark 1.05rem, nav links 0.85rem at 1.2rem gap, GitHub
   icon 1.2rem, and the wide-viewport ramp below — brand.css maps the same
   pixels onto Material's 20px root so landing <-> docs never jumps.
   ========================================================================== */

/* ----- Tokens ------------------------------------------------------------ */
:root {
  --bd-ground: #0a0b0d;     /* page ground */
  --bd-panel: #0f1013;      /* card ground */
  --bd-panel-2: #121317;    /* nested / open-row ground */
  --bd-edge: #1e2026;       /* card border */
  --bd-rule: #17181c;       /* section hairline */
  --bd-bone: #f0f2f5;       /* brightest text / solid CTA fill */
  --bd-text: #d8dce3;       /* primary text */
  --bd-dim: #7e8695;        /* secondary text */
  --bd-faint: #4c525e;      /* tertiary text / axis labels */
  /* state (product artifacts only — two data hues + a neutral series) */
  --bd-fail: #e05561;
  --bd-heal: #6fb5a0;
  --bd-open: #778092;       /* ledger open-count series — neutral, not amber */
  /* code syntax: monochrome base + a jade accent on the product's own
     fingerprint (the decorator + strings) — never a full editor palette */
  --bd-code-kw: #f0f2f5;
  --bd-code-dim: #8b929d;
  --bd-code-plain: #b9c0cc;
  --bd-display: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  --bd-mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/schibsted-grotesk-latin-var.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-500.woff2") format("woff2");
}

/* ----- Base -------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background-color: var(--bd-ground);
}

/* Wide-viewport type ramp: mirrors Material's docs-surface scaling (125% ->
   137.5% at >=100em, -> 150% at >=125em) as the same x1.1 / x1.2 ratios of
   this page's 16px root, so the landing and the docs chrome stay px-identical
   at every width. */
@media screen and (min-width: 100em) {
  html {
    font-size: 110%;
  }
}

@media screen and (min-width: 125em) {
  html {
    font-size: 120%;
  }
}

body {
  font-family: var(--bd-display);
  color: var(--bd-text);
  -webkit-font-smoothing: antialiased;
}

/* ----- Accessibility: skip link + keyboard focus ------------------------- */
.bd-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--bd-bone);
  color: var(--bd-ground);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 0 0 6px 0;
  text-decoration: none;
}

.bd-skip:focus {
  left: 0;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--bd-bone);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ----- Header (visual parity with the docs headnav — see brand.css) ------ */
.bd-siteheader {
  background: var(--bd-ground);
  border-bottom: 1px solid var(--bd-rule);
}

.bd-siteheader__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.85rem 1.2rem;
}

.bd-wordmark {
  font-family: var(--bd-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--bd-bone);
  text-decoration: none;
}

.bd-wordmark:hover {
  opacity: 0.85;
}

.bd-headnav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  justify-content: flex-end;
}

.bd-headnav__link {
  color: var(--bd-dim);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 120ms;
}

.bd-headnav__link:hover {
  color: var(--bd-bone);
}

.bd-headnav__cta {
  padding: 0.32rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--bd-bone);
  color: var(--bd-ground);
}

.bd-headnav__cta:hover {
  background: #ffffff;
  color: var(--bd-ground);
}

.bd-headnav__icon {
  display: inline-flex;
  align-items: center;
  color: var(--bd-dim);
  transition: color 120ms;
}

.bd-headnav__icon:hover {
  color: var(--bd-bone);
}

.bd-headnav__icon svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

/* ----- Hero: copy left, code + incident log right ------------------------ */
.bd-hero {
  padding: 5.5rem 1.2rem 5.25rem;
}

.bd-hero__inner {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 4rem;
  align-items: start;
  max-width: 72rem;
  margin: 0 auto;
}

.bd-hero__kicker {
  display: inline-block;
  margin: 0 0 1.7rem;
  font: 500 0.78rem var(--bd-mono);
  color: var(--bd-dim);
  background: rgba(240, 242, 245, 0.04);
  border: 1px solid var(--bd-edge);
  border-radius: 100px;
  padding: 0.3rem 0.75rem;
}

.bd-hero__title {
  margin: 0 0 1.3rem;
  font-size: clamp(2.2rem, 3.6vw, 2.85rem);
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -0.022em;
  text-wrap: balance;
  color: #f4f6f9;
}

.bd-hero__title .dim {
  color: var(--bd-faint);
}

.bd-hero__subtitle {
  max-width: 42ch;
  margin: 0 0 2.2rem;
  font-size: 1.06rem;
  line-height: 1.6;
  font-weight: 400;
  color: var(--bd-dim);
}

.bd-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.6rem;
}

.bd-btn {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border: 1px solid var(--bd-edge);
  border-radius: 7px;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--bd-text);
  text-decoration: none;
  transition: background-color 130ms, border-color 130ms, color 130ms;
}

.bd-btn:hover {
  border-color: var(--bd-dim);
  color: var(--bd-bone);
}

.bd-btn--primary {
  background: var(--bd-bone);
  border-color: var(--bd-bone);
  color: var(--bd-ground);
}

.bd-btn--primary:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--bd-ground);
}

.bd-hero__meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--bd-faint);
}

/* Load-in: quiet fade-up for hero copy (one-shot, reduced-motion static). */
@media (prefers-reduced-motion: no-preference) {
  .bd-fade {
    opacity: 0;
    animation: bd-rise 0.6s ease forwards;
  }

  .bd-fade.d2 {
    animation-delay: 0.12s;
  }

  .bd-fade.d3 {
    animation-delay: 0.24s;
  }
}

@keyframes bd-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ----- Signature: code card + incident log ------------------------------- */
/* Two stacked artifacts: the code you write, and the incident it survives —
   the only place color appears on the page (fail red / heal jade). Code
   syntax is monochrome: keywords bright + medium weight, strings and
   arguments dim, body plain. */
.bd-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bd-card {
  background: var(--bd-panel);
  border: 1px solid var(--bd-edge);
  border-radius: 10px;
  overflow: hidden;
}

.bd-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1.1rem;
  border-bottom: 1px solid var(--bd-rule);
  font: 400 0.72rem var(--bd-mono);
  color: var(--bd-faint);
}

.bd-code pre {
  margin: 0;
  padding: 1.05rem 1.2rem;
  font: 400 0.8rem/1.75 var(--bd-mono);
  color: var(--bd-code-plain);
  overflow-x: auto;
}

.bd-code .t-kw {
  color: var(--bd-code-kw);
  font-weight: 500;
}

.bd-code .t-dim {
  color: var(--bd-code-dim);
}

/* Jade accent: the healing hue lands exactly on the lines you add — the
   decorator and its name string — so the color is meaning, not decoration. */
.bd-code .t-dec {
  color: var(--bd-heal);
  font-weight: 500;
}

.bd-code .t-str {
  color: var(--bd-heal);
}

.bd-incident__log {
  margin: 0;
  padding: 1rem 1.2rem 0.4rem;
  list-style: none;
}

.bd-incident__log li {
  display: flex;
  gap: 0.8rem;
  padding: 0.14rem 0;
  font: 400 0.76rem/1.65 var(--bd-mono);
  color: #a6aebf;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.45s ease;
  transition-delay: calc(var(--i) * 0.75s);
}

.bd-incident__log.bd-play li {
  opacity: 1;
}

/* Fade out together when the loop resets (no stagger on the way out). */
.bd-incident__log:not(.bd-play) li {
  transition-delay: 0s;
  transition-duration: 0.5s;
}

.bd-incident__log time {
  flex: none;
  color: var(--bd-faint);
}

.lg--fail {
  color: var(--bd-fail);
}

.lg--heal {
  color: var(--bd-heal);
}

.bd-incident__caption {
  margin: 0;
  padding: 0.55rem 1.2rem 0.95rem;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--bd-dim);
}

@media (prefers-reduced-motion: reduce) {
  .bd-incident__log li {
    transition: none;
    opacity: 1;
  }
}

/* ----- Healing-ledger band ------------------------------------------------ */
.bd-ledger-band {
  border-top: 1px solid var(--bd-rule);
  padding: 5rem 1.2rem 5.25rem;
}

.bd-ledger-band__inner {
  max-width: 72rem;
  margin: 0 auto;
}

.bd-band-title {
  margin: 0 0 0.8rem;
  max-width: 30ch;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bd-bone);
}

.bd-band-title .dim {
  color: var(--bd-faint);
}

.bd-band-lede {
  margin: 0 0 2.2rem;
  max-width: 58ch;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--bd-dim);
}

.bd-ledger {
  background: var(--bd-panel);
  border: 1px solid var(--bd-edge);
  border-radius: 12px;
  padding: 1.5rem 1.8rem 1.3rem;
}

.bd-ledger__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  font: 400 0.76rem var(--bd-mono);
  color: var(--bd-dim);
  margin-bottom: 1.1rem;
}

.bd-ledger__head b {
  color: var(--bd-text);
  font-weight: 500;
}

.bd-legend {
  display: flex;
  gap: 1.3rem;
}

.bd-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.bd-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}

.bd-ledger svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--bd-mono);
}

.bd-ledger__foot {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--bd-rule);
  margin-top: 1.1rem;
  padding-top: 1rem;
  font: 400 0.8rem var(--bd-mono);
  color: var(--bd-dim);
}

.bd-ledger__foot b {
  color: var(--bd-text);
  font-weight: 500;
}

.bd-ledger__foot .push {
  margin-left: auto;
}

/* Chart draw-in: the step line draws, the fill and annotations fade, the
   bars grow — one-shot when the ledger scrolls into view (IntersectionObserver
   adds .in). Reduced motion / no-JS: everything visible immediately. */
@media (prefers-reduced-motion: no-preference) {
  .bd-ledger .openline {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
  }

  .bd-ledger.in .openline {
    animation: bd-draw 1.6s ease forwards 0.2s;
  }

  .bd-ledger .openfill,
  .bd-ledger .annot text {
    opacity: 0;
  }

  .bd-ledger.in .openfill {
    animation: bd-fadein 0.8s ease forwards 1.5s;
  }

  .bd-ledger.in .annot text {
    animation: bd-fadein 0.6s ease forwards 1.7s;
  }

  .bd-ledger .bars rect {
    transform-box: fill-box;
    transform-origin: bottom;
    transform: scaleY(0);
  }

  .bd-ledger.in .bars rect {
    animation: bd-grow 0.5s ease forwards;
  }

  .bd-ledger.in .bars rect:nth-child(1) { animation-delay: 0.3s; }
  .bd-ledger.in .bars rect:nth-child(2) { animation-delay: 0.4s; }
  .bd-ledger.in .bars rect:nth-child(3) { animation-delay: 0.5s; }
  .bd-ledger.in .bars rect:nth-child(4) { animation-delay: 0.6s; }
  .bd-ledger.in .bars rect:nth-child(5) { animation-delay: 0.7s; }
  .bd-ledger.in .bars rect:nth-child(6) { animation-delay: 0.8s; }
  .bd-ledger.in .bars rect:nth-child(7) { animation-delay: 0.9s; }
  .bd-ledger.in .bars rect:nth-child(8) { animation-delay: 1.0s; }
  .bd-ledger.in .bars rect:nth-child(9) { animation-delay: 1.1s; }
  .bd-ledger.in .bars rect:nth-child(10) { animation-delay: 1.2s; }
}

@keyframes bd-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes bd-grow {
  to {
    transform: scaleY(1);
  }
}

@keyframes bd-fadein {
  to {
    opacity: 1;
  }
}

/* ----- Three steps -------------------------------------------------------- */
.bd-steps {
  border-top: 1px solid var(--bd-rule);
  padding: 4.75rem 1.2rem 5rem;
}

.bd-steps__inner {
  max-width: 72rem;
  margin: 0 auto;
}

.bd-steps h2 {
  margin: 0 0 2.8rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #e9ecf1;
}

.bd-step-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bd-step__num {
  font: 400 0.72rem var(--bd-mono);
  color: var(--bd-faint);
  margin-bottom: 0.85rem;
}

.bd-step h3 {
  margin: 0 0 0.6rem;
  font-size: 1.02rem;
  font-weight: 600;
}

.bd-step h3 a {
  color: #e9ecf1;
  text-decoration: none;
}

.bd-step h3 a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bd-step p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--bd-dim);
}

.bd-steps__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.7rem;
  margin: 3rem 0 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--bd-rule);
}

.bd-steps__links a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bd-dim);
  text-decoration: none;
  transition: color 130ms;
}

.bd-steps__links a:hover {
  color: var(--bd-bone);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ----- Footer ------------------------------------------------------------- */
.bd-footer {
  border-top: 1px solid var(--bd-rule);
}

.bd-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1.2rem 2.2rem;
}

.bd-footer__line,
.bd-footer__legal {
  margin: 0;
  font-size: 0.78rem;
  color: var(--bd-faint);
}

.bd-footer__legal a {
  color: var(--bd-dim);
  text-decoration: none;
  transition: color 130ms;
}

.bd-footer__legal a:hover {
  color: var(--bd-bone);
}

/* ----- Responsive --------------------------------------------------------- */
@media (max-width: 59.9375em) {
  .bd-hero {
    padding-top: 3.5rem;
  }

  .bd-hero__inner {
    grid-template-columns: 1fr;
    gap: 2.75rem;
  }

  .bd-step-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 37.4375em) {
  .bd-code pre {
    font-size: 0.72rem;
  }

  .bd-incident__log li {
    font-size: 0.68rem;
  }

  .bd-ledger {
    padding: 1.1rem 1rem 1rem;
  }

  .bd-ledger__foot {
    gap: 1.1rem;
  }
}
