/* =============================================================
   CrispSign — "Choose a Path" doorway gate v3
   -------------------------------------------------------------
   - Full-viewport split, edge-to-edge
   - Brand palette: cream #F7F5F0, navy #061F3F, red #DB0D1C
   - Vertical cream+red-outline divider connecting through the
     center wordmark pill
   - Wordmark ONLY in the center (no top-left duplicate)
   ============================================================= */

.cs-doorway {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  background: #F7F5F0;
  color: #061F3F;
  font-family: var(--font-body, Inter, system-ui, -apple-system, sans-serif);
  opacity: 0;
  transition: opacity 240ms ease-out;
  overflow: hidden;
}
.cs-doorway.is-open { opacity: 1; }
.cs-doorway * { box-sizing: border-box; }

/* ---------- Top bar (skip only, wordmark removed) ---------- */
.cs-doorway-topbar {
  position: absolute;
  top: 0; right: 0;
  padding: 24px 32px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  z-index: 6;
  pointer-events: none;
}
.cs-doorway-skip {
  pointer-events: auto;
  background: rgba(247, 245, 240, 0.94);
  border: 1px solid rgba(6, 31, 63, 0.15);
  color: #061F3F;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}
.cs-doorway-skip:hover { background: #FFFFFF; transform: translateY(-1px); }

/* ---------- Split panels ---------- */
.cs-doorway-split {
  display: flex;
  width: 100%;
  height: 100%;
}

.cs-doorway-panel {
  position: relative;
  flex: 1;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px 44px 56px;
  transition: flex 380ms cubic-bezier(0.22, 0.61, 0.36, 1);
  min-height: 100vh;
  text-decoration: none;
  color: inherit;
}
.cs-doorway-panel,
.cs-doorway-panel * { text-decoration: none !important; }

/* Give copy on left panel a little breathing room from the center divider */
.cs-doorway-panel--left  { padding-right: 90px; }
.cs-doorway-panel--right { padding-left: 90px; }

/* Background photo — desaturated to b&w by default; recolors on hover */
.cs-doorway-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--cs-doorway-bg);
  background-size: cover;
  background-position: center;
  z-index: 0;
  transition: filter 550ms ease, transform 900ms cubic-bezier(0.22, 0.61, 0.36, 1);
  filter: grayscale(1) contrast(1.02) brightness(0.92);
}

/* Brand tint overlay — dark navy wash on the b&w state so the
   full-color copy and CTAs stay legible on top. Lifts on hover so the
   color photo can breathe. */
.cs-doorway-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity 380ms ease, background 550ms ease;
  background: linear-gradient(
    180deg,
    rgba(6, 31, 63, 0.42) 0%,
    rgba(6, 31, 63, 0.32) 42%,
    rgba(6, 31, 63, 0.72) 100%
  );
}

@media (hover: hover) {
  .cs-doorway-panel:hover::before {
    filter: grayscale(0) saturate(1.05) brightness(1);
  }
  .cs-doorway-panel:hover::after {
    /* Lighten the wash so the color image reads through */
    background: linear-gradient(
      180deg,
      rgba(247, 245, 240, 0.10) 0%,
      rgba(247, 245, 240, 0.03) 42%,
      rgba(6, 31, 63, 0.55) 100%
    );
  }
  /* No flex-scale on hover so both panels stay perfectly 50/50 and
     the vertical divider never shifts left or right. */
}

.cs-doorway-panel--left  { --cs-doorway-bg: url('./doorway-left-loaded.webp'); }
.cs-doorway-panel--right { --cs-doorway-bg: url('./doorway-right-badsign.webp'); }

/* ---------- Center vertical divider ---------- */
/*
  Single full-height cream+red-outline line, top to bottom.
  The wordmark pill and caption pill sit ON TOP of this line
  (higher z-index) so the divider connects to them without
  visible gaps.
*/
.cs-doorway-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  z-index: 3;
  pointer-events: none;
  background: #F7F5F0;
  border-left: 1.5px solid #DB0D1C;
  border-right: 1.5px solid #DB0D1C;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.25);
}

/* ---------- Center wordmark: halo glow, no container ---------- */
/*
  The wordmark IS the shape. A soft radial cream halo sits behind it
  so it separates from the photography without a hard container edge.
  The vertical divider passes through it uninterrupted (the halo is
  purely visual and doesn't block the divider visually).
*/
.cs-doorway-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%); /* perfectly centered */
  z-index: 4;
  pointer-events: none;
  width: min(440px, 44vw);
  padding: 20px 8px;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.45));
}

/* Intense cream radial halo behind the wordmark.
   Two stacked layers: a tight inner core (near-opaque cream) + a
   larger soft outer bloom that fades to transparent. */
.cs-doorway-center::before {
  content: "";
  position: absolute;
  inset: -60% -25%;
  background:
    radial-gradient(ellipse at center,
      rgba(247, 245, 240, 1.00)  0%,
      rgba(247, 245, 240, 0.95) 18%,
      rgba(247, 245, 240, 0.75) 34%,
      rgba(247, 245, 240, 0.40) 55%,
      rgba(247, 245, 240, 0.00) 82%);
  z-index: -1;
  pointer-events: none;
  filter: blur(2px);
}
/* Extra outer glow so the halo bleeds further into the photos */
.cs-doorway-center::after {
  content: "";
  position: absolute;
  inset: -110% -55%;
  background: radial-gradient(ellipse at center,
    rgba(247, 245, 240, 0.35) 0%,
    rgba(247, 245, 240, 0.15) 45%,
    rgba(247, 245, 240, 0.00) 78%);
  z-index: -2;
  pointer-events: none;
  filter: blur(6px);
}

.cs-doorway-pill {
  /* No box — wordmark sits directly on the halo */
  display: flex;
  align-items: center;
  justify-content: center;
}
.cs-doorway-pill img {
  width: 100%;
  height: auto;
  display: block;
}

/* "CHOOSE A PATH" pill — sits directly under the wordmark, centered on the divider */
.cs-doorway-caption-pill {
  position: absolute;
  top: calc(50% + 88px); /* below the halo, on the same vertical divider */
  left: 50%;
  transform: translate(-50%, 0);
  z-index: 5;
  background: #F7F5F0;
  border: 2px solid #DB0D1C;
  border-radius: 999px;
  padding: 8px 22px;
  color: #061F3F;
  font-family: var(--font-body, Inter, system-ui, sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

/* ---------- Panel copy ---------- */
.cs-doorway-copy {
  position: relative;
  z-index: 2;
  max-width: 460px;
  color: #FFFFFF;
}
.cs-doorway-eyebrow {
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #FFFFFF;
  margin: 0 0 14px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  display: inline-flex;
  align-items: center;
}
.cs-doorway-eyebrow-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #DB0D1C;
  margin-right: 14px;
  box-shadow: 0 0 10px rgba(219, 13, 28, 0.7);
}
.cs-doorway-head {
  font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
  color: #FFFFFF;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.cs-doorway-sub {
  font-family: inherit;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.94);
  margin: 0 0 26px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  max-width: 42ch;
}
.cs-doorway-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #F7F5F0;
  color: #061F3F;
  padding: 15px 26px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}
.cs-doorway-cta:hover {
  background: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.cs-doorway-cta-arrow {
  display: inline-block;
  transition: transform 180ms ease;
}
.cs-doorway-cta:hover .cs-doorway-cta-arrow { transform: translateX(4px); }

/* ---------- Mobile: compact stacked (Option 4) ----------
   Layout is 40% photo + 20% cream strip (logo + caption pill) + 40% photo.
   Everything gets dedicated space — no overlap possible.
*/
@media (max-width: 820px) {
  .cs-doorway-topbar { padding: 14px 16px; }

  /* Root becomes a column flex container.
     .cs-doorway-split uses `display: contents` so its two panels become
     direct children of the root, participating in the same flex layout as
     the center brand strip and caption pill. */
  .cs-doorway { display: flex; flex-direction: column; }
  .cs-doorway-split { display: contents; }

  .cs-doorway-panel {
    flex: 40;                 /* 40% of the column */
    min-height: 0;            /* override desktop 100vh */
    padding: 20px 18px 24px !important;
    justify-content: flex-end;
  }
  .cs-doorway-panel:hover { flex: 40; }

  /* Divider is not used on mobile in this variant */
  .cs-doorway-divider { display: none; }

  /* Center brand strip — inline flex item between the two panels.
     Uses flex: 0 0 auto so the strip is only as tall as its contents,
     not a fixed % of the column height. Tight padding hugs the logo
     and caption pill closely so there's no empty white space. */
  .cs-doorway-center {
    position: static;
    transform: none;
    order: 2;
    flex: 0 0 auto;           /* hug contents — no forced height */
    width: 100%;
    max-width: none;
    padding: 8px 16px 10px;   /* tighter top/bottom */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;                 /* pull caption pill closer to the logo */
    background: #F7F5F0;
    border-top: 1.5px solid #DB0D1C;
    border-bottom: 1.5px solid #DB0D1C;
    z-index: 3;
    filter: none;
  }
  /* Kill BOTH desktop halo pseudo-elements on mobile. The strip is the container.
     (::after gets fully re-declared below as the inline caption pill.) */
  .cs-doorway-center::before { display: none !important; }
  .cs-doorway-center::after  { all: unset; }

  /* Logo fills the full strip width — same left/right margins as the CTAs
     (CTAs sit at .cs-doorway-panel padding: 20px 18px, and skip pill at 14px 16px).
     Use 16px inset on each side so the logo aligns with the skip pill's outer edge. */
  .cs-doorway-pill { padding: 0; width: 100%; }
  .cs-doorway-pill img {
    width: 100%;
    max-width: none;
    height: auto;
    display: block;
  }

  /* Order panels around the strip; give each panel the remaining space split evenly */
  .cs-doorway-panel { flex: 1 1 0 !important; min-height: 0 !important; }
  .cs-doorway-panel--left  { order: 1; }
  .cs-doorway-panel--right { order: 3; padding-top: 20px !important; justify-content: flex-start; }

  /* Hide the original absolute-positioned caption pill; render a fresh
     inline caption pill inside the strip via a second ::after rule. */
  .cs-doorway-caption-pill { display: none !important; }
  .cs-doorway-center::after {
    content: "Choose a Path";
    display: inline-block;
    position: static;
    inset: auto;
    top: auto; left: auto; right: auto; bottom: auto;
    width: auto;
    height: auto;
    transform: none;
    background: #F7F5F0 !important;
    background-image: none !important;
    color: #061F3F;
    border: 2px solid #DB0D1C;
    border-radius: 999px;
    padding: 5px 14px;
    margin: 0;
    font-family: var(--font-body, Inter, system-ui, sans-serif);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    filter: none;
    z-index: 4;
  }

  .cs-doorway-head { font-size: 20px; margin-bottom: 8px; }
  .cs-doorway-sub  { font-size: 12px; margin-bottom: 14px; line-height: 1.5; }
  .cs-doorway-cta  { padding: 10px 18px; font-size: 11px; }
  .cs-doorway-eyebrow { font-size: 10px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .cs-doorway,
  .cs-doorway-panel,
  .cs-doorway-panel::before,
  .cs-doorway-panel::after,
  .cs-doorway-cta,
  .cs-doorway-cta-arrow {
    transition: none !important;
  }
  .cs-doorway-panel:hover { flex: 1 !important; }
  .cs-doorway-panel:hover::before { transform: none !important; }
}
