/* Landing page (/). Tokens in /theme.css, shared parts in /ui.css. Phone first, then wide. */
.skyline {
  --sky-far: color-mix(in srgb, var(--line) 55%, var(--surface));
  --sky-near: var(--line);
  --sky-detail: var(--line-strong);
}


.landing { max-width: none; padding: 0; }
.wrap { max-width: var(--page-max); margin-inline: auto; padding-inline: var(--s-4); }
.section-title { font: var(--w-bold) var(--t-xl)/1.2 var(--sans); letter-spacing: -0.015em; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--surface); border-bottom: 1px solid var(--line); }
.hero-grid {
  position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr);
  gap: var(--s-6); padding-top: var(--s-6); padding-bottom: 150px;
}
.hero h1 {
  font: var(--w-bold) var(--t-display)/1.04 var(--sans); letter-spacing: -0.03em;
  max-width: 14ch; overflow-wrap: break-word;
}
.lede { margin-top: var(--s-4); max-width: 54ch; font-size: var(--t-md); line-height: 1.55; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-5); }

.phone { margin: 0; width: 100%; max-width: 380px; }
.phone-screen {
  padding: var(--s-4); border-radius: var(--r-xl);
  background: var(--bg); box-shadow: var(--shadow-2);
}
.sms-from { display: flex; align-items: center; gap: var(--s-2); padding-bottom: var(--s-3); border-bottom: 1px solid var(--line); font-size: var(--t-sm); }
.sms-from b { color: var(--ink); }
.sms-kind { margin-left: var(--s-2); color: var(--muted); }
.sms {
  margin-top: var(--s-4); padding: var(--s-3) var(--s-4);
  border-radius: 20px 20px 20px var(--r-xs);
  background: var(--surface); color: var(--ink); font-size: var(--t-base); line-height: 1.5;
}
.phone figcaption { display: grid; gap: var(--s-1); margin-top: var(--s-4); padding-left: var(--s-2); font-size: var(--t-sm); color: var(--muted); }
.phone figcaption b { font: var(--w-bold) var(--t-md)/1.3 var(--sans); color: var(--ink); }

.skyline {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: max(100%, 760px); height: auto; pointer-events: none;
}
.skyline .sky-far rect { fill: var(--sky-far); }
.skyline .sky-near :is(rect, path, circle) { fill: var(--sky-near); }
.skyline .sky-near .wheel { fill: none; stroke: var(--sky-near); stroke-width: 5; }
.skyline .shophouses :is(rect, path) { fill: var(--sky-detail); }
.skyline .umbrella :is(path, rect) { fill: var(--ink-2); }
.skyline .rain rect { fill: var(--rain); opacity: 0.55; }
.skyline .sun { fill: var(--sky-far); }

/* ---------- roles ---------- */
.roles { padding-top: var(--s-8); }
.roles-grid { display: grid; gap: var(--s-4); margin-top: var(--s-4); }
.role { display: flex; flex-direction: column; align-items: flex-start; }
.role h3 { display: flex; align-items: center; gap: var(--s-2); font: var(--w-bold) var(--t-lg)/1.25 var(--sans); }
.role .facts { margin: var(--s-3) 0 var(--s-5); padding-left: 20px; color: var(--ink-2); }
.role .facts li { margin: var(--s-2) 0; max-width: 62ch; }
.role .facts li::marker { color: var(--faint); }
.role-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: auto; padding-top: var(--s-4); }
.role > .btn { margin-top: auto; }
.role-owner { padding: var(--s-5); }
.role-owner h3 { gap: var(--s-3); font-size: var(--t-xl); }
.role-icon {
  display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: var(--r-md);
  background: var(--accent-soft); color: var(--accent);
}

.role-others { display: grid; grid-auto-rows: 1fr; padding: 0; }
.role-others .role { padding: var(--s-5); }
.role-others .role + .role { border-top: 1px solid var(--line); }
.role-others h3 .i { color: var(--muted); }
.role-others .facts { font-size: var(--t-sm); }

/* ---------- what you pay, what you get ---------- */
.offer { padding-top: var(--s-8); }
.offer-head .lede, .how-head .lede { margin-top: var(--s-2); }
.offer-grid { display: grid; gap: var(--s-4); margin-top: var(--s-5); }
.offer-card {
  display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-5);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .offer-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
}
.offer-tier {
  align-self: flex-start; padding: 2px var(--s-3); border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent); font: var(--w-bold) var(--t-sm)/1.6 var(--sans);
}
.offer-pay { margin-top: var(--s-3); color: var(--ink-2); font-size: var(--t-sm); }
.offer-pay b {
  display: block; color: var(--ink); font: var(--w-bold) var(--t-2xl)/1.1 var(--sans);
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.offer-price { color: var(--muted); font-size: var(--t-sm); }
.offer-price b { color: var(--ink); font-variant-numeric: tabular-nums; }
.offer-rows { display: grid; margin: var(--s-4) 0 0; padding-top: var(--s-3); border-top: 1px solid var(--line); }
.offer-rows div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); padding: 6px 0; }
.offer-rows dt { color: var(--ink-2); font-size: var(--t-sm); }
.offer-rows dd { margin: 0; color: var(--ink); font-weight: var(--w-bold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.offer-band {
  display: flex; align-items: center; gap: var(--s-4); margin-top: var(--s-4); padding: var(--s-4) var(--s-5);
  border-radius: var(--r-lg); background: var(--ink); color: var(--surface);
}
.offer-band p { max-width: 72ch; line-height: 1.5; }
.offer-band b { color: var(--orange-300); }
.offer-band-icon {
  display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--surface) 12%, transparent); color: var(--orange-300);
}
.offer-note { margin-top: var(--s-3); }

/* ---------- how you get paid: three steps that light up in turn (landing.js) ---------- */
.how { padding-top: var(--s-8); }
.flow { list-style: none; display: grid; gap: 0; margin: var(--s-5) 0 0; padding: 0; }
.flow-step {
  position: relative; display: grid; gap: var(--s-1); align-content: start; padding: var(--s-5);
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink-2);
  opacity: 0.55; transform: translateY(6px);
  transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out),
    border-color 400ms var(--ease-out), box-shadow 400ms var(--ease-out);
}
.flow-step b { color: var(--ink); font: var(--w-bold) var(--t-md)/1.3 var(--sans); margin-top: var(--s-2); }
.flow-step > span:not([class]) { font-size: var(--t-sm); max-width: 40ch; }
.flow-icon {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-md);
  background: var(--sunken); color: var(--muted);
  transition: background-color 400ms var(--ease-out), color 400ms var(--ease-out);
}
.flow-num {
  position: absolute; top: var(--s-4); right: var(--s-4); display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong);
  color: var(--muted); font: var(--w-bold) var(--t-sm)/1 var(--sans);
}
.flow-paid {
  justify-self: start; display: inline-flex; align-items: center; gap: var(--s-1); margin-top: var(--s-3);
  padding: 4px var(--s-3); border-radius: var(--r-pill); background: var(--green-100); color: var(--green-700);
  font: var(--w-bold) var(--t-sm)/1.4 var(--sans);
  opacity: 0; transform: scale(0.95);
  transition: opacity 300ms var(--ease-out) 200ms, transform 300ms var(--ease-out) 200ms;
}
.flow.s1 [data-step="1"], .flow.s2 [data-step="2"], .flow.s3 [data-step="3"] {
  opacity: 1; transform: none; border-color: var(--accent); box-shadow: var(--shadow-1);
}
.flow.s1 [data-step="1"] .flow-icon, .flow.s2 [data-step="2"] .flow-icon, .flow.s3 [data-step="3"] .flow-icon {
  background: var(--accent-soft); color: var(--accent);
}
.flow.s3 .flow-paid { opacity: 1; transform: none; }
/* The link between two steps: a line that fills from the earlier step to the later one. */
.flow-link { position: relative; justify-self: center; width: 2px; height: var(--s-6); background: var(--line); overflow: hidden; }
.flow-fill {
  position: absolute; inset: 0; background: var(--accent);
  transform: scaleY(0); transform-origin: top; transition: transform 560ms var(--ease-in-out);
}
.flow.l1 .flow-link:nth-of-type(2) .flow-fill, .flow.l2 .flow-link:nth-of-type(4) .flow-fill { transform: none; }
.flow.still .flow-step, .flow.still .flow-paid, .flow.still .flow-fill { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .flow-step, .flow-paid { transform: none; }
}

/* ---------- closing action ---------- */
.closer { margin-block: var(--s-8); }
.closer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding-top: var(--s-6); border-top: 1px solid var(--line);
}
.closer-line { font: var(--w-bold) var(--t-xl)/1.25 var(--sans); max-width: 30ch; text-wrap: balance; }

.sitefoot { padding-inline: 0; }
.sitefoot .inner { padding-inline: var(--s-4); }

/* Phones: the four tiers swipe sideways instead of stacking four cards deep. */
@media (max-width: 639px) {
  .offer-grid {
    grid-auto-flow: column; grid-auto-columns: 82%; overflow-x: auto; scroll-snap-type: x mandatory;
    margin-inline: calc(-1 * var(--s-4)); padding: 2px var(--s-4) var(--s-2); scrollbar-width: none;
  }
  .offer-grid::-webkit-scrollbar { display: none; }
  .offer-card { scroll-snap-align: center; }
}

@media (max-width: 479px) {
  /* Full-width buttons; a long label wraps instead of pushing the page wider than the phone. */
  :is(.hero-actions, .closer) .btn {
    width: 100%; white-space: normal; text-align: center; line-height: 1.25; padding-block: 10px;
  }
}

@media (min-width: 640px) {
  .wrap, .sitefoot .inner { padding-inline: var(--s-5); }
  .offer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tablet portrait: copy and the SMS side by side, so the hero does not leave half the screen empty. */
@media (min-width: 720px) and (max-width: 899px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); align-items: center; }
  .phone { justify-self: end; }
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr); align-items: center;
    gap: var(--s-7); padding-top: var(--s-7); padding-bottom: 280px;
  }
  .phone { justify-self: end; }
  .skyline { width: max(100%, 1200px); }
  .roles-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: stretch; }
  .role-owner { padding: var(--s-6); }
  /* Three steps in a row, a horizontal line between each pair. */
  .flow { grid-template-columns: minmax(0, 1fr) var(--s-7) minmax(0, 1fr) var(--s-7) minmax(0, 1fr); align-items: stretch; }
  .flow-link { align-self: center; width: 100%; height: 2px; }
  .flow-fill { transform: scaleX(0); transform-origin: left; }
}

@media (min-width: 1100px) {
  .offer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
