/* First-visit brand intro (homepage) — soft fade out */

.ocm-brand-intro {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(10, 56, 80, 0.95), transparent 68%),
    linear-gradient(165deg, #031820 0%, #06273a 55%, #041c2a 100%);
  color: #f4f7f9;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.9s cubic-bezier(0.33, 0, 0.2, 1),
    visibility 0.9s cubic-bezier(0.33, 0, 0.2, 1);
}

html.ocm-intro-pending .ocm-brand-intro,
.ocm-brand-intro.is-visible {
  display: grid;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

html.ocm-intro-pending .ocm-brand-intro[hidden] {
  display: grid !important;
  opacity: 1;
  visibility: visible;
}

/* Keep painted while fading — do not set [hidden] until JS removes node */
.ocm-brand-intro.is-visible.is-leaving,
.ocm-brand-intro.is-leaving {
  display: grid;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

html.ocm-intro-pending {
  overflow: hidden;
}

html.ocm-intro-pending body {
  overflow: hidden;
  /* Keep layout width when scrollbar disappears (prevents hero image jump) */
  padding-right: var(--ocm-sb, 0px);
}

html.ocm-intro-pending .site-header {
  padding-right: var(--ocm-sb, 0px);
}

html.ocm-exit-open,
html.ocm-exit-open body {
  overflow: hidden;
}

/* Hold homepage hero until intro starts fading — then soft enter (no one-shot tug) */
html.ocm-intro-pending .hero .brand-lockup,
html.ocm-intro-pending .hero .hero-copy h1,
html.ocm-intro-pending .hero .hero-lead,
html.ocm-intro-pending .hero .hero-actions,
html.ocm-intro-pending .hero .hero-visual {
  animation: none !important;
  opacity: 0 !important;
  transform: translateY(14px) !important;
}

html.ocm-hero-enter .hero .brand-lockup {
  animation: ocmHeroIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.02s both !important;
}

html.ocm-hero-enter .hero .hero-copy h1 {
  animation: ocmHeroIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both !important;
}

html.ocm-hero-enter .hero .hero-lead {
  animation: ocmHeroIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both !important;
}

html.ocm-hero-enter .hero .hero-actions {
  animation: ocmHeroIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both !important;
}

html.ocm-hero-enter .hero .hero-visual {
  animation: ocmHeroIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both !important;
}

@keyframes ocmHeroIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.ocm-intro-pending .hero .brand-lockup,
  html.ocm-intro-pending .hero .hero-copy h1,
  html.ocm-intro-pending .hero .hero-lead,
  html.ocm-intro-pending .hero .hero-actions,
  html.ocm-intro-pending .hero .hero-visual,
  html.ocm-hero-enter .hero .brand-lockup,
  html.ocm-hero-enter .hero .hero-copy h1,
  html.ocm-hero-enter .hero .hero-lead,
  html.ocm-hero-enter .hero .hero-actions,
  html.ocm-hero-enter .hero .hero-visual {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

.ocm-brand-intro__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 30rem;
  gap: 0.85rem;
  transition:
    opacity 0.65s cubic-bezier(0.33, 0, 0.2, 1),
    transform 0.75s cubic-bezier(0.33, 0, 0.2, 1);
  will-change: opacity, transform;
}

.ocm-brand-intro.is-leaving .ocm-brand-intro__inner {
  opacity: 0;
  transform: translateY(-14px) scale(0.985);
}

.ocm-brand-intro.is-leaving .ocm-brand-intro__skip {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.ocm-brand-intro__mark {
  width: min(16rem, 72vw);
  height: auto;
  margin-bottom: 0.35rem;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
}

.ocm-brand-intro__slogan {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.55rem, 4.8vw, 2.2rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #f7fafc;
  opacity: 0;
  transform: translateY(10px);
}

html.ocm-intro-pending .ocm-brand-intro__mark,
html.ocm-intro-pending .ocm-brand-intro__slogan,
.ocm-brand-intro.is-static .ocm-brand-intro__mark,
.ocm-brand-intro.is-static .ocm-brand-intro__slogan,
.ocm-brand-intro.is-static .ocm-brand-intro__skip {
  opacity: 1;
  transform: none;
}

.ocm-brand-intro.is-playing .ocm-brand-intro__mark {
  opacity: 0;
  animation: ocmIntroIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards;
}

.ocm-brand-intro.is-playing .ocm-brand-intro__slogan {
  opacity: 0;
  animation: ocmIntroIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
}

@keyframes ocmIntroIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ocm-brand-intro__skip {
  position: absolute;
  top: max(0.85rem, env(safe-area-inset-top, 0px));
  right: max(0.85rem, env(safe-area-inset-right, 0px));
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(224, 195, 90, 0.55);
  border-radius: 999px;
  background: rgba(3, 24, 32, 0.72);
  color: #f7fafc;
  font: inherit;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  opacity: 1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.35s ease;
}

.ocm-brand-intro.is-playing .ocm-brand-intro__skip {
  animation: ocmIntroIn 0.35s ease 0.2s both;
}

.ocm-brand-intro__skip:hover,
.ocm-brand-intro__skip:focus-visible {
  color: #e0c35a;
  border-color: #e0c35a;
  background: rgba(3, 24, 32, 0.9);
  outline: 2px solid #e0c35a;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .ocm-brand-intro,
  .ocm-brand-intro__inner,
  .ocm-brand-intro__skip {
    transition-duration: 0.2s !important;
  }

  .ocm-brand-intro.is-playing .ocm-brand-intro__mark,
  .ocm-brand-intro.is-playing .ocm-brand-intro__slogan,
  .ocm-brand-intro.is-playing .ocm-brand-intro__skip {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .ocm-brand-intro.is-leaving .ocm-brand-intro__inner {
    transform: none;
  }
}
