/* LOMMART homepage: the fixed stage. Geometry and layering follow the scroll-film brief: the stage is fixed, an empty
   track supplies the scroll distance, the hero blends the film over its heading with `screen`, the applications layer
   holds four scenes, a glass menu, a card and a link pill. */
:root {
  --vh: 100vh;
  --pad: clamp(16px, 4vw, 38px);
  --nav-top: max(14px, env(safe-area-inset-top, 0px));
  --safe-bottom: max(14px, env(safe-area-inset-bottom, 0px));
}
html.js body.lm-home, body.lm-home { overflow-x: hidden; background: var(--surface); }
body.lm-home .nav-wrap { z-index: 80; }
.skip { z-index: 100; }

/* ---------------------------------------------------------------- loader */
.boot { position: fixed; inset: 0; z-index: 90; background: var(--surface); display: grid; place-items: center; transition: opacity 700ms ease, visibility 700ms ease; }
.boot.done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-in { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.boot-bar { width: 156px; height: 1px; background: rgba(201, 206, 214, 0.2); overflow: hidden; }
.boot-bar i { display: block; height: 100%; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); }
.boot.indeterminate .boot-bar i { width: 40%; transform: none; animation: bootslide 1.2s ease-in-out infinite; }
@keyframes bootslide { from { margin-left: -40%; } to { margin-left: 100%; } }
.boot-label { font: 500 12px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--chrome-2); }

/* ---------------------------------------------------------------- stage and track */
.stage { position: fixed; left: 0; top: 0; width: 100%; height: var(--vh); overflow: hidden; z-index: 1; background: var(--surface); }
.track { position: relative; z-index: 0; width: 1px; height: 600vh; }
.layer { position: absolute; inset: 0; opacity: 0; will-change: opacity; }
.layer.hero { opacity: 1; }

/* ---------------------------------------------------------------- hero: heading first, film second, screen-blended */
.hero { isolation: isolate; background: var(--surface); }
.hero-copy { position: absolute; inset: 0; display: flex; align-items: flex-start; padding: calc(88px + env(safe-area-inset-top, 0px)) calc(var(--pad) + env(safe-area-inset-right, 0px)) 0 calc(var(--pad) + env(safe-area-inset-left, 0px)); pointer-events: none; }
.hero-h1 { margin: 0; font-weight: 500; font-size: clamp(26px, 3.5vw, 50px); line-height: 1.14; letter-spacing: -0.035em; max-width: 19ch; color: rgba(242, 243, 245, 0.92); text-wrap: balance; }
.hero-media { position: absolute; inset: 0; pointer-events: none; }
.hero-media video, .hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; mix-blend-mode: screen; will-change: transform; transform: translateZ(0); }
.hero-media video { background: transparent; }
html.film-ready .hero-poster { opacity: 0; }

/* ---------------------------------------------------------------- applications layer */
.apps { background: #0b0c0f; }
.scene { position: absolute; inset: 0; opacity: 0; transition: opacity 550ms ease; }
.scene.is-on { opacity: 1; }
.scene img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.scene .bg { filter: blur(28px) saturate(1.08) brightness(0.55); transform: scale(1.14); }
.scene .product { z-index: 2; }
.scene.no-plate .product { display: none; }
.plate-note { position: absolute; z-index: 3; left: 50%; top: 46%; transform: translateX(-50%); margin: 0; color: var(--chrome-2); font-size: 14px; }

.apps-ui { position: absolute; inset: 0; z-index: 5; display: grid; grid-template-columns: auto 1fr auto; align-items: end; padding: calc(88px + env(safe-area-inset-top, 0px)) calc(var(--pad) + env(safe-area-inset-right, 0px)) calc(34px + var(--safe-bottom)) calc(var(--pad) + env(safe-area-inset-left, 0px)); pointer-events: none; }
.menu { grid-column: 1; width: 306px; padding: 20px 18px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); pointer-events: auto; }
.menu-item { display: block; width: 100%; min-height: 44px; padding: 0; text-align: left; background: none; border: 0; color: var(--chrome-2); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color 250ms ease; }
.menu-label { display: block; padding: 10px 0; font-size: 16px; font-weight: 500; }
.menu-item.on, .menu-item:hover { color: var(--ink); }
.menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu-thumb { display: block; width: 100%; height: 0; margin: 0; border-radius: 8px; object-fit: cover; opacity: 0; transition: height 450ms ease, margin 450ms ease, opacity 350ms ease; }
.menu-item.on .menu-thumb { height: 164px; margin: 12px 0 10px; opacity: 1; }
.hotspot { position: absolute; z-index: 4; width: 52px; height: 52px; margin: -26px 0 0 -26px; border: 1px solid rgba(242, 243, 245, 0.45); border-radius: 50%; pointer-events: none; }
.hotspot::after { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--ink); }
.card { grid-column: 3; width: min(416px, 34vw); min-height: 280px; padding: 26px; border-radius: 16px; background: var(--glass-2); border: 1px solid var(--line); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); pointer-events: auto; }
.card-title { margin: 0 0 20px; font-size: clamp(28px, 2.8vw, 40px); font-weight: 600; line-height: 1.08; letter-spacing: -0.03em; }
.card .rows, .card .row { margin: 0; }
.card .row { display: grid; grid-template-columns: 3px 1fr; column-gap: 12px; margin-bottom: 14px; }
.card .row i { grid-row: span 2; display: block; width: 3px; min-height: 36px; background: var(--accent); border-radius: 1px; }
.card .row span { font: 600 10px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--chrome-2); }
.card .row b { margin-top: 2px; font-size: 15px; font-weight: 500; line-height: 1.35; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.tag { font: 600 11px var(--mono); font-style: normal; padding: 4px 8px; border-radius: 6px; background: var(--accent); color: #0a0a0b; }
.more { position: absolute; z-index: 6; left: 50%; bottom: calc(14px + var(--safe-bottom)); transform: translateX(-50%); max-width: calc(100% - 28px); min-height: 44px; display: inline-flex; align-items: center; padding: 10px 20px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); color: var(--ink); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-tap-highlight-color: transparent; transition: border-color 0.2s; }
.more:hover { border-color: rgba(201, 206, 214, 0.4); }
.more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.more::after { content: '→'; margin-left: 10px; color: var(--accent); }
.noscript-note { position: fixed; left: 0; right: 0; bottom: 20px; text-align: center; z-index: 95; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1024px) {
  .menu { width: min(306px, 38vw); }
  .card { width: min(416px, 40vw); }
}
@media (max-width: 900px) {
  .hero-copy { padding-top: calc(76px + env(safe-area-inset-top, 0px)); }
  .hero-h1 { font-size: clamp(22px, 6.2vw, 28px); line-height: 1.22; max-width: none; }
  .hero-media video, .hero-media img { object-position: 70% 50%; }
  .apps-ui { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: end; align-items: end; gap: 10px; padding: calc(72px + env(safe-area-inset-top, 0px)) calc(var(--pad) + env(safe-area-inset-right, 0px)) calc(58px + var(--safe-bottom)) calc(var(--pad) + env(safe-area-inset-left, 0px)); }
  .card { grid-column: 1; grid-row: 1; width: 100%; min-height: 0; padding: 18px 16px; }
  .card-title { font-size: clamp(22px, 6vw, 26px); margin-bottom: 14px; }
  .card .row { margin-bottom: 12px; }
  .card .row b { font-size: 14px; }
  .card .row span { font-size: 9px; }
  .menu { grid-column: 1; grid-row: 2; width: 100%; display: flex; gap: 8px; padding: 10px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .menu::-webkit-scrollbar { display: none; }
  .menu-item { flex: none; width: min(168px, 44vw); scroll-snap-align: center; }
  .menu-label { font-size: 13px; padding: 8px 4px; }
  .menu-thumb { display: none; }
  .menu-item.on .menu-thumb { display: block; height: 64px; margin: 8px 0 6px; }
  .hotspot { display: none !important; }
  .more { bottom: calc(10px + var(--safe-bottom)); font-size: 12px; padding: 10px 16px; }
  .scene .bg { object-position: 62% 40%; }
  /* the plate is scaled up and placed in the free area above the card, its connector centred (--mx, --my come from plates.json) */
  .scene .product { inset: auto; left: 50%; top: calc(var(--vh) * 0.3 - 118.1vw * var(--my, 0.5)); width: 210vw; max-width: none; height: auto; object-fit: fill; transform: translateX(calc(var(--mx, 0.6) * -100%)); }
}
@media (max-width: 480px) {
  .hero-h1 { font-size: 21px; }
  .card-title { font-size: 21px; }
  .menu-item { width: min(152px, 48vw); }
  .menu-label { font-size: 12px; }
  .tag { font-size: 10px; padding: 3px 6px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .hero-copy { padding-top: calc(64px + env(safe-area-inset-top, 0px)); }
  .hero-h1 { font-size: 20px; max-width: 24ch; }
  /* a short landscape screen: the card on the right, the product on the left, the menu strip along the bottom */
  .apps-ui { grid-template-columns: 1fr minmax(250px, 42vw); grid-template-rows: minmax(0, 1fr) auto; align-items: stretch; gap: 8px 16px; padding-top: calc(80px + env(safe-area-inset-top, 0px)); padding-bottom: calc(58px + var(--safe-bottom)); }
  .card { grid-column: 2; grid-row: 1; align-self: end; padding: 14px; max-height: 100%; overflow-y: auto; }
  .card-title { font-size: 20px; margin-bottom: 8px; }
  .card .row { margin-bottom: 8px; }
  .menu { grid-column: 1 / -1; grid-row: 2; padding: 6px 10px; }
  .menu-item.on .menu-thumb { height: 40px; margin: 4px 0 2px; }
  .scene .product { inset: 0; left: 0; top: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 30% 50%; transform: none; }
  .scene .bg { object-position: 40% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .scene, .menu-thumb, .boot, .menu-item { transition: none; }
  .boot.indeterminate .boot-bar i { animation: none; width: 100%; }
}
