/* ─────────────────────────────────────────────────────────────
   Ikisaki landing page

   Follows the iOS onboarding's look: soft canvas, floating white cards, rounded type.
   ───────────────────────────────────────────────────────────── */

:root {
  /* From OnboardingTheme in the iOS app */
  --bg: #F5F5F7;
  --card: #FFFFFF;
  --text: #0A0A0B;
  --muted: #8A8A8E;
  --fill: #F2F2F4;
  --accent: #FF7A2F;
  --accent-grad: linear-gradient(180deg, #FFA24A, #FF6A2B);
  /* The app icon's sky */
  --sky-grad: linear-gradient(180deg, #6EC0F8, #3393EA);
  --sky: #42B8EC;
  --green: #2FB86E;
  --red: #E8302A;
  --purple: #A774FF;
  --gold: #FFB400;

  /* SwiftUI's shadow(radius: 24, y: 12) at 10% black */
  --shadow: 0 12px 48px rgba(0, 0, 0, 0.10);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.08);

  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, sans-serif;
  --display-weight: 800;
  --display-tracking: -0.025em;

  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ───────────── Base ───────────── */

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, figure, blockquote { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
b { font-weight: 700; }

:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 8px; }

.icon { width: 1em; height: 1em; flex: none; }
.muted { color: var(--muted); }

.display {
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: 1.04;
  text-wrap: balance;
}
h1.display { font-size: clamp(2.6rem, 7.2vw, 5rem); }
h2.display { font-size: clamp(2rem, 4.6vw, 3.4rem); }

/* The muted second line of a headline */
.alt { color: #B5B5BA; }

.lede {
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.45;
  text-wrap: pretty;
}

/* ───────────── Buttons ───────────── */

/* The onboarding's capsule call to action with a trailing arrow */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 56px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--text);
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.3s var(--spring), opacity 0.25s;
}
.btn:hover { transform: scale(1.03); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.25; pointer-events: none; }
.btn .icon--arrow { transition: transform 0.3s var(--smooth); }
.btn:hover .icon--arrow { transform: translateX(3px); }
.btn--small { height: 40px; padding: 0 16px; gap: 7px; font-size: 14px; }
.btn--light { background: #FFFFFF; color: #0A0A0B; box-shadow: 0 12px 36px rgba(0, 40, 90, 0.25); }
.btn--store .icon:first-child { font-size: 20px; margin-top: -3px; }

/* ───────────── Collage pieces ───────────── */

/* White pill with an icon, used as a floating sticker */
.sticker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px 0 12px;
  border-radius: 999px;
  background: #FFFFFF;
  box-shadow: var(--shadow);
  color: #0A0A0B;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.sticker .icon { font-size: 16px; }
.sticker--avatar { padding-left: 4px; }

/* A destination's flag, round as CountryFlagView draws it in the app */
.flag {
  width: var(--size, 46px);
  height: var(--size, 46px);
  flex: none;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.10), 0 0 0 1px rgba(0, 0, 0, 0.04);
  object-fit: cover;
}

/* Memoji in a white bubble */
.avatar {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border: 3px solid #FFFFFF;
  border-radius: 50%;
  background: var(--c, var(--fill));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.avatar img { width: 84%; }
.avatar--xs { width: 28px; height: 28px; border-width: 2px; box-shadow: none; }
.avatar--sm { width: 34px; height: 34px; }
.avatar--lg { width: 58px; height: 58px; box-shadow: var(--shadow); }
.avatars { display: inline-flex; }
.avatars .avatar { width: 34px; height: 34px; box-shadow: none; }
.avatars .avatar + .avatar { margin-left: -10px; }

/* Photo with a thick white border, like a printed photo */
.photo-card {
  display: block;
  width: 140px;
  height: 170px;
  padding: 6px;
  border-radius: 26px;
  background: #FFFFFF;
  box-shadow: var(--shadow);
}
.photo-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
.photo-card--small { width: 96px; height: 116px; padding: 5px; border-radius: 25px; }

/* Tinted circle with a white symbol */
.glyph {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 78%, #FFFFFF), var(--c));
  color: #FFFFFF;
  font-size: 15px;
}
.glyph--s { width: 28px; height: 28px; font-size: 13px; }

/* Gentle bob, so collages feel alive */
.bob { animation: bob var(--d, 2.6s) ease-in-out infinite alternate; }
@keyframes bob { from { transform: translateY(5px); } to { transform: translateY(-5px); } }

/* ───────────── Phone and screenshot slots ───────────── */

.phone {
  --w: 300px;
  position: relative;
  flex: none;
  width: var(--w);
  padding: calc(var(--w) * 0.034);
  border-radius: calc(var(--w) * 0.168);
  background: #0A0A0B;
  box-shadow: inset 0 0 0 2px #3A3A3D, 0 30px 60px -12px rgba(0, 0, 0, 0.28), 0 12px 24px rgba(0, 0, 0, 0.10);
}
.phone::after {
  content: "";
  position: absolute;
  top: calc(var(--w) * 0.062);
  left: 50%;
  width: calc(var(--w) * 0.29);
  height: calc(var(--w) * 0.084);
  border-radius: 999px;
  background: #000000;
  transform: translateX(-50%);
}
.screen {
  position: relative;
  aspect-ratio: 1206 / 2622;
  border-radius: calc(var(--w) * 0.134);
  background: #FFFFFF;
  overflow: hidden;
}

/* A slot shows its screenshot once the file exists, and a labelled placeholder until then */
.shot { position: absolute; inset: 0; opacity: 0; transition: opacity 0.45s ease; }
.shot.is-active { opacity: 1; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.shot-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  background: linear-gradient(150deg, #DCEBFF, #F3E8FF);
  color: #5B6B85;
  font-family: system-ui, -apple-system, sans-serif;
  text-align: center;
  text-transform: none;
}
.shot-placeholder::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1.5px dashed rgba(91, 107, 133, 0.35);
  border-radius: inherit;
}
.screen .shot-placeholder::before { border-radius: calc(var(--w) * 0.105); }
.shot-placeholder .icon { font-size: 28px; opacity: 0.7; }
.shot-placeholder b { font-size: 14px; font-weight: 600; color: #33415C; }
/* In a tile the phone runs off the bottom, so the label moves up into the part that shows */
.tile .phone .shot-placeholder { justify-content: flex-start; padding-top: 42%; }
.shot-placeholder code {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font: 500 10.5px ui-monospace, "SF Mono", Menlo, monospace;
}

/* ───────────── Progress plane and navigation ───────────── */

.progress { --p: 0; position: fixed; inset: 9px 0 auto; height: 5px; z-index: 60; pointer-events: none; }
.progress-fill {
  width: calc(var(--p) * 100%);
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: var(--sky);
}
/* The emoji points up and to the right, so it's turned to point along the bar */
.progress-plane {
  position: absolute;
  top: 50%;
  left: clamp(11px, calc(var(--p) * 100% + 6px), calc(100% - 11px));
  font-size: 18px;
  line-height: 1;
  transform: translate(-50%, -50%) rotate(45deg);
  opacity: min(1, calc(var(--p) * 40));
}

.nav {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1040px, calc(100% - 24px));
  padding: 8px 8px 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-sm);
  transform: translateX(-50%);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.brand img { border-radius: 26%; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: #55555A;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover { background: rgba(0, 0, 0, 0.05); color: var(--text); }

/* ───────────── Hero ───────────── */

.hero { position: relative; padding: 148px 24px 0; text-align: center; }
.hero-copy { position: relative; max-width: 900px; margin: 0 auto; }

.badges { display: flex; justify-content: center; gap: 8px; margin-bottom: 26px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 14px;
  font-weight: 700;
}
.badge--gold { background: #FFF3CF; color: #8A5B00; }
.badge--gold .icon { color: var(--gold); }

.hero .lede { max-width: 580px; margin: 24px auto 0; }

.hero-actions { display: flex; flex-direction: column; align-items: center; gap: 20px; margin-top: 34px; }
.loved { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; font-weight: 600; }

.hero-stage { position: relative; max-width: 1000px; height: 540px; margin: 64px auto 0; }
.hero-stage::before {
  content: "";
  position: absolute;
  inset: -40px 0 0;
  background:
    radial-gradient(closest-side at 30% 55%, rgba(66, 184, 236, 0.20), transparent),
    radial-gradient(closest-side at 72% 45%, rgba(255, 122, 47, 0.14), transparent);
  pointer-events: none;
}
/* The phone runs off the bottom of the stage and fades out */
.hero-phone {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 8px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 90px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 90px), transparent);
}

.piece {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  transform: translate(calc(var(--anchor, -50%) + var(--x)), var(--y)) rotate(var(--r, 0deg));
  /* Pops in after the headline, one piece at a time (--n is its turn) */
  animation: pop 0.6s var(--spring) calc(0.7s + var(--n) * 0.11s) backwards;
}
@keyframes pop { from { opacity: 0; scale: 0.5; } }
.piece--days      { --n: 0; --x: -240px; --y: 44px;  --r: -6deg; }
.piece--photo     { --n: 2; --x: -310px; --y: 150px; --r: -8deg; }
.piece--added     { --n: 4; --x: -252px; --y: 392px; --r: 3deg; }
.piece--join      { --n: 1; --x: 236px;  --y: 60px;  --r: 5deg; }
.piece--friend    { --n: 3; --x: 322px;  --y: 150px; }
.piece--time      { --n: 5; --x: 268px;  --y: 268px; --r: -3deg; }
.piece--optimized { --n: 6; --x: 244px;  --y: 410px; --r: 4deg; }

.hero-tabs { position: relative; z-index: 3; margin-top: -8px; }
.tabs {
  display: inline-flex;
  gap: 2px;
  max-width: 100%;
  padding: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab {
  padding: 9px 18px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.2s, background 0.25s, box-shadow 0.25s;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: #FFFFFF; color: #0A0A0B; box-shadow: var(--shadow-sm); }

.tab-caption { display: grid; max-width: 440px; margin: 20px auto 0; color: var(--muted); font-size: 18px; line-height: 1.4; }
.tab-caption span { grid-area: 1 / 1; opacity: 0; transition: opacity 0.35s; }
.tab-caption span.is-active { opacity: 1; }
.tab-caption b { color: var(--text); font-weight: 600; }

/* ───────────── Sections ───────────── */

.section { max-width: 1120px; margin: 0 auto; padding: 140px 24px 0; }
.section--narrow { max-width: 800px; }
.section-head { margin-bottom: 56px; text-align: center; }

.split { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; }
.split-copy { max-width: 470px; }
.split-copy .lede { margin: 20px 0 32px; }
.split-stage { display: grid; place-items: center; min-height: 520px; }
.split--flip .split-copy { order: 2; justify-self: end; }

/* Two texts in one spot: room is kept for both, so nothing jumps when they swap */
.swap { display: grid; }
.swap > * { grid-area: 1 / 1; transition: opacity 0.4s, filter 0.4s; }
/* A short title sits right above its subtitle rather than at the top of the room kept for the long one */
h2.swap > * { align-self: end; }
.swap-b { opacity: 0; filter: blur(8px); }
.swap.is-swapped .swap-a { opacity: 0; filter: blur(8px); }
.swap.is-swapped .swap-b { opacity: 1; filter: none; }

/* Scales a fixed-size stage (--w × --h px) without disturbing the layout around it */
.scaler { --k: 1.25; width: calc(var(--w) * var(--k) * 1px); height: calc(var(--h) * var(--k) * 1px); }
.scaler > * {
  width: calc(var(--w) * 1px);
  height: calc(var(--h) * 1px);
  transform: scale(var(--k));
  transform-origin: top left;
}

/* ───────────── Chaos collage → trip card ───────────── */

.chaos { position: relative; }
.chaos-item {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r));
  transition: transform 0.55s var(--spring), opacity 0.35s;
  transition-delay: calc(var(--i) * 0.1s);
}
.js .chaos:not(.is-scattered) .chaos-item {
  opacity: 0;
  transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)) scale(0.6);
}
.chaos.is-assembled .chaos-item {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(0deg) scale(0.2);
  transition: transform 0.5s cubic-bezier(0.5, 0, 0.3, 1), opacity 0.3s 0.2s;
  transition-delay: calc(var(--i) * 0.09s), calc(var(--i) * 0.09s + 0.2s);
}

.fragment {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 204px;
  padding: 12px;
  border-radius: 22px;
  background: #FFFFFF;
  box-shadow: var(--shadow);
  color: #0A0A0B;
  text-align: left;
  line-height: 1.25;
}
.fragment b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; }
.fragment small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }

.note {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 160px;
  padding: 12px;
  border-radius: 20px;
  background: #FFF1B8;
  box-shadow: var(--shadow);
  color: #5C4A12;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}
.note b { font-size: 15px; }

.chat-fragment {
  width: 172px;
  padding: 10px 14px;
  border-radius: 20px;
  background: #F2F2F4;
  box-shadow: var(--shadow);
  color: #0A0A0B;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
}

/* Boarding-pass trip card: destination on top, a perforated tear line, then the trip on a timeline */
.ticket-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.5);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.12));
  pointer-events: none;
  transition: transform 0.3s ease-in, opacity 0.25s;
}
.chaos.is-assembled .ticket-wrap {
  opacity: 1;
  transform: none;
  transition: transform 0.65s var(--spring) 0.85s, opacity 0.3s 0.85s;
}
.ticket {
  width: 320px;
  border-radius: 30px;
  background: #FFFFFF;
  color: #0A0A0B;
  /* A half-circle notch on each side, where the tear line starts */
  -webkit-mask:
    radial-gradient(circle 10px at 0 76px, transparent 9.5px, #000 10px),
    radial-gradient(circle 10px at 100% 76px, transparent 9.5px, #000 10px);
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(circle 10px at 0 76px, transparent 9.5px, #000 10px),
    radial-gradient(circle 10px at 100% 76px, transparent 9.5px, #000 10px);
  mask-composite: intersect;
}
.ticket-head { display: flex; align-items: center; gap: 12px; height: 76px; padding: 0 16px; }
.ticket-city { flex: 1; text-align: left; line-height: 1.15; }
.ticket-city b { display: block; font-size: 22px; font-weight: 800; }
.ticket-city small { color: var(--muted); font-size: 15px; font-weight: 500; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sky) 12%, transparent);
  color: var(--sky);
  font-size: 13px;
  font-weight: 700;
}
.ticket-perforation { margin: 0 16px; border-top: 2px dashed rgba(0, 0, 0, 0.13); }
.ticket-rows { position: relative; padding: 10px 12px 12px; }
/* Thread joining the icons, from the first to the last */
.ticket-rows::before {
  content: "";
  position: absolute;
  top: 31px;
  bottom: 33px;
  left: 29px;
  width: 2px;
  background: rgba(0, 0, 0, 0.08);
}
.ticket-rows li { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 4px; }
.ticket-rows .glyph { position: relative; box-shadow: 0 0 0 2px #FFFFFF; }
.ticket-rows b { flex: 1; font-size: 15px; font-weight: 600; text-align: left; }
.ticket-rows small {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

/* ───────────── Route map ───────────── */

.route { position: relative; }
.route-map {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.route-map::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 5px #FFFFFF;
  pointer-events: none;
}
.route-map svg { display: block; width: 100%; height: 100%; }

/* Each route is drawn up to its dash offset, so animating that draws and erases it */
.route-line {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  transition: stroke-dashoffset 0.35s ease-in, opacity 0s 0.35s;
}
.route-line--tangled { stroke: var(--red); filter: drop-shadow(0 2px 4px rgba(232, 48, 42, 0.3)); }
.route-line--optimized { stroke: var(--green); filter: drop-shadow(0 2px 4px rgba(47, 184, 110, 0.3)); }
.route.is-tangled .route-line--tangled { stroke-dashoffset: 0; opacity: 1; transition: stroke-dashoffset 1.3s ease-in-out; }
.route.is-optimized .route-line--optimized { stroke-dashoffset: 0; opacity: 1; transition: stroke-dashoffset 1s ease-in-out; }

/* A 📍 pushpin whose needle sits on the place, with the name hanging below */
.pin, .pin-label { position: absolute; transition: transform 0.45s var(--spring), opacity 0.3s; }
.pin {
  font-size: 26px;
  line-height: 1;
  transform: translate(-50%, calc(-100% + 3px));
  transform-origin: 50% 100%;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}
.pin-label {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: rgba(0, 0, 0, 0.75);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  transform: translateX(-50%);
  transform-origin: 50% 0;
}
.js .pin:not(.is-in) { opacity: 0; transform: translate(-50%, calc(-100% + 3px)) scale(0.3); }
.js .pin-label:not(.is-in) { opacity: 0; transform: translateX(-50%) scale(0.3); }

/* Time spent getting around: red for the zigzag, green once optimized */
.route-time { position: absolute; top: -18px; left: 50%; color: var(--red); font-weight: 700; transform: translateX(-50%); transition: color 0.3s; }
.route.is-optimized .route-time { color: var(--green); }
.route-time .muted { font-weight: 700; }
.route-saved {
  position: absolute;
  right: -6px;
  bottom: -16px;
  opacity: 0;
  transform: rotate(-4deg) scale(0.4);
  transition: transform 0.5s var(--spring), opacity 0.25s;
}
.route.is-done .route-saved { opacity: 1; transform: rotate(-4deg); }

/* ───────────── Feature tiles ───────────── */

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.tile {
  display: flex;
  flex-direction: column;
  grid-column: span var(--span, 2);
  border-radius: 32px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tile-copy { padding: 32px 32px 0; }
.tile h3 {
  margin-bottom: 8px;
  font-size: 24px;
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: 1.15;
}
.tile p { color: var(--muted); }
.tile-media { display: flex; justify-content: center; align-items: flex-start; height: 300px; margin-top: auto; padding: 32px 24px 0; }

.tile--wide { flex-direction: row; align-items: stretch; }
.tile--wide .tile-copy { flex: 1; align-self: center; padding: 48px; }
.tile--wide h3 { font-size: 32px; }
.tile--wide p { max-width: 400px; font-size: 18px; }
.tile--wide .tile-media { flex: 0 0 44%; height: 380px; margin-top: 0; padding-top: 44px; }

/* The scratch map's globe on its own: the tile takes the black of the screenshot's sky,
   and a square cut from the middle of the image holds the whole globe. stars.svg carries the
   image's stars on across the tile, as dense and as bright as they are in the image */
.tile--space { background: #000000 url(assets/stars.svg) 0 0 / 1200px 600px; color: #FFFFFF; }
.tile--space p { color: rgba(255, 255, 255, 0.62); }
.tile--wide .tile-media--globe { position: relative; flex: none; aspect-ratio: 1; padding: 0; }
.tile-media--globe .shot { inset: 8%; }
.tile-media--globe .shot img { object-position: center; }
/* Dark too, so no light edge shows around the image when it lands between pixels */
.tile--space .shot-placeholder { background: none; color: rgba(255, 255, 255, 0.6); }
.tile--space .shot-placeholder::before { border-color: rgba(255, 255, 255, 0.25); }
.tile--space .shot-placeholder b { color: #FFFFFF; }
.tile--space .shot-placeholder code { color: #33415C; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.chips .sticker { height: 40px; padding: 0 14px; box-shadow: var(--shadow-sm); }

/* Friends planning the trip, as chat bubbles */
.tile-media--chat {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  height: auto;
  min-height: 252px;
  margin: 28px 16px 16px;
  padding: 20px 14px;
  border-radius: 22px;
  background: var(--bg);
}
.bubble { display: flex; align-items: flex-end; gap: 8px; transition: transform 0.5s var(--spring), opacity 0.3s; }
.bubble > span:last-child {
  padding: 10px 14px;
  border-radius: 20px;
  background: #FFFFFF;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.07);
  color: #0A0A0B;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
}
.bubble--me { justify-content: flex-end; }
.bubble--me > span:last-child { background: var(--accent-grad); box-shadow: 0 8px 16px rgba(255, 122, 47, 0.3); color: #FFFFFF; font-weight: 600; }
.js .bubble:not(.is-in) { opacity: 0; transform: translateY(18px); }

/* The trip countdown, as a small Home Screen widget */
.tile-media--widget { align-items: center; padding-bottom: 32px; }
.widget {
  display: flex;
  flex-direction: column;
  width: 184px;
  aspect-ratio: 1;
  padding: 18px;
  border-radius: 40px;
  background: #FFFFFF;
  box-shadow: var(--shadow);
  color: #0A0A0B;
  line-height: 1.15;
}
.widget-trip { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.widget-trip b { display: block; color: #0A0A0B; font-size: 17px; }
/* The count sits in a panel as wide as the row above, so both halves share their edges */
.widget-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 78px;
  margin-top: auto;
  border-radius: 22px;
  background: var(--fill);
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
}
.widget-count b { color: #0A0A0B; font-size: 46px; font-weight: var(--display-weight); letter-spacing: -0.03em; line-height: 1; }

/* ───────────── Reviews ───────────── */

.proof { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.proof .tile { --span: 1; }
.stat { align-items: center; justify-content: center; gap: 2px; min-height: 190px; padding: 28px; text-align: center; }
.stat b { font-size: 48px; font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: 1.1; }
.stat span { color: var(--muted); font-weight: 600; }
.proof .stat--rating {
  --span: 2;
  flex-direction: row;
  gap: 16px;
  background: linear-gradient(180deg, #FFF7E0, var(--card));
}
.stat--rating div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.laurel { width: 52px; height: 94px; color: var(--gold); }
.laurel--flip { transform: scaleX(-1); }
.stars, .stat .stars { display: inline-flex; gap: 2px; color: var(--gold); font-size: 17px; }
.stars--sm { display: flex; font-size: 12px; margin-top: 2px; }

.proof .review { --span: 2; gap: 14px; padding: 28px; }
.review figcaption { display: flex; align-items: center; gap: 12px; line-height: 1.2; }
.review figcaption b { font-size: 16px; }
.review blockquote { color: color-mix(in srgb, var(--text) 72%, transparent); font-size: 17px; line-height: 1.5; }
.review blockquote b { display: block; margin-bottom: 4px; color: var(--text); }

/* ───────────── FAQ ───────────── */

.faq details { margin-bottom: 12px; border-radius: 24px; background: var(--card); box-shadow: 0 6px 28px rgba(0, 0, 0, 0.05); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px;
  border-radius: 24px;
  font-size: 18px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--muted); font-size: 20px; transition: transform 0.35s var(--spring); }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq p { padding: 0 26px 24px; color: var(--muted); max-width: 640px; }

/* ───────────── Closing call to action ───────────── */

.cta {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 440px;
  padding: 72px 64px;
  border-radius: 40px;
  background:
    radial-gradient(60% 80% at 85% 10%, rgba(255, 255, 255, 0.35), transparent),
    var(--sky-grad);
  color: #FFFFFF;
  overflow: hidden;
}
.cta-copy { position: relative; z-index: 1; max-width: 480px; }
.cta-kanji { margin-bottom: 14px; font-size: 20px; font-weight: 700; letter-spacing: 0.3em; opacity: 0.85; }
.cta h2.display { font-size: clamp(2.4rem, 5.4vw, 4.2rem); }
.cta .lede { margin: 16px 0 32px; color: rgba(255, 255, 255, 0.92); font-weight: 600; }
.cta-plane {
  position: absolute;
  top: 50%;
  right: 1%;
  width: min(54%, 600px);
  filter: drop-shadow(0 30px 40px rgba(0, 50, 110, 0.35));
  animation: fly 4.5s ease-in-out infinite alternate;
}
@keyframes fly {
  from { transform: translateY(-46%) rotate(-1.5deg); }
  to { transform: translateY(-54%) rotate(1.5deg); }
}

/* ───────────── Legal pages: Terms & Conditions, Privacy Policy ───────────── */

.legal { max-width: 800px; margin: 0 auto; padding: 168px 24px 0; }
.legal-head { margin-bottom: 40px; }
.legal-head h1.display { font-size: clamp(2.2rem, 5.6vw, 3.6rem); }
.legal-head p { margin-top: 12px; color: var(--muted); font-weight: 600; }

/* The document sits on one white card, like the FAQ's answers */
.legal-body { padding: 48px; border-radius: 32px; background: var(--card); box-shadow: var(--shadow); }
.legal-body > * + * { margin-top: 16px; }
.legal-body h2 {
  font-size: 22px;
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: 1.2;
}
.legal-body > h2 { margin-top: 40px; }
.legal-body h3 { margin-top: 28px; font-size: 17px; font-weight: 800; }
.legal-body p, .legal-body li { color: color-mix(in srgb, var(--text) 72%, transparent); }
.legal-body ul { display: grid; gap: 10px; padding-left: 22px; list-style: disc; }
.legal-body li::marker { color: var(--muted); }
.legal-body b { color: var(--text); font-weight: 700; }
.legal-body a {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline var(--accent) 2px;
  text-underline-offset: 3px;
}
.legal-summary { display: grid; gap: 14px; padding: 26px 28px; border-radius: 24px; background: var(--fill); }
.legal-summary h2 { font-size: 18px; }

/* ───────────── Footer ───────────── */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 64px 24px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}
.footer .brand { color: var(--text); }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer a:hover, .footer a[aria-current] { color: var(--text); }

/* ───────────── Scroll reveal: fade and lift, as the onboarding does ───────────── */

/* The hero rises on load, without waiting for a script, so the headline can never be left hidden */
.hero .reveal { animation: rise 0.8s var(--smooth) backwards; }
.hero .reveal:nth-child(2) { animation-delay: 0.08s; }
.hero .reveal:nth-child(3) { animation-delay: 0.16s; }
.hero .reveal:nth-child(4) { animation-delay: 0.24s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

.js .reveal:not(.hero *) { opacity: 0; transform: translateY(24px); }
.js .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--smooth), transform 0.7s var(--smooth);
  transition-delay: calc(var(--stagger, 0) * 0.09s);
}

/* ───────────── Smaller screens ───────────── */

@media (max-width: 960px) {
  .nav-links { display: none; }
  .scaler { --k: 1.1; }

  .hero-stage { height: 500px; }
  .hero-phone .phone { --w: 270px !important; }
  .piece--days      { --x: -190px; --y: 30px; }
  .piece--photo     { --x: -250px; --y: 150px; }
  .piece--added     { --x: -200px; --y: 380px; }
  .piece--join      { --x: 190px;  --y: 60px; }
  .piece--friend    { --x: 250px;  --y: 150px; }
  .piece--time      { --x: 220px;  --y: 260px; }
  .piece--optimized { --x: 196px;  --y: 400px; }

  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento .tile { grid-column: span 1; }
  .bento .tile--wide { grid-column: span 2; }
  .proof { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .section { padding-top: 96px; }
  .section-head { margin-bottom: 40px; }

  .split { grid-template-columns: 1fr; gap: 24px; }
  .split--flip .split-copy { order: 0; justify-self: start; }
  .split-stage { min-height: 0; padding: 24px 0 16px; }
  .scaler { --k: 1; }

  .tile--wide { flex-direction: column; }
  .tile--wide .tile-copy { align-self: stretch; padding: 32px 32px 0; }
  .tile--wide .tile-media { flex: none; height: 320px; padding-top: 32px; }
  .tile--wide .tile-media--globe { align-self: center; width: min(100%, 420px); height: auto; padding-top: 0; }

  .cta { flex-direction: column; align-items: flex-start; min-height: 0; padding: 48px 32px 0; }
  .cta-copy { width: 100%; max-width: none; }
  .cta-plane { position: static; width: 110%; max-width: none; margin: 8px -5% 0 auto; animation: none; }
}

@media (max-width: 600px) {
  .hero { padding-top: 124px; padding-inline: 16px; }
  .section { padding-inline: 16px; }
  .legal { padding: 124px 16px 0; }
  .legal-body { padding: 28px 22px; border-radius: 28px; }
  .legal-summary { padding: 20px; border-radius: 20px; }
  .nav .btn--small svg { display: none; }

  /* Fewer pieces, tucked against the phone like the onboarding's collage. Each is placed by its outer
     edge, a set distance from the centre, and stops 8px short of the screen edge on narrow phones.
     The stickers sit over the phone's top corners and its faded bottom, so they cover no screenshot content. */
  .hero-stage { height: 470px; margin-top: 56px; }
  .hero-phone .phone { --w: 240px !important; }
  .piece--photo, .piece--join, .piece--time { display: none; }
  .piece { --anchor: 0%; --x: 0px; }
  .piece--days      { left: max(-8px, calc(50% - 173px)); --y: -16px; }
  .piece--added     { left: max(-8px, calc(50% - 193px)); --y: 412px; }
  .piece--friend    { left: auto; right: max(-8px, calc(50% - 163px)); --y: 96px; }
  .piece--optimized { left: auto; right: max(-8px, calc(50% - 165px)); --y: -36px; }

  .tab { padding: 9px 10px; font-size: 14px; }
  .tab-caption { font-size: 17px; }

  .bento { grid-template-columns: 1fr; }
  .bento .tile, .bento .tile--wide { grid-column: span 1; }
  .proof .stat { padding-inline: 12px; }  /* keeps "Trips planned" on one line, level with its neighbour */
  .proof .stat b { font-size: 38px; }
  .laurel { width: 40px; height: 72px; }
  .cta { padding: 40px 24px 0; }
  .cta .btn { width: 100%; padding: 0 16px; font-size: 16px; }
  .cta-plane { margin-bottom: 20px; }
  .faq summary { padding: 20px; font-size: 17px; }
  .faq p { padding: 0 20px 20px; }
  .footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 380px) {
  .scaler { --k: 0.9; }
  /* All four tabs fit without scrolling */
  .tab { padding-inline: 7px; }
}

@media (max-width: 350px) {
  .tab { padding-inline: 5px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}
