/* Normal scrolling pages (home, Explore, Contact): page frame, solid top bar, shared bits,
   footer, then the Explore and Contact layouts. Layered on css/base.css. */

html, body { min-height: 100%; overflow-x: hidden; }
body.page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }

/* ── top bar: solid ground, lined up with the content width, closed by a hairline ── */
body.page .top { padding-left: var(--gutter); padding-right: var(--gutter); }
body.page .top::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
body.page .brand { min-width: 120px; }
.links a[aria-current="page"] { color: var(--fg); }

/* ── shared label style: small mono capitals ── */
.label, .eyebrow {
  font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint);
}

/* ── page frame ── */
.page-main {
  flex: 1; width: 100%;
  padding: calc(156px + env(safe-area-inset-top)) var(--gutter) 120px;
}
.page-head { display: grid; gap: 24px; max-width: 820px; }
.page-head h1 { font-size: clamp(56px, 8vw, 116px); line-height: .9; letter-spacing: -0.03em; }
.page-head .lede { margin-top: 0; max-width: 46ch; }

/* square transport button (Explore track, preview, the home demo tile) */
.play-btn {
  flex: none; display: grid; place-items: center; border-radius: 2px; color: var(--fg); cursor: pointer;
  border: 1px solid #383b40; background: var(--bg); transition: border-color .2s;
}
.play-btn:hover { border-color: var(--dim); }
.play-btn .i-pause, .play-btn.on .i-play { display: none; }
.play-btn.on .i-pause { display: block; }

/* ── Explore head: title on the left, the shared song track on the right (wraps under) ── */
.explore-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 40px 72px; }
.explore-head .page-head { flex: 0 1 auto; }
.sync { flex: 1 1 520px; max-width: 760px; display: flex; align-items: flex-end; gap: 16px; }
.sync-track { flex: 1; min-width: 0; }
.sync-play { width: 42px; height: 42px; margin-bottom: -4px; }
.sync-play svg { width: 14px; height: 14px; }
/* the shared track draws in cue colours; on these pages it stays monochrome */
.page .track .wave canvas { filter: grayscale(1); }
.page .track .lane .prog { background: var(--fg); }
.page .track .lane.on .prog { box-shadow: none; }

/* ── Explore grid: 3 across, the second row of 2 centred ── */
.grid { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 56px 24px; margin-top: 96px; padding-top: 48px; border-top: 1px solid var(--line); }
.grid .card { grid-column: span 2; }
.grid .card:nth-child(4) { grid-column: 2 / span 2; }
.card { display: flex; flex-direction: column; gap: 14px; }
.card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--raise); border: 1px solid var(--line); transition: border-color .2s; }
.card:hover .card-media { border-color: #383b40; }
.card h2 { font-weight: 500; font-size: 19px; line-height: 1.2; letter-spacing: -0.01em; margin-top: 4px; }
.card p { font-size: 14.5px; line-height: 1.55; color: var(--dim); max-width: 40ch; margin-top: -6px; }

/* clickable cards */
.grid .card { cursor: pointer; outline: none; }
.grid .card:focus-visible .card-media { outline: 1px solid var(--fg); outline-offset: 3px; }

/* ── Explore: card preview (dims the page; set box, info panel, song track) ── */
.preview { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: var(--pad); }
.preview[hidden] { display: none; }
.preview-scrim { position: absolute; inset: 0; background: rgba(8,9,10,0.9); opacity: 0; transition: opacity .22s ease; }
.preview-panel {
  position: relative; width: min(1180px, 100%); height: min(720px, calc(100svh - 2 * var(--pad)));
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr) auto; gap: 24px 32px;
  padding: 24px; border: 1px solid var(--line); background: var(--bg);
  opacity: 0; transform: translateY(8px); transition: opacity .22s ease, transform .22s ease;
}
.preview.in .preview-scrim, .preview.in .preview-panel { opacity: 1; transform: none; }
body.preview-open { overflow: hidden; }

.preview-set { aspect-ratio: auto; display: grid; place-items: center; }
.preview-play { width: 64px; height: 64px; }
.preview-play svg { width: 18px; height: 18px; }

.preview-info { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 6px 4px 0 0; min-width: 0; }
.preview-title { font-weight: 600; font-size: clamp(28px, 2.6vw, 40px); line-height: 1; letter-spacing: -0.02em; padding-right: 44px; }
.preview-text { font-size: 15px; line-height: 1.6; color: var(--dim); }
.preview-close {
  position: absolute; top: 0; right: 0; width: 34px; height: 34px; display: grid; place-items: center;
  color: var(--dim); border: 1px solid #383b40; border-radius: 2px; transition: color .2s, border-color .2s;
}
.preview-close:hover { color: var(--fg); border-color: var(--fg); }
.preview-close svg { width: 14px; height: 14px; }
.preview-track { grid-column: 1 / -1; }

/* ── Contact ── */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: clamp(40px, 7vw, 112px); align-items: start; }
.mail { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); max-width: 38ch; }
.mail .label { display: block; margin-bottom: 10px; }
.mail-line { font-size: 18px; font-weight: 500; }

.form { display: flex; flex-direction: column; gap: 22px; padding-top: 8px; }
.field { display: flex; flex-direction: column; gap: 10px; }
/* fields are an underline only */
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 17px; color: var(--fg);
  background: transparent; border: 0; border-bottom: 1px solid #383b40; border-radius: 0;
  padding: 8px 0 12px; outline: none; transition: border-color .2s;
}
.field input { height: 48px; }
.field textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.field input:hover, .field textarea:hover { border-color: var(--dim); }
.field input:focus, .field textarea:focus { border-color: var(--signal); }
.form-row { display: flex; align-items: center; justify-content: flex-start; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.thanks { display: none; padding: 32px; border: 1px solid var(--line); background: var(--raise); }
.thanks h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1; }
.thanks p { margin-top: 12px; font-size: 14.5px; line-height: 1.55; color: var(--dim); }
.thanks:focus { outline: none; }
.sent .form { display: none; }
.sent .thanks { display: block; }

/* ── footer ── */
.page-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  margin: 0 var(--gutter); padding: 28px 0 calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint);
}

/* ── responsive ── */
@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid .card, .grid .card:nth-child(4) { grid-column: auto; }
}
@media (max-width: 860px) {
  .preview { padding: 12px; }
  .preview-panel { grid-template-columns: 1fr; grid-template-rows: auto auto auto; height: auto; max-height: calc(100svh - 24px); overflow-y: auto; gap: 18px; padding: 16px; }
  .preview-set { aspect-ratio: 16 / 10; }
  /* the nav drops to a second row of the bar */
  body.page .top { flex-wrap: wrap; row-gap: 12px; }
  body.page .links { order: 3; width: 100%; justify-content: space-between; gap: 0; padding-top: 12px; border-top: 1px solid var(--line); }
  .page-main { padding-top: calc(150px + env(safe-area-inset-top)); }
  .contact { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .page-main { padding-bottom: 72px; }
  .page-head { gap: 16px; }
  .page-head h1 { font-size: clamp(48px, 15vw, 72px); }
  .grid { grid-template-columns: 1fr; gap: 40px; margin-top: 56px; padding-top: 32px; }
  .form-row .btn { width: 100%; justify-content: center; }
}
