/* Opening screen: full-screen For him / For her choice before the collection.
   Sequence: the photos fade in, then the Youghazi logo printed on each photo
   slowly comes alive: a soft breathing glow and a light that sweeps across it. */
body.gate-open { overflow: hidden; }
.gender-gate {
  position: fixed; inset: 0; z-index: 30;
  height: 100vh; height: 100dvh;
  background: #111;
  transition: opacity 700ms ease, visibility 0s linear 700ms;
}
.gender-gate[hidden] { display: none; }
.gender-gate.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; }

.gate-options { display: flex; width: 100%; height: 100%; }
.gate-option {
  position: relative; flex: 1 1 0; min-width: 0; overflow: hidden;
  border: 0; padding: 0; margin: 0; cursor: pointer;
  background: #1a1a1a; color: #fff; font: inherit;
  transition: flex-grow 900ms cubic-bezier(.65, 0, .35, 1);
}
.gate-option + .gate-option { border-left: 1px solid #ffffff26; }

/* Photo and its logo overlay move together. */
.gate-media {
  position: absolute; inset: 0; display: block;
  opacity: 0; transform: scale(1.08); filter: brightness(.92);
  transition: transform 1400ms cubic-bezier(.22, 1, .36, 1), filter 600ms ease;
}
.gate-media img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 40%;
}
.gate-option::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, #0b0b0bb3 0%, #0b0b0b40 24%, #0b0b0b00 45%);
}

/* Logo overlay: placed exactly over the printed logo by gate.js. */
.gate-mark { position: absolute; display: block; pointer-events: none; opacity: 0; }
.gate-mark-glow {
  position: absolute; inset: -18%; border-radius: 50%;
  background: radial-gradient(circle, #ffffff40 0%, #ffffff14 38%, #ffffff00 66%);
  opacity: 0;
}
.gate-mark-shine {
  position: absolute; inset: 0;
  /* The printed logo is already white, so the "light" is a clear band in a
     soft dark veil: the logo dims to silver and a bright band sweeps across. */
  background: linear-gradient(115deg, #0e0e0e9e 38%, #0e0e0e00 47%, #0e0e0e00 53%, #0e0e0e9e 62%) no-repeat;
  background-size: 260% 100%; background-position: 160% 0; opacity: 0;
  -webkit-mask: url(assets/logo-ring.webp) center / 100% 100% no-repeat, url(assets/logo-emblem.webp) center / 100% 100% no-repeat;
          mask: url(assets/logo-ring.webp) center / 100% 100% no-repeat, url(assets/logo-emblem.webp) center / 100% 100% no-repeat;
}

.gate-label {
  position: absolute; z-index: 1; left: 0; right: 0; bottom: clamp(32px, 7vh, 72px);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center; opacity: 0; transform: translateY(18px);
}
.gate-title {
  font-size: clamp(2.5rem, 4.6vw, 4.25rem); font-weight: 300;
  line-height: 1; letter-spacing: .02em;
}
.gate-cta {
  font-size: .75rem; font-weight: 500; letter-spacing: .32em; text-transform: uppercase;
  padding-bottom: 6px; border-bottom: 1px solid #ffffff80;
  transition: border-color 300ms ease;
}

/* Intro runs once the photos are ready (gate.js adds .is-ready). */
.gender-gate.is-ready .gate-media { animation: gate-photo-in 1800ms cubic-bezier(.22, 1, .36, 1) 150ms both; }
.gender-gate.is-ready .gate-option + .gate-option .gate-media { animation-delay: 350ms; }
.gender-gate.is-ready .gate-mark { animation: gate-fade 1200ms ease 1200ms both; }
.gender-gate.is-ready .gate-mark-glow { animation: gate-glow 6s ease-in-out 1400ms infinite alternate both; }
.gender-gate.is-ready .gate-mark-shine { animation: gate-shine 8s cubic-bezier(.45, 0, .25, 1) 1600ms infinite both; }
/* Stagger the two logos so they take turns. */
.gender-gate.is-ready .gate-option + .gate-option .gate-mark-glow { animation-delay: 4400ms; }
.gender-gate.is-ready .gate-option + .gate-option .gate-mark-shine { animation-delay: 5600ms; }
.gender-gate.is-ready .gate-label { animation: gate-label-in 900ms cubic-bezier(.22, 1, .36, 1) 1500ms both; }
.gender-gate.is-ready .gate-option + .gate-option .gate-label { animation-delay: 1650ms; }

@keyframes gate-photo-in { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: scale(1); } }
@keyframes gate-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gate-glow { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1.04); } }
/* A slow sweep of light across the logo, then a long rest. */
@keyframes gate-shine {
  0%   { opacity: 0; background-position: 160% 0; }
  12%  { opacity: 1; background-position: 160% 0; }
  48%  { opacity: 1; background-position: -60% 0; }
  60%  { opacity: 0; background-position: -60% 0; }
  100% { opacity: 0; background-position: -60% 0; }
}
@keyframes gate-label-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Hover: the pointed-at side brightens, the other dims slightly. */
@media (hover: hover) {
  .gate-options:hover .gate-media { filter: brightness(.7); }
  .gate-options .gate-option:hover .gate-media { filter: brightness(1); transform: scale(1.03); }
  .gate-option:hover .gate-cta { border-color: #fff; }
}
.gate-option:focus-visible { outline: 2px solid #fff; outline-offset: -8px; }

/* Leaving: the chosen side widens, then everything fades. */
.gender-gate.is-choosing .gate-option { cursor: default; }
.gender-gate.is-choosing .gate-option.is-chosen { flex-grow: 3; }
.gender-gate.is-choosing .gate-option.is-chosen .gate-media { filter: brightness(1); }

@media (max-width: 700px) {
  .gate-options { flex-direction: column; }
  .gate-option + .gate-option { border-left: 0; border-top: 1px solid #ffffff26; }
  .gate-media img { object-position: center 38%; }
  .gate-label { bottom: 22px; gap: 8px; }
  .gate-title { font-size: 2.25rem; }
  .gate-cta { font-size: .6875rem; letter-spacing: .26em; }
}

@media (prefers-reduced-motion: reduce) {
  .gender-gate.is-ready .gate-media,
  .gender-gate.is-ready .gate-mark,
  .gender-gate.is-ready .gate-label { animation: gate-fade 600ms ease both; }
  .gender-gate.is-ready .gate-mark-glow,
  .gender-gate.is-ready .gate-mark-shine { animation: none; }
  .gate-option, .gate-media { transition: opacity 300ms ease; }
}

/* Close button: the screen now opens on demand, so shoppers can back out. */
.gate-close {
  position: absolute; z-index: 3; top: max(16px, env(safe-area-inset-top)); right: 16px;
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  border: 1px solid #ffffff59; background: #0b0b0b59; color: #fff; font-size: 18px;
  display: grid; place-items: center; backdrop-filter: blur(4px);
  opacity: 0; transition: background-color 150ms ease, opacity 400ms ease;
}
.gender-gate.is-ready .gate-close { opacity: 1; transition-delay: 0s, 1200ms; }
.gate-close:hover { background: #0b0b0b99; }
.gate-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.gender-gate.is-choosing .gate-close { opacity: 0; }
