/* --------------------------------------------------------------------------
   Esoteric coding game — landing
   Responsive landing page.
   -------------------------------------------------------------------------- */

:root {
  --bg-0: #101722;
  --bg-1: #172233;
  --bg-2: #1e2c40;
  --panel: rgba(25, 37, 55, 0.94);
  --panel-border: rgba(126, 169, 224, 0.3);
  --ink: #e0e4eb;
  --ink-dim: #a8b1bf;
  --ink-faint: #8591a3;
  --accent: #7ea9e0;
  --accent-soft: rgba(126, 169, 224, 0.14);
  --danger: #ff8f8f;
  --steam: #6b7580;
  --radius: 14px;
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  overflow-x: hidden;
}

#code-rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  #code-rain { display: none; }
}

/* Keep the background free of scanlines and noise. */
.noise,
.scanlines {
  display: none;
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
}

.noise {
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.scanlines {
  opacity: 0.04;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.06) 0,
    rgba(255, 255, 255, 0.06) 1px,
    transparent 2px,
    transparent 4px
  );
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  padding: 48px 32px 36px;
  gap: 28px;
}

.brand {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
  user-select: none;
}

.brand__glyph {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid rgba(148, 164, 186, 0.12);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
}

.panel {
  position: relative;
  width: min(640px, 100%);
  padding: 44px 48px;
  background:
    linear-gradient(180deg, rgba(126, 169, 224, 0.03), transparent 28%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: rise 0.8s var(--ease) both;
}

/* Full-height square brackets frame the content with open top/bottom edges. */
.panel::before,
.panel::after {
  content: "";
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 60px;
  border: 6px solid var(--panel-border);
  border-radius: 3px;
  pointer-events: none;
}

.panel::before {
  left: -6px;
  border-right: 0;
}

.panel::after {
  right: -6px;
  border-left: 0;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.title {
  margin: 0 0 28px;
  font-family: var(--font-mono);
  font-size: clamp(1.85rem, 2.4vw, 2.35rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #f0f2f6;
}

.copy p {
  margin: 0 0 1.05em;
  color: var(--ink-dim);
}

.copy p:last-child {
  margin-bottom: 0;
}

.aside {
  color: var(--ink-faint);
  font-style: italic;
}

.signoff {
  margin-top: 1.4em !important;
  margin-bottom: 1.4em !important;
  font-family: var(--font-mono);
  font-size: 0.95em;
  color: var(--ink);
}


.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s var(--ease),
    opacity 0.2s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* EmailOctopus injects its own stylesheet. Scope these overrides to this form;
   !important is only needed for its inline styles and utility declarations. */
#newsletter-form {
  font-family: var(--font-mono);
}

#newsletter-form .inline-container {
  max-width: none !important;
}

#newsletter-form .form-container {
  max-width: none;
  width: 100%;
  margin: 0;
}

#newsletter-form .emailoctopus-form-wrapper {
  display: flex;
  flex-direction: column;
  margin: 0 !important;
  padding: 0 !important;
}

#newsletter-form .emailoctopus-form {
  order: -1;
  margin: 0;
  font-size: 13px;
}

/* EmailOctopus hides this badge and uses the notice below instead. Keep its
   offscreen position from widening the page while Google is loading. */
#newsletter-form .grecaptcha-badge {
  right: 0 !important;
}

#newsletter-form .main-form {
  display: flex;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  background: rgba(13, 20, 31, 0.55);
  flex-wrap: nowrap;
  align-items: stretch;
}

#newsletter-form .main-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

#newsletter-form [eo-form-fields-container] {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

#newsletter-form .emailoctopus-form-row {
  min-width: 0;
  margin: 0 !important;
}

#newsletter-form input[type="email"] {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  box-shadow: none;
}

#newsletter-form input[type="email"]::placeholder {
  color: rgba(151, 164, 183, 0.75);
}

#newsletter-form .main-form:has(input[type="email"]:user-invalid) {
  border-color: var(--danger);
}

#newsletter-form input[type="submit"] {
  flex: 0 0 auto;
  width: auto;
  min-width: 132px;
  height: 48px;
  margin: 0 !important;
  padding: 0 18px;
  border: 0;
  border-left: 1px solid var(--panel-border);
  border-radius: 0;
  background: var(--accent);
  color: #111b29;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
}

#newsletter-form input[type="submit"]:focus-visible {
  outline: 2px solid #111b29;
  outline-offset: -4px;
}

#newsletter-form input[type="submit"]:disabled {
  cursor: progress;
  opacity: 0.85;
}

#newsletter-form input[type="submit"]:hover:not(:disabled) {
  background: #9bbce8;
}

#newsletter-form input[type="submit"]:active:not(:disabled) {
  background: #709bd2;
}

#newsletter-form .emailoctopus-error-message,
#newsletter-form .emailoctopus-success-message {
  margin: 10px 0 0;
  padding: 0;
  color: var(--accent) !important;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  text-align: left;
}

#newsletter-form .emailoctopus-error-message {
  color: var(--danger) !important;
}

#newsletter-form .emailoctopus-success-message {
  font-size: 18px;
}

#newsletter-form .emailoctopus-error-message:empty,
#newsletter-form .emailoctopus-success-message:empty {
  margin: 0;
}

/* Retain the provider's required free-plan attribution. */
#newsletter-form .mastfoot {
  display: block;
  margin-top: 18px !important;
}

#newsletter-form .mastfoot p {
  display: block;
  line-height: 20px;
}

#newsletter-form .mastfoot a::before {
  top: 1px;
  filter: hue-rotate(-28deg) saturate(0.6) brightness(1.05);
  /* AI version: filter: hue-rotate(-35deg) saturate(0.65) brightness(1.2); */
}

#newsletter-form .mastfoot p,
#newsletter-form .mastfoot a {
  color: var(--ink-dim);
}

.footer__privacy {
  margin: 12px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: normal;
  text-align: center;
  user-select: text;
}

.footer__privacy a {
  color: inherit;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.divider span {
  height: 1px;
  background: rgba(148, 164, 186, 0.12);
}

.divider em {
  font-style: normal;
}

.btn--steam {
  width: 100%;
  border-color: rgba(148, 163, 176, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--steam);
  cursor: not-allowed;
  opacity: 0.55;
}

.btn--steam:disabled {
  filter: grayscale(0.35);
}

.btn__icon {
  flex: 0 0 auto;
  opacity: 0.85;
}

.btn__badge {
  margin-left: 2px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 176, 0.22);
  background: rgba(255, 255, 255, 0.04);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(148, 163, 176, 0.9);
}

.footer {
  max-width: 640px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  color: rgba(133, 145, 163, 0.55);
  user-select: none;
}

.footer__marks {
  display: inline-block;
}

/* Tablets: keep the centered card, with room for browser chrome and touch. */
@media (max-width: 1024px) {
  .page {
    min-height: 100svh;
    padding: 32px 28px 24px;
    gap: 24px;
  }

  #newsletter-form input[type="email"] {
    font-size: 16px;
  }
}

/* Phones: give the copy more width and keep the brackets proportional. */
@media (max-width: 600px) {
  body {
    font-size: 16px;
    line-height: 1.6;
  }

  .page {
    padding: 24px 20px 20px;
    gap: 24px;
  }

  .panel {
    min-width: 0;
    padding: 30px 24px;
  }

  .panel::before,
  .panel::after {
    top: -4px;
    bottom: -4px;
    width: 36px;
    border-width: 4px;
    border-radius: 2px;
  }

  .panel::before { left: -4px; }
  .panel::after { right: -4px; }

  .eyebrow {
    margin-bottom: 12px;
    font-size: 11px;
  }

  .title {
    margin-bottom: 22px;
    font-size: clamp(1.6rem, 6vw, 1.85rem);
    line-height: 1.2;
  }

  #newsletter-form input[type="email"] {
    padding: 0 12px;
  }

  #newsletter-form input[type="submit"] {
    min-width: 112px;
    padding: 0 12px;
  }

  .footer {
    font-size: 11px;
    letter-spacing: 0.2em;
  }
}

/* Keep the joined form usable when side-by-side fields become too narrow. */
@media (max-width: 480px) {
  #newsletter-form .main-form {
    flex-direction: column;
  }

  #newsletter-form input[type="submit"] {
    width: 100%;
    border-left: 0;
    border-top: 1px solid rgba(126, 169, 224, 0.3);
  }

}

@media (max-width: 360px) {
  .page { padding-inline: 16px; }
  .panel { padding-inline: 18px; }
}
