:root {
  --ground: #f4f0ff;
  --ink: #1c1428;
  --ink-soft: rgba(28, 20, 40, 0.55);
  --raspberry: #ff3b7a;
  --blob-a: #ff3b7a;
  --blob-b: #ffb020;
  --blob-c: #3d4fff;
  --city-hue: #ff4d3a;
  --city-wash: #fff1ee;
  --font-display: "Syne", sans-serif;
  --font-body: "Figtree", sans-serif;
  --pad-x: 24px;
  --measure: 28rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

html[data-city="london"] {
  --city-hue: #ff4d3a;
  --city-wash: #fff1ee;
}

html[data-city="paris"] {
  --city-hue: #3040f0;
  --city-wash: #eeeeff;
}

html[data-city="budapest"] {
  --city-hue: #e0a020;
  --city-wash: #fff6e4;
}

html[data-city="dublin"] {
  --city-hue: #1e8a4c;
  --city-wash: #e9f6ee;
}

html[data-city="venice"] {
  --city-hue: #f06a9a;
  --city-wash: #fff0f5;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font-body);
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

.blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.22;
  will-change: transform;
}

.blob--a {
  width: min(70vw, 320px);
  height: min(70vw, 320px);
  background: var(--blob-a);
  top: -8%;
  left: -18%;
  animation: drift-a 22s ease-in-out infinite alternate;
}

.blob--b {
  width: min(60vw, 280px);
  height: min(60vw, 280px);
  background: var(--blob-b);
  top: 38%;
  right: -16%;
  animation: drift-b 26s ease-in-out infinite alternate;
}

.blob--c {
  width: min(65vw, 300px);
  height: min(65vw, 300px);
  background: var(--blob-c);
  bottom: -10%;
  left: 10%;
  animation: drift-c 24s ease-in-out infinite alternate;
}

.story {
  position: relative;
  z-index: 1;
}

.chapter {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding: calc(32px + var(--safe-top)) calc(var(--pad-x) + var(--safe-right))
    calc(40px + var(--safe-bottom)) calc(var(--pad-x) + var(--safe-left));
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.chapter.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.chapter--open {
  justify-content: flex-start;
  padding-top: calc(18vh + var(--safe-top));
}

.chapter__inner {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
}

.label {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.name {
  margin: 0 0 1.25rem;
  /* Syne 800 is wide — size to the padded viewport so "Mafalda" never clips */
  font-size: min(4rem, calc((100vw - 2 * var(--pad-x) - var(--safe-left) - var(--safe-right)) / 7));
  letter-spacing: -0.045em;
}

.wish {
  margin: 0 0 1rem;
  font-size: clamp(2.2rem, 9vw, 3.2rem);
}

.signoff {
  margin: 0 0 1rem;
  font-size: clamp(2.6rem, 11vw, 3.6rem);
}

.body {
  margin: 0;
  max-width: var(--measure);
}

.scroll-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(28px + var(--safe-bottom));
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: opacity 0.35s ease;
}

.scroll-hint.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.offer-panel {
  padding: 1.5rem 1.35rem;
  border-radius: 18px;
  background: var(--raspberry);
  color: #fff;
}

.offer-panel .body {
  color: #fff;
}

/* City blocks: hide all, show the active pair */
.city-block {
  display: none;
}

html[data-city="london"] .city-block[data-city="london"],
html[data-city="paris"] .city-block[data-city="paris"],
html[data-city="budapest"] .city-block[data-city="budapest"],
html[data-city="dublin"] .city-block[data-city="dublin"],
html[data-city="venice"] .city-block[data-city="venice"] {
  display: flex;
}

.chapter--photo {
  padding: 0;
  justify-content: stretch;
}

.city-photo {
  position: relative;
  margin: 0;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  background: #1c1428;
}

.city-photo__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.chapter--photo.is-visible .city-photo__img {
  transform: scale(1);
}

html[data-city="london"] .city-photo__img {
  object-position: center 45%;
}

html[data-city="paris"] .city-photo__img {
  object-position: center 32%;
}

html[data-city="budapest"] .city-photo__img {
  object-position: center 40%;
}

html[data-city="dublin"] .city-photo__img {
  object-position: center 30%;
}

html[data-city="venice"] .city-photo__img {
  object-position: center 40%;
}

.city-photo::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28%;
  background: linear-gradient(to top, rgba(28, 20, 40, 0.72), transparent);
  pointer-events: none;
}

.city-photo__name {
  position: absolute;
  left: calc(var(--pad-x) + var(--safe-left));
  right: calc(var(--pad-x) + var(--safe-right));
  bottom: calc(28px + var(--safe-bottom));
  z-index: 1;
  margin: 0;
  color: #fff;
  font-size: clamp(2.8rem, 12vw, 4rem);
}

.chapter--words {
  background: var(--city-wash);
}

.city-rule {
  width: 3rem;
  height: 3px;
  margin: 0 0 1.25rem;
  border: 0;
  background: var(--city-hue);
  border-radius: 2px;
}

.credit {
  margin: 1.5rem 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.credit a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chapter--ask .ask-line {
  margin-bottom: 1.5rem;
}

.wa-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0.9rem 1.25rem;
  border-radius: 14px;
  background: var(--raspberry);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}

.wa-button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.fineprint {
  margin: 1rem 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* City hue on drifting blobs once the city photo is in view */
html.city-mode .blob--a,
html.city-mode .blob--b,
html.city-mode .blob--c {
  background: var(--city-hue);
}

html.city-mode .blob--b {
  opacity: 0.16;
}

html.city-mode .blob--c {
  opacity: 0.12;
}

@keyframes drift-a {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(12vw, 8vh) scale(1.08);
  }
}

@keyframes drift-b {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-10vw, -6vh) scale(1.12);
  }
}

@keyframes drift-c {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(8vw, -10vh) scale(0.95);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .blob {
    animation: none !important;
  }

  .chapter {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .city-photo__img {
    transform: none;
    transition: none;
  }
}

/* Noscript London wash fallback */
.chapter--words-london {
  background: #fff1ee;
}

.chapter--words-london .city-rule {
  background: #ff4d3a;
}
