/* tabblabs.net/music - "Getting your music off the old Mac".
   Same site identity as tabblabs.net/andrew (deliberate: this is a sibling page of the same site, not a
   different client): the accepted LIGHT rich multi-hue gradient FIELD, ~16 soft big OVERLAPPING radial
   blooms (transparent ~74%) on a tinted base, white cards floating over it, clean type.
   Field passes kit/check-gradient-presence.cjs (>=8 blooms, strong blooms, tinted base).

   Structure is its OWN: this is a long-form walkthrough read top to bottom, mostly on a phone, so it is
   built as a numbered step spine with a generated thread, not as the portfolio's section deck.

   Playground features implemented here (marked data-pf in index.html):
     thumb-zone-action-bar . reflow-not-clip . fluid-type-clamp-floor . touch-target-size
     section-connecting-path (drawn in app.js)

   NO HORIZONTAL SCROLL AT ANY WIDTH is a hard requirement of this page: the field's horizontal inset is
   pinned to 0 (an -8% h-bleed cost /andrew ~8% of horizontal scroll), body clips overflow-x, and the two
   file-path blocks + the tool table scroll INSIDE their own containers rather than widening the page. */

:root {
  --ink: #171423;
  --ink-soft: #453f59;
  /* Darkened from /andrew's #7b7492, which measures 4.42:1 on a white card and therefore FAILS WCAG AA
     for the 12px bold .mono labels that use it (bold only counts as large text at 18.66px+). No gate on
     this page caught it: the grader's contrast check reads the config's brand tokens, not the CSS.
     Revised 2026-07-28 from #756e8c to #655e7d: #756e8c cleared the white card (4.81:1) but only reached
     3.95:1 on the gradient FIELD, and two of this page's uses sit directly on the field rather than
     inside a card (the "One to seven" section label and the footer line). Checking one surface is not
     checking the surfaces. #655e7d is 6.09:1 on the card and 4.83:1 at the worst of the four field
     stops, so it passes everywhere it is actually painted. Same value now on /andrew. */
  --ink-faint: #655e7d;
  --line: rgba(23, 20, 35, 0.10);
  --line-soft: rgba(23, 20, 35, 0.07);
  --card: rgba(255, 255, 255, 0.74);
  --card-solid: rgba(255, 255, 255, 0.88);
  --accent: #5b3df5;
  --accent2: #e0487f;
  --accent3: #37b6d6;
  --ok: #0f8a4e;
  --warn: #b3541e;
  --sans: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --maxw: 940px;
  --r: 22px;
  --tap: 44px;               /* WCAG 2.5.5 target-size floor. Every control here meets it. */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans); color: var(--ink); line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background: #efe9f8; position: relative; overflow-x: hidden;
  /* thumb-zone bar: the body reserves its height so the last paragraph is readable, never trapped behind it */
  padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 761px) { body { padding-bottom: 0; } }

/* ---- the light rich multi-hue gradient FIELD (16 overlapping blooms + tinted base) ---- */
/* Radius ~= bloom SPACING (not 2x): 5-6 blooms at 2x average into a flat wash, which is the recurring
   rejection this recipe exists to avoid. Horizontal inset stays 0 so the field can never widen the page. */
/* THE BLEED IS IN PIXELS, NOT PERCENT — and on this page that is load-bearing.
   /andrew uses `inset: -6% 0 -4% 0`, which is harmless there because that page is short. This one is a
   14,900px document on a phone, so -4% resolved to **574px of bottom overhang**, and an absolutely
   positioned child extends the body's scrollable area: the reader reached the end of the walkthrough and
   then scrolled through 648px of empty gradient with the download bar floating over nothing. Measured on
   the live page at 390px: doc 14,926 vs content ending at 14,278. A px bleed does not scale with document
   length, so it is 40px whether the page is 3,000px or 30,000px. */
body::before {
  content: ""; position: absolute; inset: -60px 0 -40px 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1300px 1180px at 16% 3%,  rgba(120, 92, 255, 0.34), transparent 74%),
    radial-gradient(1200px 1100px at 84% 6%,  rgba(90, 190, 235, 0.30), transparent 74%),
    radial-gradient(1150px 1050px at 46% 12%, rgba(150, 120, 255, 0.26), transparent 74%),
    radial-gradient(1250px 1150px at 92% 20%, rgba(255, 120, 175, 0.24), transparent 74%),
    radial-gradient(1200px 1100px at 8%  27%, rgba(120, 150, 255, 0.26), transparent 74%),
    radial-gradient(1350px 1240px at 62% 32%, rgba(150, 205, 235, 0.24), transparent 74%),
    radial-gradient(1200px 1100px at 30% 40%, rgba(170, 130, 255, 0.24), transparent 74%),
    radial-gradient(1250px 1150px at 86% 47%, rgba(120, 220, 200, 0.22), transparent 74%),
    radial-gradient(1350px 1230px at 12% 55%, rgba(150, 122, 250, 0.27), transparent 74%),
    radial-gradient(1300px 1200px at 58% 62%, rgba(115, 205, 200, 0.26), transparent 74%),
    radial-gradient(1550px 1420px at 86% 70%, rgba(255, 165, 110, 0.31), transparent 76%),
    radial-gradient(1500px 1380px at 20% 74%, rgba(150, 118, 255, 0.31), transparent 76%),
    radial-gradient(1300px 1200px at 68% 84%, rgba(255, 140, 185, 0.28), transparent 74%),
    radial-gradient(1600px 1460px at 82% 88%, rgba(110, 195, 238, 0.29), transparent 76%),
    radial-gradient(1550px 1420px at 40% 92%, rgba(255, 158, 120, 0.30), transparent 76%),
    radial-gradient(1300px 1200px at 30% 96%, rgba(180, 135, 255, 0.26), transparent 74%),
    linear-gradient(168deg, #ece6f7 0%, #e6eefb 38%, #e9e2f4 70%, #efe6f2 100%);
  background-repeat: no-repeat;
}

.wrap { width: min(var(--maxw), 92vw); margin: 0 auto; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.mono {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.75rem; font-weight: 700; color: var(--ink-faint);   /* 12px floor, not 10.9px */
}
/* No white-space:nowrap here: the usual sr-only recipe carries it, and it makes every visually-hidden
   string read as a 494px-truncated line to the mobile audit. Screen readers are unaffected. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); border: 0;
}

/* THE min-width:0 RULE, and why it is at the top of the file.
   A grid or flex ITEM defaults to min-width:auto, which means it can never shrink below the MIN-CONTENT
   width of what is inside it. One `white-space: nowrap` file path inside a card therefore sets a 471px
   floor on that card, the card pushes past a 390px viewport, and body{overflow-x:hidden} then HIDES the
   overflow instead of fixing it, so the page pans sideways and the right edge of every paragraph is
   unreachable. An overflow-x:auto wrapper does NOT save you: it also needs min-width:0 to be allowed to
   be narrower than its content. Measured here before the fix: doc 530px vs vw 390px. */
.step, .step > .body, .tools, .pathbox, .facts li, .stuck-list li, .stuck-list p { min-width: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 0 0 10px 0; z-index: 60; font-weight: 700; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---- header ---- */
/* NOTE: this element carries backdrop-filter, which makes it the containing block for any fixed
   descendant. The thumb-zone bar is therefore a child of <body>, never of this header. */
header { position: sticky; top: 0; z-index: 30; padding: 12px 0;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  background: rgba(243, 239, 251, 0.72); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750;
  font-size: clamp(0.9rem, 2.4vw, 1rem); letter-spacing: -0.015em; }
.brand .spark { width: 24px; height: 24px; border-radius: 8px; flex: none;
  background: conic-gradient(from 210deg, var(--accent), var(--accent2), var(--accent3), var(--accent));
  box-shadow: 0 4px 14px rgba(91, 61, 245, 0.35); }
header nav ul { display: flex; gap: 6px; list-style: none; font-weight: 650; font-size: 0.86rem; flex-wrap: wrap; }
/* touch-target-size: nav links are their own box with real padding, not bare inline text. */
header nav a { color: var(--ink-soft); display: inline-flex; align-items: center;
  min-height: var(--tap); padding: 0 10px; border-radius: 10px; }
header nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.55); }
@media (max-width: 700px) { header nav { width: 100%; } header nav ul { gap: 2px; } header nav a { padding: 0 8px; } }
@media (max-width: 430px) { header nav a { font-size: 0.8rem; padding: 0 6px; } }

/* ---- hero ---- */
/* fluid-type-clamp-floor: every MIN below was chosen at 320px, not in a desktop window. The vw term in
   an h1 clamp dies on every phone (crossover = MIN / vw-factor), so the floor IS the phone size: here
   2rem/32px, measured to fit the 294px content box at 320px without tipping shrink-to-fit zoom. */
.hero { padding: 56px 0 26px; }
.hero h1 { font-size: clamp(2rem, 6.2vw, 3.5rem); line-height: 1.06; letter-spacing: -0.03em; font-weight: 800; }
.hero h1 .grad { background: linear-gradient(120deg, var(--accent), var(--accent2) 62%, var(--accent3));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { max-width: 60ch; margin: 20px 0 0; font-size: clamp(1.02rem, 2.6vw, 1.14rem); color: var(--ink-soft); }

.facts { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 30px 0 0; }
.facts li { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(60, 40, 120, 0.10); }
.facts p { margin-top: 8px; font-size: 0.95rem; color: var(--ink-soft); }
/* reflow-not-clip: three across becomes one column, every height auto, nothing clipped. */
@media (max-width: 760px) { .facts { grid-template-columns: 1fr; } }

/* The ROW is .cta-row; the token `cta` (and the subordinate `cta-ghost`) goes on the ANCHORS, which is
   the kit's convention for "this is the primary action, that one is secondary". */
.cta-row { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.btn { display: flex; flex-direction: column; gap: 2px; padding: 14px 26px; border-radius: 14px;
  min-height: 44px; min-height: var(--tap); justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.btn-t { font-weight: 750; font-size: 1rem; }
.btn-s { font-size: 0.78rem; opacity: 0.72; font-family: var(--mono); letter-spacing: 0.04em; }
.btn-solid { background: var(--ink); color: #fff; box-shadow: 0 14px 30px rgba(23, 20, 35, 0.25); }
.btn-solid:hover { transform: translateY(-2px); }
.btn-ghost { background: rgba(255, 255, 255, 0.72); border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { transform: translateY(-2px); border-color: rgba(91, 61, 245, 0.32); }
@media (max-width: 520px) { .btn { width: 100%; } }

/* ---- generic section + card ---- */
section.block { padding: 26px 0; }
.sec-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.sec-head h2 { font-size: clamp(1.45rem, 3.6vw, 2.1rem); letter-spacing: -0.025em; font-weight: 800; line-height: 1.15; }
.sec-head .mono { margin-left: auto; }
.lead-line { max-width: 64ch; color: var(--ink-soft); font-size: 1.02rem; margin: 0 0 18px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 46px rgba(60, 40, 120, 0.12); }
.card.pad { padding: clamp(20px, 3.4vw, 38px); }
.card p + p { margin-top: 13px; }
.card p { color: var(--ink-soft); font-size: clamp(1rem, 2.5vw, 1.04rem); }
.card p b, .card li b { color: var(--ink); font-weight: 700; }

.first .big { font-size: clamp(1.15rem, 3.2vw, 1.5rem); font-weight: 750; color: var(--ink);
  line-height: 1.35; margin-bottom: 14px; letter-spacing: -0.015em; }

/* ---- the three tools (reflow-not-clip) ---- */
/* Desktop: a real 3-column table. Phone: each row restacks into its own labelled block. The wrapper is
   overflow-x auto ONLY in table mode; it never has a fixed height, so nothing can be silently cut. */
.tools { margin: 4px 0 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tool-table { width: 100%; border-collapse: collapse; text-align: left; }
.tool-table th, .tool-table td { padding: 14px 16px; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.tool-table thead th { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 0.75rem; color: var(--ink-faint); font-weight: 700; border-bottom: 1px solid var(--line); }
.tool-table tbody th { font-weight: 750; color: var(--ink); white-space: nowrap; }
.tool-table td { color: var(--ink-soft); font-size: 0.97rem; }
.tool-table tbody tr:last-child th, .tool-table tbody tr:last-child td { border-bottom: 0; }
.tnum { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  margin-right: 9px; font-size: 0.8rem; font-weight: 800; color: #fff; vertical-align: -6px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 6px 16px rgba(91, 61, 245, 0.28); }
.flag { font-weight: 750; }
.flag-no { color: var(--ok); } .flag-yes { color: var(--warn); }

@media (max-width: 760px) {
  .tools { overflow-x: visible; }                    /* nothing to scroll once it is one column */
  .tool-table, .tool-table tbody, .tool-table tr, .tool-table th, .tool-table td { display: block; width: 100%; }
  .tool-table thead { display: none; }
  .tool-table tbody tr { border: 1px solid var(--line); border-radius: 16px; padding: 4px 2px;
    margin-bottom: 12px; background: rgba(255, 255, 255, 0.5); }
  .tool-table tbody tr:last-child { margin-bottom: 0; }
  .tool-table tbody th { white-space: normal; font-size: 1.02rem; border-bottom: 0; padding-bottom: 4px; }
  .tool-table td { border-bottom: 0; padding-top: 4px; }
  .tool-table td::before { content: attr(data-l); }
  .tool-table td:last-child { padding-bottom: 14px; }
}

.note { margin-top: 18px; padding: 15px 17px; border-radius: 14px; background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line); font-size: 0.97rem; color: var(--ink-soft); }

/* ---- the step spine ---- */
.steps { list-style: none; position: relative; display: grid; gap: 22px; }
.step { display: grid; grid-template-columns: 54px 1fr; gap: 18px; align-items: start; position: relative; }
.step > .k { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center;
  font-weight: 800; font-size: 1.3rem; color: #fff; position: sticky; top: 84px; z-index: 2;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 24px rgba(91, 61, 245, 0.32); }
.step .body h3 { font-size: clamp(1.2rem, 3.1vw, 1.6rem); letter-spacing: -0.02em; font-weight: 800;
  line-height: 1.2; margin-bottom: 12px; }
.step .body h4 { font-size: clamp(1rem, 2.6vw, 1.1rem); font-weight: 750; color: var(--ink);
  margin: 24px 0 9px; letter-spacing: -0.01em; }
.step .body h4 .rn { color: var(--accent); margin-right: 5px; }

/* section-connecting-path: the generated thread. Sits behind the badges, never intercepts a tap. */
.spine { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: visible; }
.spine path { fill: none; stroke: url(#spine-grad); stroke-width: 3; stroke-linecap: round; opacity: 0.55; }

@media (max-width: 680px) {
  /* reflow-not-clip applied to the pin: when the rail cannot fit, remove the RAIL, not the content.
     The badge becomes a chip at the top of each card and the thread simply is not drawn. */
  .step { grid-template-columns: 1fr; gap: 10px; }
  .step > .k { position: static; width: 42px; height: 42px; border-radius: 13px; font-size: 1.05rem; }
  .spine { display: none; }
}

.callout { margin: 15px 0; padding: 15px 17px; border-radius: 14px; background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line); border-left: 3px solid var(--accent); }
.step .body .callout { color: var(--ink-soft); }

/* Inline code sits INSIDE a running line, so its box must not grow taller than the line box it lives in:
   vertical padding plus a border on an inline element pushes its rect into the neighbouring line and the
   audit reads that, correctly, as two pieces of text overlapping. Horizontal padding only, no border. */
/* display:inline-block is load-bearing, not cosmetic. As a plain inline, a 23-character command name like
   `Put It All Back.command` breaks mid-token across two lines, so the chip's background and rounded
   corners are sliced in half AND the element reports two client rects whose union covers both whole
   lines. inline-block + max-width:100% keeps each chip one unbroken box that moves to the next line
   intact, and still lets the text inside it wrap rather than widen the page at 320px. */
code.in { font-family: var(--mono); font-size: 0.86em; background: rgba(91, 61, 245, 0.10);
  border-radius: 6px; padding: 0 5px; line-height: 1.3;
  display: inline-block; max-width: 100%; vertical-align: baseline;
  color: #3d2ab5; overflow-wrap: anywhere; }

/* The two file-path blocks: they scroll inside their own container, they never widen the page. */
.pathbox { margin: 12px 0; padding: 13px 15px; border-radius: 12px; background: rgba(23, 20, 35, 0.045);
  border: 1px solid var(--line); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pathbox code { font-family: var(--mono); font-size: clamp(0.8rem, 2.5vw, 0.9rem); color: var(--ink);
  white-space: nowrap; }

.bullets, .opts { margin: 12px 0 0 0; padding-left: 22px; display: grid; gap: 8px; }
.bullets { list-style: disc; } .opts { list-style: decimal; }
.bullets li, .opts li { color: var(--ink-soft); font-size: clamp(1rem, 2.5vw, 1.04rem); padding-left: 3px; }
.bullets li::marker, .opts li::marker { color: var(--accent); }

/* ---- if you get stuck ---- */
.stuck-list { list-style: none; display: grid; gap: 14px; margin: 0 0 18px; }
.stuck-list li { display: grid; grid-template-columns: 32px 1fr; gap: 14px; align-items: start; }
.stuck-list .k { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; font-size: 0.85rem; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 6px 16px rgba(91, 61, 245, 0.28); }

.grab .cta { margin-top: 6px; }

/* ---- footer ---- */
footer { padding: 34px 0 46px; border-top: 1px solid var(--line); margin-top: 30px; }
footer p { color: var(--ink-faint); font-size: 0.9rem; }

/* ---- thumb-zone action bar (phones only) ---- */
/* Fixed to the VIEWPORT (a body child, so no backdrop-filter ancestor can steal the containing block).
   Bottom padding is built from env(safe-area-inset-bottom) so the last row of pixels is not under the
   home indicator. The surface is opaque, not blurred: an un-blurred bar over a scrolling colour field
   goes muddy, and dropping the blur is also what keeps it out of the containing-block trap. */
.thumbbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; gap: 10px; align-items: stretch;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(247, 244, 253, 0.97); border-top: 1px solid var(--line);
  box-shadow: 0 -10px 30px rgba(60, 40, 120, 0.13);
}
.tb-btn { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: var(--tap); padding: 10px 12px; border-radius: 13px; font-weight: 750; font-size: 0.95rem; }
.tb-solid { background: var(--ink); color: #fff; }
.tb-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
@media (min-width: 761px) { .thumbbar { display: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
