/* STORY RULER (formerly The Story Engine).
   Layout: a story-machine control panel on graph paper — an ink header, a live player, the master chart as the
   centerpiece, then the formats, the workbench and the shape drawer as ruled "windows". One light paper world
   (the site has no dark mode), so every color is set explicitly from these tokens. */
:root {
  --paper: #f4f1ea;
  --paper-2: #fffdf9;
  --ink: #10120f;
  --muted: #45473f;
  --blue: #234b9b;
  --red: #e62d24;
  --gold: #f6a716;
  --blue-soft: #dce5f4;
  --red-soft: #f4d8d3;
  --gold-soft: #f7e7bb;
  --grey-soft: #e2ddd1;
  --green: #4f9a60;
  --red-text: #b8211a;
  --ok: #2f7a42;
  --warn: #8a5a00;
  --lab: 230px;
  --term: #10120f;
  --term-green: #7fd18f;
  --term-text: #e9e6dc;
  --grid-line: rgba(16, 18, 15, .065);
  --line: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --display: "Archivo", "Arial Black", "Arial Bold", sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", "Courier New", Courier, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--mono); font-size: 16px; line-height: 1.5; }
::selection { background: var(--gold); color: var(--ink); }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
img, svg, canvas { display: block; max-width: 100%; }
.shell { width: min(1440px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--ink); color: var(--paper-2); border-bottom: 4px solid var(--gold); }
.site-header .shell { min-height: 68px; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; font-family: var(--display); font-size: clamp(.85rem, 1.5vw, 1.1rem); letter-spacing: .01em; text-decoration: none; white-space: nowrap; }
.brand svg { width: 30px; height: 30px; }
.brand .product { font-family: var(--display); font-size: clamp(.95rem, 1.6vw, 1.15rem); letter-spacing: .02em; color: var(--paper-2); }
.brand .studio { font-family: var(--mono); font-weight: 700; font-size: .72rem; letter-spacing: .12em; color: var(--gold); border-left: 2px solid #3a3c36; padding-left: .7rem; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: clamp(.8rem, 1.8vw, 1.6rem); }
.site-nav a { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.site-nav a:hover { color: var(--gold); }
.nav-cta { padding: .62rem .8rem; background: var(--gold); color: var(--ink) !important; border: 2px solid var(--paper-2); text-decoration: none !important; }
.nav-cta:hover { background: var(--paper-2); }
.nav-toggle { display: none; margin-left: auto; min-height: 42px; padding: .4rem .8rem; border: 2px solid var(--paper-2); background: transparent; color: var(--paper-2); font-size: .75rem; font-weight: 700; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: flex-start; gap: 1rem; padding: 1.2rem var(--gutter) 1.5rem; background: var(--ink); border-bottom: 4px solid var(--gold); }
  .site-nav.open { display: flex; }
  .brand .studio { display: none; }
}

/* ---------- shared pieces ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: .55rem; padding: .45rem .7rem; background: var(--ink); color: var(--paper-2); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow::before { content: "●"; color: var(--red); }
.kicker { display: block; margin: 0 0 .8rem; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.button { display: inline-flex; align-items: center; justify-content: space-between; gap: 1.6rem; min-height: 54px; padding: .85rem 1rem; border: var(--line); box-shadow: 5px 5px 0 var(--ink); background: var(--paper-2); color: var(--ink); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.button:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); background: var(--gold-soft); }
.button:active { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--ink); }
.button.primary { background: var(--gold); }
.button.small { min-height: 42px; gap: .8rem; padding: .55rem .8rem; font-size: .72rem; box-shadow: 3px 3px 0 var(--ink); }
.button.small:hover { box-shadow: 1px 1px 0 var(--ink); transform: translate(2px, 2px); }
.button.dark { background: var(--ink); color: var(--paper-2); box-shadow: 4px 4px 0 var(--gold); }
.button.dark:hover { color: var(--gold); box-shadow: 2px 2px 0 var(--gold); }
.button[disabled] { opacity: .45; pointer-events: none; }
.button-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.chip { min-height: 40px; padding: .5rem .75rem; border: 2px solid var(--ink); background: var(--paper-2); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.chip:hover { background: var(--gold-soft); }
.chip[aria-pressed="true"] { background: var(--gold); }
.window { border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); background: var(--paper-2); min-width: 0; }
.window.red, .window.gold, .window.ink { box-shadow: 5px 5px 0 var(--ink); }
.window-bar { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem .8rem; background: var(--paper); border-bottom: 2px solid var(--ink); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.window-bar .controls { letter-spacing: .3em; white-space: nowrap; }
.window-bar.gold, .window-bar.red { background: var(--paper); }
.window-body { padding: clamp(.9rem, 2vw, 1.4rem); }
.terminal { background: var(--term); color: var(--term-text); border: 3px solid var(--ink); font-size: .8rem; line-height: 1.6; }
.terminal .t-head { color: var(--term-green); font-weight: 700; letter-spacing: .06em; }
.terminal b, .terminal .t-gold { color: var(--gold); }
.section { padding-block: clamp(3.5rem, 7vw, 6.5rem); border-bottom: 2px solid var(--ink); }
.section.white { background: var(--paper-2); }
.hero { background-color: var(--paper); background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 40px 40px; }
.section.dots { background: var(--paper-2); }
.section.grid-bg { background: var(--paper); }
.section-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); gap: clamp(1.5rem, 5vw, 6rem); align-items: end; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section-head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 4.4vw, 4.2rem); line-height: 1; letter-spacing: -.035em; text-wrap: balance; }
.section-head p { margin: 0; max-width: 600px; font-family: var(--serif); font-size: 1.1rem; line-height: 1.6; }
@media (max-width: 860px) { .section-head { grid-template-columns: 1fr; } }

/* ---------- hero ---------- */
.hero { border-bottom: 2px solid var(--ink); }
.hero .shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; padding-block: clamp(3rem, 6vw, 5.5rem); }
.hero h1 { margin: 1.8rem 0 1.4rem; font-family: var(--display); font-weight: 900; font-size: clamp(2.5rem, 5vw, 5.4rem); line-height: .9; letter-spacing: -.025em; text-wrap: balance; }
.hero h1 .r { color: var(--red); display: block; }
.hero h1 .b { color: var(--blue); display: block; }
.hero-lede { margin: 0 0 2rem; max-width: 640px; font-family: var(--serif); font-size: clamp(1.1rem, 1.8vw, 1.4rem); line-height: 1.55; }
.hero-strip { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hero-strip i { color: var(--red); font-style: normal; }
@media (max-width: 1000px) { .hero .shell { grid-template-columns: 1fr; } }

/* ---------- player ---------- */
.player { display: flex; flex-direction: column; min-width: 0; }
.player .stage { position: relative; background: var(--paper); display: flex; justify-content: center; align-items: center; overflow: hidden; }
.player canvas { width: 100%; height: auto; background: var(--paper); }
.player.vertical .stage { background: var(--ink); padding: 1rem; }
.player.vertical canvas { width: auto; max-height: min(72vh, 760px); max-width: 100%; }
.player .big-play { position: absolute; inset: 0; margin: auto; width: 96px; height: 96px; border: 4px solid var(--ink); background: var(--gold); box-shadow: 6px 6px 0 var(--ink); display: grid; place-items: center; }
.player .big-play svg { width: 40px; height: 40px; }
.player .bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .6rem; border-top: 3px solid var(--ink); background: var(--paper-2); }
.player .bar .now { flex: 1 1 220px; min-width: 0; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .scrub { position: relative; height: 14px; border-top: 3px solid var(--ink); background: var(--grey-soft); cursor: pointer; }
.player .scrub .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--red); }
.player .scrub .tick { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); opacity: .5; }
.pbtn { min-height: 38px; min-width: 38px; padding: .35rem .6rem; border: 2px solid var(--ink); background: var(--paper-2); font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }
.pbtn:hover { background: var(--gold-soft); }
.pbtn[aria-pressed="true"] { background: var(--gold); }
.pbtn svg { width: 14px; height: 14px; }

/* ---------- chart ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1.2rem; }
.toolbar .label { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-right: .2rem; }
.toolbar .sep { width: 2px; height: 30px; background: var(--ink); opacity: .2; margin-inline: .4rem; }
.toolbar select, .toolbar input { min-height: 40px; padding: .4rem .5rem; border: 2px solid var(--ink); background: var(--paper-2); font-size: .75rem; font-weight: 700; border-radius: 0; }
.toolbar input[type="number"] { width: 6.5rem; }
.chart-window .window-body { padding: 0; }
.chart-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.chart { position: relative; min-width: 1060px; user-select: none; touch-action: pan-y; }
.chart .row { display: grid; grid-template-columns: var(--lab) minmax(0, 1fr); border-bottom: 1px solid rgba(16, 18, 15, .18); }
.chart .row:hover .rlabel { background: var(--gold-soft); }
.chart .rlabel { display: flex; align-items: center; gap: .55rem; padding: .3rem .6rem; border-right: 3px solid var(--ink); background: var(--paper-2); font-size: .72rem; line-height: 1.15; min-width: 0; text-decoration: none; }
.chart .rlabel .n { flex: none; width: 1.9rem; height: 1.9rem; display: grid; place-items: center; background: var(--ink); color: var(--paper-2); font-weight: 700; font-size: .7rem; }
.chart .rlabel b { display: block; font-size: .74rem; letter-spacing: .03em; text-transform: uppercase; }
.chart .rlabel span { display: block; color: var(--muted); font-size: .68rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart .track { position: relative; height: 48px; background: var(--paper) linear-gradient(90deg, transparent calc(25% - 1px), rgba(16,18,15,.16) calc(25% - 1px) 25%, transparent 25% calc(50% - 1px), rgba(16,18,15,.16) calc(50% - 1px) 50%, transparent 50% calc(75% - 1px), rgba(16,18,15,.16) calc(75% - 1px) 75%, transparent 75%); }
.chart .row.has-pts .track { height: 76px; }
.chart .cell { position: absolute; top: 4px; height: 40px; border: 2px solid var(--ink); padding: 2px 5px; font: inherit; font-size: .75rem; font-weight: 700; line-height: 1.15; text-align: left; overflow: hidden; background: var(--paper-2); color: var(--ink); cursor: pointer; display: flex; align-items: center; }
.chart .cell .num { font-variant-numeric: tabular-nums; }
.chart .cell:focus-visible, .chart .pt:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; z-index: 5; }
.chart .cell:hover { background: var(--gold-soft); z-index: 2; }
.chart .cell.hit { background: var(--gold-soft); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); z-index: 2; }
.chart .pt { position: absolute; top: 48px; height: 26px; margin-left: -9px; padding: 0 0 0 22px; border: 0; background: transparent; font: inherit; font-size: .75rem; font-weight: 700; color: var(--ink); cursor: pointer; z-index: 3; display: flex; align-items: center; white-space: nowrap; }
.chart .pt i { position: absolute; left: 1px; top: 5px; width: 15px; height: 15px; background: var(--ink); border: 2px solid var(--ink); transform: rotate(45deg); }
.chart .pt .pl.end { position: absolute; right: 100%; padding-right: 6px; }
.chart .pt::before { content: ""; position: absolute; left: 8px; top: -6px; height: 6px; width: 2px; background: var(--ink); }
.chart .pt:hover i { background: var(--gold); }
.chart .pt.hit i { background: var(--gold); }
.chart .group { padding: .5rem .8rem; background: var(--ink); color: var(--paper-2); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; display: flex; justify-content: space-between; gap: 1rem; }
.chart .group span { color: var(--gold); }
.chart .head { position: sticky; top: 0; z-index: 4; }
.chart .acts { display: grid; grid-template-columns: repeat(4, 1fr); }
.chart .acts div { padding: .45rem .6rem; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); font-size: .74rem; font-weight: 700; letter-spacing: .1em; }
.chart .acts div { background: var(--paper-2); } .chart .acts .a3 { border-right: 0; }
.chart .ruler { position: relative; height: 26px; background: var(--paper-2); border-bottom: 3px solid var(--ink); }
.chart .ruler i { position: absolute; bottom: 0; width: 1px; background: var(--ink); }
.chart .ruler i.big { height: 10px; width: 2px; } .chart .ruler i.sm { height: 5px; opacity: .6; }
.chart .ruler b { position: absolute; top: 3px; font-size: .75rem; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.chart .ruler b.first { transform: translateX(3px); } .chart .ruler b.last { transform: translateX(calc(-100% - 3px)); }
.chart .playhead { position: absolute; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: var(--red); pointer-events: none; z-index: 6; }
.chart .playhead::before { content: ""; position: absolute; top: 0; left: -8px; width: 20px; height: 20px; background: var(--red); border: 3px solid var(--ink); }
.chart .playhead[hidden] { display: none; }
.readout { margin-top: 0; border: 0; border-top: 2px solid var(--ink); padding: 1rem clamp(.8rem, 2vw, 1.4rem) 1.2rem; background: var(--paper-2); color: var(--ink); }
.readout .t-head { color: var(--ink); }
.readout .t-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; margin-bottom: .8rem; }
.readout ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .25rem 1.2rem; }
.readout li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .5rem; padding: .3rem 0; border-bottom: 1px solid rgba(16, 18, 15, .14); font-size: .8rem; min-width: 0; }
.readout li .who { color: var(--muted); }
.readout li .what { color: var(--ink); font-family: var(--serif); font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.readout li .what.none { color: var(--muted); font-style: italic; }
.readout li .what .pt-name { color: var(--ink); font-weight: 700; }
.chart-note { margin-top: 1.2rem; font-family: var(--serif); font-size: 1.05rem; line-height: 1.6; max-width: 900px; }
.pop { position: fixed; z-index: 80; width: min(380px, calc(100vw - 32px)); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); background: var(--paper-2); }
.pop .window-bar { min-height: 36px; }
.pop .window-body { font-family: var(--serif); font-size: 1rem; line-height: 1.5; }
.pop .lbl { font-family: var(--mono); }
.pop h4 { margin: 0 0 .4rem; font-family: var(--serif); font-weight: 400; font-size: 1.5rem; line-height: 1.05; }
.pop .prompt { margin-top: .6rem; padding-top: .6rem; border-top: 2px dashed var(--ink); font-family: var(--serif); font-style: italic; }
.pop .button-row { margin-top: .8rem; gap: .5rem; }

/* ---------- formats ---------- */
.catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.2rem, 2.4vw, 2rem); }
@media (max-width: 1100px) { .catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .catalog { grid-template-columns: 1fr; } }
.fcard { border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); background: var(--paper-2); display: flex; flex-direction: column; min-width: 0; }
.fcard[hidden] { display: none; }
.fcard .window-bar { background: var(--paper); }
.fcard .thumb { display: block; border-bottom: 2px solid var(--ink); background: var(--paper); aspect-ratio: 16 / 7; max-width: 100%; cursor: pointer; position: relative; padding: 0; border-left: 0; border-right: 0; border-top: 0; width: 100%; }
.fcard .thumb svg { width: 100%; height: 100%; }
.fcard .thumb .play-chip { position: absolute; right: .8rem; bottom: .8rem; padding: .45rem .6rem; background: var(--gold); border: 3px solid var(--ink); font-size: .7rem; font-weight: 700; letter-spacing: .05em; }
.fcard-body { flex: 1; display: flex; flex-direction: column; padding: 1.15rem; }
.fcard .meta { display: flex; justify-content: space-between; gap: 1rem; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.fcard h3 { margin: 1rem 0 .3rem; font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 2.6vw, 2.4rem); line-height: 1; letter-spacing: -.035em; }
.fcard .by { font-size: .78rem; color: var(--muted); }
.fcard p { margin: .9rem 0 1.1rem; font-family: var(--serif); font-size: 1.02rem; line-height: 1.5; }
.fcard .actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: .6rem; }
.catalog-count { margin-left: auto; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- format window (overlay) ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(16, 18, 15, .55); overflow-y: auto; padding: calc(env(safe-area-inset-top, 0px) + 20px) var(--gutter) 40px; }
.overlay[hidden] { display: none; }
.overlay .window { max-width: 1320px; margin: 0 auto; box-shadow: 10px 10px 0 var(--gold); }
.overlay .close { min-height: 34px; padding: .2rem .65rem; border: 2px solid var(--ink); background: var(--paper-2); font-weight: 700; }
.fw-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(1.2rem, 3vw, 2.4rem); }
@media (max-width: 980px) { .fw-grid { grid-template-columns: 1fr; } }
.fw-head .meta { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fw-head h2 { margin: .5rem 0 .4rem; font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 4vw, 3.6rem); line-height: .92; letter-spacing: -.02em; text-transform: uppercase; text-wrap: balance; }
.fw-head .by { font-family: var(--serif); font-size: 1.25rem; }
.fw-essence { margin: 1.3rem 0 1rem; font-family: var(--serif); font-size: clamp(1.5rem, 2.6vw, 2.2rem); line-height: 1.12; letter-spacing: -.02em; }
.fw-summary { font-family: var(--serif); font-size: 1.05rem; line-height: 1.65; max-width: 62ch; }
.fw-source { font-size: .78rem; color: var(--muted); line-height: 1.6; }
.note-box { margin-top: .8rem; padding: .7rem .9rem; border: 3px solid var(--ink); background: var(--red-soft); font-size: .78rem; font-weight: 700; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.3rem; }
@media (max-width: 600px) { .pair { grid-template-columns: 1fr; } }
.pair > div { border: 3px solid var(--ink); background: var(--paper-2); padding: .9rem 1rem; box-shadow: 4px 4px 0 var(--gold); min-width: 0; }
.pair > div + div { box-shadow: 4px 4px 0 var(--red); }
.pair h5 { margin: 0 0 .4rem; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.pair p { margin: 0; font-family: var(--serif); font-size: 1.02rem; line-height: 1.5; }
.dl-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.table-wrap { overflow-x: auto; margin-top: 1.6rem; border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); background: var(--paper-2); }
table.beats { width: 100%; min-width: 760px; border-collapse: collapse; font-size: .8rem; }
table.beats th { position: sticky; top: 0; background: var(--blue-soft); text-align: left; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; padding: .55rem .6rem; border-bottom: 3px solid var(--ink); }
table.beats td { padding: .6rem; border-bottom: 1px solid rgba(16, 18, 15, .2); vertical-align: top; line-height: 1.45; }
table.beats td.num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }
table.beats td.name { font-weight: 700; text-transform: uppercase; letter-spacing: .02em; min-width: 11rem; }
table.beats td.desc { font-family: var(--serif); font-size: .95rem; }
table.beats td.prompt { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: .95rem; }
table.beats td .eq { display: block; margin-top: .35rem; font-size: .68rem; color: var(--blue); font-weight: 700; text-transform: uppercase; }
.badge { display: inline-grid; place-items: center; min-width: 2rem; height: 1.6rem; padding: 0 .3rem; border: 2px solid var(--ink); font-size: .68rem; font-weight: 700; }
.badge { background: var(--paper-2); color: var(--ink); font-variant-numeric: tabular-nums; }
.layers { margin-top: 1.4rem; display: grid; gap: .6rem; }
.layer-row { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .6rem; align-items: stretch; }
.layer-row b { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; align-self: center; }
.layer-track { position: relative; height: 44px; border: 2px solid var(--ink); background: var(--paper); }
.layer-track span { position: absolute; top: 0; bottom: 0; border-right: 2px solid var(--ink); padding: 3px 5px; font-family: var(--serif); font-size: .74rem; line-height: 1.1; overflow: hidden; }
.fw-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.6rem; flex-wrap: wrap; }

/* ---------- workbench ---------- */
.wb { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(1.2rem, 2.4vw, 2rem); align-items: start; }
@media (max-width: 1080px) { .wb { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .9rem; min-width: 0; }
.field label, .lbl { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.field input, .field textarea, .field select { width: 100%; min-height: 44px; padding: .6rem .7rem; border: 2px solid var(--ink); background: var(--paper); border-radius: 0; }
.field textarea { min-height: 84px; resize: vertical; font-family: var(--serif); font-size: 1.02rem; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.example-flag { display: inline-block; margin-left: .5rem; padding: .1rem .45rem; background: var(--gold); border: 2px solid var(--ink); font-size: .62rem; font-weight: 700; letter-spacing: .08em; }
.story-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.story-tools select { min-height: 42px; padding: .4rem .5rem; border: 2px solid var(--ink); background: var(--paper-2); font-weight: 700; font-size: .78rem; max-width: 100%; }
.beat-card { border: 3px solid var(--ink); background: var(--paper-2); margin-bottom: .8rem; }
.beat-card header { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-bottom: 2px solid var(--ink); background: var(--paper); }
.beat-card header b { font-size: .78rem; letter-spacing: .03em; text-transform: uppercase; min-width: 0; }
.beat-card header .pos { margin-left: auto; font-size: .7rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.beat-card .body { padding: .6rem .7rem .7rem; }
.beat-card .hint { margin: 0 0 .45rem; font-family: var(--serif); font-style: italic; font-size: .92rem; color: var(--muted); }
.beat-card textarea { width: 100%; min-height: 64px; padding: .5rem .6rem; border: 2px solid var(--ink); background: var(--paper); font-family: var(--serif); font-size: 1rem; line-height: 1.45; resize: vertical; border-radius: 0; }
.beat-card .actual { display: flex; align-items: center; gap: .5rem; margin-top: .45rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.beat-card .actual input { width: 6.5rem; min-height: 34px; padding: .25rem .4rem; border: 2px solid var(--ink); background: var(--paper); font-size: .78rem; }
.ai-btn { border-color: var(--blue) !important; }
.tabs { display: flex; flex-wrap: wrap; gap: 0; border: 3px solid var(--ink); margin-bottom: 1rem; }
.tabs button { flex: 1 1 auto; min-height: 44px; border: 0; border-right: 2px solid var(--ink); background: var(--paper-2); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tabs button:last-child { border-right: 0; }
.tabs button[aria-selected="true"] { background: var(--gold); }
.targets { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.targets .chip { min-height: 34px; padding: .3rem .55rem; font-size: .66rem; }
.tcard { border: 3px solid var(--ink); background: var(--paper-2); margin-bottom: 1rem; box-shadow: 4px 4px 0 var(--blue); }
.tcard .window-bar { min-height: 38px; }
.tcard table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.tcard td { padding: .5rem .6rem; border-bottom: 1px solid rgba(16, 18, 15, .18); vertical-align: top; }
.tcard td.tb { width: 38%; font-weight: 700; text-transform: uppercase; font-size: .72rem; letter-spacing: .02em; }
.tcard td.tb small { display: block; margin-top: .2rem; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.tcard td.tx { font-family: var(--serif); font-size: .98rem; line-height: 1.45; }
.tcard td.tx.gap { color: var(--red-text); font-style: italic; }
.gap-tag { font-family: var(--mono); font-style: normal; font-weight: 700; font-size: .72rem; letter-spacing: .08em; padding: 0 .3rem; background: var(--red-text); color: var(--paper-2); }
.tcard .near { display: block; color: var(--muted); font-style: normal; margin-top: .2rem; font-size: .85rem; }
.tx-list { margin: 0; padding-left: 1.1rem; } .tx-list li + li { margin-top: .25rem; }
.ai-tag { font-family: var(--mono); font-style: normal; font-weight: 700; font-size: .68rem; letter-spacing: .08em; padding: 0 .3rem; border: 1.5px solid var(--blue); color: var(--blue); margin-right: .2rem; }
.ai-idea { display: block; font-style: italic; border: 2px dashed var(--blue); padding: .3rem .45rem; }
.tcard td.tx.ai { color: var(--blue); }
.tcard .fit-note { padding: .6rem .7rem; font-size: .75rem; background: var(--gold-soft); border-bottom: 2px solid var(--ink); }
.pace { border: 3px solid var(--ink); background: var(--paper-2); padding: 1rem; }
.pace-row { display: grid; grid-template-columns: 11rem minmax(0, 1fr) 9rem 5.5rem; gap: .7rem; align-items: center; padding: .35rem 0; border-bottom: 1px dashed rgba(16, 18, 15, .3); font-size: .74rem; }
.pace-row .bar { position: relative; height: 18px; background: var(--paper); border: 2px solid var(--ink); }
.pace-row .bar .tgt { position: absolute; top: -4px; bottom: -4px; width: 4px; margin-left: -2px; background: var(--ink); }
.pace-row .bar .act { position: absolute; top: 1px; width: 14px; height: 12px; margin-left: -7px; border: 2px solid var(--ink); }
.pace-row .dev { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--red-text); }
.pace-row .act.ok { background: var(--ok); } .pace-row .act.warn { background: var(--gold); } .pace-row .act.bad { background: var(--red-text); }
.pace-sum { margin: 0 0 1rem; font-family: var(--serif); font-size: 1.1rem; }
.status-line { min-height: 1.4em; margin: .5rem 0 0; font-size: .74rem; font-weight: 700; }

/* ---------- shapes ---------- */
.shape-wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr); gap: clamp(1.2rem, 2.4vw, 2rem); align-items: start; }
@media (max-width: 980px) { .shape-wrap { grid-template-columns: 1fr; } }
.draw-pad { position: relative; touch-action: none; background: var(--paper); }
.draw-pad canvas { width: 100%; height: auto; cursor: crosshair; }
.draw-pad .hint { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); padding: .5rem .7rem; background: var(--ink); color: var(--paper-2); font-size: .72rem; font-weight: 700; letter-spacing: .06em; pointer-events: none; text-transform: uppercase; }
.matches { display: grid; gap: .7rem; }
.match { border: 3px solid var(--ink); background: var(--paper-2); padding: .8rem .9rem; }
.match.best { box-shadow: 5px 5px 0 var(--red); }
.match .score { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.match h4 { margin: .25rem 0 .3rem; font-family: var(--serif); font-weight: 400; font-size: 1.6rem; line-height: 1; }
.match p { margin: 0; font-family: var(--serif); font-size: .98rem; line-height: 1.45; }
.minis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .7rem; margin-top: 1.4rem; }
@media (max-width: 760px) { .minis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mini { border: 2px solid var(--ink); background: var(--paper-2); padding: .4rem; font: inherit; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; text-align: left; color: var(--ink); cursor: pointer; }
.mini:hover { background: var(--gold-soft); }
.mini .by { font-weight: 400; color: var(--muted); text-transform: none; }
.mini svg { width: 100%; height: auto; margin-bottom: .3rem; }

/* ---------- about + footer ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }
.about-grid h2 { margin: 0; font-family: var(--display); font-weight: 900; font-size: clamp(2.6rem, 5.4vw, 5.4rem); line-height: .9; letter-spacing: -.025em; text-transform: uppercase; }
.about-copy > p:first-child { margin-top: 0; font-family: var(--serif); font-size: 1.3rem; line-height: 1.6; }
.about-copy p { font-family: var(--serif); line-height: 1.65; font-size: 1.08rem; }
.rule-list { margin-top: 2rem; border-top: 3px solid var(--ink); }
.rule-list details { border-bottom: 2px solid var(--ink); }
.rule-list summary { padding: 1rem .2rem; cursor: pointer; font-family: var(--serif); font-size: 1.25rem; }
.rule-list summary:hover { color: var(--blue); }
.rule-list ol { margin: 0 0 1.2rem; padding-left: 1.6rem; font-size: .8rem; line-height: 1.7; }
.rule-list ol li { margin-bottom: .35rem; }
.rule-list p { margin: 0 0 1.2rem; font-size: .84rem; line-height: 1.7; }
.cta-band { background: var(--blue); color: var(--paper-2); text-align: center; border-bottom: 4px solid var(--ink); padding-block: clamp(3.5rem, 7vw, 6rem); }
.cta-band .kicker { color: var(--gold); }
.cta-band h2 { margin: 0 auto; max-width: 16ch; font-family: var(--display); font-weight: 900; font-size: clamp(2.6rem, 6.5vw, 6.4rem); line-height: .9; letter-spacing: -.025em; text-transform: uppercase; text-wrap: balance; }
.cta-band p { max-width: 640px; margin: 1.6rem auto 2rem; font-family: var(--serif); font-size: 1.2rem; line-height: 1.6; }
.cta-band .button-row { justify-content: center; }
.site-footer { padding-block: 3rem; border-top: 6px solid var(--gold); background: var(--ink); color: var(--paper-2); }
.footer-grid { display: grid; grid-template-columns: 1.3fr .7fr .7fr; gap: 2rem; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer p, .site-footer nav { margin: 1rem 0 0; font-size: .76rem; line-height: 1.8; }
.site-footer nav { display: flex; flex-direction: column; align-items: flex-start; }
.site-footer a:hover { color: var(--gold); }
.footer-bottom { margin-top: 2.2rem; padding-top: 1rem; border-top: 1px solid #5f615b; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: .72rem; }
.toast-btn { margin-left: .6rem; min-height: 32px; padding: .2rem .6rem; border: 2px solid var(--gold); background: var(--gold); color: var(--ink); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); transform: translateX(-50%); z-index: 120; padding: .7rem 1rem; background: var(--ink); color: var(--paper-2); border: 3px solid var(--gold); font-size: .76rem; font-weight: 700; letter-spacing: .04em; max-width: calc(100vw - 32px); }
.toast[hidden] { display: none; }
@media print {
  .site-header, .hero, #chart, #formats, #shapes, #about, .cta-band, .site-footer, .story-tools, .tabs, .targets, .no-print { display: none !important; }
  body { background: var(--paper-2); }
  .window { box-shadow: none; }
}

/* ---------- Story Ruler relaunch ---------- */
.skip:focus { position: fixed; left: 16px; top: 16px; width: auto; height: auto; clip: auto; z-index: 200; padding: .6rem .8rem; background: var(--gold); color: var(--ink); }
.hero-note { margin: -1rem 0 2rem; font-family: var(--serif); font-size: 1.05rem; }
.hero-example { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.25fr); gap: .8rem; align-items: start; }
.hx-right { display: grid; gap: .8rem; min-width: 0; }
.hx-col { min-width: 0; }
.hx-head { margin: 0 0 .4rem; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.hx-list li { border: 2px solid var(--ink); background: var(--paper); padding: .35rem .5rem; }
.hx-list b { display: block; font-size: .75rem; letter-spacing: .03em; text-transform: uppercase; }
.hx-list span { display: block; font-family: var(--serif); font-size: .92rem; line-height: 1.3; }
.hx-list li.gap { border-style: dashed; border-color: var(--red-text); background: var(--paper-2); }
.hx-list li.gap span { color: var(--red-text); font-style: italic; }
.hx-arrow { align-self: center; font-size: 1.6rem; font-weight: 700; }
.hero-caption { margin: 1rem 0 0; font-family: var(--serif); font-size: 1rem; line-height: 1.5; }
@media (max-width: 640px) { .hero-example { grid-template-columns: 1fr; } .hx-arrow { transform: rotate(90deg); justify-self: center; } }
.feature-window { margin-bottom: 2rem; }
.player .big-play.labeled { width: auto; height: auto; padding: .8rem 1.1rem; gap: .6rem; display: flex; font-weight: 700; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }
.player .big-play.labeled svg { width: 28px; height: 28px; }
.legend { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-size: .8rem; font-weight: 700; }
.legend li { display: flex; align-items: center; gap: .45rem; }
.legend .acts-note { flex-basis: 100%; font-weight: 400; font-family: var(--serif); font-size: .98rem; }
.legend .sw { display: inline-block; flex: none; }
.legend .sw.bar { width: 28px; height: 16px; border: 2px solid var(--ink); background: var(--paper-2); }
.legend .sw.dia { width: 12px; height: 12px; margin: 0 3px; background: var(--ink); transform: rotate(45deg); }
.legend .sw.line { width: 4px; height: 18px; background: var(--red); }
.legend .sw.blank { width: 28px; height: 16px; border: 2px dashed rgba(16,18,15,.45); background: var(--paper); }
.slider-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .7rem .9rem; border-bottom: 3px solid var(--ink); background: var(--paper-2); font-size: .8rem; font-weight: 700; }
.slider-row input[type=range] { flex: 1 1 240px; min-height: 32px; accent-color: var(--red); }
.slider-row output { display: inline-block; min-width: 3.2em; font-variant-numeric: tabular-nums; }
.chart-show, .filter-toggle { display: none; }
.chart .rlabel .hint { white-space: normal; }
.ph-layer { position: absolute; left: var(--lab); right: 0; top: 0; bottom: 0; pointer-events: none; }
.window-bar .saved { font-weight: 400; text-transform: none; letter-spacing: 0; }
.linkish { border: 0; padding: 0; background: none; font: inherit; color: var(--blue); text-decoration: underline; text-transform: none; letter-spacing: 0; cursor: pointer; }
.pace-in { display: grid; gap: .15rem; font-size: .7rem; }
.pace-in input { width: 100%; min-height: 34px; border: 2px solid var(--ink); background: var(--paper); padding: .2rem .35rem; }
.pace-in small { font-weight: 400; color: var(--muted); }
.disclaimer { color: #c9c6bb; }
.artifact-only { display: none; }
.has-claude .artifact-only { display: inline; }
.in-artifact .site-header { position: static; }
@media (max-width: 760px) { .pace-row { grid-template-columns: minmax(0, 1fr) 7.5rem; } .pace-row .bar { grid-column: 1 / -1; grid-row: 2; } }
@media (max-width: 700px) {
  :root { --lab: 64px; }
  .chart-show, .filter-toggle { display: inline-flex; margin: .7rem .9rem; }
  .filter-toggle { margin: 0 0 1rem; }
  .toolbar.collapsible { display: none; }
  .toolbar.collapsible.open { display: flex; }
  .chart-scroll { display: none; }
  .chart-scroll.open { display: block; }
  .chart { min-width: 900px; }
  .chart .rlabel { position: sticky; left: 0; z-index: 4; padding: .3rem .35rem; }
  .chart .rlabel .nm span, .chart .rlabel .hint { display: none; }
  .chart .rlabel b { font-size: .7rem; overflow: hidden; text-overflow: ellipsis; }
  .chart .rlabel .n { display: none; }
  .chart .group span { display: none; }
  .readout li { grid-template-columns: 6rem minmax(0, 1fr); }
  .readout li .what { white-space: normal; }
  .chip, .pbtn, .toolbar select, .toolbar input, .targets .chip, .button.small, .field input, .field select, .beat-card .actual input, .pace-in input { min-height: 44px; }
  .player .scrub { height: 32px; }
  .overlay .close { min-height: 44px; }
}

/* ---------- calmer reading ---------- */
.lbl.example-line { font-family: var(--serif); font-size: 1rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.tcard .fit-note { font-family: var(--serif); font-size: .98rem; background: var(--paper); }
.tcard .window-bar, .tcard { box-shadow: none; }
.tcard { box-shadow: 3px 3px 0 var(--ink); }
.cta-band { border-bottom: 2px solid var(--ink); }
.pair > div, .pair > div + div { box-shadow: 3px 3px 0 var(--ink); }
.note-box { background: var(--paper); font-family: var(--serif); font-weight: 400; font-size: 1rem; }

/* ---------- structure pages (a page of their own, not a pop-up) ---------- */
.on-structure main > section:not(#structure-page) { display: none; }
.structure-page { padding-block: clamp(1.5rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem); background: var(--paper-2); border-bottom: 2px solid var(--ink); }
.crumbs { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.crumbs a { color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.sp-head { margin: 1rem 0 1.6rem; }
.sp-head .meta { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sp-head h1 { margin: .4rem 0 .4rem; font-family: var(--display); font-weight: 900; font-size: clamp(2.1rem, 5vw, 4rem); line-height: .95; letter-spacing: -.02em; text-transform: uppercase; text-wrap: balance; }
.sp-head h1:focus { outline: none; }
.sp-head .by { font-family: var(--serif); font-size: 1.25rem; }
.sp-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(1.2rem, 3vw, 2.6rem); align-items: start; }
@media (max-width: 900px) { .sp-grid { grid-template-columns: 1fr; } }
.sp-media .button-row { margin-top: 1rem; }
.sp-text .fw-essence { margin-top: 0; }
.pair h2 { margin: 0 0 .4rem; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
.sp-h2 { margin: 2.6rem 0 0; font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 3vw, 2.4rem); }
table.beats td small { display: block; margin-top: .2rem; font-weight: 400; color: var(--muted); }
table.beats td.where { white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .table-wrap { overflow: visible; border: 0; box-shadow: none; background: none; }
  table.beats { min-width: 0; }
  table.beats thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.beats tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem .7rem; padding: .9rem; margin-bottom: .8rem; border: 2px solid var(--ink); background: var(--paper-2); }
  table.beats td { display: block; padding: 0; border: 0; }
  table.beats td.num { grid-row: span 2; }
  table.beats td.desc, table.beats td.prompt { grid-column: 1 / -1; }
  table.beats td.where { white-space: normal; }
}
.vbox { border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); background: var(--paper-2); }
.vstage { background: var(--ink); display: flex; justify-content: center; }
.vstage video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--ink); }
.vbox.vertical .vstage video { width: auto; max-width: 100%; height: min(72vh, 720px); aspect-ratio: 9 / 16; }
.vbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; padding: .6rem; border-top: 2px solid var(--ink); }
.seg { display: inline-flex; border: 2px solid var(--ink); }
.seg button { min-height: 40px; padding: .35rem .8rem; border: 0; background: var(--paper-2); font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--gold); }
.vdl { font-size: .8rem; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; min-height: 40px; display: inline-flex; align-items: center; }
.feature-window .player { padding: 0; }
.feature-window #feature-video .vbox { border: 0; box-shadow: none; }
.feature-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem; border-top: 2px solid var(--ink); background: var(--paper-2); }
.feature-link { font-family: var(--serif); font-size: 1.05rem; text-underline-offset: 4px; }
@media (max-width: 700px) { .seg button, .vdl { min-height: 44px; } }

details.tcard > summary { cursor: pointer; list-style: none; }
details.tcard > summary::-webkit-details-marker { display: none; }
details.tcard > summary span:first-child::before { content: "▸ "; }
details.tcard[open] > summary span:first-child::before { content: "▾ "; }
details.tcard:not([open]) > summary { border-bottom: 0; }

/* ---------- Story Ruler: brand, type, contrast, flow ---------- */
/* header: the BNC mark and wordmark, Story Ruler in gold beside it, the gold rule underneath */
.brand .studio-name { font-family: var(--display); font-weight: 900; letter-spacing: .01em; }
.brand .product { font-family: var(--mono); font-weight: 700; font-size: .78rem; letter-spacing: .14em; color: var(--gold); border-left: 2px solid #3a3c36; padding-left: .7rem; }
@media (max-width: 900px) { .brand .studio-name { display: none; } .brand .product { border: 0; padding: 0; font-size: .9rem; } }
/* display type: Archivo at heavy weight wherever the display face is used */
.hero h1, .fw-head h2, .sp-head h1, .about-grid h2, .cta-band h2 { font-weight: 900; }
.hero h1 { font-size: clamp(2.3rem, 4.4vw, 4.5rem); line-height: .98; letter-spacing: -.005em; word-spacing: .12em; margin: 1.4rem 0 1.2rem; }
.sp-head h1, .fw-head h2, .about-grid h2, .cta-band h2 { letter-spacing: 0; word-spacing: .1em; }
.hero h1 .r { color: var(--red); display: inline; }
.hero .shell { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); padding-block: clamp(3rem, 5vw, 4.5rem); }
@media (max-width: 1000px) { .hero .shell { grid-template-columns: 1fr; } }
.hero-lede { font-size: clamp(1.15rem, 1.7vw, 1.35rem); line-height: 1.5; }
/* the one ruler: along the bottom edge of the hero */
.hero { position: relative; border-bottom: 0; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; pointer-events: none;
  background: linear-gradient(var(--ink), var(--ink)) bottom / 100% 2px no-repeat,
              repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 80px) bottom / 100% 12px no-repeat,
              repeating-linear-gradient(90deg, rgba(18, 19, 16, .45) 0 1px, transparent 1px 16px) bottom / 100% 6px no-repeat; }
/* reading text and labels: bigger, darker, steadier */
.section-head p { font-size: 1.12rem; line-height: 1.6; }
.kicker { font-size: .78rem; color: var(--muted); }
.cta-band .kicker { color: var(--gold); }
.window-bar, .chip, .button, .tabs button, .seg button { letter-spacing: .05em; }
.button { font-size: .8rem; }
.button.small { font-size: .74rem; box-shadow: 2px 2px 0 var(--ink); }
.field label, .lbl { font-size: .74rem; }
.beat-card, .tcard, .match, .pace, .mini { border-width: 2px; }
.tcard, .pair > div, .pair > div + div, .match.best { box-shadow: none; }
.chip, .targets .chip { border-width: 1.5px; }
.fcard .by, .chart .rlabel span, .fw-source { color: var(--muted); }
/* section rhythm: paper and white alternate; one plain rule between them */
.section { border-bottom: 1px solid rgba(18, 19, 16, .25); }
#start, #chart, #shapes { background: var(--paper-2); }
#write, #formats, #about { background: var(--paper); }
/* new here: three steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.4vw, 2rem); }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }
.steps li { position: relative; border: 2px solid var(--ink); background: var(--paper-2); padding: 1.3rem 1.3rem 1.4rem; min-width: 0; }
#start .steps li { background: var(--paper); }
.steps .step-n { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; background: var(--ink); color: var(--paper-2); font-family: var(--display); font-weight: 900; font-size: 1.2rem; }
.steps h3 { margin: .9rem 0 .4rem; font-family: var(--serif); font-weight: 600; font-size: 1.4rem; line-height: 1.15; }
.steps p { margin: 0; font-family: var(--serif); font-size: 1.05rem; line-height: 1.55; }
.starts { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.starts .button { justify-content: flex-start; }
/* welcome back + progress */
.welcome-back { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: 0 0 1.6rem; padding: .8rem 1rem; border: 2px solid var(--ink); background: var(--paper-2); font-family: var(--serif); font-size: 1.05rem; }
.welcome-back b { font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.progress { margin: 0 0 1rem; }
.progress .ptext { display: flex; justify-content: space-between; gap: 1rem; font-size: .76rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.progress .track2 { height: 10px; margin-top: .35rem; border: 2px solid var(--ink); background: var(--paper); }
.progress .fill2 { height: 100%; background: var(--gold); transition: width .3s ease; }

/* =========================================================================================
   Interface v4: calm and spacious. The BNC logo keeps its colors; the page itself is warm
   white and ink, with hairlines, soft surfaces and rounded corners. Red is the only accent:
   the reading line and gaps. Gold and blue stay in the logo.
   ========================================================================================= */
:root {
  --paper: #faf9f6; --paper-2: #ffffff; --surface-2: #f3f1ec; --ink: #16171b; --muted: #5b5e66;
  --line: #e5e2db; --line-strong: #cdc9bf; --accent: #2a52be; --red: #c8372d; --red-text: #b3261e;
  --hl: #fdf1c7; --hl-line: #e2c766;
  --ui: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
}
body { font-family: var(--ui); background: var(--paper); }
body *:not(svg):not(svg *) { text-transform: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* header: light, the logo carries the color */
.site-header { background: rgba(255, 255, 255, .94); color: var(--ink); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.2) blur(8px); }
.site-header::after { display: none; }
.site-header .shell { min-height: 64px; }
.brand { color: var(--ink); }
.brand .studio-name { font-family: var(--ui); font-weight: 800; font-size: 1rem; letter-spacing: .01em; }
.brand .product { font-family: var(--ui); font-weight: 600; font-size: .95rem; letter-spacing: 0; color: var(--muted); border-left: 1px solid var(--line-strong); }
.site-nav a { font-size: .92rem; font-weight: 500; letter-spacing: 0; text-decoration: none; color: var(--ink); }
.site-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }
.nav-cta { background: var(--ink) !important; color: #fff !important; border: 0 !important; border-radius: 999px; padding: .55rem 1rem !important; }
.nav-cta:hover { background: #33353b !important; text-decoration: none !important; }
.nav-toggle { border: 1px solid var(--line-strong); color: var(--ink); border-radius: 999px; font-weight: 600; }
@media (max-width: 900px) { .site-nav { background: #fff; border-bottom: 1px solid var(--line); } .brand .product { color: var(--ink); } }

/* type */
.section-head h2, .sp-h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 3.6vw, 3.2rem); line-height: 1.08; letter-spacing: -.02em; }
.hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(2.6rem, 5vw, 4.6rem); line-height: 1.04; letter-spacing: -.025em; word-spacing: normal; }
.hero h1 .r { color: inherit; }
.sp-head h1 { font-family: var(--serif); font-weight: 600; text-transform: none; letter-spacing: -.02em; word-spacing: normal; }
.about-grid h2, .cta-band h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -.02em; word-spacing: normal; }
.kicker { font-family: var(--ui); font-weight: 600; font-size: .85rem; letter-spacing: 0; color: var(--muted); margin-bottom: .9rem; }
.kicker::before { display: none; }
.eyebrow { background: var(--surface-2); color: var(--ink); border-radius: 999px; font-weight: 600; font-size: .85rem; letter-spacing: 0; padding: .4rem .85rem; }
.eyebrow::before { display: none; }
.hero-strip, .catalog-count, .toolbar .label, .field label, .lbl, .crumbs, .sp-head .meta, .fcard .meta, .pair h2, .match .score, .progress .ptext, .welcome-back b, .status-line, .legend { letter-spacing: 0; font-family: var(--ui); }
.hero-strip { font-weight: 600; font-size: .85rem; color: var(--muted); }
.hero-strip i { color: var(--line-strong); }

/* sections: more air, no rules, soft alternation */
.section { padding-block: clamp(4.5rem, 9vw, 8rem); border-bottom: 0; }
.hero { background: var(--paper-2); background-image: none; }
.hero::after { display: none; }
.hero .shell { padding-block: clamp(3.5rem, 7vw, 6.5rem); gap: clamp(2.5rem, 6vw, 6rem); }
#start, #chart, #shapes { background: var(--paper); }
#write, #formats, #about { background: var(--paper-2); }
.section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }

/* surfaces */
.window, .window.red, .window.gold, .window.ink, .overlay .window, .vbox { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(22, 23, 27, .04), 0 10px 30px rgba(22, 23, 27, .05); background: var(--paper-2); overflow: hidden; }
.window-bar, .window-bar.gold, .window-bar.red { background: transparent; border-bottom: 1px solid var(--line); min-height: 52px; padding: .7rem 1.1rem; font-family: var(--ui); font-weight: 600; font-size: .95rem; letter-spacing: 0; color: var(--ink); }
.window-body { padding: clamp(1rem, 2.4vw, 1.6rem); }

/* buttons, chips, fields */
.button { font-family: var(--ui); font-weight: 600; font-size: .95rem; letter-spacing: 0; border: 1px solid var(--line-strong); border-radius: 999px; box-shadow: none; background: #fff; min-height: 48px; padding: .7rem 1.3rem; gap: .8rem; justify-content: center; }
.button:hover { transform: none; box-shadow: none; background: var(--surface-2); }
.button:active { transform: translateY(1px); box-shadow: none; }
.button.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.button.primary:hover { background: #33353b; }
.button.small { min-height: 38px; padding: .45rem .95rem; font-size: .85rem; box-shadow: none; }
.button.small:hover { box-shadow: none; transform: none; }
.chip, .targets .chip { font-family: var(--ui); font-weight: 500; font-size: .85rem; letter-spacing: 0; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; min-height: 36px; padding: .35rem .85rem; }
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.field input, .field textarea, .field select, .toolbar select, .toolbar input, .story-tools select, .beat-card textarea, .pace-in input, .beat-card .actual input { border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; font-family: var(--ui); }
.field textarea, .beat-card textarea { font-family: var(--serif); }
.field input:focus, .field textarea:focus, .beat-card textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42, 82, 190, .15); }
.tabs { border: 0; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.tabs button { border: 0 !important; border-radius: 9px; background: transparent; font-family: var(--ui); font-weight: 600; font-size: .9rem; letter-spacing: 0; min-height: 40px; }
.tabs button[aria-selected="true"] { background: #fff; box-shadow: 0 1px 3px rgba(22, 23, 27, .12); }
.seg { border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.seg button { font-family: var(--ui); font-weight: 600; letter-spacing: 0; background: #fff; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.badge { border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; font-family: var(--mono); font-weight: 600; font-size: .72rem; }
.example-flag { background: var(--surface-2); border: 0; border-radius: 999px; padding: .1rem .55rem; font-family: var(--ui); }
.gap-tag { background: #fdeceb; color: var(--red-text); border-radius: 6px; font-family: var(--ui); letter-spacing: 0; }
.ai-tag { border-radius: 6px; font-family: var(--ui); letter-spacing: 0; }

/* hero example and steps */
.hx-head { font-family: var(--ui); font-weight: 600; font-size: .85rem; letter-spacing: 0; color: var(--muted); }
.hx-list li { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.hx-list b { font-family: var(--ui); font-weight: 600; font-size: .8rem; letter-spacing: 0; color: var(--muted); }
.hx-list li.gap { border: 1px dashed #e4a59f; background: #fdf6f5; }
.steps { gap: clamp(1.5rem, 4vw, 3.5rem); }
.steps li, #start .steps li { border: 0; background: transparent; padding: 0; }
.steps .step-n { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-family: var(--ui); font-weight: 700; font-size: 1rem; }
.steps h3 { font-weight: 600; }
.welcome-back { border: 0; background: var(--surface-2); border-radius: 12px; }
.progress .track2 { border: 0; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress .fill2 { background: var(--ink); }

/* workbench pieces */
.beat-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.beat-card header { background: transparent; border-bottom: 1px solid var(--line); }
.beat-card header b { font-family: var(--ui); font-weight: 600; letter-spacing: 0; font-size: .9rem; }
.tcard { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: none; }
.tcard .window-bar { min-height: 46px; }
.tcard .fit-note { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.tcard td { border-bottom: 1px solid var(--line); }
.tcard td.tb { font-family: var(--ui); font-weight: 600; letter-spacing: 0; font-size: .82rem; }
.pace { border: 1px solid var(--line); border-radius: 12px; }
.pace-row { border-bottom: 1px solid var(--line); }
.pace-row .bar { border: 0; border-radius: 999px; background: var(--surface-2); }

/* chart: hairlines, one red line */
.chart .row { border-bottom: 1px solid var(--line); }
.chart .rlabel { border-right: 1px solid var(--line); background: #fff; }
.chart .row:hover .rlabel { background: var(--surface-2); }
.chart .rlabel .n { background: var(--surface-2); color: var(--ink); border-radius: 6px; }
.chart .rlabel b { font-family: var(--ui); font-weight: 700; letter-spacing: 0; }
.chart .track { background: #fcfbf9 linear-gradient(90deg, transparent calc(25% - .5px), var(--line) calc(25% - .5px) calc(25% + .5px), transparent calc(25% + .5px) calc(50% - .5px), var(--line) calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px) calc(75% - .5px), var(--line) calc(75% - .5px) calc(75% + .5px), transparent calc(75% + .5px)); }
.chart .cell { border: 1px solid #d9d5cb; border-radius: 7px; background: #f3f1ec; font-family: var(--ui); font-weight: 500; font-size: .8rem; letter-spacing: 0; }
.chart .cell:hover { background: #ebe8e1; }
.chart .cell.hit { background: var(--hl); border-color: var(--hl-line); box-shadow: none; color: var(--ink); }
.chart .pt { font-family: var(--ui); font-weight: 500; }
.chart .pt i { width: 12px; height: 12px; top: 7px; left: 3px; border: 0; }
.chart .pt::before { background: var(--line-strong); }
.chart .pt.hit i { background: var(--red); }
.chart .group { background: var(--surface-2); color: var(--ink); font-family: var(--ui); font-weight: 700; letter-spacing: 0; font-size: .85rem; border-bottom: 1px solid var(--line); }
.chart .group span { color: var(--muted); font-weight: 500; }
.chart .acts div, .chart .acts .a2 { background: #fff; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-family: var(--ui); font-weight: 600; letter-spacing: 0; }
.chart .ruler { border-bottom: 1px solid var(--line); background: #fff; }
.chart .ruler b { color: var(--muted); font-family: var(--ui); }
.chart .playhead { width: 2px; margin-left: -1px; background: var(--red); }
.chart .playhead::before { left: -6px; width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--red); }
.slider-row { background: #fff; border-bottom: 1px solid var(--line); font-family: var(--ui); font-weight: 600; }
.slider-row input[type=range] { accent-color: var(--ink); }
.readout { border-top: 1px solid var(--line); }
.readout .t-head { font-family: var(--ui); letter-spacing: 0; color: var(--muted); }
.legend .sw.bar { border: 1px solid #d9d5cb; border-radius: 4px; background: #f3f1ec; }
.legend .sw.blank { border: 1px dashed var(--line-strong); border-radius: 4px; }
.legend .sw.line { width: 2px; background: var(--red); }
.legend { font-weight: 500; }

/* structure cards and pages */
.fcard { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; overflow: hidden; transition: box-shadow .2s ease, transform .2s ease; }
.fcard:hover { box-shadow: 0 10px 30px rgba(22, 23, 27, .08); }
.fcard .window-bar { min-height: 44px; font-size: .85rem; color: var(--muted); }
.fcard .thumb { border-bottom: 1px solid var(--line); }
.fcard .thumb .play-chip { border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; font-family: var(--ui); letter-spacing: 0; }
.fcard h3 { font-weight: 500; }
.pair > div, .pair > div + div { border: 0; background: var(--surface-2); border-radius: 12px; box-shadow: none; }
.note-box { border: 0; background: #fbf3dc; border-radius: 10px; }
.table-wrap { border: 1px solid var(--line); border-radius: 12px; box-shadow: none; overflow: hidden; }
table.beats th { background: var(--surface-2); border-bottom: 1px solid var(--line); font-family: var(--ui); letter-spacing: 0; color: var(--muted); }
table.beats td { border-bottom: 1px solid var(--line); }
table.beats td.name { font-family: var(--ui); font-weight: 600; letter-spacing: 0; }
table.beats td .eq { color: var(--muted); font-family: var(--ui); letter-spacing: 0; font-weight: 500; }
.layer-track { border: 1px solid var(--line); border-radius: 8px; }
.vbar { border-top: 1px solid var(--line); }
.feature-nav { border-top: 1px solid var(--line); }
.pop { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(22, 23, 27, .14); overflow: hidden; }
.pop .close, .overlay .close { border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; }

/* shapes */
.match { border: 1px solid var(--line); border-radius: 12px; }
.match.best { border-color: var(--ink); }
.mini { border: 1px solid var(--line); border-radius: 12px; font-family: var(--ui); font-weight: 600; letter-spacing: 0; }

/* field guide band and footer */
.cta-band { background: var(--ink); border-bottom: 0; }
.cta-band .kicker { color: #c9c7c0; }
.cta-band .button { background: transparent; color: #fff; border-color: #6a6c72; }
.cta-band .button.primary { background: #fff; color: var(--ink); border-color: #fff; }
.site-footer { border-top: 0; }
.toast { border: 0; border-radius: 12px; font-family: var(--ui); letter-spacing: 0; }
.toast-btn { border-radius: 999px; }

/* =========================================================================================
   v5: color and clear section changes. Warm paper behind white panels, darker greys,
   firmer lines. Each section owns one brand accent (a band on its top edge and the dot
   on its label); "How it works" is a deep blue band; the field guide band stays ink.
   ========================================================================================= */
:root { --paper: #f3efe6; --surface-2: #ece7dc; --line: #dcd7cc; --line-strong: #bfb9ac; --muted: #474a52;
  --bnc-blue: #234b9b; --bnc-red: #e62d24; --bnc-gold: #f6a716; --deep-blue: #1c3a7a; }
.hero { background: var(--paper); }
.hero h1 .r { color: var(--bnc-red); }
.section { position: relative; box-shadow: inset 0 6px 0 var(--sec, transparent); }
#write { --sec: var(--bnc-gold); background: #fff; }
#chart { --sec: var(--bnc-red); background: var(--paper); }
#formats { --sec: var(--bnc-blue); background: #fff; }
#shapes { --sec: var(--bnc-gold); background: var(--paper); }
#about { --sec: var(--bnc-red); background: #fff; }
.section .kicker::before { content: ""; display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--sec, var(--ink)); margin-right: .5rem; vertical-align: .05rem; }
.section .kicker { color: var(--ink); }
/* How it works: the deep blue band */
#start { background: var(--deep-blue); color: #fff; box-shadow: none; }
#start .kicker { color: #c9d6f2; }
#start .kicker::before { background: var(--bnc-gold); }
#start .section-head h2, #start h3 { color: #fff; }
#start .section-head p, #start .steps p { color: #dfe6f5; }
#start .steps .step-n { background: var(--bnc-gold); color: var(--ink); }
#start .starts .button { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
#start .starts .button:hover { background: rgba(255, 255, 255, .12); }
#start :focus-visible { outline-color: var(--bnc-gold); }
/* panels lift off the paper */
.window, .vbox, .fcard, .table-wrap { border-color: var(--line); }
#chart .window, #shapes .window { box-shadow: 0 1px 2px rgba(22, 23, 27, .06), 0 14px 34px rgba(22, 23, 27, .08); }
.fcard { background: #fff; }
#formats .fcard { border-color: var(--line-strong); }
/* chart act header: soft tints carry the four quarters */
.chart .acts .a0 { background: #fdf0c7; color: #5b4300; }
.chart .acts .a1 { background: #e3eaf7; color: #1c3a7a; }
.chart .acts .a2 { background: #fbe3df; color: #8f1d16; }
.chart .acts .a3 { background: #e9e6df; color: var(--ink); }
.chart .group { background: var(--surface-2); }
/* stronger reading contrast */
.fcard .by, .chart .rlabel span, .fw-source, .readout li .who, .hx-head, .hx-list b { color: var(--muted); }
.section-head p { color: #2b2d33; }
.cta-band { box-shadow: inset 0 6px 0 var(--bnc-gold); }
.cta-band .kicker::before { background: var(--bnc-gold); }

/* =========================================================================================
   v6: two doors. Learn (films, chart) and Write (how it works + outline), announced in the hero.
   ========================================================================================= */
.hero .shell { align-items: center; }
.hero .feature-window { margin: 0; }
.hero .feature-window .window-bar { font-size: .9rem; }
#formats { --sec: var(--bnc-blue); background: var(--paper-2); }
#chart { --sec: var(--bnc-red); background: var(--paper); }
#write { --sec: var(--bnc-gold); background: var(--paper-2); padding-top: clamp(3rem, 6vw, 5rem); }
#write .section-head { margin-bottom: 2rem; }
.start-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 1000px) { .start-grid { grid-template-columns: 1fr; } }
.start-grid .steps { grid-template-columns: 1fr; gap: 2rem; }
#oz-window { color: var(--ink); }
#oz-window .button-row { margin-top: 1rem; gap: .6rem; }
.catalog-more { grid-column: 1 / -1; display: flex; justify-content: center; padding-top: .5rem; }
#start #oz-window h3, #start #oz-window .hx-head { color: var(--muted); }

/* ---------- structure pages v7: synopsis beside the shape, the timeline graph, calm beat cards ---------- */
.sp-how { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(1.4rem, 4vw, 3.4rem); align-items: start; margin-top: 3rem; padding-top: 2.4rem; border-top: 1px solid var(--line); }
.sp-synopsis { max-width: 68ch; min-width: 0; }
.sp-synopsis .sp-h2 { margin-top: 0; }
.sp-synopsis p { margin: 1.1rem 0 0; font-family: var(--serif); font-size: 1.12rem; line-height: 1.7; color: var(--ink); }
.sp-synopsis b { font-weight: 600; }
.sp-shape { position: sticky; top: 96px; margin: 0; padding: 1rem 1rem .85rem; background: #fff; border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.sp-shape figcaption { margin: 0 0 .7rem; font-family: var(--ui); font-weight: 600; font-size: .92rem; color: var(--muted); }
.sp-shape svg { display: block; width: 100%; height: auto; border-radius: 10px; }
.fig-note { margin: .7rem 0 0; font-family: var(--ui); font-size: .85rem; color: var(--muted); }
@media (max-width: 900px) { .sp-how { grid-template-columns: 1fr; } .sp-shape { position: static; } }

.sp-tl { margin-top: 3rem; padding-top: 2.4rem; border-top: 1px solid var(--line); }
.sp-lede { max-width: 68ch; margin: .8rem 0 1.4rem; font-family: var(--serif); font-size: 1.08rem; line-height: 1.6; color: var(--muted); }
.tl { --cols: 2.4rem minmax(0, 17rem) minmax(0, 1fr); padding: .5rem 1rem .3rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.tl-axis, .tl-row, .tl-scale { display: grid; grid-template-columns: var(--cols); gap: .9rem; align-items: center; }
.tl-rows { margin: 0; padding: 0; list-style: none; }
.tl-row { padding: .5rem 0; border-top: 1px solid #efebe3; }
.tl-num { font-family: var(--mono); font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-name { min-width: 0; font-family: var(--ui); font-weight: 600; font-size: .95rem; line-height: 1.25; }
.tl-name small { display: block; margin-top: .15rem; font-weight: 500; font-size: .78rem; color: var(--muted); }
.tl-track { position: relative; height: 26px; border-radius: 6px; background: linear-gradient(90deg, #fdf0c7 0 25%, #e3eaf7 25% 50%, #fbe3df 50% 75%, #ece9e2 75% 100%); }
.tl-track::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(90deg, transparent calc(25% - .5px), rgba(22, 23, 27, .14) calc(25% - .5px) calc(25% + .5px), transparent calc(25% + .5px) calc(50% - .5px), rgba(22, 23, 27, .14) calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px) calc(75% - .5px), rgba(22, 23, 27, .14) calc(75% - .5px) calc(75% + .5px), transparent calc(75% + .5px)); }
.tl-bar { position: absolute; top: 8px; height: 10px; min-width: 6px; border-radius: 999px; background: var(--ink); }
.tl-pt { position: absolute; top: 6px; width: 14px; height: 14px; margin-left: -7px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px #fff; transform: rotate(45deg); }
.tl-axis { padding: .3rem 0 .45rem; }
.tl-acts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); font-family: var(--ui); font-weight: 700; font-size: .78rem; }
.tl-acts b { padding-left: .35rem; white-space: nowrap; overflow: hidden; }
.tl-acts .a0 { color: #5b4300; } .tl-acts .a1 { color: #1c3a7a; } .tl-acts .a2 { color: #8f1d16; } .tl-acts .a3 { color: var(--ink); }
.tl-scale { padding: .45rem 0 .25rem; border-top: 1px solid #efebe3; }
.tl-ticks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-layer { margin: 1.8rem 0 .6rem; font-family: var(--ui); font-weight: 700; font-size: 1.02rem; }
@media (max-width: 640px) {
  .tl { --cols: 1.6rem minmax(0, 1fr) minmax(0, 40%); padding: .4rem .7rem .25rem; }
  .tl-axis, .tl-row, .tl-scale { gap: .55rem; }
  .tl-name { font-size: .9rem; }
  .tl-acts .w { display: none; }
  .tl-acts b { padding-left: .2rem; font-size: .7rem; }
  .tl-ticks i:nth-child(2), .tl-ticks i:nth-child(4) { visibility: hidden; }
  .sp-synopsis p { font-size: 1.06rem; line-height: 1.66; }
}

/* beat cards on phones: hairline cards, no ink frames */
@media (max-width: 700px) {
  .table-wrap { border: 0; border-radius: 0; overflow: visible; background: none; }
  table.beats tr { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 1rem 1rem .9rem; }
  table.beats td { border: 0; }
  table.beats td .eq { margin-top: .3rem; }
  table.beats td.where { padding-top: .35rem; border-top: 1px solid #efebe3; margin-top: .35rem; }
  table.beats td.desc { margin-top: .4rem; }
}
.fw-nav { margin-top: 2.4rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .fw-nav .button { flex: 1 1 100%; justify-content: space-between; } }

/* the wordmark is Story Ruler alone, beside the arched mark */
.brand .product, .brand .product:only-of-type { font-family: var(--ui); font-weight: 800; font-size: 1.02rem; letter-spacing: .02em; color: var(--ink); border-left: 0; padding-left: 0; }
@media (max-width: 900px) { .brand .product { font-size: .98rem; } }

/* First release: a dedicated workspace and readable guide pages. */
.backup-help,.comparison-note {font-size:.88rem;line-height:1.55;color:var(--muted);margin:.8rem 0 1rem;}
.save-error {color:#8b1712!important;max-width:32ch;white-space:normal!important;font-weight:700;}
.writing-focus .wb {grid-template-columns:minmax(0,820px);justify-content:center;}
.writing-focus .wb > .window:nth-child(2) {display:none;}
.writer-page .site-header {position:relative; top:auto; z-index:50;}
.writer-page #write {padding-top:2rem;}
.writer-page .section-head {margin-bottom:1.5rem;}
.writer-page .section-head p {max-width:60ch;}
.writer-page .site-footer {padding:1.5rem 0;}
.pace .dev.reference {color:var(--ink);background:transparent;}
.pace .act.reference {background:var(--blue,#234b9b);}
.guide-page .guide-layout {display:grid;grid-template-columns:minmax(0,1.2fr) minmax(280px,.8fr);gap:3rem;align-items:start;}
.guide-page h1 {font:600 clamp(2.6rem,6vw,5rem)/1.04 'Source Serif 4',Georgia,serif;letter-spacing:-.04em;margin:1rem 0 1.5rem;max-width:13ch;}
.guide-page .lead {font:400 1.25rem/1.55 'Source Serif 4',Georgia,serif;max-width:52ch;}
.guide-page .guide-form {border:2px solid var(--ink);background:#fffdf8;padding:clamp(1.2rem,3vw,2rem);box-shadow:6px 6px 0 #dcd7cc;}
.guide-page label {display:block;font-weight:600;margin:.9rem 0 .4rem;}
.guide-page input[type=email] {width:100%;padding:.9rem;border:1px solid var(--ink);font:inherit;background:white;}
.guide-page .consent {display:flex;align-items:flex-start;gap:.6rem;font-size:.9rem;line-height:1.5;font-weight:400;}
.guide-page .consent input {margin-top:.3rem;flex-shrink:0;}
.guide-page .smallprint {font-size:.85rem;line-height:1.6;color:var(--muted);margin:1rem 0;}
.guide-page .guide-form button {width:100%;margin-top:1rem;}
.guide-page .preview-grid {display:grid;grid-template-columns:1fr 1fr;gap:2rem;margin-top:2rem;}
.guide-page .preview-grid img {display:block;width:100%;height:auto;border:1px solid #c5c0b4;background:white;}
.guide-page figure {margin:0;}
.guide-page figcaption {font-size:.9rem;line-height:1.5;margin-top:.75rem;}
.guide-page .reading {max-width:740px;margin:auto;}
.guide-page .reading h2 {margin-top:2rem;}
.guide-page .reading p {font-size:1.1rem;line-height:1.7;margin:1rem 0;}
.guide-page .section {padding-top:clamp(2.5rem,6vw,5rem);padding-bottom:clamp(2.5rem,6vw,5rem);}
@media(max-width:760px){.guide-page .guide-layout,.guide-page .preview-grid{grid-template-columns:1fr;gap:2rem}.guide-page h1{max-width:17ch}.writer-page .section-head{display:block}.save-error{font-size:.75rem}.writer-page .window-bar{gap:.5rem;align-items:flex-start;}}


/* Page sharing: part of the reading flow, with room for mobile touch targets. */
.page-share { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-top:22px; }
.share-button { min-height:46px; gap:9px; border-color:var(--blue, #234b9b); color:var(--blue, #234b9b); background:#fff; }
.share-button svg { width:20px; height:20px; flex-shrink:0; }
.share-button:hover { background:#234b9b; color:#fff; }
.share-copy { min-height:44px; border:0; padding:8px; background:transparent; color:inherit; font:inherit; font-size:13px; text-decoration:underline; text-underline-offset:4px; cursor:pointer; }
.page-share button:focus-visible, .share-url:focus-visible { outline:3px solid #234b9b; outline-offset:4px; }
.share-status, .share-note { font-size:12px; color:var(--muted, #474a52); }
.share-note { margin:8px 0 24px; }
.share-url { width:100%; padding:12px; border:1px solid #234b9b; font:inherit; }
.share-url[hidden] { display:none; }
.share-invitation { margin-top:36px; padding:24px; border:1px solid var(--line, #dcd7cc); border-left:4px solid #234b9b; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px; }
.share-invitation h2 { margin:0 0 8px; font-size:20px; }
.share-invitation p { margin:0; }
.share-invitation .page-share { margin-top:0; }
