/* Readable-zone landing clearance. No added chrome. */
html {
  scroll-padding-top: var(--bee-band);
}

.copy h1,
.copy h2,
.copy h3,
.copy .project,
.copy .case-teaser,
.copy .case-crumb,
.copy .case-next,
.copy .lede,
.copy [id] {
  scroll-margin-top: var(--bee-band);
}

.copy .guide-byline {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--graphite);
}

/*
  Phone keyboard: BeeLayout shortens --bee-band with the visual viewport, so the
  page content rides up under the scaled BB feet. Push the byline (and the Doc
  Mastro badge below it) clear of the bee box. Layout only — BB size/transition
  untouched. Desktop keyboard never packs BB over guide chrome.
*/
@media (max-width: 899px) {
  .page.kbd .copy > .guide-byline {
    margin-top: 64px;
  }
}

/*
  Official Doc Mastro wordmark on cream pages. Middle bands are cream/pale mint,
  so the lockup must sit on a near-black badge (logo art unchanged) — same read
  as on /doc-mastro. Product-badge treatment: compact, intentional, not a card.
*/
.copy .dm-guide-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 14px;
  padding: 14px 18px;
  border-radius: 16px;
  background: #0b0b0b;
}
.copy .dm-guide-brand .dm-wordmark,
.copy .dm-guide-brand img {
  display: block;
  width: min(220px, calc(72vw - 36px));
  height: auto;
}

/* /making-doc-mastro case H1: same dark badge behind the horizontal lockup. */
.copy h1.dm-case-h1 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 16px 20px;
  border-radius: 18px;
  background: #0b0b0b;
  line-height: 0;
}
.copy h1.dm-case-h1 .dm-wordmark,
.copy h1.dm-case-h1 img {
  display: block;
  width: min(340px, calc(92vw - 40px));
  height: auto;
}

.copy .guide-byline time {
  font-variant-numeric: tabular-nums;
}

/* Guide visuals: loudness diagram, path cards, release track. */
.guide-viz {
  margin: 18px 0 22px;
  padding: 16px 14px 14px;
  background: var(--white);
  border-radius: 18px;
  box-shadow: var(--edge);
}

.guide-viz > figcaption,
.guide-viz-cap {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--graphite);
}

/*
 * Loudness chart: shared linear scale -24 → -10 LUFS.
 * Position % = (value - (-24)) / 14. Axis ticks, bar widths, and the -14
 * line all use the same map. Captions live outside the scaled plot.
 */
.guide-viz-lufs {
  padding: 20px 16px 22px;
}

@media (min-width: 720px) {
  .guide-viz-lufs {
    padding: 26px 24px 28px;
  }
}

.guide-lufs {
  display: block;
  width: 100%;
}

.guide-lufs-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.guide-lufs-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.guide-lufs-scale {
  position: relative;
  min-width: 0;
}

.guide-lufs-axis {
  position: relative;
  height: 28px;
  margin: 0 0 10px;
}

.guide-lufs-tick,
.guide-lufs-pill,
.guide-lufs-unit {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.guide-lufs-tick {
  position: absolute;
  top: 6px;
  font-family: var(--mono);
  color: var(--graphite);
  transform: translateX(-50%);
}

.guide-lufs-pill {
  position: absolute;
  top: 0;
  /* Sit just right of the -14 line so it does not cover the -16 tick. */
  transform: translateX(6px);
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.guide-lufs-unit {
  display: block;
  padding-top: 6px;
  font-family: var(--mono);
  color: var(--muted);
}

/* Shared map: left/width = (LUFS + 24) / 14 */
.guide-lufs-at-20 { left: calc(4 / 14 * 100%); }
.guide-lufs-at-16 { left: calc(8 / 14 * 100%); }
.guide-lufs-at-14 { left: calc(10 / 14 * 100%); }

.guide-lufs-bars {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 4px 0;
}

.guide-lufs-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--ink) 0 5px,
    transparent 5px 9px
  );
  pointer-events: none;
  z-index: 3;
}

.guide-lufs-rail {
  position: relative;
  z-index: 2;
  height: 36px;
  border-radius: 18px;
  background: var(--haze);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(21, 23, 26, 0.04);
}

@media (min-width: 720px) {
  .guide-lufs-rail { height: 42px; border-radius: 21px; }
  .guide-lufs-bars { gap: 16px; }
}

.guide-lufs-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.guide-lufs-bar-soft {
  width: calc(4 / 14 * 100%);
  background: var(--mist);
  box-shadow: inset 0 0 0 1px rgba(62, 110, 168, 0.18);
}

.guide-lufs-bar-lift {
  width: calc(8 / 14 * 100%);
  background: linear-gradient(90deg, var(--bloom), var(--deep));
  box-shadow: inset 0 -1px 0 rgba(21, 23, 26, 0.08);
}

.guide-lufs-keys {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.guide-lufs-keys > li {
  margin: 0;
  padding: 0;
}

.copy .guide-lufs-label {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
}

.copy .guide-lufs-sub {
  margin: 3px 0 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--graphite);
}

.guide-paths {
  display: grid;
  gap: 10px;
  margin: 14px 0 22px;
}

.guide-path {
  display: grid;
  gap: 6px;
  padding: 14px 14px 12px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--edge);
}

.guide-path-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bloom);
}

.guide-path-why {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.guide-path-fix {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--graphite);
}

.guide-path-fix a {
  color: var(--deep);
  text-underline-offset: 2px;
}

@media (min-width: 720px) {
  .guide-paths {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

.guide-track {
  margin: 16px 0 22px;
  padding: 4px 0;
  list-style: none;
}

.guide-track > li {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  margin: 0;
  padding: 0 0 18px;
}

.guide-track > li:last-child {
  padding-bottom: 0;
}

.guide-track > li::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--haze);
}

.guide-track > li:last-child::before {
  display: none;
}

.guide-step-num {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--deep);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  z-index: 1;
}

.guide-step-body {
  min-width: 0;
  padding-top: 4px;
}

.guide-step-when {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bloom);
}

.guide-step-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.guide-step-note {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--graphite);
}

.guide-step-note a {
  color: var(--deep);
  text-underline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .guide-lufs-bar {
    transform-origin: left center;
    animation: guide-bar-in 0.7s var(--rise) both;
  }

  .guide-lufs-bar-lift { animation-delay: 0.1s; }

  .guide-path {
    animation: guide-rise 0.5s var(--rise) both;
  }

  .guide-path:nth-child(2) { animation-delay: 0.06s; }
  .guide-path:nth-child(3) { animation-delay: 0.12s; }

  .guide-track > li {
    animation: guide-rise 0.45s var(--rise) both;
  }

  .guide-track > li:nth-child(2) { animation-delay: 0.05s; }
  .guide-track > li:nth-child(3) { animation-delay: 0.1s; }
  .guide-track > li:nth-child(4) { animation-delay: 0.15s; }
  .guide-track > li:nth-child(5) { animation-delay: 0.2s; }
  .guide-track > li:nth-child(6) { animation-delay: 0.25s; }
}

@keyframes guide-bar-in {
  from { transform: scaleX(0.12); opacity: 0.35; }
  to { transform: scaleX(1); opacity: 1; }
}

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

@media (prefers-reduced-motion: reduce) {
  .guide-lufs-bar,
  .guide-path,
  .guide-track > li {
    animation: none;
  }
}

/* Guide slides: full-width carousel images inside a guide-viz card.
   PNGs ship a baked footer (SOURCE + DOC MASTRO + NN / 09). Clip that band
   in layout only — image files stay byte-identical. Bottom 10.5% of the
   1080×1350 frame (source line starts ~y=1213). margin-bottom pulls the
   leftover layout box closed (10.5% of height ≈ 13.125% of width). */
.guide-slide img {
  display: block;
  width: 100%;
  max-width: 540px;
  height: auto;
  margin: 0 auto -13.125%;
  clip-path: inset(0 0 10.5% 0 round 12px);
}
.guide-slide > figcaption {
  margin: 12px 0 0;
}

/* Guide requirements table: scrolls sideways on narrow screens. */
.guide-table-wrap {
  margin: 18px 0 22px;
  overflow-x: auto;
  background: var(--white);
  border-radius: 18px;
  box-shadow: var(--edge);
}
.guide-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.4;
}
.guide-table caption {
  padding: 14px 14px 0;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--graphite);
}
.guide-table th,
.guide-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.guide-table thead th {
  font-size: 13px;
  color: var(--graphite);
}
.guide-table tbody tr:last-child th,
.guide-table tbody tr:last-child td {
  border-bottom: 0;
}
