/* Ms.Jemi.com — warm scrapbook × modern gallery */

:root {
  --cream: #F7F1E8;
  --blush: #E8C4B8;
  --terracotta: #C4785A;
  --sage: #A8B5A0;
  --charcoal: #2C2A28;
  --white: #FFFcf8;
  --paper: #F3E9DC;
  --tape: rgba(168, 181, 160, 0.55);
  --tape-blush: rgba(232, 196, 184, 0.65);
  --shadow: 0 12px 28px rgba(44, 42, 40, 0.08);
  --shadow-soft: 0 6px 16px rgba(44, 42, 40, 0.06);
  --radius: 14px;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-hand: "Caveat", "Segoe Print", cursive;
  --max: 980px;
  --tap: 44px;
  --pad-x: 1rem;
}

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

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

html.gated,
html.gated body {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--charcoal);
  overflow-x: clip;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  background:
    radial-gradient(ellipse at 12% 8%, rgba(232, 196, 184, 0.35), transparent 45%),
    radial-gradient(ellipse at 88% 12%, rgba(168, 181, 160, 0.22), transparent 40%),
    linear-gradient(180deg, var(--cream) 0%, #f3ebe0 100%);
  background-attachment: scroll;
}

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

a {
  color: var(--terracotta);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--charcoal);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ——— Password gate ——— */

.password-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background:
    radial-gradient(ellipse at 30% 20%, rgba(232, 196, 184, 0.45), transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(168, 181, 160, 0.3), transparent 45%),
    var(--cream);
}

.password-gate[hidden] {
  display: none !important;
}

.gate-card {
  width: min(100%, 420px);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.85rem 1.25rem 1.6rem;
  text-align: center;
  position: relative;
  border: 1px solid rgba(196, 120, 90, 0.12);
}

@media (min-width: 480px) {
  .gate-card {
    padding: 2.25rem 2rem 2rem;
  }
}

.gate-card::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 88px;
  height: 22px;
  background: var(--tape);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(44, 42, 40, 0.08);
}

.gate-brand {
  font-family: var(--font-hand);
  font-size: 1.55rem;
  color: var(--terracotta);
  margin: 0.4rem 0 0.35rem;
}

.gate-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 4vw, 2rem);
  margin: 0 0 0.4rem;
  letter-spacing: 0.01em;
}

.gate-sub {
  margin: 0 0 1.4rem;
  color: rgba(44, 42, 40, 0.7);
  font-size: 0.98rem;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gate-input {
  width: 100%;
  min-height: var(--tap);
  padding: 0.85rem 1rem;
  border: 1.5px solid rgba(44, 42, 40, 0.12);
  border-radius: 12px;
  background: var(--cream);
  font: inherit;
  font-size: 1.05rem;
  color: var(--charcoal);
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
}

.gate-input:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(196, 120, 90, 0.18);
}

.gate-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  min-height: var(--tap);
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  background: var(--charcoal);
  color: var(--cream);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.15s ease, background 0.15s ease;
  touch-action: manipulation;
}

.gate-btn:hover {
  background: #3d3936;
  transform: translateY(-1px);
}

.gate-error {
  margin: 0.85rem 0 0;
  color: var(--terracotta);
  font-size: 0.95rem;
  font-family: var(--font-hand);
}

/* ——— Layout shell ——— */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(247, 241, 232, 0.86);
  border-bottom: 1px solid rgba(44, 42, 40, 0.06);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.7rem var(--pad-x) 0.55rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
}

@media (min-width: 760px) {
  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    gap: 1rem;
  }
}

.logo {
  font-family: var(--font-hand);
  font-size: 1.55rem;
  color: var(--charcoal);
  text-decoration: none;
  line-height: 1;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
}

.logo span {
  color: var(--terracotta);
}

/* Scrapbook chip rail — scrolls on narrow screens */
.nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  justify-content: flex-start;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  margin: 0 calc(-1 * var(--pad-x));
  padding: 0.1rem var(--pad-x) 0.35rem;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  flex: 0 0 auto;
  text-decoration: none;
  color: rgba(44, 42, 40, 0.78);
  font-size: 0.92rem;
  font-weight: 500;
  min-height: var(--tap);
  padding: 0.45rem 0.9rem;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.88);
  border: 1px solid rgba(196, 120, 90, 0.16);
  box-shadow: 0 2px 6px rgba(44, 42, 40, 0.04);
  touch-action: manipulation;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--charcoal);
  border-color: var(--blush);
  background: var(--white);
}

.nav a[aria-current="page"] {
  box-shadow: var(--shadow-soft);
  border-color: rgba(196, 120, 90, 0.35);
}

@media (min-width: 900px) {
  .nav {
    flex-wrap: wrap;
    overflow: visible;
    margin: 0;
    padding: 0;
    justify-content: flex-end;
    gap: 0.35rem 0.45rem;
  }
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.35rem var(--pad-x) 3.25rem;
  width: 100%;
}

@media (min-width: 760px) {
  main {
    padding: 2rem 1.25rem 4rem;
  }
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad-x) 2.5rem;
  text-align: center;
  color: rgba(44, 42, 40, 0.55);
  font-size: 0.9rem;
}

.site-footer .hand {
  font-family: var(--font-hand);
  font-size: 1.15rem;
  color: var(--terracotta);
}

/* ——— Shared type ——— */

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.page-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.1rem, 5vw, 3rem);
  margin: 0 0 0.6rem;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.lede {
  max-width: 36rem;
  margin: 0 0 2rem;
  color: rgba(44, 42, 40, 0.78);
  font-size: 1.08rem;
}

.hand {
  font-family: var(--font-hand);
}

.placeholder-hint {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(168, 181, 160, 0.28);
  color: rgba(44, 42, 40, 0.7);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ——— Home ——— */

.hero {
  display: grid;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

@media (min-width: 760px) {
  .hero {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2.5rem;
  }
}

.hero-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem 1.2rem;
  box-shadow: var(--shadow);
  position: relative;
  border: 1px solid rgba(196, 120, 90, 0.1);
}

@media (min-width: 560px) {
  .hero-card {
    padding: 2rem 1.75rem;
  }
}

.hero-card::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 22px;
  width: 56px;
  height: 16px;
  background: var(--tape-blush);
  transform: rotate(8deg);
  border-radius: 2px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  margin: 0.2rem 0 0.75rem;
  line-height: 1.1;
}

.hero h1 em {
  font-style: italic;
  color: var(--terracotta);
}

.welcome-note {
  margin: 0;
  font-size: 1.08rem;
  color: rgba(44, 42, 40, 0.82);
}

.welcome-from {
  margin: 1rem 0 0;
  font-family: var(--font-hand);
  font-size: 1.45rem;
  color: var(--terracotta);
}

.polaroid {
  background: var(--white);
  padding: 0.85rem 0.85rem 2.1rem;
  box-shadow: var(--shadow);
  border-radius: 4px;
  transform: rotate(-2.5deg);
  width: min(100%, 300px);
  margin: 0 auto;
  position: relative;
}

.polaroid::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 72px;
  height: 20px;
  transform: translateX(-50%) rotate(-3deg);
  background: var(--tape);
  border-radius: 2px;
}

.polaroid-frame {
  aspect-ratio: 1;
  border-radius: 2px;
  overflow: hidden;
  background: linear-gradient(145deg, var(--blush), var(--sage) 55%, #d9c4b0);
  display: grid;
  place-items: center;
}

.polaroid-caption {
  margin: 0.85rem 0 0;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--charcoal);
}

.section-links {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
}

.section-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.2rem 1.15rem;
  min-height: var(--tap);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(44, 42, 40, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
}

.section-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  color: inherit;
}

.section-card .label {
  font-family: var(--font-display);
  font-size: 1.45rem;
  margin: 0 0 0.35rem;
}

.section-card p {
  margin: 0;
  color: rgba(44, 42, 40, 0.68);
  font-size: 0.95rem;
}

.section-card .go {
  font-family: var(--font-hand);
  color: var(--terracotta);
  margin-top: 0.85rem;
  display: inline-block;
  font-size: 1.2rem;
}

/* ——— Story timeline ——— */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: linear-gradient(var(--blush), var(--sage));
}

@media (min-width: 700px) {
  .timeline::before {
    left: 50%;
    transform: translateX(-1px);
  }
}

.timeline-item {
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 700px) {
  .timeline-item {
    width: 50%;
    padding-left: 0;
    padding-right: 2.25rem;
  }

  .timeline-item:nth-child(even) {
    margin-left: 50%;
    padding-right: 0;
    padding-left: 2.25rem;
  }
}

.timeline-dot {
  position: absolute;
  left: 7px;
  top: 1.15rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--terracotta);
  box-shadow: 0 0 0 4px rgba(196, 120, 90, 0.15);
}

@media (min-width: 700px) {
  .timeline-item .timeline-dot {
    left: auto;
    right: -8px;
  }

  .timeline-item:nth-child(even) .timeline-dot {
    left: -8px;
    right: auto;
  }
}

.entry {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.35rem 1.35rem 1.2rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(44, 42, 40, 0.05);
  position: relative;
}

.entry-date {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: var(--terracotta);
  margin: 0 0 0.25rem;
}

.entry h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.45rem;
  margin: 0 0 0.5rem;
}

.entry p {
  margin: 0;
  color: rgba(44, 42, 40, 0.8);
}

/* ——— Photos gallery ——— */

.gallery-section {
  margin-top: 2.75rem;
  margin-bottom: 1.5rem;
}

.gallery-section:first-of-type {
  margin-top: 0.5rem;
}

.gallery-heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.65rem, 3.5vw, 2.15rem);
  margin: 0 0 0.35rem;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.gallery-soft {
  margin: 0 0 1.5rem;
  color: rgba(44, 42, 40, 0.68);
  font-size: 1.05rem;
  font-style: italic;
  max-width: 32rem;
}

.photo-slot .frame img,
.polaroid-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-together {
  columns: 1;
}

@media (min-width: 560px) {
  .gallery-together {
    columns: 2;
  }
}

.photo-slot.featured {
  transform: rotate(-1.2deg);
}

.photo-slot.featured .frame {
  aspect-ratio: 5 / 4;
}

.photo-slot.empty-slot .frame {
  min-height: 100%;
}

.gallery {
  columns: 1;
  column-gap: 1.25rem;
  width: 100%;
}

@media (min-width: 560px) {
  .gallery {
    columns: 2;
  }
}

@media (min-width: 860px) {
  .gallery {
    columns: 3;
  }
}

.photo-slot {
  break-inside: avoid;
  margin-bottom: 1.25rem;
  background: var(--white);
  padding: 0.75rem 0.75rem 1.6rem;
  box-shadow: var(--shadow-soft);
  border-radius: 3px;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
  width: 100%;
  max-width: 100%;
}

.photo-slot:nth-child(3n + 1) {
  transform: rotate(-1.8deg);
}

.photo-slot:nth-child(3n + 2) {
  transform: rotate(1.4deg);
}

.photo-slot:nth-child(3n) {
  transform: rotate(-0.6deg);
}

.photo-slot:hover {
  transform: rotate(0deg) translateY(-2px);
}

.photo-slot .frame {
  aspect-ratio: 4 / 5;
  border-radius: 2px;
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
}

.photo-slot.tall .frame {
  aspect-ratio: 3 / 4;
}

.photo-slot.wide .frame {
  aspect-ratio: 5 / 4;
}

.frame-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  color: rgba(44, 42, 40, 0.55);
}

.frame-placeholder .add {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  color: var(--charcoal);
  margin: 0.4rem 0 0;
}

.frame-placeholder .hint {
  font-size: 0.82rem;
  margin: 0.2rem 0 0;
}

.photo-slot figcaption {
  margin: 0.7rem 0 0;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 1.25rem;
}

.bg-a {
  background: linear-gradient(160deg, #e8c4b8, #f3e9dc 60%, #d7c2b0);
}

.bg-b {
  background: linear-gradient(200deg, #a8b5a0, #e8ddd0 55%, #c9b8a4);
}

.bg-c {
  background: linear-gradient(135deg, #d9b5a4, #f0e6d8, #b8c2b0);
}

.bg-d {
  background: linear-gradient(175deg, #c4785a33, #f7f1e8 45%, #a8b5a055);
}

.floral {
  width: 72px;
  height: 72px;
  opacity: 0.55;
}

/* ——— Notes ——— */

.notes-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .notes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.note-card {
  background: var(--paper);
  border-radius: 4px;
  padding: 1.5rem 1.35rem 1.35rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  min-height: 200px;
  border: 1px solid rgba(44, 42, 40, 0.04);
}

.note-card:nth-child(odd) {
  transform: rotate(-0.8deg);
}

.note-card:nth-child(even) {
  transform: rotate(0.9deg);
  background: #f6ebe0;
}

.note-card::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 1.4rem;
  width: 64px;
  height: 18px;
  background: var(--tape);
  transform: rotate(-4deg);
  border-radius: 2px;
}

.note-card:nth-child(even)::before {
  left: auto;
  right: 1.5rem;
  background: var(--tape-blush);
  transform: rotate(6deg);
}

.note-meta {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(44, 42, 40, 0.5);
  margin: 0 0 0.6rem;
}

.note-card h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.4rem;
  margin: 0 0 0.55rem;
}

.note-body {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 1.4rem;
  line-height: 1.45;
  color: rgba(44, 42, 40, 0.88);
}

.note-sign {
  margin: 1.1rem 0 0;
  font-family: var(--font-hand);
  font-size: 1.3rem;
  color: var(--terracotta);
  text-align: right;
}

/* Phone: flatten tilts so polaroids don’t spill horizontally */
@media (max-width: 600px) {
  .photo-slot,
  .photo-slot:nth-child(n),
  .photo-slot.featured,
  .note-card,
  .note-card:nth-child(n),
  .polaroid {
    transform: none;
  }

  .photo-slot:hover,
  .note-card:hover {
    transform: none;
  }

  .scrapbook-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .scrapbook-btns {
    width: 100%;
  }

  .scrapbook-btns .scrap-btn {
    flex: 1;
  }

  .scrapbook-dots {
    justify-content: center;
  }

  .lede {
    font-size: 1.02rem;
  }
}

/* ——— Bangkok scrapbook animation ——— */

.scrapbook-player {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(196, 120, 90, 0.12);
  padding: 1rem 0.85rem 1.25rem;
  position: relative;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

@media (min-width: 560px) {
  .scrapbook-player {
    padding: 1.25rem 1.25rem 1.5rem;
  }
}

.scrapbook-player::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 96px;
  height: 22px;
  background: var(--tape-blush);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(44, 42, 40, 0.08);
}

.scrapbook-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 480 / 280;
  min-height: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(44, 42, 40, 0.06);
}

.vignette {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.vignette.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

/* Reset nested anims when hidden so Replay / revisit restarts them */
.vignette:not(.is-active) .plane,
.vignette:not(.is-active) .taxi,
.vignette:not(.is-active) .moto,
.vignette:not(.is-active) .lance-search,
.vignette:not(.is-active) .heart,
.vignette:not(.is-active) .cloud,
.vignette:not(.is-active) .qmark,
.vignette:not(.is-active) .zzz text,
.vignette:not(.is-active) .speed-lines line,
.vignette:not(.is-active) .moto-wobble,
.vignette:not(.is-active) .wave {
  animation: none !important;
}


.vignette-art {
  width: 100%;
  height: auto;
  max-height: none;
  display: block;
}

.scrapbook-caption {
  margin: 1rem 0 0.85rem;
  text-align: center;
  font-size: clamp(1.25rem, 3.2vw, 1.55rem);
  line-height: 1.35;
  color: var(--charcoal);
  min-height: 2.6em;
}

.scrapbook-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1rem;
}

.scrapbook-dots {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.scrapbook-dots .dot {
  appearance: none;
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  position: relative;
  touch-action: manipulation;
  transition: transform 0.15s ease;
}

.scrapbook-dots .dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid var(--blush);
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.scrapbook-dots .dot:hover {
  transform: scale(1.05);
}

.scrapbook-dots .dot:hover::after {
  border-color: var(--terracotta);
}

.scrapbook-dots .dot.is-active::after {
  background: var(--terracotta);
  border-color: var(--terracotta);
}

.scrapbook-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.scrap-btn {
  appearance: none;
  border: 1.5px solid rgba(44, 42, 40, 0.12);
  background: var(--cream);
  color: var(--charcoal);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  min-height: var(--tap);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.scrap-btn:hover:not(:disabled) {
  border-color: var(--terracotta);
  transform: translateY(-1px);
}

.scrap-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.scrap-btn-primary {
  background: var(--charcoal);
  color: var(--cream);
  border-color: var(--charcoal);
}

.scrap-btn-primary:hover:not(:disabled) {
  background: #3d3936;
  border-color: #3d3936;
}

.scrapbook-note {
  margin: 1rem 0 0;
  text-align: center;
  color: var(--terracotta);
  font-size: 1.15rem;
}

.story-bangkok-link {
  margin: 0 0 2rem;
  padding: 0.85rem 1.1rem;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid rgba(196, 120, 90, 0.14);
  box-shadow: var(--shadow-soft);
  font-size: 1.02rem;
  color: rgba(44, 42, 40, 0.82);
}

.story-bangkok-link a {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  text-decoration: none;
  border-bottom: 2px solid var(--blush);
}

.story-bangkok-link a:hover {
  border-bottom-color: var(--terracotta);
}

@media (min-width: 640px) {
  .section-links {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 960px) {
  .section-links {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Scene animations (only when active & motion OK) */

@media (prefers-reduced-motion: no-preference) {
  .vignette.is-active .cloud-a {
    animation: drift 5s ease-in-out infinite alternate;
  }
  .vignette.is-active .cloud-b {
    animation: drift 6s ease-in-out infinite alternate-reverse;
  }
  .vignette.is-active .cloud-c {
    animation: drift 4.5s ease-in-out infinite alternate;
  }

  /* Plane moves relative to .plane-wrap origin at Jakarta */
  .vignette.is-active .plane {
    animation: fly-path 4s ease-in-out forwards;
  }

  .vignette.is-active .flight-path {
    stroke-dashoffset: 0;
    animation: dash-draw 4s ease forwards;
  }

  .vignette.is-active .lance-search {
    animation: peer-lr 1.6s ease-in-out infinite;
  }

  .vignette.is-active .qmark {
    animation: bob 1.4s ease-in-out infinite;
  }
  .vignette.is-active .q2 {
    animation-delay: 0.35s;
  }

  .vignette.is-active .heart {
    animation: float-heart 2.2s ease-in-out infinite;
  }
  .vignette.is-active .h2 {
    animation-delay: 0.4s;
  }
  .vignette.is-active .h3 {
    animation-delay: 0.8s;
  }

  .vignette.is-active .taxi {
    animation: taxi-drive 3.8s ease-in-out forwards;
  }

  .vignette.is-active .wave {
    animation: wave-shift 3s ease-in-out infinite alternate;
  }

  .vignette.is-active .moto {
    animation: moto-zoom 3.6s ease-in-out forwards;
  }

  .vignette.is-active .moto-wobble {
    animation: wobble 0.35s ease-in-out infinite;
  }

  .vignette.is-active .speed-lines line {
    animation: speed-flash 0.45s linear infinite;
  }
  .vignette.is-active .sl2 {
    animation-delay: 0.12s;
  }
  .vignette.is-active .sl3 {
    animation-delay: 0.24s;
  }

  .vignette.is-active .z1 {
    animation: snore-z 2.4s ease-in-out infinite;
  }
  .vignette.is-active .z2 {
    animation: snore-z 2.4s ease-in-out infinite 0.4s;
  }
  .vignette.is-active .z3 {
    animation: snore-z 2.4s ease-in-out infinite 0.8s;
  }
}

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(18px); }
}

@keyframes fly-path {
  0% { transform: translate(0, 0); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translate(320px, -60px); opacity: 1; }
}

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

@keyframes peer-lr {
  0%, 100% { transform: translate(0, 0); }
  35% { transform: translate(-50px, 0); }
  70% { transform: translate(55px, 0); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(-6px); opacity: 1; }
}

@keyframes float-heart {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.85; }
  50% { transform: translateY(-14px) scale(1.08); opacity: 1; }
}

@keyframes taxi-drive {
  0% { transform: translate(0, 0); }
  100% { transform: translate(200px, 0); }
}

@keyframes wave-shift {
  from { transform: translateX(0); }
  to { transform: translateX(12px); }
}

@keyframes moto-zoom {
  0% { transform: translate(-160px, 0); }
  55% { transform: translate(140px, -5px); }
  70% { transform: translate(160px, 0) scaleX(-1); }
  100% { transform: translate(-80px, 0) scaleX(-1); }
}

@keyframes wobble {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(5deg); }
}

@keyframes speed-flash {
  0% { opacity: 0; transform: translateX(0); }
  40% { opacity: 0.7; }
  100% { opacity: 0; transform: translateX(-20px); }
}

@keyframes snore-z {
  0% { opacity: 0; transform: translate(0, 0) scale(0.8); }
  40% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(10px, -22px) scale(1.15); }
}

/* Reduced motion: show final scene statically, no looping anims */
@media (prefers-reduced-motion: reduce) {
  .scrapbook-player.reduced-motion .vignette {
    transition: none;
  }

  .scrapbook-player.reduced-motion .vignette:not(.is-active) {
    display: none;
  }

  .scrapbook-player.reduced-motion .vignette.is-active {
    position: relative;
    opacity: 1;
    visibility: visible;
  }

  .vignette[data-scene="0"] .plane {
    transform: translate(320px, -60px);
  }

  .vignette[data-scene="3"] .taxi {
    transform: translate(200px, 0);
  }

  .vignette[data-scene="4"] .moto {
    transform: translate(0, 0);
  }

  .zzz {
    opacity: 0.85;
  }
}

/* ——— Chapter pages: Bali / Homeward / Afar / Tokyo ——— */

.chapter-intro {
  margin: 0 0 1.75rem;
}

.chapter-intro .lede {
  margin-bottom: 0.75rem;
}

.chapter-friends {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: rgba(44, 42, 40, 0.72);
  margin: 0;
}

/* Bali scrapbook gallery (reuses .gallery / .photo-slot) */
.bali-scrap .photo-slot figcaption {
  font-size: 1.3rem;
  line-height: 1.3;
}

.bali-note {
  margin: 1.5rem 0 0;
  padding: 1rem 1.15rem;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid rgba(196, 120, 90, 0.14);
  box-shadow: var(--shadow-soft);
  font-family: var(--font-hand);
  font-size: 1.35rem;
  line-height: 1.4;
  color: rgba(44, 42, 40, 0.85);
}

/* Homeward / goodbye Bali */
.homeward-map {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(196, 120, 90, 0.12);
  padding: 1rem 0.75rem 1.15rem;
  margin: 0 0 1.5rem;
  position: relative;
}

.homeward-map::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 88px;
  height: 20px;
  background: var(--tape);
  border-radius: 2px;
}

.homeward-map svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

.pass-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin: 0 0 1.5rem;
}

@media (min-width: 640px) {
  .pass-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.boarding-pass {
  background: linear-gradient(135deg, #fffef9 0%, #f6ebe0 100%);
  border-radius: 12px;
  border: 1.5px dashed rgba(196, 120, 90, 0.35);
  padding: 1.15rem 1.1rem 1.05rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.boarding-pass::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -10px;
  width: 20px;
  height: 20px;
  background: var(--cream);
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: inset 1px 0 0 rgba(44, 42, 40, 0.06);
}

.pass-airline {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.pass-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  margin: 0 0 0.65rem;
  font-weight: 500;
}

.pass-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.pass-city {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  line-height: 1.1;
}

.pass-arrow {
  flex: 1;
  text-align: center;
  color: var(--sage);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

.pass-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  font-size: 0.88rem;
  color: rgba(44, 42, 40, 0.65);
}

.pass-meta strong {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(44, 42, 40, 0.45);
  font-weight: 600;
}

.suitcase-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  margin: 0 0 1.5rem;
}

.suitcase {
  background: var(--white);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(44, 42, 40, 0.06);
  box-shadow: var(--shadow-soft);
  text-align: center;
  min-width: min(100%, 160px);
  flex: 1 1 140px;
  max-width: 200px;
}

.suitcase-icon {
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.suitcase p {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 1.2rem;
  color: rgba(44, 42, 40, 0.85);
}

.homeward-hope {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.25rem 1.15rem;
  border: 1px solid rgba(168, 181, 160, 0.35);
  box-shadow: var(--shadow-soft);
}

.homeward-hope p {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 1.4rem;
  line-height: 1.45;
  color: rgba(44, 42, 40, 0.88);
}

.homeward-hope .sign {
  margin-top: 0.85rem;
  color: var(--terracotta);
  text-align: right;
  font-size: 1.25rem;
}

/* Afar — chat from afar */
.afar-hint {
  display: inline-block;
  margin: 0 0 1.25rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(168, 181, 160, 0.28);
  color: rgba(44, 42, 40, 0.7);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.phones {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  margin-bottom: 1.5rem;
}

@media (min-width: 720px) {
  .phones {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.phone-frame {
  background: #2C2A28;
  border-radius: 28px;
  padding: 0.65rem 0.55rem 0.85rem;
  box-shadow: var(--shadow);
  max-width: 380px;
  width: 100%;
  margin: 0 auto;
}

.phone-notch {
  width: 36%;
  height: 10px;
  background: #1a1918;
  border-radius: 0 0 10px 10px;
  margin: 0 auto 0.55rem;
}

.phone-screen {
  background: linear-gradient(180deg, #f7f1e8 0%, #efe4d6 100%);
  border-radius: 20px;
  min-height: 320px;
  padding: 0.85rem 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.phone-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(44, 42, 40, 0.08);
  margin-bottom: 0.15rem;
}

.phone-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blush);
  display: grid;
  place-items: center;
  font-family: var(--font-hand);
  font-size: 1.1rem;
  color: var(--charcoal);
  flex-shrink: 0;
}

.phone-avatar.lance {
  background: var(--sage);
}

.phone-who {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.2;
}

.phone-tz {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(44, 42, 40, 0.55);
}

.chat-bubble {
  max-width: 88%;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.4;
  position: relative;
}

.chat-bubble.them {
  align-self: flex-start;
  background: var(--white);
  border: 1px solid rgba(44, 42, 40, 0.06);
  border-bottom-left-radius: 4px;
}

.chat-bubble.me {
  align-self: flex-end;
  background: rgba(232, 196, 184, 0.55);
  border-bottom-right-radius: 4px;
}

.chat-bubble .time {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  color: rgba(44, 42, 40, 0.45);
  text-align: right;
}

.chat-bubble.them .time {
  text-align: left;
}

.afar-footer-note {
  font-family: var(--font-hand);
  font-size: 1.3rem;
  text-align: center;
  color: rgba(44, 42, 40, 0.75);
  margin: 0;
}

/* Tokyo planning */
.tokyo-page {
  --tokyo-indigo: #3d4a6b;
  --tokyo-blush: #e8b4bc;
  --tokyo-cream: #faf6f0;
  --tokyo-ink: #2a2e3a;
}

.tokyo-page body,
body.tokyo-page {
  background:
    radial-gradient(ellipse at 18% 6%, rgba(232, 180, 188, 0.28), transparent 42%),
    radial-gradient(ellipse at 88% 10%, rgba(61, 74, 107, 0.1), transparent 40%),
    linear-gradient(180deg, #faf6f0 0%, #f3ebe3 100%);
}

.tokyo-save-note {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  background: rgba(61, 74, 107, 0.07);
  border-left: 3px solid var(--tokyo-indigo, #3d4a6b);
  border-radius: 0 10px 10px 0;
  font-size: 0.95rem;
  color: rgba(42, 46, 58, 0.78);
  line-height: 1.5;
}

.tokyo-lists {
  display: grid;
  gap: 1.25rem;
}

.tokyo-section {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(61, 74, 107, 0.1);
  padding: 1.15rem 1rem 1.1rem;
}

.tokyo-section h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.45rem;
  margin: 0 0 0.35rem;
  color: var(--tokyo-ink, #2a2e3a);
}

.tokyo-section .sec-hint {
  margin: 0 0 0.9rem;
  font-size: 0.88rem;
  color: rgba(42, 46, 58, 0.55);
}

.tokyo-list {
  list-style: none;
  margin: 0 0 0.9rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 2.5rem;
}

.tokyo-list:empty::before,
.tokyo-empty {
  display: block;
  font-family: var(--font-hand);
  font-size: 1.2rem;
  color: rgba(42, 46, 58, 0.45);
  padding: 0.5rem 0.25rem;
}

.tokyo-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  background: var(--tokyo-cream, #faf6f0);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(61, 74, 107, 0.08);
}

.tokyo-item .item-text {
  flex: 1;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.4;
  word-break: break-word;
}

.tokyo-item .item-by {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(232, 180, 188, 0.45);
  color: var(--tokyo-ink, #2a2e3a);
}

.tokyo-item .item-by.lance {
  background: rgba(61, 74, 107, 0.15);
}

.tokyo-item .item-del {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(42, 46, 58, 0.4);
  cursor: pointer;
  min-width: var(--tap);
  min-height: var(--tap);
  margin: -0.35rem -0.25rem -0.35rem 0;
  border-radius: 8px;
  font-size: 1.15rem;
  line-height: 1;
  touch-action: manipulation;
  flex-shrink: 0;
}

.tokyo-item .item-del:hover {
  color: var(--terracotta);
  background: rgba(196, 120, 90, 0.1);
}

.tokyo-add {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

@media (min-width: 520px) {
  .tokyo-add {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
  }
}

.tokyo-add input[type="text"] {
  flex: 1 1 100%;
  min-height: var(--tap);
  padding: 0.65rem 0.85rem;
  border: 1.5px solid rgba(61, 74, 107, 0.18);
  border-radius: 12px;
  background: var(--tokyo-cream, #faf6f0);
  font: inherit;
  font-size: 1rem;
  color: var(--tokyo-ink, #2a2e3a);
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
}

@media (min-width: 520px) {
  .tokyo-add input[type="text"] {
    flex: 1 1 auto;
    width: auto;
  }
}

.tokyo-add input[type="text"]:focus {
  outline: none;
  border-color: var(--tokyo-indigo, #3d4a6b);
  box-shadow: 0 0 0 3px rgba(61, 74, 107, 0.15);
}

.tokyo-who {
  display: flex;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.tokyo-who label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: var(--tap);
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(61, 74, 107, 0.18);
  background: var(--white);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.tokyo-who input {
  accent-color: var(--tokyo-indigo, #3d4a6b);
}

.tokyo-add-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  min-height: var(--tap);
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  background: var(--tokyo-indigo, #3d4a6b);
  color: #faf6f0;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  touch-action: manipulation;
  flex: 0 0 auto;
}

.tokyo-add-btn:hover {
  background: #2f3a56;
}

@media (max-width: 600px) {
  .boarding-pass,
  .suitcase,
  .homeward-map,
  .phone-frame {
    transform: none;
  }
}
