/* THE COVER — Phase 1 static prototype */

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/BarlowCondensed-SemiBold.woff2") format("woff2");
}

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

:root {
  --logo-optical-y: 2%;
  --cover-nav-band-top: 6.5rem;
  --cover-nav-band-bottom: 8.5rem;
}

html {
  min-height: 100%;
  overflow-y: auto;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f4f2ef;
  background: #1a1a1a;
}

.cover__nav,
.cover__pause,
.notice__heading,
.notice__status,
.notice__back {
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: max(1rem, env(safe-area-inset-left));
  top: max(1rem, env(safe-area-inset-top));
  z-index: 20;
  padding: 0.5rem 0.75rem;
  background: #1a1a1a;
  color: #f4f2ef;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid #f4f2ef;
  outline-offset: 2px;
}

.cover {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  container-type: size;
  container-name: cover;
}

.cover__media {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.cover__poster,
.cover__poster img,
.cover__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
}

.cover__poster--still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
}

.cover__poster {
  margin: 0;
}

.cover__video {
  opacity: 0;
  transition: opacity 0.8s ease;
}

@media (prefers-reduced-motion: reduce) {
  .cover__video {
    transition: none;
  }
}

.cover__video--playing {
  opacity: 1;
}

.cover__video--idle {
  opacity: 0;
}

.cover__grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0.06;
  pointer-events: none;
}

.cover__grain-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.cover__scrim {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 88% 72% at 50% 46%,
      rgba(0, 0, 0, 0.36) 0%,
      rgba(0, 0, 0, 0.14) 48%,
      transparent 74%
    ),
    radial-gradient(
      ellipse 128% 98% at 50% 50%,
      rgba(0, 0, 0, 0.12) 38%,
      rgba(0, 0, 0, 0.55) 100%
    );
}

/* Logo sits directly above scrim+media so mix-blend-mode composites with the film */
.cover__logo-stage {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(var(--cover-nav-band-top), env(safe-area-inset-top))
    0.75rem
    max(var(--cover-nav-band-bottom), env(safe-area-inset-bottom))
    0.75rem;
  pointer-events: none;
}

.cover__title {
  margin: 0;
  line-height: 0;
}

.cover__logo {
  display: block;
  width: min(72vw, 498px);
  height: auto;
  max-height: min(
    38vh,
    332px,
    calc(
      100dvh - var(--cover-nav-band-top) - var(--cover-nav-band-bottom) - 2rem
    )
  );
  transform: translateY(var(--logo-optical-y));
}

/* The logo stage is position:fixed with a z-index, so it forms its own stacking
   context. Blend the stage itself, otherwise the logo only blends with the
   stage's transparent backdrop and the JPEG's black panel stays visible. */
html[data-logo-mode="screen"] .cover__logo-stage {
  mix-blend-mode: screen;
}

.cover__main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  pointer-events: none;
  padding-bottom: 2rem;
}

.cover__main a,
.cover__main button {
  pointer-events: auto;
}

.cover__nav {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  font-size: 1rem;
}

.cover__nav a,
.cover__nav button {
  pointer-events: auto;
}

.cover__link {
  position: absolute;
  color: inherit;
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.72);
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size 0.2s ease;
}

.cover__link:hover,
.cover__link:focus-visible {
  background-size: 100% 1px;
}

@media (prefers-reduced-motion: reduce) {
  .cover__link {
    transition: none;
  }
}

.cover__link:focus-visible {
  outline: 2px solid #f4f2ef;
  outline-offset: 3px;
}

.cover__link--tl {
  top: max(1.25rem, env(safe-area-inset-top));
  left: max(1.25rem, env(safe-area-inset-left));
}

.cover__link--tr {
  top: max(1.25rem, env(safe-area-inset-top));
  right: max(1.25rem, env(safe-area-inset-right));
  text-align: right;
}

.cover__link--br {
  bottom: max(2.75rem, calc(env(safe-area-inset-bottom) + 1.5rem));
  right: max(1.25rem, env(safe-area-inset-right));
  text-align: right;
}

.cover__bottom-left {
  position: absolute;
  left: max(1.25rem, env(safe-area-inset-left));
  bottom: max(2.75rem, calc(env(safe-area-inset-bottom) + 1.5rem));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  max-width: min(100%, 22rem);
}

.cover__link--bl {
  position: relative;
  left: auto;
  bottom: auto;
}

.cover__link--collective {
  order: 1;
}

.cover__link--booksy {
  order: 2;
}

.cover__link--barbers {
  order: 3;
}

.cover__link--gallery {
  order: 4;
}

.cover__pause {
  order: 5;
  margin: 0;
  padding: 0.5rem;
  min-height: 44px;
  min-width: 44px;
  border: 0;
  background-color: transparent;
  color: inherit;
  font-size: 1rem;
  cursor: pointer;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.72);
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size 0.2s ease;
}

.cover__pause:hover,
.cover__pause:focus-visible {
  background-size: 100% 1px;
}

@media (prefers-reduced-motion: reduce) {
  .cover__pause {
    transition: none;
  }
}

.cover__pause:focus-visible {
  outline: 2px solid #f4f2ef;
  outline-offset: 3px;
}

.cover__pause[hidden] {
  display: none;
}

.cover__disclosure {
  position: fixed;
  left: 50%;
  bottom: max(0.65rem, env(safe-area-inset-bottom));
  z-index: 4;
  margin: 0;
  max-width: calc(100% - 2.5rem);
  transform: translateX(-50%);
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  opacity: 0.6;
  line-height: 1.4;
  pointer-events: none;
}

@media (orientation: portrait) {
  .cover__bottom-left {
    max-width: min(100%, 18rem);
  }
}

/* Reflow: narrow effective viewport (browser zoom) or large root text (container rem) */
@media (max-width: 19em), (max-height: 19em) {
  .cover__logo-stage {
    position: relative;
    inset: auto;
    flex: 0 0 auto;
    min-height: auto;
    padding: max(2rem, env(safe-area-inset-top)) 1.25rem 1.5rem;
  }

  .cover__logo {
    max-height: min(32vh, 280px);
  }

  .cover__main {
    min-height: auto;
    padding: 0 0 2rem;
  }

  .cover__nav {
    position: relative;
    inset: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: 100%;
    padding: 0 1.25rem 1.25rem;
    pointer-events: auto;
  }

  .cover__link,
  .cover__bottom-left {
    position: static;
    max-width: none;
  }

  .cover__bottom-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: 100%;
  }

  .cover__link {
    text-align: left;
  }

  .cover__disclosure {
    position: relative;
    inset: auto;
    left: auto;
    transform: none;
    padding: 0.75rem 1.25rem 1.5rem;
    pointer-events: none;
  }
}

@container cover (max-width: 18rem) {
  .cover__logo-stage {
    position: relative;
    inset: auto;
    flex: 0 0 auto;
    min-height: auto;
    padding: max(2rem, env(safe-area-inset-top)) 1.25rem 1.5rem;
  }

  .cover__logo {
    max-height: min(32vh, 280px);
  }

  .cover__main {
    min-height: auto;
    padding: 0 0 2rem;
  }

  .cover__nav {
    position: relative;
    inset: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: 100%;
    padding: 0 1.25rem 1.25rem;
    pointer-events: auto;
  }

  .cover__link,
  .cover__bottom-left {
    position: static;
    max-width: none;
  }

  .cover__bottom-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: 100%;
  }

  .cover__link {
    text-align: left;
  }

  .cover__disclosure {
    position: relative;
    inset: auto;
    left: auto;
    transform: none;
    padding: 0.75rem 1.25rem 1.5rem;
    pointer-events: none;
  }
}

html[data-reduced-motion="true"] .cover__video {
  display: none;
}

html[data-reduced-motion="true"] .cover__poster {
  opacity: 1;
}

html[data-video-paused="true"] .cover__video {
  visibility: hidden;
}

html[data-video-paused="true"] .cover__poster {
  opacity: 1;
}

/* Section notice page */
body.notice-page {
  margin: 0;
  min-height: 100dvh;
  color: #f4f2ef;
}

.notice-page .cover__media,
.notice-page .cover__grain,
.notice-page .cover__scrim {
  position: fixed;
}

.notice-page__content {
  position: relative;
  z-index: 4;
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: max(2rem, env(safe-area-inset-top)) 1.5rem
    max(2rem, env(safe-area-inset-bottom));
  text-align: center;
}

.notice__heading {
  margin: 0;
  font-size: clamp(1.25rem, 5vw, 1.75rem);
}

.notice__status {
  margin: 0;
  font-size: 1rem;
  opacity: 0.88;
}

.notice__back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  color: inherit;
  text-decoration: none;
  font-size: 1rem;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size 0.2s ease;
}

.notice__back:hover,
.notice__back:focus-visible {
  background-size: 100% 1px;
}

.notice__back:focus-visible {
  outline: 2px solid #f4f2ef;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .notice__back {
    transition: none;
  }
}

/* Reflow order: keep the cover's reading order (Collective, Book Now, Barbers,
   Gallery) with the pause control last, regardless of the corner grouping. */
@media (max-width: 19em), (max-height: 19em) {
  .cover__bottom-left { display: contents; }
  .cover__link--collective { order: 1; }
  .cover__link--booksy { order: 2; }
  .cover__link--barbers { order: 3; }
  .cover__link--gallery { order: 4; }
  .cover__pause { order: 5; }
}

@container cover (max-width: 18rem) {
  .cover__bottom-left { display: contents; }
  .cover__link--collective { order: 1; }
  .cover__link--booksy { order: 2; }
  .cover__link--barbers { order: 3; }
  .cover__link--gallery { order: 4; }
  .cover__pause { order: 5; }
}

/* Corner labels stay on one line; in reflow they may wrap so nothing overflows. */
.cover__link { white-space: nowrap; }
@media (max-width: 19em), (max-height: 19em) {
  .cover__link { white-space: normal; letter-spacing: 0.08em; }
}
@container cover (max-width: 18rem) {
  .cover__link { white-space: normal; letter-spacing: 0.08em; }
}
@media (max-width: 19em), (max-height: 19em) {
  .cover__nav { padding-left: 0.75rem; padding-right: 0.75rem; }
  .cover__link { overflow-wrap: anywhere; }
}
