/* Home page only. Layered on css/base.css + css/pages.css; reuses their tokens, type and buttons.
   Composition: a dark, quiet page lit by fields of channel data (see "signature" below). A
   full-screen hero with the headline at the centre of two fans of beams, sections opened by
   full-width hairlines, product visuals left unframed so their fields dissolve into the page,
   and the demo call flanked by two quieter fields. */

:root {
  --section: clamp(88px, 10vw, 140px); /* vertical rhythm between sections */
  --tile-gap: 6px;                      /* gaps inside product panels */
}

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
html.demo-open, html.demo-open body { overflow: hidden; }

.home-main { flex: 1; width: 100%; padding: 0 var(--gutter); }
.home-main section { position: relative; }
.h2 { font-size: clamp(36px, 4.2vw, 64px); line-height: .96; }
.btn-icon { width: 11px; height: 11px; margin: 0 10px 0 -2px; flex: none; }

/* ── hero: full bleed and a full screen tall; the copy centred, the demo link at its foot ── */
.hero {
  position: relative; margin-inline: calc(50% - 50vw); min-height: clamp(640px, 100svh, 1080px); overflow: hidden;
  display: grid; grid-template-rows: 1fr auto; justify-items: center; text-align: center;
  padding: calc(120px + env(safe-area-inset-top)) var(--pad) 40px;
}
.hero > :not(.hero-art) { position: relative; z-index: 1; }
.hero-copy { align-self: center; display: grid; justify-items: center; }
.hero-copy h1 { font-size: clamp(64px, 10.5vw, 176px); line-height: .9; letter-spacing: -0.035em; }
.hero-copy h1 .dim { display: block; }
.hero-copy .lede { margin-top: 36px; max-width: 44ch; }
.hero-copy .ctas { margin-top: 36px; justify-content: center; }


/* ── sections: each opens on a hairline ── */
.band, .feature, .download { border-top: 1px solid var(--line); padding-top: var(--section); padding-bottom: var(--section); }

/* ── bands (headed sections) ── */
.band-head { display: grid; gap: 18px; max-width: 760px; }
.band-head .lede { margin-top: 6px; max-width: 52ch; }

/* steps: three open columns, each led by its picture */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 56px; margin-top: 56px; }
.step { display: grid; gap: 12px; align-content: start; }
.step h3 { margin-top: 8px; font-weight: 600; font-size: 24px; line-height: 1.1; letter-spacing: -0.01em; }
.step p { font-size: 15px; line-height: 1.6; color: var(--dim); max-width: 34ch; }

/* ── feature rows: copy + a framed product panel ── */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.feature.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature.flip .feature-visual { order: -1; }
.feature-copy { display: grid; gap: 18px; justify-items: start; }
.feature-copy .lede { margin-top: 6px; max-width: 42ch; }

.panel-box { padding: clamp(8px, 1.4vw, 20px) 0; } /* unframed: the fields dissolve into the page */
.feature-visual { display: grid; gap: 28px; min-width: 0; }
/* the small uppercase names inside panels share the mono label style (.label, pages.css) */
.mini-lanes span, .stem-name, .layer-name, .fixtures span, .pad {
  font-family: var(--mono); font-weight: 400; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
}

/* song panel */
.mini-track { display: grid; gap: 12px; }
.mini-lanes { display: flex; gap: 3px; }
.mini-lanes span {
  flex: var(--w) 1 0; min-width: 0; position: relative; padding: 0 2px 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  color: var(--faint);
}
.mini-lanes span::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); }
.mini-lanes span.on { color: var(--fg); }
.mini-lanes span.on::after { height: 2px; background: var(--signal); }
.mini-wave { height: 168px; }
.readout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; border-top: 1px solid var(--line); padding-top: 20px; }
.readout div { display: grid; gap: 8px; }
.readout b, .energy-head b { font-weight: 600; font-size: 24px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.readout b.hot { color: var(--signal); }

/* instrument panel: stem lanes */
.stems { position: relative; display: grid; gap: 6px; }
.stem { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 14px; }
.stem-name { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stem-track { position: relative; height: 44px; }
.stem-track i { position: absolute; top: 6px; bottom: 6px; background: var(--fg); } /* no-JS fallback; signature.js reads and replaces these */

/* looks panel */
.presets { display: flex; flex-wrap: wrap; gap: var(--tile-gap); }
.chip { height: 34px; display: inline-flex; align-items: center; padding: 0 13px; border: 1px solid #2e3035; border-radius: 2px; font-weight: 500; font-size: 13.5px; color: var(--dim); }
.chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip.ghost { border-color: transparent; color: var(--faint); padding: 0 6px; }
.swatch-row, .energy { display: grid; gap: 14px; }
.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--tile-gap); }
.energy-head { display: flex; justify-content: space-between; align-items: baseline; }

/* rig panel */
.fixtures { list-style: none; display: grid; }
.fixtures li { display: flex; align-items: baseline; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); font-weight: 500; font-size: 16px; }
.fixtures li:first-child { padding-top: 0; }
.fixtures li:last-child { border-bottom: 0; padding-bottom: 0; }
.fixtures span { margin-left: auto; text-align: right; color: var(--faint); }

/* cue pads panel */
.pads { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--tile-gap); }
.pad {
  position: relative; isolation: isolate; aspect-ratio: 1; display: flex; align-items: flex-end; padding: 10px; min-width: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 2px; color: var(--dim);
}
.pad.on { border-color: var(--signal); color: var(--fg); }
.auto-row { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding-top: 20px; }
.auto-dot { width: 2px; height: 12px; background: var(--signal); }
.auto-text { font-size: 14px; color: var(--dim); }

/* chase creator panel: three pixel-mapped layers stacked over the chase they make. Each layer's
   name is a toggle; switching one off dims its track and takes it out of the chase row. */
.layers { display: grid; gap: 6px; }
.layer { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 14px; }
.layer-track { position: relative; height: 48px; }
.layer-name { all: unset; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg); white-space: nowrap; cursor: pointer; }
.layer-name[aria-pressed="false"] { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line); }
.layer-name:focus-visible { outline: 1px solid var(--signal); outline-offset: 4px; }
.layer.out { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.layer.out .layer-name { color: var(--dim); cursor: default; }
.layer.out .layer-track { height: 120px; }

/* ── works with: two columns split by a hairline ── */
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 72px; }
.spec { display: grid; gap: 20px; align-content: start; padding-right: clamp(24px, 4vw, 56px); }
.spec + .spec { border-left: 1px solid var(--line); padding: 0 0 0 clamp(24px, 4vw, 56px); }
.names { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 24px; }
.names li { font-weight: 600; font-size: clamp(28px, 2.8vw, 42px); letter-spacing: -0.015em; line-height: 1.1; }
.names li[data-edit] { width: 100%; margin-top: 4px; font-weight: 400; font-size: 15px; letter-spacing: 0; color: var(--dim); }
.spec p { font-size: 15px; line-height: 1.6; color: var(--dim); max-width: 44ch; }

/* ── demo band: full bleed, the call in a quiet centre column between two channel fields ── */
.demo-band {
  position: relative; overflow: hidden;
  margin-inline: calc(50% - 50vw); padding: clamp(112px, 12vw, 176px) var(--pad);
  display: grid; justify-items: center; text-align: center; gap: 18px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.demo-band > :not(.burst) { position: relative; z-index: 1; }
.demo-band h2 { font-size: clamp(48px, 7vw, 108px); line-height: .9; letter-spacing: -0.03em; }
.demo-band .lede { margin-top: 10px; max-width: 44ch; }
.demo-band .ctas { justify-content: center; margin-top: 18px; }

/* ── download ── */
.download { border-top: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px clamp(40px, 7vw, 112px); align-items: end; }
.download .lede { max-width: 40ch; }
.dl-side .ctas { margin-top: 0; }

/* ── signature: light made of data ──
   Every illustration is drawn by js/signature.js from DMX channel values: rows of fine vertical
   bars, one per channel, rising where a beam passes and falling to nothing outside it. Fields fan
   out from their sources and dissolve before the copy ([data-clear]) and before their own edges.
   It draws the hero's two fans, the three step pictures, the panel visuals (song, stem lanes,
   colour schemes, energy, cue pads) and the two fields flanking the demo band. The beams'
   look (mono, colour or aberration) is set by LOOK in js/signature.js. A [data-sig]
   element is the host; its canvas fills it. Sizes live here, the drawing lives in the JS. */
:where([data-sig]) { position: relative; display: block; }
canvas.sig { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.hero-art { position: absolute; inset: 0; }
.step-art { aspect-ratio: 16 / 10; margin-bottom: 8px; }
.swatches [data-sig] { height: 52px; border: 1px solid var(--line); border-radius: 2px; }
.swatches [data-sig].on { border-color: var(--signal); }
.energy-bar { height: 40px; }
.pad canvas.sig { z-index: -1; }
.burst { position: absolute; top: 0; bottom: 0; width: clamp(0px, calc((100% - 760px) / 2), 520px); }
.burst.l { left: 0; }
.burst.r { right: 0; }

/* ── reveal on scroll (only when JS turned it on) ── */
.reveal-on :is(.band, .feature, .demo-band, .download) > :not(.burst) { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal-on :is(.band, .feature, .demo-band, .download).shown > :not(.burst) { opacity: 1; transform: none; }
.reveal-on :is(.band, .feature, .demo-band, .download).shown > :nth-child(2) { transition-delay: .08s; }
.reveal-on :is(.band, .feature, .demo-band, .download).shown > :nth-child(3) { transition-delay: .16s; }

/* ── demo modal: the demo video ── */
.demo-modal { position: fixed; inset: 0; z-index: 50; }
.demo-modal[hidden] { display: none; }
.demo-scrim { position: absolute; inset: 0; background: rgba(8,9,10,0.94); opacity: 0; transition: opacity .25s ease; }
/* the panel takes the video's 16:9 shape, as large as fits, so there are no bars around it */
.demo-panel {
  --gap: clamp(10px, 1.6vw, 24px);
  position: absolute; left: 0; right: 0; top: 0; bottom: 0; margin: auto; overflow: hidden;
  width: min(100vw - 2 * var(--gap), (100vh - 2 * var(--gap)) * 16 / 9); height: auto; aspect-ratio: 16 / 9;
  border: 1px solid var(--line); background: var(--bg);
  opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease;
}
.demo-modal.in .demo-scrim, .demo-modal.in .demo-panel { opacity: 1; transform: none; }
.demo-video { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; object-fit: contain; background: #000; cursor: pointer; opacity: 0; transition: opacity .6s ease; }
.demo-panel.ready .demo-video { opacity: 1; }
.demo-close {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; z-index: 2;
  width: 34px; height: 34px; display: grid; place-items: center;
  color: var(--fg); border: 1px solid #383b40; border-radius: 2px; background: var(--bg); transition: border-color .2s;
}
.demo-close:hover { border-color: var(--dim); }
.demo-credit {
  position: absolute; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 2; pointer-events: none;
  padding: 5px 8px; border-radius: 2px; background: rgba(8,9,10,0.72);
  font-family: var(--sans); font-size: 12.5px; color: var(--dim);
}
.demo-close svg { width: 14px; height: 14px; }

/* ── responsive ── */
@media (max-width: 1080px) {
  .steps { grid-template-columns: 1fr; row-gap: 48px; }
  .step-art { aspect-ratio: 16 / 7; }
}
@media (max-width: 860px) {
  .burst { display: none; }
  .feature, .feature.flip, .download, .specs { grid-template-columns: 1fr; }
  .feature.flip .feature-visual { order: 0; }
  .spec { padding: 0 0 36px; }
  .spec + .spec { border-left: 0; border-top: 1px solid var(--line); padding: 36px 0 0; }
  .demo-panel { --gap: 0px; border: 0; }
}
@media (max-width: 560px) {
  .hero { padding-top: calc(104px + env(safe-area-inset-top)); padding-bottom: 28px; }
  .hero-copy h1 { font-size: clamp(56px, 17vw, 76px); }
  .hero-copy .lede, .hero-copy .ctas { margin-top: 24px; }
  .hero-copy .ctas .btn { justify-content: center; }
  .step-art { aspect-ratio: 16 / 9; }
  .stem { grid-template-columns: 48px minmax(0, 1fr); }
  .layer { grid-template-columns: 62px minmax(0, 1fr); gap: 10px; }
  .swatches [data-sig] { height: 44px; }
  .pad { padding: 7px; font-size: 8.5px; letter-spacing: .02em; }
  .fixtures span { display: none; }
  .download .ctas .btn { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
