/**
 * @file build-story.css
 * @author Jouni Miikki
 * SPDX-License-Identifier: MIT
 * @description The build-story page (bs- prefix, views/build-story.js): four beats told in the
 *   showroom's language, a rail of the four that sticks to the side and lights the beat on
 *   screen, and the generator open at the end. Shares its vocabulary with landing-showroom.css
 *   (.ld-sh-h2, .ld-sh-text, .ld-sh-box, .ld-sh-btn, .ld-sh-sticker, .ld-sh-door), which is the
 *   point: the story and the front page are one voice.
 * @version-history
 *   v1.0.0 — 2026-08-28 — Initial.
 */
.bs-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 3.5rem; align-items: end; padding: 2.5rem 0 1.5rem; }
.bs-head-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 1.1rem; }
.bs-title {
  margin: 0; font-family: var(--font-showroom); font-weight: 400; text-transform: uppercase;
  font-size: clamp(2rem, 4.6vw, 4.2rem); line-height: .98; color: var(--text); text-shadow: .08em .08em 0 var(--accent);
  display: flex; flex-direction: column;
}
.bs-lead { margin: 0; max-width: 40rem; font-family: var(--font-showroom-body); font-size: 1.1rem; line-height: 1.55; font-weight: 600; }

/* The rail: a dark slab in the head, and it sticks near the top once the head has scrolled by. */
.bs-rail {
  position: sticky; top: 1rem; display: flex; flex-direction: column; gap: .55rem;
  padding: 1.25rem 1.5rem; background: var(--text); color: var(--bg); border: 3px solid var(--text); box-shadow: 8px 8px 0 var(--sun);
}
.bs-rail-label { font-family: var(--font-showroom); text-transform: uppercase; font-size: .72rem; color: var(--sun); margin-bottom: .2rem; }
.bs-rail-item { display: flex; align-items: center; gap: .6rem; font-family: var(--font-showroom-body); font-size: 1rem; font-weight: 800; color: var(--bg); text-decoration: none; opacity: .55; }
.bs-rail-item:hover, .bs-rail-item.is-on { opacity: 1; }
.bs-rail-item.is-on .bs-rail-num { background: var(--sun); color: #1A1A2E; }
.bs-rail-num { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; font-family: var(--font-showroom); font-size: .8rem; border: 2px solid var(--sun); color: var(--sun); }

/* A beat: copy on one side, the picture on the other, flipped every other time. */
.bs-beat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3.5rem; align-items: center; padding: 3.5rem 0; border-top: 3px solid var(--text); scroll-margin-top: 1rem; }
.bs-beat-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 1.1rem; }
.bs-num { font-family: var(--font-showroom); font-size: 4rem; line-height: 1; color: var(--accent); text-shadow: 4px 4px 0 var(--text); }
.bs-picture {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  border: 4px solid var(--text);
}
.bs-picture--sun { box-shadow: 12px 12px 0 var(--sun); transform: rotate(1.2deg); }
.bs-picture--coral { box-shadow: -12px 12px 0 var(--accent); transform: rotate(-1.2deg); }
.bs-picture--ink { box-shadow: 12px 12px 0 var(--text); transform: rotate(1deg); }
.bs-picture--small { max-width: 420px; box-shadow: 8px 8px 0 var(--sun); transform: rotate(-1deg); margin-top: .5rem; }

/* Beat 1: the idea box is a door to the builder at the bottom, drawn as the box it leads to. */
.bs-ideabox {
  display: block; width: 100%; box-sizing: border-box; min-height: 5.5rem; padding: 1rem 1.1rem;
  font-family: var(--font-showroom-body); font-size: 1rem; font-weight: 600; font-style: italic; color: var(--text-dim); text-decoration: none;
  border: 3px solid var(--text); background: var(--card-bg); box-shadow: 6px 6px 0 var(--accent);
}
.bs-ideabox:hover { color: var(--accent); }
.bs-tracks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; width: 100%; }
.bs-track { display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1rem; border: 3px solid var(--text); background: var(--card-bg); box-shadow: 4px 4px 0 var(--text); }
.bs-track--new { box-shadow: 4px 4px 0 var(--accent); }
.bs-track-name { font-family: var(--font-showroom); text-transform: uppercase; font-size: .85rem; }
.bs-track-desc { font-family: var(--font-showroom-body); font-size: .9rem; line-height: 1.5; color: var(--text-dim); }

/* Beat 2: what the prompt contains, its first lines, and the one button. */
.bs-promptbox { display: flex; flex-direction: column; gap: .7rem; width: 100%; box-sizing: border-box; padding: 1rem 1.1rem; border: 3px solid var(--text); background: var(--card-bg); box-shadow: 6px 6px 0 var(--text); }
.bs-promptbox-label { font-family: var(--font-showroom); text-transform: uppercase; font-size: .72rem; color: var(--text-dim); }
.bs-chips { display: flex; flex-wrap: wrap; gap: .5rem; font-family: var(--font-showroom-body); font-size: .82rem; font-weight: 800; }
.bs-chips span { padding: .25rem .6rem; border: 2px solid var(--text); }
.bs-prompt-preview {
  margin: 0; max-height: 7rem; overflow: hidden; padding-top: .6rem; border-top: 1px solid var(--border);
  font-family: var(--font-mono); font-size: .75rem; line-height: 1.5; color: var(--text-dim); white-space: pre-wrap; word-break: break-word;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.bs-copy { align-self: flex-start; }
.bs-beat .mgd-note { width: 100%; }

/* Beat 3: two doors. */
.bs-doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; width: 100%; }
.bs-door { display: flex; flex-direction: column; gap: .5rem; padding: 1.25rem; border: 3px solid var(--text); background: var(--card-bg); }
.bs-door--coral { box-shadow: 6px 6px 0 var(--accent); }
.bs-door--ink { box-shadow: 6px 6px 0 var(--text); }
.bs-door-title { font-family: var(--font-showroom); text-transform: uppercase; font-size: .9rem; }
.bs-door-text { font-family: var(--font-showroom-body); font-size: .95rem; line-height: 1.55; }
.bs-door-btn { font-size: .85rem; align-self: flex-start; margin-top: .4rem; }
.bs-door .ld-sh-door { align-self: flex-start; margin-top: .4rem; }

/* Beat 4: the wall, with the visitor's card second. */
.bs-wallmock { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; padding: .5rem; }
.bs-card { display: flex; flex-direction: column; gap: .4rem; padding: 1rem 1.1rem; background: var(--card-bg); border: 3px solid var(--text); box-shadow: 6px 6px 0 var(--accent); }
.bs-card:nth-child(1) { box-shadow: 6px 6px 0 var(--text); transform: rotate(.6deg); }
.bs-card:nth-child(3) { box-shadow: 6px 6px 0 var(--sun); transform: rotate(-.6deg); }
.bs-card--mine { outline: 4px solid var(--sun); outline-offset: 4px; }
.bs-card-shot { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 2px solid var(--text); background: var(--bg-surface); }
.bs-card-shot--empty { background: repeating-linear-gradient(135deg, var(--bg-surface) 0 10px, var(--card-bg) 10px 20px); }
.bs-card-name { font-family: var(--font-showroom-body); font-size: 1rem; font-weight: 800; }
.bs-card-desc { font-family: var(--font-showroom-body); font-size: .8rem; color: var(--text-dim); }
.bs-wall-sticker { top: 38%; left: 46%; }

/* The builder, open, at the end. */
.bs-builder { display: flex; flex-direction: column; gap: .9rem; margin: 0 0 1rem; padding: 2.5rem 2.75rem; background: var(--bg-surface); border: 3px solid var(--text); box-shadow: 8px 8px 0 var(--accent); scroll-margin-top: 1rem; }
.bs-builder-lead { color: var(--text-dim); }
.bs-builder .ld-invite { max-width: none; margin: .5rem 0 0; }

@media (max-width: 900px) {
  .bs-head { grid-template-columns: 1fr; gap: 1.5rem; }
  .bs-rail { position: static; box-shadow: 6px 6px 0 var(--sun); }
  .bs-beat { grid-template-columns: 1fr; gap: 1.5rem; padding: 2.5rem 0; }
  .bs-beat--flip .bs-picture, .bs-beat--flip .bs-wallmock { order: 2; }
  .bs-picture { box-shadow: 8px 8px 0 var(--sun); }
  .bs-picture--coral { box-shadow: -8px 8px 0 var(--accent); }
  .bs-picture--ink { box-shadow: 8px 8px 0 var(--text); }
}
@media (max-width: 600px) {
  .bs-tracks, .bs-doors { grid-template-columns: 1fr; }
  .bs-builder { padding: 1.5rem 1.1rem; }
  .bs-num { font-size: 3rem; }
}
