/* First-view offer v2: bounded, mobile-first, and intentionally distinct in 1999 mode. */
.has-first-viewer-offer,
.has-first-viewer-offer body {
  overflow: hidden !important;
}

#firstViewerOffer,
#firstViewerOffer * {
  box-sizing: border-box;
}

#firstViewerOffer {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: grid;
  place-items: center;
  padding:
    max(.75rem, env(safe-area-inset-top))
    max(.75rem, env(safe-area-inset-right))
    max(.75rem, env(safe-area-inset-bottom))
    max(.75rem, env(safe-area-inset-left));
  overflow: hidden;
  overscroll-behavior: contain;
  color: var(--ink, #f5efe3);
}

#firstViewerOffer[hidden] {
  display: none !important;
}

#firstViewerOffer .first-viewer-offer__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 3, 5, .82);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

#firstViewerOffer .first-viewer-offer__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(58rem, 100%);
  min-height: 0;
  max-height: calc(100dvh - max(1.5rem, env(safe-area-inset-top)) - max(1.5rem, env(safe-area-inset-bottom)));
  grid-template-columns: minmax(17rem, .82fr) minmax(0, 1.18fr);
  border: 1px solid color-mix(in srgb, var(--accent) 62%, var(--line));
  border-radius: 1rem;
  background: color-mix(in srgb, var(--surface) 94%, #000 6%);
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, .66);
  overflow: hidden;
  isolation: isolate;
  opacity: 0;
  transform: translateY(.55rem) scale(.99);
  transition: opacity 220ms ease, transform 220ms ease;
}

#firstViewerOffer[data-ready="true"] .first-viewer-offer__dialog {
  opacity: 1;
  transform: none;
}

#firstViewerOffer .first-viewer-offer__close {
  position: absolute;
  top: .7rem;
  right: .7rem;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-color: color-mix(in srgb, var(--line) 86%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  border-style: solid;
  border-width: 1px;
  border-radius: 999px;
  cursor: pointer;
}

#firstViewerOffer .first-viewer-offer__close:focus-visible,
#firstViewerOffer :where(a, button, input):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

#firstViewerOffer .first-viewer-offer__art {
  position: relative;
  min-height: 32rem;
  border-radius: 0;
  overflow: hidden;
  background: #090706;
}

#firstViewerOffer .first-viewer-offer__art-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #090706;
}

#firstViewerOffer .first-viewer-offer__art-bg::before {
  border-radius: 0;
}

#firstViewerOffer .first-viewer-offer__art-bg::before {
  content: "";
  position: absolute;
  inset: -1rem;
  background-image: linear-gradient(180deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .72)), var(--fvop-bg);
  filter: blur(8px) saturate(.92);
  transform: scale(1.06);
  background-size: cover;
  background-position: center;
}

#firstViewerOffer .first-viewer-offer__art-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .02), rgba(0, 0, 0, .58));
}

#firstViewerOffer .first-viewer-offer__mockup {
  position: absolute;
  z-index: 2;
  width: min(88%, 25rem);
  max-width: calc(100% - 1.5rem);
  max-height: calc(100% - 2.5rem);
  left: 50%;
  top: 50%;
  object-fit: contain;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 1.4rem 1.5rem rgba(0, 0, 0, .62));
}

#firstViewerOffer .first-viewer-offer__copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: clamp(2rem, 4vw, 3.25rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: left;
}

#firstViewerOffer .first-viewer-offer__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  padding-right: 2.5rem;
}

#firstViewerOffer .first-viewer-offer__discount {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: .35rem .58rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1;
}

#firstViewerOffer h2 {
  margin: 0;
  color: var(--ink, #f8f0df);
  font-family: var(--display-font, Georgia, serif);
  flex: 1 1 13rem;
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  line-height: .92;
  letter-spacing: 0;
  text-wrap: balance;
}

#firstViewerOffer .first-viewer-offer__subtitle {
  margin: 1rem 0 0;
  color: var(--ink);
  font-size: .92rem;
  font-weight: 800;
  letter-spacing: .035em;
}

#firstViewerOffer .first-viewer-offer__body {
  max-width: 40rem;
  margin: .65rem 0 0;
  color: var(--muted);
  font-size: .94rem;
  line-height: 1.55;
}

#firstViewerOffer .first-viewer-offer__terms {
  margin: .5rem 0 1.15rem;
  color: color-mix(in srgb, var(--muted) 84%, var(--ink));
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .035em;
}

#firstViewerOffer .first-viewer-offer__form,
#firstViewerOffer .newsletter-form {
  width: 100%;
}

#firstViewerOffer .newsletter-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#firstViewerOffer .newsletter-form .field {
  display: grid;
  gap: .35rem;
  min-width: 0;
}

#firstViewerOffer .newsletter-form .field-trap,
#firstViewerOffer .newsletter-form .button {
  grid-column: 1 / -1;
}

#firstViewerOffer .newsletter-form label {
  color: color-mix(in srgb, var(--ink, #fff) 86%, var(--muted, #aaa));
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#firstViewerOffer .newsletter-form input[type="text"],
#firstViewerOffer .newsletter-form input[type="email"] {
  width: 100%;
  min-height: 3rem;
  border: 1px solid color-mix(in srgb, var(--line, rgba(255,255,255,.2)) 85%, var(--accent, #f2a045));
  border-radius: .4rem;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  color: var(--ink, #fff);
  padding: .7rem .82rem;
  font: inherit;
}

#firstViewerOffer .newsletter-form .button {
  width: 100%;
  min-height: 3rem;
  justify-content: center;
}

#firstViewerOffer .first-viewer-offer__mobile-link {
  display: none;
}

#firstViewerOffer .first-viewer-offer__decline {
  align-self: center;
  min-height: 2.75rem;
  margin-top: .55rem;
  padding: .5rem .75rem;
  border: 0;
  background: transparent;
  color: var(--muted, rgba(255,255,255,.68));
  font: 800 .76rem/1.2 system-ui, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

#firstViewerOffer .first-viewer-offer__decline:hover,
#firstViewerOffer .first-viewer-offer__decline:focus-visible {
  color: var(--ink, #fff);
  text-decoration: underline;
  text-underline-offset: .28rem;
}

@media (max-width: 740px) {
  #firstViewerOffer {
    padding:
      max(.5rem, env(safe-area-inset-top))
      max(.5rem, env(safe-area-inset-right))
      max(.5rem, env(safe-area-inset-bottom))
      max(.5rem, env(safe-area-inset-left));
  }

  #firstViewerOffer .first-viewer-offer__dialog {
    width: min(100%, 28rem);
    max-height: calc(100dvh - max(1rem, env(safe-area-inset-top)) - max(1rem, env(safe-area-inset-bottom)));
    grid-template-columns: 1fr;
    grid-template-rows: clamp(8rem, 25dvh, 10.5rem) minmax(0, 1fr);
    border-radius: .8rem;
  }

  #firstViewerOffer .first-viewer-offer__art {
    min-height: 0;
    height: 100%;
    border-radius: 0;
    overflow: hidden;
  }

  #firstViewerOffer .first-viewer-offer__mockup {
    width: min(72%, 16rem);
    max-width: calc(100% - 4.5rem);
    max-height: calc(100% - .75rem);
    top: 52%;
  }

  #firstViewerOffer .first-viewer-offer__copy {
    justify-content: start;
    padding: 1.05rem;
    text-align: left;
  }

  #firstViewerOffer .first-viewer-offer__heading {
    gap: .5rem .7rem;
    padding-right: 0;
  }

  #firstViewerOffer .first-viewer-offer__discount {
    min-height: 1.75rem;
    padding: .28rem .45rem;
    font-size: .68rem;
  }

  #firstViewerOffer h2 {
    flex-basis: 12rem;
    font-size: clamp(1.75rem, 8.5vw, 2.45rem);
    line-height: .96;
  }

  #firstViewerOffer .first-viewer-offer__subtitle {
    margin-top: .7rem;
    font-size: .8rem;
  }

  #firstViewerOffer .first-viewer-offer__body {
    display: block;
    margin-top: .45rem;
    font-size: .84rem;
    line-height: 1.45;
  }

  #firstViewerOffer .first-viewer-offer__terms {
    margin: .4rem 0 .85rem;
    font-size: .66rem;
  }

  #firstViewerOffer .first-viewer-offer__form {
    display: none;
  }

  #firstViewerOffer .first-viewer-offer__mobile-link {
    width: 100%;
    min-height: 3rem;
    display: inline-flex;
    justify-content: center;
  }

  #firstViewerOffer .first-viewer-offer__decline {
    align-self: stretch;
    width: 100%;
    min-height: 2.75rem;
    margin-top: .25rem;
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  #firstViewerOffer .first-viewer-offer__dialog {
    width: min(46rem, 100%);
    grid-template-columns: minmax(12rem, .72fr) minmax(0, 1.28fr);
    grid-template-rows: 1fr;
  }

  #firstViewerOffer .first-viewer-offer__art {
    min-height: 0;
  }

  #firstViewerOffer .first-viewer-offer__copy {
    padding: .9rem 1rem;
  }

  #firstViewerOffer .first-viewer-offer__form {
    display: none;
  }

  #firstViewerOffer .first-viewer-offer__mobile-link {
    width: 100%;
    min-height: 2.8rem;
    display: inline-flex;
    justify-content: center;
  }
}

/* 1999 mode gets a genuine web window, not a modern card with retro colors. */
html[data-mode="1999"] #firstViewerOffer {
  padding:
    max(.5rem, env(safe-area-inset-top))
    max(.5rem, env(safe-area-inset-right))
    max(.5rem, env(safe-area-inset-bottom))
    max(.5rem, env(safe-area-inset-left)) !important;
  font-family: "Comic Sans MS", "Comic Sans", cursive !important;
}

html[data-mode="1999"] #firstViewerOffer .first-viewer-offer__backdrop {
  background: rgba(0, 0, 32, .9) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-mode="1999"] #firstViewerOffer .first-viewer-offer__dialog {
  width: min(52rem, 100%) !important;
  min-height: 0 !important;
  max-height: calc(100dvh - max(1rem, env(safe-area-inset-top)) - max(1rem, env(safe-area-inset-bottom))) !important;
  grid-template-columns: minmax(15rem, .78fr) minmax(0, 1.22fr) !important;
  border: 4px outset var(--1999-border, #ffff00) !important;
  border-radius: 0 !important;
  background: var(--1999-surface, #000080) !important;
  box-shadow: .5rem .5rem 0 #000 !important;
  overflow: hidden !important;
}

html[data-mode="1999"] #firstViewerOffer .first-viewer-offer__art {
  min-height: 30rem !important;
  max-height: none !important;
  border-right: 4px ridge var(--1999-border, #ffff00) !important;
  border-radius: 0 !important;
  background: #000 !important;
}

html[data-mode="1999"] #firstViewerOffer .first-viewer-offer__art-bg::before {
  inset: 0;
  background-image: linear-gradient(rgba(0, 0, 0, .25), rgba(0, 0, 0, .7)), url("/assets/img/1999/pixel-phone-bg.png");
  background-size: cover;
  image-rendering: pixelated;
  filter: none;
  transform: none;
}

html[data-mode="1999"] #firstViewerOffer .first-viewer-offer__mockup {
  width: min(94%, 25rem) !important;
  filter: drop-shadow(.45rem .45rem 0 #000);
}

html[data-mode="1999"] #firstViewerOffer .first-viewer-offer__copy {
  padding: 1.25rem !important;
  color: var(--1999-ink, #fff) !important;
  background: var(--1999-surface, #000080) !important;
}

html[data-mode="1999"] #firstViewerOffer .first-viewer-offer__discount {
  border: 2px solid var(--1999-headingInk, #ffff00);
  color: var(--1999-headingInk, #ffff00);
  background: var(--1999-accent, #ff00ff);
}

html[data-mode="1999"] #firstViewerOffer h2 {
  color: var(--1999-headingInk, #ffff00) !important;
  font-family: "Comic Sans MS", "Comic Sans", cursive !important;
  text-shadow: 2px 2px 0 #000;
}

html[data-mode="1999"] #firstViewerOffer :where(.first-viewer-offer__subtitle, .first-viewer-offer__body, .first-viewer-offer__terms) {
  color: var(--1999-ink, #fff) !important;
}

html[data-mode="1999"] #firstViewerOffer .first-viewer-offer__close,
html[data-mode="1999"] #firstViewerOffer :where(.newsletter-form .button, .first-viewer-offer__mobile-link) {
  border: 3px outset var(--1999-border, #ffff00) !important;
  border-radius: 0 !important;
  background: var(--1999-accent, #ff00ff) !important;
  color: var(--1999-headingInk, #ffff00) !important;
  box-shadow: none !important;
}

html[data-mode="1999"] #firstViewerOffer .newsletter-form input[type="text"],
html[data-mode="1999"] #firstViewerOffer .newsletter-form input[type="email"] {
  border: 2px inset var(--1999-border, #ffff00) !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #000 !important;
}

html[data-mode="1999"] #firstViewerOffer .first-viewer-offer__decline {
  color: var(--1999-link, #00ffff) !important;
  font-family: inherit !important;
}

@media (max-width: 740px) {
  html[data-mode="1999"] #firstViewerOffer .first-viewer-offer__dialog {
    width: 100% !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: clamp(7.5rem, 23dvh, 9.5rem) minmax(0, 1fr) !important;
  }

  html[data-mode="1999"] #firstViewerOffer .first-viewer-offer__art {
    min-height: 0 !important;
    max-height: none !important;
    border-right: 0 !important;
    border-bottom: 4px ridge var(--1999-border, #ffff00) !important;
  }

  html[data-mode="1999"] #firstViewerOffer .first-viewer-offer__copy {
    padding: .85rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #firstViewerOffer .first-viewer-offer__dialog {
    transition: none !important;
    transform: none !important;
  }
}
