/*
 * Beat mascot-to-sdk: Mascotworks, a brand-specimen board that reads left to right as
 * the workflow it explains (web/landing/sections/mascot-to-sdk.html). Linked in the page
 * head by lib/landing.ts while the beat is enabled; the shells' sheets it builds on are
 * linked by the page itself, once each and before every section sheet. Every class here
 * starts with the beat id, and every rule is scoped by [data-beat]: the frame's variant
 * (mascot-to-sdk-mascotworks) is styled here and nowhere else.
 *
 * Layout: the copy as a header across the top, the Mascotworks window full width below. In
 * it one ordered list, the pipeline, drawn as a STATIC diagram: 01 the still (Pip's source
 * image as a specimen, his name in the serif, the house-example note), 02 one build (the
 * endpoint in mono and what it does in a line), 03 every line, live (the tabs, the running
 * stage, the line with its words lit, the controls). From 900 px of frame the three steps
 * stand side by side, the step labels on one rail with an arrow from each to the next;
 * below that they stack, an arrow pointing down between them, the still a thumbnail beside
 * its caption. Nothing in the diagram animates: the build step is an explanation, never a
 * progress bar.
 *
 * Type: the serif for the mascot's name alone (the specimen's headline), mono for the step
 * labels, the endpoints and the file name, the system sans for the explanation and the line.
 */

/* ── The copy, as a header ─────────────────────────────────────────────── */

.use-case[data-beat="mascot-to-sdk"] .use-case-copy {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  grid-template-areas:
    "eyebrow eyebrow"
    "title body";
  align-items: end;
  gap: 0 clamp(28px, 5vw, 72px);
  margin: 0 0 clamp(24px, 4vh, 36px);
}

.use-case[data-beat="mascot-to-sdk"] .use-case-eyebrow { grid-area: eyebrow; }
.use-case[data-beat="mascot-to-sdk"] .use-case-title { grid-area: title; margin: 0; }
.use-case[data-beat="mascot-to-sdk"] .use-case-body { grid-area: body; padding-bottom: 6px; }

@media (max-width: 860px) {
  .use-case[data-beat="mascot-to-sdk"] .use-case-copy {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "eyebrow" "title" "body";
  }

  .use-case[data-beat="mascot-to-sdk"] .use-case-title { margin: 0 0 16px; }
}

/* ── The window: one slot, the board ───────────────────────────────────── */

[data-beat="mascot-to-sdk"] .demo-frame-body {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "main";
}

/* ── The board: three steps, stacked ───────────────────────────────────── */

[data-beat="mascot-to-sdk"] .mascot-to-sdk-board {
  --mascot-to-sdk-gap: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

[data-beat="mascot-to-sdk"] .mascot-to-sdk-step {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Stacked: an arrow pointing down from one step to the next. */
[data-beat="mascot-to-sdk"] .mascot-to-sdk-step + .mascot-to-sdk-step::before {
  content: "";
  display: block;
  width: 12px;
  height: 30px;
  margin: 8px 0 8px 9px;
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 30'><path d='M6 1v27M1 23l5 5 5-5' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat center / contain;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 30'><path d='M6 1v27M1 23l5 5 5-5' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat center / contain;
}

[data-beat="mascot-to-sdk"] .mascot-to-sdk-step-label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}

[data-beat="mascot-to-sdk"] .mascot-to-sdk-step-n {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  letter-spacing: .06em;
}

/* ── 01 The still: the specimen ────────────────────────────────────────── */

[data-beat="mascot-to-sdk"] .mascot-to-sdk-specimen {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  margin: 0;
}

[data-beat="mascot-to-sdk"] .mascot-to-sdk-still {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  background: #0e0b14; /* the stage colour, behind the art while it loads */
  box-shadow: 0 0 0 1px var(--line);
}

[data-beat="mascot-to-sdk"] .mascot-to-sdk-specimen-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

/* The specimen's headline: the mascot's own name, in the book voice. */
[data-beat="mascot-to-sdk"] .mascot-to-sdk-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

[data-beat="mascot-to-sdk"] .mascot-to-sdk-name:empty { display: none; }

[data-beat="mascot-to-sdk"] .mascot-to-sdk-slug {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Pip is ours, not Masko's: said where the still is, not tucked in the drawer. */
[data-beat="mascot-to-sdk"] .mascot-to-sdk-note {
  margin-top: 4px;
  padding: 8px 11px 8px 12px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 4px 10px 10px 4px;
  background: var(--panel-2);
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text);
}

/* ── 02 One build ──────────────────────────────────────────────────────── */

[data-beat="mascot-to-sdk"] .mascot-to-sdk-build {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

[data-beat="mascot-to-sdk"] .mascot-to-sdk-endpoint {
  justify-self: start;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: box-shadow .12s;
}

[data-beat="mascot-to-sdk"] .mascot-to-sdk-endpoint:hover,
[data-beat="mascot-to-sdk"] .mascot-to-sdk-endpoint:focus-visible { box-shadow: 0 0 0 1px var(--accent); }

[data-beat="mascot-to-sdk"] .mascot-to-sdk-build-line {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

/* ── 03 Every line, live ───────────────────────────────────────────────── */

[data-beat="mascot-to-sdk"] .mascot-to-sdk-live {
  display: grid;
  gap: 12px;
  min-width: 0;
}

/* New speech / Existing audio: a segmented switch over the one stage. */
[data-beat="mascot-to-sdk"] .mascot-to-sdk-tabs {
  display: flex;
  justify-self: start;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink);
}

[data-beat="mascot-to-sdk"] .mascot-to-sdk-tabs[hidden] { display: none; }

[data-beat="mascot-to-sdk"] .mascot-to-sdk-tab {
  min-height: 32px;
  padding: 5px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .12s, color .12s;
}

[data-beat="mascot-to-sdk"] .mascot-to-sdk-tab:hover { color: var(--text); }

[data-beat="mascot-to-sdk"] .mascot-to-sdk-tab[aria-selected="true"] {
  background: var(--panel-2);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line);
}

[data-beat="mascot-to-sdk"] .mascot-to-sdk-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

[data-beat="mascot-to-sdk"] .mascot-to-sdk-stage {
  justify-self: start;
  max-width: 360px;
}

/* With the tabs running, they name the panels; the labels stand for them without a script. */
[data-beat="mascot-to-sdk"] .mascot-to-sdk-flow[data-reader-js] [data-segment-label] { display: none; }

[data-beat="mascot-to-sdk"] .mascot-to-sdk-flow .reader-flow-segment + .reader-flow-segment { padding-top: 4px; }

[data-beat="mascot-to-sdk"] .mascot-to-sdk-wire {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

[data-beat="mascot-to-sdk"] .mascot-to-sdk-supplied {
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text);
}

[data-beat="mascot-to-sdk"] .mascot-to-sdk-flow .reader-flow-text {
  font-size: 15.5px;
  line-height: 1.55;
}

[data-beat="mascot-to-sdk"] .mascot-to-sdk-tools {
  flex: none;
  min-height: 36px;
}

[data-beat="mascot-to-sdk"] .mascot-to-sdk-icon {
  width: 13px;
  height: 13px;
  flex: none;
}

[data-beat="mascot-to-sdk"] .mascot-to-sdk-icon[hidden] { display: none; }

/* Use my text: the live alternative, its door said on the link itself. */
[data-beat="mascot-to-sdk"] .mascot-to-sdk-use { flex-wrap: wrap; }

[data-beat="mascot-to-sdk"] .mascot-to-sdk-door {
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

[data-beat="mascot-to-sdk"] .mascot-to-sdk-status { min-height: 1.4em; }

/* ── Side by side: the steps on one rail ───────────────────────────────── */

@container demo-frame (min-width: 900px) {
  [data-beat="mascot-to-sdk"] .mascot-to-sdk-board {
    grid-template-columns: minmax(0, .9fr) minmax(0, .8fr) minmax(320px, 1.2fr);
    column-gap: var(--mascot-to-sdk-gap);
    align-items: start;
  }

  [data-beat="mascot-to-sdk"] .mascot-to-sdk-step { gap: 16px; }

  [data-beat="mascot-to-sdk"] .mascot-to-sdk-step + .mascot-to-sdk-step::before { content: none; }

  /* The rail: a hairline from each step's label across the gap, and a chevron before the
     next step's number. */
  [data-beat="mascot-to-sdk"] .mascot-to-sdk-step:not(:last-child) > .mascot-to-sdk-step-label::after {
    content: "";
    flex: 1 1 auto;
    min-width: 12px;
    height: 1px;
    margin-right: calc(-1 * var(--mascot-to-sdk-gap) + 14px);
    background: var(--muted);
    opacity: .7;
  }

  [data-beat="mascot-to-sdk"] .mascot-to-sdk-step + .mascot-to-sdk-step > .mascot-to-sdk-step-label::before {
    content: "";
    position: absolute;
    left: -15px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-top: 1.4px solid var(--muted);
    border-right: 1.4px solid var(--muted);
    transform: translateY(-50%) rotate(45deg);
  }

  [data-beat="mascot-to-sdk"] .mascot-to-sdk-specimen {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  [data-beat="mascot-to-sdk"] .mascot-to-sdk-still { max-width: 260px; }

  [data-beat="mascot-to-sdk"] .mascot-to-sdk-build { margin-top: clamp(40px, 8cqi, 96px); }
}
