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

:root {
  --bg: #080808;
  --fg: #e8e8e6;
  --fg-muted: #7a7a78;
  --fg-whisper: #4e4e4c;
  --border: rgba(232, 232, 230, 0.28);
  --border-hover: rgba(232, 232, 230, 0.72);
  --divider: rgba(232, 232, 230, 0.14);
  --btn-bg: rgba(8, 8, 8, 0.78);
  --btn-bg-hover: rgba(24, 24, 24, 0.92);
  --mono: "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

/* ==========================================================================
   Page 1: Landing Gate
   ========================================================================== */

body.gate-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

.gate {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg);
}

.gate-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
  z-index: 1;
}

.gate-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  background: transparent;
  z-index: 2;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.58) 0%,
    rgba(0, 0, 0, 0.66) 34%,
    rgba(0, 0, 0, 1) 52%,
    rgba(0, 0, 0, 1) 100%
  );
  mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.58) 0%,
    rgba(0, 0, 0, 0.66) 34%,
    rgba(0, 0, 0, 1) 52%,
    rgba(0, 0, 0, 1) 100%
  );
}

.gate-actions {
  position: absolute;
  top: calc(1.25rem + env(safe-area-inset-top, 0px));
  right: calc(1.25rem + env(safe-area-inset-right, 0px));
  width: max-content;
  max-width: calc(100% - 2rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 4;
}

.gate-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 0.28rem 0.6rem;
  background-color: rgba(8, 8, 8, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0;
  color: #f2f2f2;
  font-family: "Times New Roman", Times, Georgia, serif;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.gate-btn:hover {
  background-color: rgba(8, 8, 8, 0.92);
  border-color: rgba(255, 255, 255, 0.8);
  color: #ffffff;
}

.gate-btn:focus-visible {
  outline: 1px solid #f2f2f2;
  outline-offset: 2px;
  border-color: rgba(255, 255, 255, 0.8);
}

.gate-btn:active {
  background-color: #f2f2f2;
  border-color: #f2f2f2;
  color: #080808;
}

/* ==========================================================================
   Page 2: Sparse Intel
   ========================================================================== */

body.intel-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(2rem + env(safe-area-inset-top, 0px))
    calc(1.5rem + env(safe-area-inset-right, 0px))
    calc(2rem + env(safe-area-inset-bottom, 0px))
    calc(1.5rem + env(safe-area-inset-left, 0px));
}

.intel {
  width: 100%;
  max-width: 34rem;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1.35rem, 2.5vh, 1.85rem);
}

.intel-line {
  font-size: clamp(0.875rem, 0.82rem + 0.25vw, 0.96875rem);
  line-height: 1.65;
  letter-spacing: 0.06em;
  color: var(--fg);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.intel-disclaimer {
  width: 100%;
  max-width: 34rem;
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 1.5rem;
  row-gap: 0.35rem;
  font-size: clamp(0.72rem, 0.69rem + 0.12vw, 0.76rem);
  line-height: 1.6;
  letter-spacing: 0.03em;
  color: #8f8f8f;
  overflow-wrap: break-word;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

/* Portrait & square-ish viewports: frame the woman's face & transparent cutouts,
   remove the wide-screen horizontal mask */
@media (max-aspect-ratio: 6 / 5) {
  .gate-overlay {
    object-position: 68.5% 48%;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .gate-video {
    object-position: 50% 45%;
  }

  .gate-actions {
    top: calc(1rem + env(safe-area-inset-top, 0px));
    right: calc(1rem + env(safe-area-inset-right, 0px));
  }
}

/* Mobile touch devices in landscape (e.g. 844x390) */
@media (max-height: 500px) and (orientation: landscape) {
  .gate-actions {
    top: calc(0.875rem + env(safe-area-inset-top, 0px));
    right: calc(0.875rem + env(safe-area-inset-right, 0px));
  }

  body.intel-page {
    padding: calc(1.25rem + env(safe-area-inset-top, 0px))
      calc(1.5rem + env(safe-area-inset-right, 0px))
      calc(1.25rem + env(safe-area-inset-bottom, 0px))
      calc(1.5rem + env(safe-area-inset-left, 0px));
  }

  .intel-disclaimer {
    padding-top: 1.25rem;
  }
}

/* Ultra-narrow screens down to 320px */
@media (max-width: 380px) {
  body.intel-page {
    padding: calc(1.5rem + env(safe-area-inset-top, 0px))
      calc(1.125rem + env(safe-area-inset-right, 0px))
      calc(1.5rem + env(safe-area-inset-bottom, 0px))
      calc(1.125rem + env(safe-area-inset-left, 0px));
  }

  .intel-line {
    letter-spacing: 0.04em;
  }

  .intel-disclaimer {
    column-gap: 1rem;
  }
}
