/* sax.llc — multiverse hero (SPAN experiment). The hero is a phantom building: slabs are its
   front faces, coloured like the ground so they hide the paint behind them; the SVG behind
   draws the ground paint and the 45° returns. Text never sits on paint. */

.mv { position: relative; overflow: clip; isolation: isolate; background: var(--color-bg); }
.mv-stick { position: relative; overflow: hidden; }
.mv-stage, .mv-paint { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; pointer-events: none; }
.mv-paint text { font-family: "Archivo", system-ui, sans-serif; font-weight: 900; letter-spacing: -0.02em; }
.mv-paint .f-c1 { fill: var(--c1); }
.mv-paint .f-c2 { fill: var(--c2); }
.mv-paint .f-c3 { fill: var(--c3); }
.mv-paint .f-ground { fill: var(--ground); }
.mv-paint .night { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mv-paint .night { display: inline; } }
:root[data-theme="dark"] .mv-paint .night { display: inline; }
.mv + .band, .mv + section { border-top: 0; }

.mv-grid {
  position: relative; z-index: 1; display: grid; gap: 16px; align-content: start;
  grid-template-columns: minmax(0, 1fr);
  padding: 24px var(--edge) 72px; min-height: calc(100svh - 58px);
}
.slab, .ln { background: var(--color-bg); color: var(--color-text); }
.slab { padding: 12px 14px; margin: 0; }
.mv-label { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 8px; }
.mv-kick { justify-self: start; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }

/* — the title as a type score: scale jumps, widths fight, lines step off the grid — */
.mv-title { min-width: 0; margin: 8px 0; display: grid; justify-items: start; font-size: 16px; line-height: 1; letter-spacing: 0; }
.ln {
  display: block; margin-left: calc(var(--in, 0) * 5%); padding: 0.02em 0.06em 0;
  font-family: "Archivo", system-ui, sans-serif; font-weight: 900; line-height: 0.84; letter-spacing: -0.035em; white-space: nowrap;
}
.s-xl { font-size: clamp(56px, min(26vw, 17svh), 248px); font-stretch: 125%; text-transform: uppercase; }
.s-l { font-size: clamp(52px, min(22vw, 16svh), 232px); font-stretch: 62%; text-transform: uppercase; }
.s-m { font-size: clamp(34px, min(7.5vw, 9svh), 120px); font-stretch: 100%; }
.s-s { font-size: clamp(24px, min(4.5vw, 5.5svh), 64px); font-stretch: 75%; letter-spacing: -0.02em; }
.s-mono {
  font-family: var(--font-mono); font-weight: 500; font-size: clamp(12px, 1.1vw, 15px); font-stretch: 100%;
  letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.3; padding: 6px 8px; margin-block: 10px;
}

/* — rooms — */
.mv-row { display: grid; gap: 16px; align-items: end; }
.mv-lede { font-size: 17px; line-height: 1.45; font-weight: 600; max-width: 36ch; }
.mv-index ol, .mv-site ol { list-style: none; margin: 0; padding: 0; }
.mv-index li a {
  display: grid; grid-template-columns: 3ch 1fr; gap: 8px; padding: 7px 0; text-decoration: none; color: inherit;
  font-weight: 700; font-size: 15px; line-height: 1.25; border-top: 1px solid var(--color-divider);
}
.mv-index li a:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.mv-index .n, .mv-site .n { font-family: var(--font-mono); font-weight: 400; color: var(--ink-muted); }
.mv-more { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.mv-act { display: grid; gap: 12px; }
.mv-act .btn-block { margin: 0; justify-content: space-between; }
.mv-act .chords { margin: 0; font-size: 10px; }
.mv-act .chords button { padding: 3px 6px; }

.mv-site { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.mv-site ol { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.mv-site a { color: inherit; text-decoration: none; display: inline-flex; gap: 6px; padding: 3px 4px; }
.mv-site a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mv-site a[aria-current="page"] { background: var(--color-text); color: var(--color-bg); }
.mv-site a[aria-current="page"] .n { color: inherit; }
.mv-idea { margin: 10px 0 0; font-family: "Archivo", system-ui, sans-serif; font-weight: 900; font-size: 15px; letter-spacing: -0.01em; text-transform: none; line-height: 1.15; }

/* home rooms */
.mv-proof { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mv-proof .num { display: block; font-family: "Archivo", system-ui, sans-serif; font-weight: 900; font-stretch: 62%; font-size: clamp(26px, 2.2vw, 40px); line-height: 0.9; letter-spacing: -0.02em; }
.mv-proof .lbl { display: block; font-size: 11.5px; line-height: 1.3; margin-top: 6px; color: var(--ink-muted); }
.mv-doors { display: grid; gap: 12px; }
.mv-door { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; text-decoration: none; color: inherit; font-weight: 900; font-size: 20px; line-height: 1.05; min-height: 84px; }
.mv-door .k { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 6px; }
.mv-door:hover { outline: 2px solid var(--color-text); outline-offset: -2px; }

@media (min-width: 720px) {
  .mv-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mv-row > :nth-child(even) { margin-bottom: 40px; }
}
@media (min-width: 1040px) {
  .mv-grid { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr auto; column-gap: 32px; row-gap: 12px; padding-bottom: 64px; }
  .mv-kick { grid-area: 1 / 1; }
  .mv-title { grid-area: 2 / 1; align-self: center; }
  .mv-row { grid-area: 3 / 1; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
  .mv-row > :nth-child(even) { margin-bottom: 56px; }
  .mv-row > :nth-child(3) { margin-bottom: 24px; }
  .mv-site { grid-area: 1 / 2 / 4 / 3; writing-mode: vertical-rl; justify-self: end; align-self: start; padding: 14px 12px; }
  .mv-site ol { flex-wrap: nowrap; gap: 18px; }
  .mv-idea { margin: 0 14px 0 0; font-size: 17px; }
  .ln { margin-left: calc(var(--in, 0) * 9%); }
  .mv.home .mv-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mv.home .mv-row > :nth-child(even) { margin-bottom: 32px; }
}

@media (min-width: 1280px) {
  .mv.home .mv-row { grid-template-columns: 1.1fr 1.5fr 0.9fr 1fr 1fr; }
  .mv--labels.home .mv-row { grid-template-columns: 1.1fr 1.6fr 1fr 1fr; }
}

/* — the anamorphic stage (src/span/stage.ts) — */
@media (min-width: 1040px) and (min-height: 680px) {
  .mv { height: 185svh; }                     /* the hero holds while the ceiling city folds down */
  .mv-stick { position: sticky; top: 0; height: 100svh; }
  .mv-grid { min-height: 100%; }
}
.mv-sky { position: absolute; inset: 0; z-index: 1; pointer-events: none; display: none; }
.mv--labels .mv-sky { display: block; }
.mv-sky-n {
  position: absolute; left: 0; top: 0; margin: -24px 0 0 -12px; padding: 2px 5px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; background: var(--color-bg); color: var(--ink-muted);
}
.mv--labels .mv-index { display: contents; }
.mv--labels .mv-index > .mv-label, .mv--labels .mv-index > .mv-more {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.mv--labels .mv-index ol { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.mv--labels .mv-index li { position: absolute; left: 0; top: 0; }
.mv--labels .mv-index li a {
  pointer-events: auto; position: relative; display: inline-grid; grid-template-columns: auto auto; gap: 8px;
  transform: translate(-50%, calc(-100% - 18px)); white-space: nowrap; border: 0;
  padding: 7px 10px; background: var(--color-bg); font-size: 14px;
}
.mv--labels .mv-index li a::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 18px; background: var(--color-text); }
.mv--labels .mv-index li a:hover { background: var(--color-text); color: var(--color-bg); }
.mv--labels .mv-index li a:hover .n { color: inherit; }
.mv-hint {
  display: none; position: absolute; left: var(--edge); bottom: 16px; z-index: 2; padding: 6px 10px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
}
.mv--3d .mv-hint { display: block; }
.mv-hint-on { display: none; }
.mv-hint.on { background: var(--color-text); color: var(--color-bg); }
.mv-hint.on .mv-hint-on { display: inline; }
.mv-hint.on .mv-hint-off { display: none; }
@media (prefers-reduced-motion: reduce) { .mv-hint { display: none !important; } }

/* — the portal: a chord switch opens the next universe through SPAN rings — */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: sg-portal 900ms cubic-bezier(0.7, 0, 0.2, 1) both; }
@keyframes sg-portal {
  from { clip-path: circle(0 at var(--px, 50%) var(--py, 50%)); }
  to { clip-path: circle(150vmax at var(--px, 50%) var(--py, 50%)); }
}
.sg-ring {
  position: fixed; left: var(--px, 50%); top: var(--py, 50%); z-index: 100; pointer-events: none;
  width: 0; height: 0; border-radius: 50%; transform: translate(-50%, -50%);
  box-shadow: inset 0 0 0 8px var(--c1), inset 0 0 0 16px var(--ground), inset 0 0 0 24px var(--c2),
    inset 0 0 0 32px var(--ground), inset 0 0 0 40px var(--c3);
  animation: sg-ring 900ms cubic-bezier(0.7, 0, 0.2, 1) both;
}
@keyframes sg-ring { from { width: 0; height: 0; } to { width: 300vmax; height: 300vmax; } }
@media (prefers-reduced-motion: reduce) { .sg-ring { display: none; } }
