/* GLOP pre-launch sign up (/prelaunch) — port of the glop.world teaser (horizon-glop sections/glop-teaser.liquid).
   Figma: black video frame, copy block at 17.3% from the left, headline at 45% height, Favorit Mono on black. */

:root {
  --ink: #fffef2;
  --pink: #ffa2dc;
  --margin: 28px;
  --mono: 'ABC Favorit Mono', 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

@media (max-width: 749px) {
  :root { --margin: 20px; }
}

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

/* Classes below set display, which would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #000;
}

.glop-teaser {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  background: #000;
  color: var(--ink);
  overflow: hidden;
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}

.glop-teaser__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.glop-teaser__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.glop-teaser__copy {
  position: absolute;
  z-index: 1;
  left: 17.3%;
  top: 45.4%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: clamp(220px, 16.2vw, 300px);
}

.glop-teaser__title {
  margin: 0 0 clamp(40px, 4.1vw, 64px);
  font: 400 clamp(18px, 1.42vw, 22px) / 0.964 var(--mono);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.glop-teaser__form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

.glop-teaser__label {
  margin: 0 0 clamp(12px, 1.2vw, 18px);
  font-size: clamp(12px, 0.95vw, 15px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.glop-teaser__done { margin: 0; outline: none; }

.glop-teaser__input {
  width: 100%;
  margin: 0;
  padding: 0 0 clamp(10px, 0.9vw, 14px);
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: max(16px, 0.95vw); /* 16px floor stops iOS zooming on focus */
  letter-spacing: 0.04em;
  text-transform: uppercase;
  outline: none;
}

.glop-teaser__input::placeholder {
  color: var(--ink);
  opacity: 0.5;
}

.glop-teaser__input:focus-visible { border-bottom-color: var(--pink); }

.glop-teaser__submit {
  appearance: none;
  margin: clamp(14px, 1.3vw, 22px) 0 0;
  padding: 0 clamp(16px, 1.2vw, 20px);
  height: clamp(40px, 2.9vw, 46px);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(12px, 0.95vw, 15px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.glop-teaser__submit:hover { background: var(--ink); color: #000; }
.glop-teaser__submit:active { transform: translateY(1px); }
.glop-teaser__submit:disabled { opacity: 0.5; cursor: progress; }
.glop-teaser__submit:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }

.glop-teaser__error {
  margin: 10px 0 0;
  font-size: clamp(11px, 0.85vw, 13px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pink);
}

/* Honeypot: off-screen, not display:none, so bots still fill it */
.glop-teaser__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.glop-teaser__back {
  position: absolute;
  z-index: 2;
  right: var(--margin);
  bottom: var(--margin);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.6;
}

.glop-teaser__back:hover,
.glop-teaser__back:focus-visible { opacity: 1; }

@media (max-width: 749px) {
  /* Letterbox the 16:9 loop so the chrysalis is never under the copy */
  .glop-teaser__media {
    top: 14%;
    bottom: auto;
    aspect-ratio: 16 / 9;
  }

  .glop-teaser__video {
    object-position: 55% 50%;
    transform: scale(1.35);
    transform-origin: 55% 50%;
  }

  /* 9:16 cut on phones: no letterbox. Its ground is #100e0e, not #000, so the page
     matches it and the frame fades out at the bottom; no seam where the blacks meet. */
  html:has(.glop-teaser__video--portrait),
  html:has(.glop-teaser__video--portrait) body,
  .glop-teaser:has(.glop-teaser__video--portrait) {
    background: #100e0e;
  }

  /* width-fit keeps the chrysalis (bottom at ~74% of the 177.8vw-tall frame) above the
     copy; short phones lift the frame (crops branch, not chrysalis) */
  .glop-teaser__media:has(.glop-teaser__video--portrait) {
    inset: 0 0 auto;
    top: min(0px, calc(86svh - 190px - 131.6vw));
    max-height: 100%;
    aspect-ratio: 9 / 16;
  }

  .glop-teaser__media:has(.glop-teaser__video--portrait)::after {
    content: '';
    position: absolute;
    inset: auto 0 -1px;
    height: 30%;
    background: linear-gradient(to bottom, rgb(16 14 14 / 0), #100e0e);
    pointer-events: none;
  }

  .glop-teaser__media .glop-teaser__video--portrait {
    object-position: 50% 0%;
    transform: none;
  }

  .glop-teaser__copy {
    left: var(--margin);
    right: var(--margin);
    top: auto;
    bottom: 14%;
    width: auto;
  }

  .glop-teaser__title {
    font-size: 18px;
    margin-bottom: 32px;
    white-space: normal;
  }

  .glop-teaser__label,
  .glop-teaser__submit { font-size: 13px; }

  .glop-teaser__submit {
    height: 44px;
    min-width: 120px;
  }

  .glop-teaser__back {
    right: auto;
    left: var(--margin);
    bottom: 24px;
  }
}

/* Outside welcome (/prelaunch/?=outside). The card is an inner div so a click on the
   dialog element itself means the backdrop was clicked. */
.glop-outside {
  width: min(440px, calc(100vw - 2 * var(--margin)));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 28px;
  outline: none;
  overflow: visible;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}

.glop-outside::backdrop {
  background: rgb(0 0 0 / 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.glop-outside[open] { animation: glop-outside-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.glop-outside[open]::backdrop { animation: glop-outside-fade 0.3s ease both; }

.glop-outside__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 44px 36px 36px;
  border: 1.5px solid var(--ink);
  border-radius: 28px;
  background: #100e0e;
  box-shadow: 0 0 0 6px rgb(255 162 220 / 0.18), 0 24px 80px rgb(255 162 220 / 0.22);
  text-align: center;
}

.glop-outside__card:focus { outline: none; }

.glop-outside__kicker {
  margin: 0 0 18px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-wrap: balance;
}

.glop-outside__logo {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 0 32px;
  transform: rotate(-4deg);
  filter: drop-shadow(0 6px 18px rgb(255 205 0 / 0.25));
  animation: glop-outside-logo 0.7s 0.15s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
}

.glop-outside__form {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.glop-outside__form .glop-teaser__input { text-align: center; }
.glop-outside .glop-teaser__done { margin: 0; text-wrap: balance; }

.glop-outside__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 400 26px / 1 var(--mono);
  cursor: pointer;
  opacity: 0.7;
}

.glop-outside__close:hover { opacity: 1; }
.glop-outside__close:focus-visible { outline: 2px solid var(--pink); border-radius: 50%; opacity: 1; }

@keyframes glop-outside-in {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
}

@keyframes glop-outside-fade {
  from { opacity: 0; }
}

@keyframes glop-outside-logo {
  from { opacity: 0; transform: rotate(-14deg) scale(0.6); }
}

@media (max-width: 749px) {
  .glop-outside__card { padding: 56px 24px 28px; }
  .glop-outside__kicker { font-size: 12px; }
  .glop-outside__logo { max-width: 240px; margin-bottom: 26px; }
}

/* Small phones (SE 1st gen): keep "Thanks for reading about us in" on one line */
@media (max-width: 360px) {
  .glop-outside__card { padding-left: 18px; padding-right: 18px; }
  .glop-outside__kicker { font-size: 11px; letter-spacing: 0.03em; }
}

/* Short viewports (phone landscape, keyboard open): compact card, scroll if it still doesn't fit */
@media (max-height: 540px) {
  .glop-outside { max-height: calc(100dvh - 16px); overflow-y: auto; }
  .glop-outside__card { padding: 28px 32px 22px; }
  .glop-outside__close { top: 8px; right: 10px; }
  .glop-outside__kicker { margin-bottom: 10px; }
  .glop-outside__logo { max-width: 190px; margin-bottom: 16px; }
  .glop-outside .glop-teaser__label { margin-bottom: 8px; }
  .glop-outside .glop-teaser__submit { margin-top: 12px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .glop-outside[open],
  .glop-outside[open]::backdrop,
  .glop-outside__logo { animation: none; }
}
