/* Chapters 06–08: supergraphic "Span & Wave", generator, motion. Classes and ids prefixed sg-. */

.sg-cq { container-type: inline-size; }
.sg-fill { position: absolute; inset: 0; }
.sg-art { position: absolute; inset: 0; }
.sg-art > svg { display: block; width: 100%; height: 100%; }
/* a square artwork shown as a specimen, inset like the plates beside it */
.sg-art-frame { position: absolute; inset: 9%; border-radius: 6px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--bp-line-strong); }
.sg-art-frame .sg-art { inset: 0; }
.sg-mk { display: block; width: 100%; height: 100%; color: var(--bp-white); overflow: visible; }

/* ─── 06 · mark → modules → grid ───────────────────────────────────────── */
.sg-anat { width: 100%; height: 100%; display: block; }
.sg-anat text { font: 500 7px var(--mono); letter-spacing: .06em; text-transform: uppercase; fill: var(--bp-grey-quiet); }
.sg-anat .sg-lead { stroke: rgb(255 255 255 / .28); stroke-width: .6; fill: none; stroke-dasharray: 2 2; }
.sg-anat .sg-pin { fill: var(--bp-white); }

.sg-explode { position: absolute; inset: 9% 7%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6%; align-content: center; }
.sg-explode figure { margin: 0; display: grid; gap: 6px; justify-items: center; }
.sg-explode figure > div { width: 100%; aspect-ratio: 1; color: var(--bp-white); }
.sg-explode svg { display: block; width: 100%; height: 100%; }
.sg-explode figcaption { font: 9.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--bp-grey-quiet); white-space: nowrap; }

.sg-arrowline { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 16px; font: 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--bp-grey-quiet); }
.sg-arrowline i { width: 28px; height: 1px; background: var(--bp-line-strong); }

/* module alphabet */
.sg-spec { margin: 0; padding: 12px 12px 14px; border-radius: 12px; background: var(--bp-raise); box-shadow: inset 0 0 0 1px var(--bp-line); min-width: 0; }
.sg-spec-art { aspect-ratio: 1; border-radius: 8px; background: #000; box-shadow: inset 0 0 0 1px var(--bp-line); color: var(--bp-white); overflow: hidden; }
.sg-spec-art svg { display: block; width: 100%; height: 100%; transition: transform .9s var(--bb-ease); }
.sg-spec:hover .sg-spec-art svg { transform: rotate(90deg); }
.sg-spec figcaption { display: grid; gap: 3px; margin-top: 10px; }
.sg-spec figcaption b { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.sg-spec figcaption span { font: 11px/1.45 var(--mono); color: var(--bp-grey-quiet); }
.sg-spec figcaption p { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--bp-grey); }
.sg-spec .sg-n { font: 10.5px var(--mono); color: var(--bp-grey-quiet); }

/* tones */
.sg-sw { display: flex; flex-wrap: wrap; gap: 6px 12px; flex-basis: 100%; margin-top: 4px; }
.sg-sw span { display: inline-flex; align-items: center; gap: 6px; font: 11px var(--mono); color: var(--bp-grey-quiet); }
.sg-sw i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); box-shadow: inset 0 0 0 1px var(--bp-line-strong); }

/* glow share meter */
.sg-meter { flex-basis: 100%; height: 3px; margin: 4px 0 2px; border-radius: 3px; background: var(--bp-raise-3); overflow: hidden; }
.sg-meter i { display: block; height: 100%; width: var(--v); background: linear-gradient(90deg, var(--bp-violet), var(--bp-blue)); }
.sg-meter.is-over i { background: #ff453a; }

/* type over the pattern */
.sg-zone { position: absolute; border: 1px dashed rgb(245 245 247 / .4); border-radius: 2px; pointer-events: none; }
.sg-zone::before { content: "Clear zone · 4 × 3 cells"; position: absolute; top: 8px; right: 10px; font: 9.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--bp-grey-quiet); }
.sg-copy { position: absolute; display: grid; gap: 2.6cqw; }
.sg-copy h4 { margin: 0; font-size: 4.6cqw; font-weight: 700; letter-spacing: -0.04em; line-height: 1.04; color: var(--bp-white); }
.sg-copy p { margin: 0; font-size: 1.9cqw; line-height: 1.45; color: var(--bp-grey); }
.sg-copy svg.sg-wm { display: block; height: 2.4cqw; width: auto; color: var(--bp-white); }
.is-light .sg-copy h4, .sg-on-light h4 { color: var(--bp-light-ink); }
.is-light .sg-copy svg.sg-wm, .sg-on-light svg.sg-wm { color: var(--bp-light-ink); }

/* ─── formats ──────────────────────────────────────────────────────────── */
/* billboard at dusk */
.sg-bill { position: absolute; inset: 0; background: linear-gradient(180deg, #060608 0%, #0c0b12 60%, #12111a 86%, #050506 86.3%, #000 100%); }
.sg-bill::before { content: ""; position: absolute; left: 0; right: 0; top: 86%; height: 1px; background: rgb(255 255 255 / .1); }
.sg-bill-face { position: absolute; left: 12%; width: 76%; top: 12%; aspect-ratio: 3 / 1; overflow: hidden; background: #000; box-shadow: 0 0 0 .5cqw #1c1c20, 0 0 0 .7cqw #0b0b0d, 0 3cqw 6cqw -2cqw rgb(0 0 0 / .9); }
.sg-bill-face::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(255 255 255 / .07), transparent 35%); pointer-events: none; }
.sg-bill-leg { position: absolute; top: calc(12% + 25.33cqw + .7cqw); bottom: 14%; width: 1.4cqw; background: linear-gradient(90deg, #17171a, #3a3a40 50%, #141416); box-shadow: 0 .3cqw 0 -.1cqw rgb(255 255 255 / .06); }
.sg-bill-leg.a { left: 30%; } .sg-bill-leg.b { left: 68%; }
.sg-bill-cat { position: absolute; left: 14%; right: 14%; top: calc(12% + 25.33cqw + .8cqw); height: .6cqw; background: #26262a; }
.sg-bill-lamp { position: absolute; top: calc(12% - 2.2cqw); width: 3cqw; height: .8cqw; border-radius: .2cqw; background: #2a2a2e; }
.sg-bill-lamp::after { content: ""; position: absolute; left: -2cqw; right: -2cqw; top: .8cqw; height: 9cqw; background: radial-gradient(60% 100% at 50% 0%, rgb(245 245 247 / .08), transparent 70%); }
.sg-bill-lamp.a { left: 24%; } .sg-bill-lamp.b { left: 48.5%; } .sg-bill-lamp.c { left: 73%; }
.sg-bill-face .sg-copy { left: 4.5%; top: 50%; transform: translateY(-50%); width: 40%; gap: 1.6cqw; }
.sg-bill-face .sg-copy h4 { font-size: 3.6cqw; }
.sg-bill-face .sg-copy svg.sg-wm { height: 1.5cqw; }

/* poster on a wall */
.sg-wall { position: absolute; inset: 0; background: radial-gradient(90% 70% at 40% 20%, #2a2a2e, #141416 70%); }
.sg-wall::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12%; background: linear-gradient(180deg, #0f0f11, #08080a); box-shadow: 0 -1px 0 rgb(255 255 255 / .05); }
.sg-poster { container-type: inline-size; position: absolute; left: 50%; top: 9%; width: 50%; aspect-ratio: 2 / 3; transform: translateX(-50%); overflow: hidden; background: var(--bp-white);
  box-shadow: 0 1px 0 rgb(255 255 255 / .4) inset, 0 2cqw 4cqw -1cqw rgb(0 0 0 / .65), 0 .5cqw 1cqw rgb(0 0 0 / .4); }
.sg-poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgb(255 255 255 / .18), transparent 40%, rgb(0 0 0 / .06)); pointer-events: none; }
.sg-poster .sg-copy { left: 8%; right: 8%; bottom: 6%; gap: 4cqw; }
.sg-poster .sg-copy h4 { font-size: 10cqw; color: var(--bp-light-ink); }
.sg-poster .sg-copy svg.sg-wm { height: 4.4cqw; color: var(--bp-light-ink); }
.sg-poster .sg-foot { display: flex; justify-content: space-between; font: 3.2cqw var(--mono); letter-spacing: .04em; color: #6e6e73; }

/* social post */
.sg-post { container-type: inline-size; position: absolute; left: 50%; top: 50%; width: 74%; transform: translate(-50%, -50%); border-radius: 2.4cqw; overflow: hidden; background: #0b0b0d; box-shadow: inset 0 0 0 1px var(--bp-line), 0 3cqw 6cqw -2cqw rgb(0 0 0 / .8); }
.sg-post header { display: flex; align-items: center; gap: 3cqw; padding: 3.6cqw 4cqw; }
.sg-post header img { width: 9cqw; height: 9cqw; border-radius: 2.2cqw; display: block; }
.sg-post header b { display: block; font-size: 4.4cqw; font-weight: 600; color: var(--bp-white); }
.sg-post header span { display: block; font: 3.4cqw var(--mono); color: var(--bp-grey-quiet); }
.sg-post-img { position: relative; aspect-ratio: 1; overflow: hidden; container-type: inline-size; }
.sg-post-img .sg-copy { left: 7%; right: 7%; bottom: 7%; gap: 3cqw; }
.sg-post-img .sg-copy h4 { font-size: 8.6cqw; }
.sg-post-img .sg-copy p { font-size: 3.6cqw; }
.sg-post footer { display: flex; gap: 4cqw; padding: 3.4cqw 4cqw 4cqw; }
.sg-post footer i { width: 5.5cqw; height: 5.5cqw; border-radius: 50%; box-shadow: inset 0 0 0 .5cqw rgb(255 255 255 / .5); }

/* story on a phone */
.sg-phone { position: absolute; left: 50%; top: 50%; height: 88%; aspect-ratio: 9 / 19.2; transform: translate(-50%, -50%); padding: 1.6%; border-radius: 9cqw / 7cqw; background: linear-gradient(145deg, #2c2c30, #0d0d0f 60%, #1a1a1d);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12), 0 3cqw 6cqw -2cqw rgb(0 0 0 / .9); }
.sg-phone-screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 7.6cqw / 5.8cqw; background: #000; container-type: inline-size; }
.sg-phone-screen::before { content: ""; position: absolute; z-index: 2; top: 2.6%; left: 50%; width: 30%; height: 3.4%; transform: translateX(-50%); border-radius: 999px; background: #000; }
.sg-phone-screen .sg-copy { left: 9%; right: 9%; bottom: 9%; gap: 5cqw; }
.sg-phone-screen .sg-copy h4 { font-size: 11cqw; }
.sg-phone-screen .sg-copy p { font-size: 4.8cqw; }
.sg-phone-screen .sg-copy svg.sg-wm { height: 4.6cqw; }
.sg-pill { justify-self: start; display: inline-flex; align-items: center; height: 10cqw; padding: 0 6cqw; border-radius: 999px; background: var(--bp-white); color: #000; font-size: 4.6cqw; font-weight: 600; }
.sg-bars { position: absolute; z-index: 2; top: 3.4%; left: 8%; right: 8%; display: flex; gap: 1.5cqw; }
.sg-bars i { flex: 1; height: .9cqw; border-radius: 1cqw; background: rgb(255 255 255 / .35); }
.sg-bars i:first-child { background: rgb(255 255 255 / .9); }

/* do / don't plates */
.sg-tile { position: absolute; inset: 0; display: grid; }
.sg-tile svg { width: 100%; height: 100%; display: block; }
.sg-skew { position: absolute; inset: -10%; transform: rotate(-14deg) scale(1.1); }

/* ─── 07 · generator ───────────────────────────────────────────────────── */
.sg-gen { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .sg-gen { grid-template-columns: minmax(0, 1fr); } }
.sg-gen-view { min-width: 0; position: sticky; top: 116px; }
@media (max-width: 900px) { .sg-gen-view { position: static; } }
.sg-gen-stage { width: min(100%, calc(64vh * var(--arn, 3))); margin: 0 auto; transition: background .3s; }
.sg-gen-art { position: absolute; inset: 0; }
.sg-gen-art svg { display: block; }
.sg-gen-zone { position: absolute; border: 1px dashed rgb(245 245 247 / .45); border-radius: 2px; pointer-events: none; }
.is-light > .sg-gen-zone { border-color: rgb(29 29 31 / .45); }
.sg-gen-zone::before { content: "Copy area"; position: absolute; top: 6px; left: 8px; font: 9.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--bp-grey-quiet); }
.sg-gen-zone[hidden] { display: none; }
.sg-gen-panel { display: grid; gap: 18px; padding: 18px; border-radius: 16px; background: var(--bp-raise); box-shadow: inset 0 0 0 1px var(--bp-line); min-width: 0; }
.sg-field { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.sg-lab { display: flex; justify-content: space-between; gap: 8px; font: 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--bp-grey-quiet); padding: 0; }
.sg-lab output, .sg-lab span { text-transform: none; letter-spacing: 0; color: var(--bp-grey); }
.sg-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sg-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-pill-btn { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: none; box-shadow: inset 0 0 0 1px var(--bp-line-strong); color: var(--bp-grey); font: 500 12.5px var(--sans); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.sg-pill-btn:hover { color: var(--bp-white); background: rgb(255 255 255 / .06); }
.sg-pill-btn[aria-pressed="true"] { color: var(--bp-white); background: rgb(255 255 255 / .12); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .34); }
.sg-pill-btn:disabled { opacity: .35; cursor: default; pointer-events: none; }
.sg-num { width: 92px; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: #000; box-shadow: inset 0 0 0 1px var(--bp-line-strong); color: var(--bp-white); font: 500 13px var(--mono); }
.sg-icon-btn { width: 30px; padding: 0; display: inline-grid; place-items: center; }
.sg-range { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; margin: 0; background: transparent; cursor: pointer; }
.sg-range::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--bp-white) var(--v, 0%), var(--bp-line-strong) var(--v, 0%)); }
.sg-range::-moz-range-track { height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--bp-white) var(--v, 0%), var(--bp-line-strong) var(--v, 0%)); }
.sg-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgb(255 255 255 / .08); }
.sg-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
.sg-range:disabled { opacity: .35; cursor: default; }
.sg-mods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sg-mod { aspect-ratio: 1; padding: 6px; border: 0; border-radius: 10px; background: none; box-shadow: inset 0 0 0 1px var(--bp-line-strong); color: var(--bp-grey-quiet); cursor: pointer; transition: color .15s, background .15s; }
.sg-mod > span { display: block; width: 100%; height: 100%; }
.sg-mod svg { display: block; width: 100%; height: 100%; }
.sg-mod[aria-pressed="true"] { color: var(--bp-white); background: rgb(255 255 255 / .08); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .3); }
.sg-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--bp-grey); cursor: pointer; }
.sg-check input { width: 14px; height: 14px; margin: 0; accent-color: var(--bp-white); }
.sg-gen-panel .bb-btns { margin: 0; }
.sg-pill-btn:focus-visible, .sg-mod:focus-visible, .sg-num:focus-visible, .sg-range:focus-visible, .sg-check input:focus-visible { outline: 2px solid var(--bp-blue); outline-offset: 2px; }
.bb-btn:disabled { opacity: .5; cursor: progress; }

/* ─── 08 · motion ──────────────────────────────────────────────────────── */
.sg-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sg-study { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; margin: 0 0 28px; }
@media (max-width: 860px) { .sg-study { grid-template-columns: minmax(0, 1fr); } }
.sg-study h4 { margin: 0 0 6px; font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
.sg-study h4 small { margin-right: 8px; font: 11px var(--mono); color: var(--bp-grey-quiet); }
.sg-study .bb-p { margin-bottom: 14px; }
.sg-study .bb-spec { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* easing curve */
.sg-curve { width: 76%; height: auto; display: block; overflow: visible; }
.sg-curve .ax { stroke: rgb(255 255 255 / .16); stroke-width: 1; fill: none; }
.sg-curve .hd { stroke: rgb(255 255 255 / .35); stroke-width: 1; stroke-dasharray: 3 3; fill: none; }
.sg-curve .cv { stroke: var(--bp-white); stroke-width: 2.4; fill: none; stroke-linecap: round; }
.sg-curve .ln { stroke: rgb(255 255 255 / .22); stroke-width: 1.2; fill: none; stroke-dasharray: 2 4; }
.sg-curve circle { fill: #000; stroke: var(--bp-white); stroke-width: 1.4; }
.sg-curve text { font: 9px var(--mono); fill: var(--bp-grey-quiet); }
.sg-ease { display: grid; gap: 10px; padding: 14px 16px; border-radius: 12px; background: var(--bp-raise); box-shadow: inset 0 0 0 1px var(--bp-line); margin: 0 0 16px; }
.sg-track { position: relative; height: 22px; border-radius: 999px; background: #000; box-shadow: inset 0 0 0 1px var(--bp-line); }
.sg-track i { position: absolute; top: 5px; left: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--bp-white); }
.sg-track.is-lin i { background: var(--bp-grey-quiet); }
.sg-track span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 10px var(--mono); color: var(--bp-grey-quiet); }
.sg-ease.is-run .sg-track i { animation: sg-move .9s var(--bb-ease) both; }
.sg-ease.is-run .sg-track.is-lin i { animation-timing-function: linear; }
@keyframes sg-move { from { left: 5px; } to { left: calc(100% - 17px); } }

/* logo reveal */
.sg-reveal { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; }
.sg-reveal .sg-rv-mark { position: relative; width: clamp(84px, 16%, 136px); height: auto; overflow: visible; color: var(--bp-white); }
.sg-reveal .sg-rv-mark path { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.sg-reveal .sg-rv-wm { position: relative; height: clamp(18px, 2.4vw, 26px); width: auto; color: var(--bp-white); }
.sg-reveal .sg-rv-draw { stroke-dasharray: 1 1; stroke-dashoffset: 0; }
.sg-reveal .sg-rv-refl { opacity: .35; }
.sg-reveal.is-play .sg-rv-deck { animation: sg-draw .5s var(--bb-ease) both; }
.sg-reveal.is-play .sg-rv-tower { animation: sg-draw .5s .25s var(--bb-ease) both; }
.sg-reveal.is-play .sg-rv-cable { animation: sg-draw .9s .6s var(--bb-ease) both; }
.sg-reveal.is-play .sg-rv-refl { animation: sg-refl .6s 1.3s var(--bb-ease) both; }
.sg-reveal.is-play .sg-rv-wm { animation: sg-rise .6s 1.6s var(--bb-ease) both; }
.sg-reveal.is-play .sg-rv-glow { animation: sg-glow 2.2s var(--bb-ease) both; }
/* horizon light from the bottom edge, even across the frame: never a spot behind the logo */
.sg-rv-glow { position: absolute; inset: 0; background: linear-gradient(0deg, rgb(139 123 255 / .12), rgb(118 140 255 / .04) 28%, transparent 55%); pointer-events: none; }
@keyframes sg-draw { 0% { stroke-dashoffset: 1; opacity: 0; } 2% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes sg-refl { from { opacity: 0; } to { opacity: .35; } }
@keyframes sg-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sg-glow { from { opacity: 0; } to { opacity: 1; } }
.sg-timeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0 0 16px; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--bp-line); }
.sg-timeline div { padding: 12px 14px; box-shadow: inset -1px 0 0 var(--bp-line); }
.sg-timeline b { display: block; font-size: 14px; font-weight: 600; }
.sg-timeline span { display: block; margin-top: 4px; font: 11px var(--mono); color: var(--bp-grey-quiet); }
.sg-timeline i { display: block; height: 2px; margin-top: 10px; border-radius: 2px; background: linear-gradient(90deg, transparent var(--a), var(--bp-white) var(--a), var(--bp-white) var(--b), transparent var(--b)), rgb(255 255 255 / .1); }
@media (max-width: 700px) { .sg-timeline { grid-template-columns: minmax(0, 1fr); } .sg-timeline div { box-shadow: inset 0 -1px 0 var(--bp-line); } }

@media (prefers-reduced-motion: reduce) {
  .sg-reveal.is-play *, .sg-ease.is-run .sg-track i { animation: none !important; }
  .sg-ease.is-run .sg-track i { left: calc(100% - 17px); }
  .sg-spec:hover .sg-spec-art svg { transform: none; }
}
