/*
 * ILELAN homepage v2 (owner's brief, 2026-10-24; branch site/homepage-v2): the product in the first seconds. Only the
 * homepage's own styles; the shared ones (header, buttons, doors, tokens' scales) stay in assets/site.css, colours come
 * from assets/tokens.css (the cream below is mixed from two of them, no new colour).
 *
 * Black is stage, not field (owner's rule for this page, 2026-10-24): the only dark areas are the hero and the closing
 * Visit / Build band (and the footer under it, where the dots live). Everything between is warm cream, and the colour on
 * it comes from the buildings' own light and materials (their pictures and films). Precise and restrained, never empty
 * or cold: hairlines, generous space, exact type, one idea per section.
 */
.home-v2 {
  /* Warm cream: the lobby's warm white light thinned with the interface's white. */
  --cream: color-mix(in srgb, var(--lobby-light) 45%, var(--ui-white));
  --cream-deep: color-mix(in srgb, var(--lobby-light) 80%, var(--ui-white));
  --ink-on-cream: var(--matte-black);
  --ink-on-cream-2: color-mix(in srgb, var(--steel-dark) 80%, var(--matte-black));
  --ink-on-cream-3: color-mix(in srgb, var(--steel-dark) 70%, var(--cream));
  --cream-line: color-mix(in srgb, var(--matte-black) 12%, transparent);
  --cream-line-strong: color-mix(in srgb, var(--matte-black) 30%, transparent);
  --cream-frost: color-mix(in srgb, var(--cream) 82%, transparent);
  background: var(--void);
}
.home-v2 body { background: var(--cream); }
.home-v2 .page.landing { background: transparent; }
/* The page fills its sections edge to edge; the content keeps to the site's container. */
.hv-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; }

/* ---------- 1. The hero: Buffft's palazzo, live ---------- */
.hv-hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; background: var(--void); color: var(--ink); isolation: isolate; }
.hv-hero .hv-media, .hv-hero .hv-media > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.hv-media img, .hv-media video, .hv-media canvas { display: block; object-fit: cover; object-position: 50% 50%; }
.hv-media picture { display: block; }
/* The live render and the film fade up over the poster once their first frame is on screen; the poster stays the picture
   with reduced motion, without WebGL2 or a film, and while either is still on its way. */
.hv-gl, .hv-film { opacity: 0; transition: opacity var(--long) var(--ease-out); }
.hv-hero.is-live .hv-gl, .hv-hero.is-film .hv-film { opacity: 1; }
/* Legibility: the void under the words, nothing over the building. */
.hv-shade { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(180deg, color-mix(in srgb, var(--void) 52%, transparent) 0%, transparent 16%, transparent 52%, color-mix(in srgb, var(--void) 62%, transparent) 76%, color-mix(in srgb, var(--void) 88%, transparent) 100%); }
.hv-copy { position: absolute; left: var(--gutter); right: var(--gutter); bottom: max(40px, calc(28px + env(safe-area-inset-bottom))); z-index: 3; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-4); max-width: 720px; }
/* The wordmark is the headline (§6: Michroma only for the wordmark). */
.hv-mark { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(40px, 8vw, 112px); line-height: 1; letter-spacing: 0.18em; margin-right: -0.18em; color: var(--ink); }
.hv-line { margin: 0; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.4; font-weight: 400; letter-spacing: -0.005em; color: var(--ink); text-wrap: balance; }
.hv-actions { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-2); }
/* The one primary control: a lit pill, as the building's own "Enter the building" (vime's entry screen). */
.hv-enter { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; min-width: 148px; padding: 0 30px; border: 1px solid transparent; border-radius: 999px; background: var(--ui-white); color: var(--matte-black); font-family: var(--sans); font-size: 16px; font-weight: 500; line-height: 1; letter-spacing: 0.01em; text-decoration: none; cursor: pointer; transition: background var(--beat) var(--ease-out), color var(--beat) var(--ease-out), border-color var(--beat) var(--ease-out); }
.hv-enter:hover, .hv-enter:focus-visible { color: var(--matte-black); background: color-mix(in srgb, var(--ui-white) 82%, var(--lobby-light)); }
.hv-enter:active { background: color-mix(in srgb, var(--ui-white) 70%, var(--lobby-light)); transition-duration: var(--quick); }
.hv-enter .go-arrow { width: 7px; height: 7px; }
.hv-enter:hover .go-arrow, .hv-enter:focus-visible .go-arrow { transform: translateX(3px) rotate(45deg); }

/* ---------- the cream between ---------- */
.hv-sec { position: relative; background: var(--cream); color: var(--ink-on-cream); padding: var(--sec-y) var(--gutter); }
.hv-sec + .hv-sec { padding-top: 0; }
.hv-sec .hv-wrap { border-top: 1px solid var(--cream-line); padding-top: var(--s-7); }
.hv-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-5); margin-bottom: var(--s-7); }
.hv-h { margin: 0; font-family: var(--sans); font-weight: 500; font-size: clamp(28px, 3vw, 40px); line-height: 1.12; letter-spacing: -0.015em; color: var(--ink-on-cream); text-wrap: balance; }
.hv-sub { margin: 0; max-width: 32em; font-size: var(--t-ui); line-height: 1.5; color: var(--ink-on-cream-2); }
/* Controls on cream: an ink pill (the primary), the chevron that steps forward. */
.hv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 24px; border: 1px solid var(--matte-black); border-radius: 999px; background: var(--matte-black); color: var(--ui-white); font-family: var(--sans); font-size: var(--t-ui); font-weight: 500; line-height: 1; letter-spacing: 0.01em; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background var(--beat) var(--ease-out), border-color var(--beat) var(--ease-out), color var(--beat) var(--ease-out); }
.hv-btn:hover, .hv-btn:focus-visible { background: var(--graphite); border-color: var(--graphite); color: var(--ui-white); }
.hv-btn:active { background: var(--charcoal); transition-duration: var(--quick); }
.hv-btn .go-arrow { width: 7px; height: 7px; }
.hv-btn:hover .go-arrow, .hv-btn:focus-visible .go-arrow { transform: translateX(3px) rotate(45deg); }
.hv-sec :focus-visible { outline-color: var(--matte-black); }

/* ---------- 2. Worlds: the two buildings, their covers, a few seconds of each inside ---------- */
.hv-worlds-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 64px); row-gap: var(--s-8); max-width: 1120px; }
.world { display: flex; flex-direction: column; gap: var(--s-5); min-width: 0; }
/* The picture: the album's cover; a tap (a pointer resting on it) plays a few silent seconds from inside the building. */
.world-pic { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: var(--matte-black); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.world-pic::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--cream-line); pointer-events: none; }
.world-pic picture, .world-pic img, .world-pic video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.world-pic video { opacity: 0; transition: opacity var(--slow) var(--ease-out); }
.world.is-playing .world-pic video { opacity: 1; }
.world-pic:focus-visible { outline: 2px solid var(--matte-black); outline-offset: 4px; }
/* A world with no film yet (Rydelic's house, 2026-11-01): its picture is a still, not a button. */
.world-still { cursor: default; }
/* The preview's control, in the picture's lower corner: a ring with a play mark; it shows the time left as it plays. */
.world-play { position: absolute; right: var(--s-4); bottom: var(--s-4); display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 16px 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--frost-strong); -webkit-backdrop-filter: var(--frost-filter); backdrop-filter: var(--frost-filter); color: var(--ink); font-family: var(--sans); font-size: var(--t-sm); font-weight: 500; line-height: 1; transition: opacity var(--slow) var(--ease-out), background var(--beat) var(--ease-out); }
.world-play i { width: 0; height: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; margin-left: 2px; }
.world-pic:hover .world-play, .world-pic:focus-visible .world-play { background: var(--frost-hover); }
.world.is-playing .world-play { opacity: 0; }
.world-text { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); }
.world-k { margin: 0; font-size: var(--t-sm); line-height: 1.4; color: var(--ink-on-cream-2); }
.world-name { margin: 0; font-family: var(--sans); font-weight: 400; font-size: clamp(28px, 2.6vw, 38px); line-height: 1.15; letter-spacing: -0.01em; color: var(--ink-on-cream); }
.world-name .name { letter-spacing: 0; }
.world-name .sep { margin: 0 0.22em; color: var(--ink-on-cream-3); font-family: var(--sans); font-style: normal; }
/* Three worlds in a row (2026-11-01): every name keeps room for two lines, so the Enters line up when one name wraps. */
@media (min-width: 761px) { .hv-worlds-list .world-name { min-height: 2.3em; } }
.world .hv-btn { margin-top: var(--s-3); }
/* His door shut (his door.js says so): the card stays whole, the words say when, no way in yet. */
.world[data-door-state="closed"] .hv-btn { display: none; }
.world-soon { display: none; margin: var(--s-3) 0 0; font-size: var(--t-ui); color: var(--ink-on-cream-2); }
.world[data-door-state="closed"] .world-soon { display: block; }

/* ---------- 3. How it works: three moments, three real views ---------- */
.hv-how-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.hv-how-list figure { margin: 0; display: flex; flex-direction: column; gap: var(--s-4); }
.hv-how-list picture { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--matte-black); }
.hv-how-list picture::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--cream-line); pointer-events: none; }
.hv-how-list img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hv-how-list figcaption { display: flex; align-items: baseline; gap: var(--s-3); font-size: clamp(20px, 1.7vw, 24px); font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; color: var(--ink-on-cream); }
.hv-how-list figcaption .n { font-size: var(--t-sm); font-weight: 500; line-height: 1; color: var(--ink-on-cream-3); font-variant-numeric: tabular-nums; }

/* ---------- 4. For artists ---------- */
.hv-artists .hv-wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(24px, 4vw, 64px); align-items: start; }
.hv-artists .hv-h { margin: 0; }
.hv-artists-body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-6); }
.hv-artists-body p { margin: 0; max-width: 34em; font-size: var(--t-md); line-height: var(--lh-body); color: var(--ink-on-cream); text-wrap: pretty; }
.hv-artists { padding-bottom: var(--sec-y); }

/* ---------- 5. Visit / Build: the two doors, on the dark band that closes the page ---------- */
.hv-doors { position: relative; background: var(--void); color: var(--ink); padding: var(--sec-y) var(--gutter); }
.hv-doors-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.hv-door { position: relative; display: flex; flex-direction: column; gap: var(--s-2); min-height: 220px; padding: var(--s-6) 72px var(--s-6) var(--s-6); border: 1px solid var(--line); border-radius: 20px; background: var(--frost); box-shadow: var(--lit-edge); color: var(--ink); text-decoration: none; transition: background var(--beat) var(--ease-out), border-color var(--beat) var(--ease-out); }
.hv-door:hover, .hv-door:focus-visible { color: var(--ink); background: var(--frost-hover); border-color: var(--line-strong); }
.hv-door:active { background: var(--frost-press); transition-duration: var(--quick); }
.hv-door-k { font-size: var(--t-sm); line-height: 1.4; color: var(--ink-2); }
.hv-door-w { margin-top: auto; font-size: clamp(36px, 4vw, 56px); font-weight: 500; line-height: 1.05; letter-spacing: -0.02em; }
.hv-door-l { font-size: var(--t-md); line-height: 1.45; color: var(--ink-2); }
.hv-door .go-arrow { position: absolute; right: 32px; bottom: 40px; width: 10px; height: 10px; color: var(--ink-3); }
.hv-door:hover .go-arrow, .hv-door:focus-visible .go-arrow { color: var(--ink); transform: translateX(4px) rotate(45deg); }

/* ---------- the footer: dark, the dots live here only ---------- */
.home-v2 .site-footer.hv-foot { position: relative; z-index: 2; overflow: hidden; min-height: 280px; align-items: flex-end; background: var(--void); border-top: 1px solid var(--line-soft); padding-top: var(--s-10); }
.hv-dots { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.hv-foot > :not(.hv-dots) { position: relative; z-index: 1; }

/* ---------- the Sound ring: lower right, on the whole page (moved here from assets/motion/motion.css with the film) ---------- */
.sound-toggle { position: fixed; right: var(--gutter); bottom: 28px; --ring-right: var(--gutter); z-index: 40; width: 48px; height: 48px; padding: 0; color: var(--ink-2); }
.sound-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sound-toggle .on { display: none; }
.sound-toggle[aria-pressed="true"] { color: var(--ink); border-color: var(--line-strong); background: color-mix(in srgb, var(--ui-white) 12%, var(--frost)); }
.sound-toggle[aria-pressed="true"] .on { display: block; }
.sound-toggle[aria-pressed="true"] .off { display: none; }
.sound-toggle[aria-busy="true"] svg { opacity: 0.55; }
.sound-toggle[aria-pressed="true"] .on .w2 { animation: soundWave 2.4s ease-in-out infinite; transform-origin: 12px 12px; }
@keyframes soundWave { 50% { opacity: 0.35; } }
.entering .sound-toggle { opacity: 0; transition: opacity .3s var(--ease-out); }
/* Never over text or links (iPhone review, 2026-10-06): over any, it tucks into the right edge and takes no taps. */
.sound-toggle { transition: transform .16s var(--ease-out), opacity .16s var(--ease-out), color var(--beat) var(--ease-out), border-color var(--beat) var(--ease-out), background var(--beat) var(--ease-out); }
.sound-toggle.tucked { transform: translateX(calc(100% + var(--ring-right, 16px) - 6px)); opacity: 0.55; pointer-events: none; }

/* ---------- the header over the cream: ink, and a cream frost once scrolled ---------- */
html.on-light .site-header > .wordmark,
html.on-light .site-header .nav-main > a,
html.on-light .site-header .nav-top:not([aria-expanded="true"]),
html.on-light .site-header .nav-main > .menu-btn { color: var(--matte-black); }
html.on-light .site-header .nav-main > a:hover, html.on-light .site-header .nav-top:not([aria-expanded="true"]):hover { color: var(--graphite); }
html.on-light .site-header .nav-main > .menu-btn { background: color-mix(in srgb, var(--ui-white) 55%, transparent); border-color: color-mix(in srgb, var(--matte-black) 18%, transparent); }
html.on-light.scrolled .site-header { background: var(--cream-frost); border-bottom-color: var(--cream-line); }
html.on-light .site-header :focus-visible { outline-color: var(--matte-black); }
/* The Sound ring over cream: the same ring in cream glass, its mark in ink. */
/* (its own corner decides: home.js sets .on-light on it over a cream section) */
.sound-toggle.on-light { color: var(--matte-black); background: color-mix(in srgb, var(--cream) 80%, transparent); border-color: color-mix(in srgb, var(--matte-black) 18%, transparent); }
.sound-toggle.on-light[aria-pressed="true"] { color: var(--matte-black); background: color-mix(in srgb, var(--ui-white) 85%, transparent); border-color: color-mix(in srgb, var(--matte-black) 34%, transparent); }
.sound-toggle.on-light:hover, .sound-toggle.on-light:focus-visible { color: var(--matte-black); background: color-mix(in srgb, var(--ui-white) 70%, transparent); border-color: color-mix(in srgb, var(--matte-black) 34%, transparent); }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  /* The Enter button and the Sound ring share the hero's last row: Enter across, the ring in the corner beside it
     (the ring never sits over a control: home.js tucks it, so it needs its own place here). */
  .hv-copy { gap: 14px; bottom: calc(20px + env(safe-area-inset-bottom)); }
  .hv-mark { font-size: clamp(40px, 13vw, 64px); letter-spacing: 0.16em; margin-right: -0.16em; }
  .hv-enter { min-height: 48px; min-width: 0; flex: 1; }
  .hv-actions { align-self: stretch; margin-top: var(--s-1); padding-right: 64px; }
  .hv-sec .hv-wrap { padding-top: var(--s-6); }
  .hv-head { flex-direction: column; align-items: flex-start; gap: var(--s-2); margin-bottom: var(--s-6); }
  .hv-worlds-list { grid-template-columns: minmax(0, 1fr); row-gap: var(--s-8); }
  .world .hv-btn { align-self: stretch; min-height: 56px; }
  .hv-how-list { grid-template-columns: minmax(0, 1fr); gap: var(--s-7); }
  .hv-artists .hv-wrap { grid-template-columns: minmax(0, 1fr); row-gap: var(--s-5); }
  .hv-artists-body .hv-btn { align-self: stretch; min-height: 56px; }
  .hv-doors-list { grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
  .hv-door { min-height: 168px; padding: var(--s-5) 64px var(--s-5) var(--s-5); border-radius: 18px; }
  .hv-door .go-arrow { right: 26px; bottom: 32px; }
  .home-v2 .site-footer.hv-foot { min-height: 240px; }
  .sound-toggle { right: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); --ring-right: 16px; }
}
/* A phone on its side: the hero one screen, the words smaller. */
@media (max-height: 520px) and (min-aspect-ratio: 4/5) {
  .hv-hero { min-height: 100svh; }
  .hv-mark { font-size: 40px; }
  .hv-copy { gap: 10px; bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .hv-gl, .hv-film, .world-pic video { transition-duration: var(--quick); }
  .sound-toggle[aria-pressed="true"] .on .w2 { animation: none; }
}
