/* Components every landing shares. Each landing sets the variables and section colours in its
   own <style> (src/landings/<slug>.mjs). Every block is one phone screen that reads like a chat;
   scrolling snaps from screen to screen. */

html {
  scroll-snap-type: y proximity;
}

body {
  background: var(--bg);
}

.page {
  font-family: var(--font-body);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.45;
  overflow-x: clip;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus, currentColor);
  outline-offset: 3px;
}

/* One screen per block */
.screen {
  min-height: 100svh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 36px max(20px, calc(50% - 220px));
}

h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: var(--h2-size, 30px);
  line-height: 1.02;
  letter-spacing: var(--display-spacing, 0);
  text-transform: var(--display-case, none);
  text-align: center;
}

/* Header */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--logo, var(--ink));
}

.logo-mark {
  width: 34px;
  height: auto;
}

.foot .logo-mark {
  width: 26px;
}

.lang {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--lang-bg, #FFFFFF);
}

.lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  color: var(--lang-ink, var(--ink));
}

.lang a[aria-current="page"] {
  background: var(--lang-on-bg, var(--ink));
  color: var(--lang-on-ink, #FFFFFF);
}

/* Hero. Hidden for a moment while its fonts load (fontGate in src/layout.mjs). */
.fonts-pending .hero {
  visibility: hidden;
}

.hero {
  justify-content: flex-start;
  gap: 0;
  padding-top: 0;
  padding-bottom: 36px;
}

.hero-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: var(--hero-align, center);
}

.eyebrow {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--eyebrow, var(--muted));
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: var(--h1-size);
  line-height: var(--h1-line, 1);
  letter-spacing: var(--display-spacing, 0);
  text-transform: var(--display-case, none);
}

h1 .em {
  color: var(--accent);
}

/* Headlines break into even lines, paragraphs avoid a lonely last word. */
h1,
h2,
.eyebrow,
.card-title,
.cta {
  text-wrap: balance;
}

.sub,
.note,
.msg,
.card-sub,
.offer-card p,
.soon {
  text-wrap: pretty;
}

.sub {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.hero-art {
  display: flex;
  justify-content: center;
}

/* Form and main button */
.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field input[type="email"] {
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  font: inherit;
  font-size: 18px;
  text-align: var(--field-align, center);
  color: #1C1C1C;
  background: #FFFFFF;
  border: var(--field-border, 2px solid transparent);
  border-radius: var(--field-radius, 999px);
}

.field input::placeholder {
  color: #76706A;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 14px 18px;
  border: 0;
  border-radius: var(--cta-radius, 999px);
  background: var(--cta-bg, var(--ink));
  color: var(--cta-ink, #FFFFFF);
  font: inherit;
  font-family: var(--cta-font, inherit);
  font-size: var(--cta-size, clamp(15px, 4.6vw, 18px));
  font-weight: 800;
  letter-spacing: var(--cta-spacing, 0);
  text-transform: var(--cta-case, none);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--cta-shadow, none);
}

.cta.again {
  align-self: center;
}

.note {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.error {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--error, var(--accent));
}

/* Cards: questions, done, cart, offer */
.card,
.cart,
.offer-card {
  background: var(--card-bg, #FFFFFF);
  color: var(--card-ink, var(--ink));
  border: var(--card-border, 0);
  border-radius: var(--radius, 24px);
  box-shadow: var(--card-shadow, none);
}

.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 16px;
  text-align: center;
}

.card-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--card-title, var(--card-ink, var(--ink)));
}

.card-sub {
  margin: -8px 0 0;
  font-size: 15px;
  color: var(--card-muted, var(--muted));
}

.question {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.q {
  margin: 0;
  font-weight: 800;
}

.options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.options button {
  min-height: 44px;
  padding: 8px 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--card-ink, var(--ink));
  background: #FFFFFF;
  border: 2px solid var(--opt-border, var(--line));
  border-radius: 999px;
  cursor: pointer;
}

.options.row button {
  min-width: 52px;
}

.options button[aria-pressed="true"] {
  color: var(--opt-on-ink, #FFFFFF);
  background: var(--opt-on-bg, var(--primary));
  border-color: var(--opt-on-bg, var(--primary));
}

.options.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.options .tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 92px;
  padding: 12px 4px 10px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.15;
}

.options .tile[aria-pressed="true"] {
  color: var(--card-ink, var(--ink));
  background: var(--tile-on-bg, #FFFFFF);
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  font-size: 19px;
  color: var(--mark-fg);
  background: var(--mark-bg);
}

.mark.plain {
  color: var(--primary);
  background: var(--tile-plain, var(--bg));
}

.tick {
  position: absolute;
  top: -7px;
  right: -7px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #FFFFFF;
  background: var(--primary);
}

.tile[aria-pressed="true"] .tick {
  display: inline-flex;
}

.cta.send {
  width: 100%;
}

.done {
  align-items: center;
}

.done-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #FFFFFF;
  background: var(--primary);
}

.done-check svg {
  width: 30px;
  height: 30px;
}

.cart {
  width: 100%;
  max-width: 340px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.cart-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--on-primary, #FFFFFF);
  background: var(--primary);
}

.cart-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cart-title {
  font-weight: 800;
}

.cart-store {
  font-size: 14px;
  color: var(--card-muted, var(--muted));
}

.cart-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cart-rows li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  font-weight: 600;
  border-top: 1px dashed var(--line);
}

.cart-rows .why {
  flex: none;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  color: var(--tag-ink, var(--accent));
  background: var(--tag-bg, transparent);
  align-self: center;
}

.cart-rows .more {
  color: var(--card-muted, var(--muted));
}

.cart-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.cart-count {
  font-size: 14px;
  color: var(--card-muted, var(--muted));
}

.cart-total {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--primary);
}

.cart-action {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 20px 6px 6px;
  font-weight: 800;
  border-radius: 999px;
  color: #FFFFFF;
  background: var(--accent);
}

.knob {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--accent);
  background: #FFFFFF;
}

/* Chat */
.chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.msg {
  max-width: 86%;
  padding: 10px 14px;
  font-size: 16px;
  line-height: 1.38;
  text-align: left;
  border: var(--bubble-border, 0);
  border-radius: 22px;
  box-shadow: var(--bubble-shadow, none);
}

.msg.you {
  align-self: flex-end;
  color: var(--you-ink);
  background: var(--you-bg);
  border-bottom-right-radius: 6px;
}

.msg.alfie {
  position: relative;
  max-width: calc(100% - 64px);
  margin-left: 42px;
  align-self: flex-start;
  color: var(--alfie-ink);
  background: var(--alfie-bg);
  border-bottom-left-radius: 6px;
}

.msg .who {
  display: block;
  margin-bottom: 2px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  opacity: 0.65;
}

.msg.alfie .who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  opacity: 1;
}

.msg-tag {
  padding: 1px 8px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  border-radius: 999px;
  color: var(--tag-ink, var(--accent));
  background: var(--tag-bg, rgba(0, 0, 0, 0.06));
}

.msg a {
  font-weight: 700;
}

.step {
  align-self: center;
  margin: 4px 0 0;
  padding: 3px 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: 999px;
  color: var(--chip-ink, var(--ink));
  background: var(--chip-bg, rgba(0, 0, 0, 0.06));
}

.chat-name {
  align-self: center;
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 800;
  opacity: 0.7;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tags span {
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  color: var(--tag-ink, var(--accent));
  background: var(--tag-bg, rgba(0, 0, 0, 0.06));
}

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

.play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  font-size: 11px;
  border-radius: 50%;
  color: var(--you-bg);
  background: var(--you-ink);
}

.wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.wave i {
  display: inline-block;
  width: 3px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.8;
}

.len {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  text-align: right;
  opacity: 0.7;
}

.msg-card {
  position: relative;
  align-self: flex-start;
  width: calc(90% - 42px);
  margin-left: 42px;
}

/* Alfie's face next to his messages, as in a messenger. */
.avatar {
  position: absolute;
  left: -42px;
  bottom: -2px;
  width: 34px;
  height: auto;
}

.msg-card .cart {
  max-width: none;
}

/* The chat reveals itself line by line when its screen comes into view. */
.js .chat > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  transition-delay: calc(var(--i, 0) * 110ms);
}

.js .in .chat > * {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-snap-type: none;
  }

  .js .chat > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Offer */
.offer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 32px 22px;
  text-align: center;
}

.offer-card p {
  margin: 0;
  font-size: 18px;
}

.offer-card .small {
  font-size: 14px;
  color: var(--card-muted, var(--muted));
}

/* Footer */
.foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px max(20px, calc(50% - 220px));
  font-size: 14px;
  text-align: center;
  color: var(--foot-ink, var(--muted));
  background: var(--foot-bg, var(--bg));
}

.foot .logo {
  font-size: 18px;
}

.soon {
  margin: 0 0 8px;
  font-weight: 600;
}

/* Wider than a phone: the hero splits into text and picture; the chats stay phone-wide. */
@media (min-width: 960px) {
  .screen {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .hero {
    padding: 0 max(40px, calc(50% - 560px)) 48px;
  }

  .hero-body {
    flex-direction: row;
    align-items: center;
    gap: 64px;
  }

  .hero-text {
    flex: 1 1 0;
    text-align: left;
  }

  h1 {
    font-size: var(--h1-size-wide, var(--h1-size));
  }

  .form {
    max-width: 460px;
  }

  .field input[type="email"] {
    text-align: left;
  }

  .hero-art {
    flex: 1 1 0;
  }

  .cart {
    max-width: 380px;
  }
}
