/* ==========================================================================
   Coming soon page (coming-soon.html). Mobile first.
   Uses tokens.css; no JS.
   - Phones (portrait): tall photo (824 x 2000), full width, bottom aligned.
     Two marquee rows; the second passes behind the glass (clipped copy on top).
   - Desktop (landscape): wide photo (1672 x 1214), covers the screen, top aligned.
     One marquee row; the heading dips behind the right glass (clipped copy on top).
   Text is sized from --art-w, the photo width, so it keeps its place on the picture.
   ========================================================================== */

@font-face {
  font-family: "Lenia Mono";
  src: url("../assets/fonts/LeniaMono-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }


/* Phones ------------------------------------------------------------------- */

.coming-soon {
  --art-ratio: 2.4272; /* 2000 / 824, a plain number so calc() can use it */
  --art-w: 100vw; /* full width, no side padding; on shorter phones the red top is cropped */
  --art-h: calc(var(--art-w) * var(--art-ratio));
  --coming-soon-bg: #c00d03; /* top edge colour of the photo, fills the space above it on very tall screens */

  margin: 0;
  min-height: 100svh;
  overflow: hidden;
  background: var(--coming-soon-bg);
  color: var(--sys-color-on-primary);
  -webkit-font-smoothing: antialiased;
}

.coming-soon__stage {
  position: relative;
  min-height: 100svh;
  overflow: clip;
}

/* Photo, bottom aligned, centred */
.coming-soon__art,
.coming-soon__cutout {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: var(--art-w);
  height: var(--art-h);
  translate: -50% 0;
  background: url("../assets/images/coming-soon-bg-mobile.webp") center bottom / 100% 100% no-repeat;
}

/* Glass layer: the photo again, clipped to the top of the big glass and placed above the
   middle marquee, so the text passes behind the glass. Same box as the photo, so the
   percentages are positions in the 824 x 2000 image. */
.coming-soon__cutout {
  pointer-events: none;
  clip-path: polygon(
    43.53% 48.27%, 45.62% 48.29%, 47.70% 48.35%, 49.79% 48.46%, 50.97% 48.58%,
    53.40% 48.87%, 55.83% 49.09%, 58.25% 49.30%, 60.68% 49.58%, 61.89% 49.80%,
    63.19% 50.05%, 63.51% 50.40%, 63.47% 50.85%, 63.47% 51.25%,
    41.02% 51.25%, 41.24% 51.04%, 41.87% 50.00%, 42.39% 48.98%, 42.72% 48.60%
  );
}

/* Heading: halfway between the top row and the middle row */
.coming-soon__title {
  position: absolute;
  left: 50%;
  top: calc((var(--art-w) * 0.036 + (100svh - var(--art-h) * 0.4985)) / 2);
  translate: -50% -50%;
  margin: 0;
  width: var(--art-w);
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  font-family: var(--ref-typeface-brand);
  font-weight: var(--ref-typeface-weight-regular);
  font-size: calc(var(--art-w) * 0.098);
  line-height: 1;
  letter-spacing: 0.005em;
}

/* Marquee rows */
.marquee {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  overflow: clip;
  font-family: var(--ref-typeface-plain);
  font-weight: 600;
  font-size: calc(var(--art-w) * 0.044);
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
  user-select: none;
  translate: 0 -50%;
}

.marquee.is--top { top: calc(var(--art-w) * 0.036); }
.marquee.is--mid { top: calc(100svh - var(--art-h) * 0.4985); } /* centred on the rim of the big glass */

.marquee__group {
  display: flex;
  flex: none;
  animation: marquee 22s linear infinite;
}

.marquee.is--reverse .marquee__group { animation-direction: reverse; }

.marquee__item { padding-right: 1.4em; }

@keyframes marquee {
  to { translate: -100% 0; }
}

/* Screen-reader only text for the marquee */
.coming-soon__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Entrance: light and quick */
@media (prefers-reduced-motion: no-preference) {
  .coming-soon__title { animation: title-in 900ms var(--sys-motion-easing-punch) 150ms both; }
  .marquee { animation: fade-in 700ms var(--sys-motion-easing-standard) both; }
}

@keyframes title-in {
  from { opacity: 0; translate: -50% -30%; }
}
@keyframes fade-in {
  from { opacity: 0; }
}

/* Reduced motion: static text, still readable */
@media (prefers-reduced-motion: reduce) {
  .marquee__group { animation: none; }
  .marquee { justify-content: center; }
  .marquee__group[aria-hidden="true"] { display: none; }
}


/* Desktop / landscape -------------------------------------------------------- */

@media (min-aspect-ratio: 1/1) {
  .coming-soon {
    --art-ratio: 1.3773; /* 1672 / 1214 */
    --art-w: max(100vw, calc(100svh * var(--art-ratio))); /* cover the screen */
    --art-h: calc(var(--art-w) / var(--art-ratio));
    --coming-soon-bg: #b80b01;
  }

  /* Photo covers the screen, top aligned */
  .coming-soon__art,
  .coming-soon__cutout {
    top: 0;
    bottom: auto;
    background: url("../assets/images/coming-soon-bg-desktop.webp") center top / 100% 100% no-repeat;
  }

  /* Glass layer: the photo again, clipped to the top of the right glass and placed above
     the heading, so the heading passes behind it. Same box as the photo, so the
     percentages are positions in the 1672 x 1214 image. */
  .coming-soon__cutout {
    clip-path: polygon(
      49.56% 25.17%, 50.06% 24.77%, 51.29% 24.84%, 52.85% 25.33%, 54.43% 25.82%,
      56.22% 26.50%, 58.01% 27.18%, 59.13% 27.68%, 59.87% 28.30%, 59.92% 28.88%,
      59.76% 30.33%, 59.63% 31.19%, 48.48% 31.19%, 48.66% 29.96%, 48.82% 28.72%, 49.16% 26.87%
    );
  }

  .coming-soon__title {
    top: calc(var(--art-w) * 0.178);
    width: 100vw;
    font-size: 9.8vw;
  }

  /* One marquee row */
  .marquee { font-size: 2.6vw; }
  .marquee.is--top { top: calc(var(--art-w) * 0.043); }
  .marquee.is--mid { display: none; }
}
