/* =========================================================
   Leola Home — holding page
   Space Age optimism × Apple keynote restraint.
   HTML + CSS + vanilla JS only.
   ========================================================= */

:root {
  --warm-black: #17110B;   /* darkest warm tone — fallback + fill */
  --ink-soft: rgba(255, 255, 255, 0.92);
  --crossfade: 1400ms;     /* kept in sync with CONFIG.crossfade in script.js */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--warm-black);
  color: var(--ink-soft);
  font-family: var(--font);
  overflow: hidden;                 /* lock to viewport, no scrolling */
  overscroll-behavior: none;
}

/* ---- Stage: the browser becomes the image ---- */
.stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;                    /* fallback for older browsers */
  height: 100dvh;
  overflow: hidden;
  background: var(--warm-black);
}

.slides { position: absolute; inset: 0; }

.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: 1;
  opacity: 0;
  will-change: opacity;
  transition: opacity var(--crossfade) ease-in-out;
}
.slide.is-active { opacity: 1; }

.slide picture {
  position: absolute;
  inset: 0;
  display: block;
}

.slide__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
  display: block;
  transform: scale(1.04);           /* gentle default so covers stay covered */
  will-change: transform;
  backface-visibility: hidden;
}

/* ---- Cinematic camera moves (subtle, near-imperceptible) ---- */
@media (prefers-reduced-motion: no-preference) {
  .slide.run[data-motion="push"] .slide__img       { animation: kb-push       var(--dur, 5.6s) linear both; }
  .slide.run[data-motion="drift-left"] .slide__img  { animation: kb-driftleft  var(--dur, 5.6s) linear both; }
  .slide.run[data-motion="drift-right"] .slide__img { animation: kb-driftright var(--dur, 5.6s) linear both; }
  .slide.run[data-motion="pullback"] .slide__img    { animation: kb-pullback   var(--dur, 9.4s) linear both; }
}

@keyframes kb-push       { from { transform: scale(1.00); } to { transform: scale(1.07); } }
@keyframes kb-pullback   { from { transform: scale(1.09); } to { transform: scale(1.00); } }
@keyframes kb-driftleft  { from { transform: scale(1.06) translate3d(1.8%, 0, 0);  } to { transform: scale(1.06) translate3d(-1.8%, 0, 0); } }
@keyframes kb-driftright { from { transform: scale(1.06) translate3d(-1.8%, 0, 0); } to { transform: scale(1.06) translate3d(1.8%, 0, 0);  } }

/* ---- Tonal overlay: keep branding legible, photography rich ---- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(to bottom,
      rgba(9, 6, 3, 0.52) 0%,
      rgba(9, 6, 3, 0.20) 14%,
      rgba(9, 6, 3, 0.00) 34%,
      rgba(9, 6, 3, 0.00) 60%,
      rgba(9, 6, 3, 0.28) 82%,
      rgba(9, 6, 3, 0.46) 100%),
    radial-gradient(120% 90% at 50% 34%, rgba(0, 0, 0, 0) 46%, rgba(6, 4, 2, 0.30) 100%);
}

/* ---- Brand lockup: large, centred in the middle of the page (desktop) ---- */
.brand {
  position: absolute;
  z-index: 5;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
  padding: 0 6vw;
}

.brand__logo {
  width: clamp(440px, 45vw, 760px);
  height: auto;
  filter: drop-shadow(0 8px 34px rgba(0, 0, 0, 0.38));
}

.coming {
  margin: clamp(64px, 15vh, 150px) 0 0;
  font-size: clamp(13px, 1.45vw, 17px);
  letter-spacing: 0.42em;
  text-indent: 0.42em;              /* balance the trailing letter-spacing */
  text-transform: uppercase;
  font-weight: 400;
  color: #fff;
  text-shadow: 0 1px 22px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.42);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 1100ms ease, transform 1100ms ease;
}
/* Revealed only on the finale */
.is-finale .coming {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 650ms;          /* fade in after the finale image settles */
}

/* ---- Small editorial year marker (lower-left) ---- */
.year {
  position: absolute;
  z-index: 5;
  left: max(4.2vw, calc(env(safe-area-inset-left) + 20px));
  bottom: max(4.2vh, calc(env(safe-area-inset-bottom) + 18px));
  margin: 0;
  font-size: clamp(10px, 1vw, 12px);
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 800ms ease;
  pointer-events: none;
}
body.show-years .year { opacity: 1; }

/* ---- Understated contact ---- */
.contact {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: max(3.4vh, calc(env(safe-area-inset-bottom) + 14px));
  margin: 0;
  text-align: center;
}
.contact a {
  font-size: clamp(9.5px, 0.95vw, 11.5px);
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
  transition: color 240ms ease;
}
.contact a:hover { color: #fff; }
.contact a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 6px;
  border-radius: 2px;
  color: #fff;
}

/* ---- Mobile / portrait tuning ---- */
@media (max-width: 768px), (orientation: portrait) {
  .brand { top: max(6vh, env(safe-area-inset-top)); transform: none; }
  .brand__logo { width: clamp(198px, 58vw, 300px); }
  .slide__img { object-position: var(--pos-m, var(--pos, 50% 50%)); }
  .coming { margin-top: clamp(16px, 2.6vh, 30px); font-size: clamp(11px, 1.35vw, 15px); letter-spacing: 0.34em; text-indent: 0.34em; }
}

/* Very short landscape (e.g. landscape phone) — keep it centred but smaller */
@media (orientation: landscape) and (max-height: 480px) {
  .brand { top: 50%; transform: translateY(-50%); }
  .brand__logo { width: clamp(220px, 34vw, 400px); }
  .coming { margin-top: clamp(18px, 5vh, 40px); font-size: clamp(11px, 1.3vw, 14px); }
}

/* ---- Reduced motion: no push/pan, gentle crossfades remain ---- */
@media (prefers-reduced-motion: reduce) {
  .slide__img { transform: none; animation: none !important; }
}

/* ---- No-JS fallback screen ---- */
.noscript-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vh, 32px);
  padding: 6vw;
  text-align: center;
  background: var(--warm-black) center / cover no-repeat;
  background-image: linear-gradient(rgba(9, 6, 3, 0.42), rgba(9, 6, 3, 0.42)), url("assets/images/lahome.png");
}
.noscript-screen__logo { width: clamp(216px, 40vw, 340px); height: auto; filter: drop-shadow(0 6px 26px rgba(0, 0, 0, 0.4)); }
.coming--static { opacity: 1; transform: none; }
