/*
 * Mailing-list form. Colours come only from the homepage's own theme variables (--text, --muted, --accent,
 * --label-color, --master-vector-color and the stage's data attributes), so the form re-colours itself
 * whenever the dashboard theme changes.
 */
.world-stage {
  --ml-ink: var(--text);
  --ml-muted: var(--muted);
  --ml-accent: var(--accent);
  --ml-surface: rgba(8, 9, 9, .82);
}
.world-stage[data-master-color="on"] { --ml-accent: var(--master-vector-color); }
.world-stage[data-label-color="custom"] { --ml-ink: var(--label-color); }
.world-stage[data-light-backdrop="true"] .stay-in-touch { --ml-ink: #1b1c1d; --ml-surface: rgba(255, 255, 255, .72); }

.ml-form {
  --ml-line: color-mix(in srgb, var(--ml-ink) 28%, transparent);
  display: grid;
  gap: 14px;
  width: min(100%, 460px);
  color: var(--ml-ink);
  font-family: var(--sans, "Helvetica Neue", Helvetica, Arial, sans-serif);
}
.ml-headline { margin: 0; color: var(--ml-ink); font-size: 1.05rem; font-weight: 500; letter-spacing: .06em; line-height: 1.3; }
.world-panel .ml-description { margin: 0; color: var(--ml-muted); font-size: .8rem; line-height: 1.6; }
.ml-row { display: flex; align-items: stretch; gap: 0; }
.ml-row input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--ml-line);
  border-right: 0;
  border-radius: 0;
  background: var(--ml-surface);
  color: var(--ml-ink);
  font: inherit;
  font-size: .9rem;
  letter-spacing: .02em;
}
.ml-row input[type="email"]::placeholder { color: color-mix(in srgb, var(--ml-ink) 45%, transparent); }
.ml-row input[type="email"]:focus-visible { outline: 0; border-color: var(--ml-accent); box-shadow: 0 0 0 1px var(--ml-accent); }
.world-panel .ml-submit, .ml-submit {
  position: relative;
  flex: 0 0 auto;
  min-height: 48px;
  padding: 10px 20px;
  border: 1px solid var(--ml-ink);
  border-radius: 0;
  background: transparent;
  color: var(--ml-ink);
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.world-panel .ml-submit:hover:not(:disabled), .ml-submit:hover:not(:disabled),
.ml-submit:focus-visible {
  border-color: var(--ml-accent);
  background: color-mix(in srgb, var(--ml-accent) 22%, transparent);
  color: var(--ml-ink);
  outline: 0;
}
.ml-submit:disabled { cursor: progress; opacity: .7; }
.ml-submit[data-loading="true"] .ml-submit-label { opacity: 0; }
.ml-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border: 2px solid color-mix(in srgb, var(--ml-ink) 30%, transparent);
  border-top-color: var(--ml-ink);
  border-radius: 50%;
  opacity: 0;
  animation: ml-spin .8s linear infinite;
}
.ml-submit[data-loading="true"] .ml-spinner { opacity: 1; }
@keyframes ml-spin { to { transform: rotate(360deg); } }
.ml-consent { display: flex; align-items: flex-start; gap: 10px; color: var(--ml-muted); font-size: .72rem; line-height: 1.5; cursor: pointer; }
.ml-consent input { flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ml-accent); }
.ml-consent input:focus-visible { outline: 1px solid var(--ml-accent); outline-offset: 2px; }
.ml-status { min-height: 1.2em; margin: 0; font-size: .76rem; line-height: 1.5; color: var(--ml-muted); }
.ml-status[data-state="error"] { color: var(--ml-ink); }
.ml-status[data-state="error"]::before { content: "× "; color: var(--ml-accent); font-weight: 700; }
.ml-success { display: grid; gap: 8px; padding: 18px 0; border-top: 1px solid var(--ml-line); border-bottom: 1px solid var(--ml-line); }
.ml-success p { margin: 0; color: var(--ml-ink); font-size: .9rem; line-height: 1.6; }
.ml-success .ml-success-mark { color: var(--ml-accent); font-size: .7rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.ml-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.content-section .mailing-section-body { min-height: 0; }

/* "Stay In Touch" button, bottom right above the footer line. */
.stay-in-touch {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: calc(34px + env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--ml-line, color-mix(in srgb, var(--ml-ink) 40%, transparent));
  border-radius: 0;
  background: var(--ml-surface);
  color: var(--ml-ink);
  font: inherit;
  font-family: var(--sans, "Helvetica Neue", Helvetica, Arial, sans-serif);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity .24s ease, border-color .18s ease, background-color .18s ease;
}
.stay-in-touch:hover, .stay-in-touch:focus-visible {
  border-color: var(--ml-accent);
  background: color-mix(in srgb, var(--ml-accent) 22%, var(--ml-surface));
  outline: 0;
}
.stay-in-touch[hidden] { display: none; }
.world-stage[data-panel-open="true"] .stay-in-touch { opacity: 0; pointer-events: none; }

/* Pop-up (Stay In Touch button and exit intent). */
.ml-dialog {
  width: min(calc(100vw - 32px), 500px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: clamp(22px, 5vw, 36px);
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--ml-ink) 30%, transparent);
  border-radius: 0;
  background: color-mix(in srgb, #080909 94%, transparent);
  color: var(--ml-ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}
.ml-dialog::backdrop { background: rgba(0, 0, 0, .62); backdrop-filter: blur(3px); }
.ml-dialog[open] { animation: ml-pop .22s ease; }
@keyframes ml-pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.ml-dialog .ml-form { width: 100%; }
.ml-dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--ml-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.ml-dialog-close:hover, .ml-dialog-close:focus-visible { color: var(--ml-ink); outline: 0; }

@media (max-width: 540px) {
  .ml-row { flex-direction: column; gap: 10px; }
  .ml-row input[type="email"] { border-right: 1px solid var(--ml-line); }
  .stay-in-touch { right: 10px; min-height: 36px; padding: 6px 12px; font-size: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ml-dialog[open] { animation: none; }
  .ml-spinner { animation-duration: 2s; }
  .stay-in-touch, .ml-submit { transition: none; }
}
