/* =========================================================
   Streetfeed — Landing Page
   Light, white, cinematic scrollytelling
   ========================================================= */

:root {
  /* Color */
  --color-primary: #eb5757;
  --color-primary-600: #d94848;
  --color-primary-50: #fff3f3;
  --color-primary-100: #ffe4e4;
  --color-text: #101014;
  --color-text-muted: #6b6b76;
  --color-text-soft: #9a9aa5;
  --color-border: #f0f0f3;
  --color-border-strong: #e5e5ea;
  --color-bg: #ffffff;
  --color-bg-soft: #fbfbfc;
  --color-ink: #0b0b0f;

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  /* Radius */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Shadows (soft) */
  --shadow-xs: 0 1px 2px rgba(16, 16, 20, 0.04);
  --shadow-sm: 0 2px 6px rgba(16, 16, 20, 0.05),
    0 1px 2px rgba(16, 16, 20, 0.03);
  --shadow-md: 0 6px 16px rgba(16, 16, 20, 0.06),
    0 2px 6px rgba(16, 16, 20, 0.04);
  --shadow-lg: 0 20px 50px rgba(16, 16, 20, 0.1),
    0 6px 16px rgba(16, 16, 20, 0.05);
  --shadow-primary: 0 10px 28px rgba(235, 87, 87, 0.3);

  /* Spacing */
  --container: 1200px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* =========================================================
   Reset & base
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: "cv11", "ss01", "ss03";
}

/* While loading, freeze scroll so the user can't peek past the loader. */
body.is-loading {
  overflow: hidden;
}

/* While locked, freeze scroll and hide everything behind the passgate. */
body.is-locked {
  overflow: hidden;
}
body.is-locked .loader,
body.is-locked .nav,
body.is-locked .stage,
body.is-locked .footer,
body.is-locked .toast {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* =========================================================
   Password gate — logo + input with inline submit
   ========================================================= */
.passgate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 24px;
  transition: opacity 0.55s var(--ease-out), visibility 0.55s;
}
body:not(.is-locked) .passgate {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.passgate__card {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  animation: passgateIn 0.7s var(--ease-out) both;
}
@keyframes passgateIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.passgate__logo {
  width: 160px;
  height: auto;
}

.passgate__form {
  width: 100%;
}

.passgate__field {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--r-pill);
  padding: 5px 5px 5px 18px;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.passgate__field:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-100);
}

.passgate__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  padding: 10px 0;
  outline: none;
  letter-spacing: 0.05em;
}
.passgate__input::placeholder {
  color: var(--color-text-soft);
  font-weight: 400;
  letter-spacing: 0;
}

.passgate__submit {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.passgate__submit:hover {
  background: var(--color-primary-600);
  transform: translateX(1px);
}
.passgate__submit:active {
  transform: translateX(1px) scale(0.96);
}

.passgate.is-error .passgate__field {
  border-color: var(--color-primary);
  animation: passgateShake 0.42s var(--ease-in-out);
}
@keyframes passgateShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

/* =========================================================
   Loading screen
   ========================================================= */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  transition: opacity 0.65s var(--ease-out), visibility 0.65s;
}

body:not(.is-loading) .loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__stage {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: loaderBreathe 2.4s var(--ease-in-out) infinite;
}

@keyframes loaderBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.loader__logo {
  position: relative;
  z-index: 2;
  width: 72px;
  height: auto;
  overflow: visible;
}

.loader__bar {
  transform-box: fill-box;
  transform-origin: 0% 50%;
  animation: barPulse 1.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.loader__bar--1 { animation-delay: 0s; }
.loader__bar--2 { animation-delay: 0.14s; }
.loader__bar--3 { animation-delay: 0.28s; }

@keyframes barPulse {
  0%   { transform: scaleX(0);    opacity: 0.15; }
  30%  { transform: scaleX(1);    opacity: 1;    }
  70%  { transform: scaleX(1);    opacity: 1;    }
  88%  { transform: scaleX(0.04); opacity: 0;    }
  100% { transform: scaleX(0);    opacity: 0;    }
}

/* =========================================================
   Page reveal — content eases in once the loader is gone
   ========================================================= */
body.is-loading .nav,
body.is-loading .stage,
body.is-loading .footer {
  opacity: 0;
}

body:not(.is-loading) .nav {
  animation: revealTop 0.7s var(--ease-out) 0.05s both;
}
body:not(.is-loading) .stage {
  animation: revealUp 0.9s var(--ease-out) 0.18s both;
}
body:not(.is-loading) .footer {
  animation: revealUp 0.7s var(--ease-out) 0.4s both;
}

@keyframes revealTop {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0);     }
}
@keyframes revealUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* Stagger the hero content so it "composes" into place */
body:not(.is-loading) .panel--hero .chip,
body:not(.is-loading) .panel--hero h1,
body:not(.is-loading) .panel--hero .panel__sub,
body:not(.is-loading) .panel--hero .signup,
body:not(.is-loading) .panel--hero .hero__hint {
  animation: revealUp 0.75s var(--ease-out) both;
}
body:not(.is-loading) .panel--hero .chip       { animation-delay: 0.35s; }
body:not(.is-loading) .panel--hero h1          { animation-delay: 0.46s; }
body:not(.is-loading) .panel--hero .panel__sub { animation-delay: 0.58s; }
body:not(.is-loading) .panel--hero .signup     { animation-delay: 0.7s;  }
body:not(.is-loading) .panel--hero .hero__hint { animation-delay: 0.82s; }

@media (prefers-reduced-motion: reduce) {
  .loader__stage,
  .loader__bar,
  .passgate__card,
  .passgate.is-error .passgate__field {
    animation: none !important;
  }
  body:not(.is-loading) .nav,
  body:not(.is-loading) .stage,
  body:not(.is-loading) .footer,
  body:not(.is-loading) .panel--hero * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

input {
  font: inherit;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

h3 {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  line-height: 1;
  transition: transform 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out), background-color 0.25s var(--ease-out);
  white-space: nowrap;
  user-select: none;
}

.btn--sm {
  padding: 10px 18px;
  font-size: 0.88rem;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.btn--primary:hover {
  background: var(--color-primary-600);
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(235, 87, 87, 0.4);
}

.btn--primary:active {
  transform: translateY(0);
}

/* =========================================================
   Navigation — centered pill, auto width
   ========================================================= */
.nav {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.nav__pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding: 8px 8px 8px 22px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(16, 16, 20, 0.06);
  border-radius: var(--r-pill);
  box-shadow: 0 6px 18px rgba(16, 16, 20, 0.06),
    0 1px 2px rgba(16, 16, 20, 0.04);
  transition: box-shadow 0.3s var(--ease-out),
    background-color 0.3s var(--ease-out);
}

.nav.is-scrolled .nav__pill {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(16, 16, 20, 0.08),
    0 1px 2px rgba(16, 16, 20, 0.04);
}

.nav__brand {
  display: flex;
  align-items: center;
}

.nav__logo {
  height: 20px;
  width: auto;
}

.nav__links {
  display: flex;
  gap: 26px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.nav__links a {
  position: relative;
  transition: color 0.2s var(--ease-out);
}

.nav__links a:hover {
  color: var(--color-text);
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease-out);
  border-radius: 2px;
}

.nav__links a:hover::after {
  transform: scaleX(1);
}

@media (max-width: 820px) {
  .nav__links {
    display: none;
  }
  .nav__pill {
    padding: 6px 6px 6px 18px;
    gap: 14px;
  }
  .nav__logo {
    height: 18px;
  }
}

@media (max-width: 420px) {
  .nav__cta span {
    display: none;
  }
  .nav__cta {
    padding: 10px 12px;
  }
}

/* =========================================================
   Stage — sticky map scrollytelling (desktop: full-bleed map on right)
   ========================================================= */
.stage {
  position: relative;
  width: 100%;
}

.stage__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 0;
}

.stage__content {
  grid-column: 1;
  position: relative;
  z-index: 2;
  /* Push content toward the right edge of the left column so it sits close to map center */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: clamp(24px, 4vw, 72px);
  padding-left: clamp(24px, 6vw, 96px);
}

.stage__visual {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--color-bg-soft);
}

.stage__map {
  position: absolute;
  inset: 0;
  background: #f2f2f5;
}

/* Wide left-edge fade — map dissolves toward the center of the page */
.stage__visual::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 45%;
  background: linear-gradient(
    to right,
    #ffffff 0%,
    rgba(255, 255, 255, 0.96) 25%,
    rgba(255, 255, 255, 0.7) 55%,
    rgba(255, 255, 255, 0) 100%
  );
  z-index: 4;
  pointer-events: none;
}

/* Top fade for extra softness under the nav pill */
.stage__visual::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 160px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  z-index: 4;
  pointer-events: none;
}

/* ======== Panels ======== */
.panel {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 80px 0;
  width: 100%;
}

.panel__body {
  max-width: 540px;
  width: 100%;
}

.panel--hero .panel__body {
  max-width: 560px;
}

.panel p {
  color: var(--color-text-muted);
  font-size: clamp(1rem, 1.15vw, 1.15rem);
  margin-top: 20px;
  line-height: 1.6;
  max-width: 480px;
}

.panel h1,
.panel h2 {
  margin-bottom: 0;
}

/* Hero chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  background: #fff;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--r-pill);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
  box-shadow: var(--shadow-xs);
  margin-bottom: 26px;
}

.chip__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 0 rgba(235, 87, 87, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(235, 87, 87, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(235, 87, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(235, 87, 87, 0); }
}

/* Eyebrow for step panels */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--color-primary-50);
  color: var(--color-primary);
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 20px;
}

.eyebrow em {
  font-style: normal;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

/* Accent word */
.accent-wrap {
  position: relative;
  display: inline-block;
}

.accent {
  color: var(--color-primary);
  position: relative;
  z-index: 1;
}

.accent__underline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8%;
  width: 100%;
  height: 0.36em;
  z-index: 0;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw 1.4s 0.6s var(--ease-out) forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

/* Bullets list */
.bullets {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bullets li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text);
  font-weight: 500;
  font-size: 1rem;
}

.bullets svg {
  flex-shrink: 0;
  padding: 4px;
  background: var(--color-primary-50);
  border-radius: 50%;
  width: 26px;
  height: 26px;
}

/* ======== Signup form ======== */
.signup {
  max-width: 520px;
  margin-top: 32px;
}

.signup__field {
  display: flex;
  align-items: center;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.signup__field:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(235, 87, 87, 0.15), var(--shadow-md);
}

.signup__field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 14px 18px;
  font-size: 1rem;
  color: var(--color-text);
}

.signup__field input::placeholder {
  color: var(--color-text-soft);
}

.signup__submit {
  padding: 13px 22px;
}

/* Hero scroll hint */
.hero__hint {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 48px;
  color: var(--color-text-soft);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.hero__hint-line {
  display: inline-block;
  width: 40px;
  height: 1px;
  background: var(--color-border-strong);
  position: relative;
  overflow: hidden;
}

.hero__hint-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-primary);
  transform: translateX(-100%);
  animation: sweep 2.4s var(--ease-in-out) infinite;
}

@keyframes sweep {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* ======== Radius Control ======== */
.radius-control {
  margin-top: 36px;
  max-width: 380px;
}

.radius-control__track {
  position: relative;
  height: 6px;
  background: var(--color-border-strong);
  border-radius: 999px;
  overflow: visible;
}

.radius-control__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  background: linear-gradient(90deg, var(--color-primary), #f57b7b);
  border-radius: 999px;
  animation: radiusFill 5s var(--ease-in-out) infinite alternate;
}

.radius-control__thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: #fff;
  border: 4px solid var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(235, 87, 87, 0.35);
  animation: radiusThumb 5s var(--ease-in-out) infinite alternate;
}

@keyframes radiusFill {
  0% { width: 12%; }
  50% { width: 50%; }
  100% { width: 92%; }
}

@keyframes radiusThumb {
  0% { left: 12%; }
  50% { left: 50%; }
  100% { left: 92%; }
}

.radius-control__labels {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--color-text-soft);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.radius-control__labels .is-active {
  color: var(--color-primary);
  font-weight: 600;
}

/* =========================================================
   Stage radius visualization (step 2)
   =========================================================  */
.stage__radius {
  position: absolute;
  top: 50%;
  /* Sit on the visible portion of the map (left 45% is faded) */
  left: 72.5%;
  transform: translate(-50%, -50%);
  width: 460px;
  height: 460px;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}

.stage__radius.is-visible {
  opacity: 1;
}

.stage__radius-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: var(--color-primary);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(235, 87, 87, 0.55),
    0 0 0 3px rgba(235, 87, 87, 0.12);
  z-index: 2;
}

.stage__radius-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px dashed rgba(235, 87, 87, 0.45);
  background: radial-gradient(
    circle,
    rgba(235, 87, 87, 0.05) 40%,
    rgba(235, 87, 87, 0) 70%
  );
}

.stage__radius-ring--a {
  width: 120px;
  height: 120px;
  animation: ringPulseA 4s var(--ease-in-out) infinite;
}
.stage__radius-ring--b {
  width: 260px;
  height: 260px;
  animation: ringPulseB 4s var(--ease-in-out) infinite;
  animation-delay: 0.3s;
}
.stage__radius-ring--c {
  width: 420px;
  height: 420px;
  animation: ringPulseC 4s var(--ease-in-out) infinite;
  animation-delay: 0.6s;
}

@keyframes ringPulseA {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
  50% { transform: translate(-50%, -50%) scale(1.03); opacity: 1; }
}
@keyframes ringPulseB {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.55; }
  50% { transform: translate(-50%, -50%) scale(1.02); opacity: 0.85; }
}
@keyframes ringPulseC {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
  50% { transform: translate(-50%, -50%) scale(1.015); opacity: 0.6; }
}

/* =========================================================
   Progress indicator
   ========================================================= */
.stage__progress {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 8;
}

.stage__progress-step {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(16, 16, 20, 0.18);
  cursor: pointer;
  transition: all 0.35s var(--ease-out);
}

.stage__progress-step.is-active {
  background: var(--color-primary);
  transform: scale(1.8);
  box-shadow: 0 0 0 3px rgba(235, 87, 87, 0.15);
}

/* =========================================================
   Active tweet card — fixed overlay inside stage__visual
   (always fully visible in viewport, regardless of map size)
   ========================================================= */
.stage__tweet {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
  /* Desktop: centered on the visible (non-faded) portion of the map so the
     card sits on the real map surface, not the white left-edge fade. */
  left: 72.5%;
  bottom: clamp(40px, 7vh, 80px);
  transform: translateX(-50%);
  width: 340px;
  max-width: calc(100% - 48px);
}

.stage__tweet.is-visible {
  opacity: 1;
}

/* When the card is inside the overlay (not a marker), override the marker-mode styles */
.stage__tweet .tweet-card {
  position: static;
  top: auto;
  left: auto;
  width: 100%;
  transform: none;
  opacity: 0;
  animation: cardInPanel 0.55s var(--ease-out) 0.1s forwards;
  transform-origin: 50% 50%;
}

.stage__tweet .tweet-card::before {
  display: none;
}

.stage__tweet .tweet-card.is-leaving {
  animation: cardOutPanel 0.35s var(--ease-out) forwards;
}

@keyframes cardInPanel {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cardOutPanel {
  to { opacity: 0; transform: translateY(6px) scale(0.98); }
}

/* =========================================================
   Tweet markers on map (injected via Leaflet divIcon)
   ========================================================= */
.tweet-marker {
  pointer-events: none;
  will-change: transform, opacity;
}

.tweet-marker__pin {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid #fff;
  box-shadow: 0 6px 20px rgba(235, 87, 87, 0.5),
    0 2px 6px rgba(16, 16, 20, 0.12);
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
  animation: pinIn 0.52s cubic-bezier(0.34, 1.42, 0.64, 1) forwards;
}

@keyframes pinIn {
  60% { opacity: 1; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.tweet-marker.is-leaving .tweet-marker__pin {
  animation: pinOut 0.36s cubic-bezier(0.55, 0, 0.68, 0) forwards;
}

@keyframes pinOut {
  to { transform: translate(-50%, -50%) scale(0.2); opacity: 0; }
}

/* Suppress the pulsing ring while a pin is fading out so it doesn't keep
   blinking during removal. */
.tweet-marker.is-leaving .tweet-marker__pin::before {
  animation: none;
  opacity: 0;
}

.tweet-marker.is-leaving .tweet-card {
  animation: cardOut 0.4s var(--ease-out) forwards;
}

.tweet-marker__pin::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  opacity: 0.55;
  animation: ping 1.8s ease-out infinite;
}

@keyframes ping {
  0% { transform: scale(0.55); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Small ambient pin — no card, just the dot + ping */
.tweet-marker--mini .tweet-marker__pin {
  width: 12px;
  height: 12px;
  border-width: 2px;
  box-shadow: 0 3px 10px rgba(235, 87, 87, 0.45);
}
.tweet-marker--mini .tweet-marker__pin::before {
  inset: -5px;
  border-width: 1.5px;
  opacity: 0.4;
  animation-duration: 2.4s;
}

/* Tweet card — centered below the pin */
.tweet-card {
  pointer-events: auto;
  position: absolute;
  top: 24px;
  left: 0;
  width: 300px;
  background: #fff;
  border: 1px solid var(--color-border-strong);
  border-radius: 18px;
  padding: 14px 14px 12px;
  box-shadow: 0 18px 48px rgba(16, 16, 20, 0.18),
    0 4px 10px rgba(16, 16, 20, 0.06);
  transform: translateX(-50%) scale(0.94);
  opacity: 0;
  animation: cardIn 0.5s var(--ease-out) 0.08s forwards;
  transform-origin: 50% 0;
}

.tweet-card::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid var(--color-border-strong);
  border-top: 1px solid var(--color-border-strong);
}

@keyframes cardIn {
  to { transform: translateX(-50%) scale(1); opacity: 1; }
}

.tweet-card.is-leaving {
  animation: cardOut 0.4s var(--ease-out) forwards;
}

@keyframes cardOut {
  to { transform: translateX(-50%) scale(0.94); opacity: 0; }
}

.tweet-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.tweet-card__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.82rem;
  flex-shrink: 0;
  letter-spacing: -0.02em;
  overflow: hidden;
  background: #e5e5ea;
}

.tweet-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tweet-card__user {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
  flex: 1;
}

.tweet-card__name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tweet-card__meta {
  font-size: 0.72rem;
  color: var(--color-text-soft);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.tweet-card__text {
  font-size: 0.88rem;
  color: var(--color-text);
  line-height: 1.45;
}

.tweet-card__actions {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.tweet-card__action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tweet-card__action--like {
  color: var(--color-primary);
  font-weight: 600;
}

.tweet-card__replies {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--color-border-strong);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tweet-card__reply {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.78rem;
  line-height: 1.4;
  opacity: 0;
  animation: replyIn 0.5s var(--ease-out) forwards;
}

.tweet-card__reply:nth-child(1) { animation-delay: 0.8s; }
.tweet-card__reply:nth-child(2) { animation-delay: 1.2s; }
.tweet-card__reply:nth-child(3) { animation-delay: 1.6s; }
.tweet-card__reply:nth-child(4) { animation-delay: 2.0s; }

@keyframes replyIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.tweet-card__reply-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.62rem;
  flex-shrink: 0;
  overflow: hidden;
  background: #e5e5ea;
}

.tweet-card__reply-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tweet-card__reply-body {
  color: var(--color-text-muted);
  flex: 1;
}

.tweet-card__reply-body strong {
  color: var(--color-text);
  font-weight: 600;
  margin-right: 4px;
}

/* =========================================================
   Final CTA + Footer (below stage)
   ========================================================= */
.panel--join {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255, 255, 255, 0) 60%
  );
}

.panel--join .signup {
  margin-top: 28px;
}

/* Footer */
.footer {
  padding: 48px 0 64px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  position: relative;
  z-index: 10;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer__brand img {
  height: 18px;
  width: auto;
}

.footer__links {
  display: flex;
  gap: 24px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.footer__links a:hover {
  color: var(--color-text);
}

.footer small {
  color: var(--color-text-soft);
  font-size: 0.85rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, calc(100% + 60px));
  background: var(--color-ink);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s var(--ease-out), opacity 0.3s var(--ease-out);
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

/* =========================================================
   Reveal animations (light touch)
   ========================================================= */
.panel__body > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.panel.is-in .panel__body > *:nth-child(1) { transition-delay: 0s; }
.panel.is-in .panel__body > *:nth-child(2) { transition-delay: 80ms; }
.panel.is-in .panel__body > *:nth-child(3) { transition-delay: 160ms; }
.panel.is-in .panel__body > *:nth-child(4) { transition-delay: 240ms; }
.panel.is-in .panel__body > *:nth-child(5) { transition-delay: 320ms; }
.panel.is-in .panel__body > *:nth-child(6) { transition-delay: 400ms; }

.panel.is-in .panel__body > * {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   Leaflet overrides (light theme)
   ========================================================= */
.leaflet-container {
  background: #f2f2f5;
  font-family: var(--font-sans);
  outline: none;
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.7) !important;
  color: rgba(16, 16, 20, 0.4) !important;
  font-size: 10px !important;
  padding: 2px 6px !important;
}

.leaflet-control-attribution a {
  color: rgba(16, 16, 20, 0.55) !important;
}

.leaflet-pane {
  z-index: 1;
}

/* Soft tile desaturation to feel premium */
.leaflet-tile {
  filter: saturate(0.95) contrast(0.98) brightness(1.02);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 960px) {
  /* Mobile stage */
  .stage {
    max-width: none;
    padding: 0;
  }

  /* Map sticky at TOP, content scrolls BELOW */
  .stage__grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  /* Top third: map. Bottom two-thirds: content. */
  .stage__visual {
    grid-column: 1;
    grid-row: 1;
    height: 33.33vh;
    height: 33.33svh;
    position: sticky;
    top: 0;
    z-index: 3;
    overflow: visible;
    border-bottom: 0;
  }

  /* Soft fade at bottom of map into the white content area */
  .stage__visual::before {
    top: auto;
    left: 0;
    right: 0;
    bottom: -40px;
    width: 100%;
    height: 80px;
    background: linear-gradient(
      to top,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.85) 50%,
      rgba(255, 255, 255, 0) 100%
    );
    z-index: 6;
    pointer-events: none;
  }

  /* Top fade stays subtle so nav pill reads */
  .stage__visual::after {
    height: 80px;
    background: linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.55) 0%,
      rgba(255, 255, 255, 0) 100%
    );
  }

  /* Content sits below the sticky map and scrolls UNDER it — the map's
     bottom fade (::before) fades content to white before it hits the map. */
  .stage__content {
    grid-column: 1;
    grid-row: 2;
    position: relative;
    z-index: 1;
    padding: 0;
    align-items: stretch;
  }

  .panel {
    min-height: 50vh;
    min-height: 50svh;
    padding: 48px 24px;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .panel--hero {
    padding-top: 56px;
    min-height: 60vh;
  }

  .panel__body {
    max-width: 640px;
  }

  .stage__radius {
    width: 280px;
    height: 280px;
    left: 50%;
  }

  .stage__radius-ring--a { width: 80px; height: 80px; }
  .stage__radius-ring--b { width: 170px; height: 170px; }
  .stage__radius-ring--c { width: 260px; height: 260px; }

  .stage__progress {
    display: none;
  }

  .tweet-card {
    width: 240px;
    font-size: 0.85rem;
  }

  /* Mobile: center the tweet card in the map area. The map pans to different
     Berlin locations underneath, the card itself stays in place and fully visible. */
  .stage__tweet {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: calc(100vw - 24px);
    max-width: 340px;
  }

  /* Compact card content so it fits in the 33vh map area on phones */
  .stage__tweet .tweet-card {
    padding: 10px 12px 9px;
  }

  .stage__tweet .tweet-card__head {
    margin-bottom: 6px;
    gap: 8px;
  }

  .stage__tweet .tweet-card__avatar {
    width: 28px;
    height: 28px;
  }

  .stage__tweet .tweet-card__name {
    font-size: 0.82rem;
  }

  .stage__tweet .tweet-card__meta {
    font-size: 0.68rem;
  }

  .stage__tweet .tweet-card__text {
    font-size: 0.82rem;
    line-height: 1.4;
  }

  .stage__tweet .tweet-card__actions {
    margin-top: 6px;
    font-size: 0.7rem;
  }

  .stage__tweet .tweet-card__replies {
    margin-top: 8px;
    padding-top: 8px;
    gap: 5px;
  }

  .stage__tweet .tweet-card__reply {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  /* Cap at 2 replies on mobile so the card always fits */
  .stage__tweet .tweet-card__reply:nth-child(n+3) {
    display: none;
  }

  .stage__tweet .tweet-card__reply-avatar {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 640px) {
  .panel {
    padding: 40px 20px;
  }

  .panel p {
    font-size: 1rem;
  }

  .signup__field {
    flex-direction: column;
    padding: 10px;
    border-radius: 22px;
    gap: 8px;
  }

  .signup__field input {
    width: 100%;
    padding: 12px 14px;
    text-align: center;
  }

  .signup__submit {
    width: 100%;
  }

  .bullets li {
    font-size: 0.95rem;
  }

  .tweet-card {
    width: 220px;
    padding: 12px 12px 10px;
  }

  .tweet-card__text {
    font-size: 0.82rem;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .panel__body > * {
    opacity: 1;
    transform: none;
  }
}
