/* wabi.co.ke — whatsapp.com's architecture, Wabi's branding.
   Cream page, one big photo card, alternating text/phone rows, one dark row,
   a pale card for the download, a dark footer with four columns.
   The faint dotted grid and the floating particles stay from the first site.
   Theme follows the phone. Tokens mirror lib/theme/tokens.dart. */

:root {
  --page: #FCF5EB;
  --text: #111B21;
  --soft: #3B4A54;
  --faint: #5B6B76;
  --hair: #E9DFD0;
  --brand: #0D7377;
  --brand-dark: #095456;
  --brand-light: #14A3A8;
  --wash: #E0F2F3;
  --dark: #111B21;
  --dark-soft: #D1D7DB;
  --dark-faint: #8696A0;
  --on-brand: #FFFFFF;
  --gold: #CBA14C;
  --dot: rgba(13, 115, 119, 0.12);
  --line: rgba(13, 115, 119, 0.05);
  --frame: #111B21;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0B141A;
    --text: #E9EDEF;
    --soft: #D1D7DB;
    --faint: #8696A0;
    --hair: #2A3942;
    --wash: rgba(20, 163, 168, 0.14);
    --dot: rgba(20, 163, 168, 0.16);
    --line: rgba(20, 163, 168, 0.06);
    --frame: #2A3942;
    --logo-ring: rgba(255, 255, 255, 0.42);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Dotted grid, kept from the first site */
body::before, body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px;
}
body::after {
  background-image: radial-gradient(circle, var(--dot) 1.5px, transparent 1.5px);
  background-size: 40px 40px;
}

/* Floating particles, kept from the first site */
.particles { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.particle {
  position: absolute;
  bottom: -12px;
  border-radius: 50%;
  opacity: 0;
  animation: float-up 14s infinite ease-out;
}
@keyframes float-up {
  0%   { transform: translateY(0) scale(1); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.15; }
  100% { transform: translateY(-110vh) scale(0.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .particle { animation: none; display: none; } }

header, main, footer { position: relative; z-index: 2; }

a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }

.wrap { max-width: 1400px; margin: 0 auto; padding: 0 32px; }

/* Header: logo, links, one pill */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--page);
}
.top .wrap { height: 80px; display: flex; align-items: center; gap: 24px; }
/* The mark alone, as big as the bar allows without growing it (80 px desktop, 64 px phone) */
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { width: 56px; height: 56px; border-radius: 13px; display: block; box-shadow: 0 0 0 1px var(--logo-ring); }
.links { display: flex; gap: 8px; margin: 0 auto; }
.links a { text-decoration: none; font-size: 16px; font-weight: 500; padding: 10px 14px; border-radius: 999px; }
.links a:hover { background: var(--wash); }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}
.pill:hover { background: var(--brand-light); }
.pill:active { background: var(--brand-dark); }
.pill svg { width: 20px; height: 20px; }
.pill.small { padding: 12px 22px; }
.menu { display: none; }

/* Hero: one photo card with the headline and app bits on it */
.hero { padding: 0 32px 16px; }
.card {
  position: relative;
  border-radius: 25px;
  overflow: hidden;
  background: var(--brand);
  height: clamp(420px, 34vw, 656px);
}
.card > picture, .card > picture > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(17,27,33,0.55) 0%, rgba(17,27,33,0.25) 45%, rgba(17,27,33,0) 70%); }
.card .copy {
  position: absolute;
  left: 7%;
  top: 50%;
  transform: translateY(-50%);
  max-width: 520px;
  color: #FFFFFF;
}
.card h1 { font-size: clamp(40px, 5.6vw, 80px); line-height: 1.02; font-weight: 700; }
.card .lead { font-size: clamp(16px, 1.3vw, 19px); line-height: 1.45; margin: 20px 0 28px; max-width: 420px; }
.card .pill { background: var(--brand); }

/* The job's chat, floating over the photo as whatsapp.com floats a group's
   chat over its hero: a job card, one outgoing bubble, one incoming bubble
   with a status chip. Drawn with the app's own bubble rules
   (lib/widgets/chat/chat_bubble.dart): wash for outgoing, white for
   incoming, radius 14 with a 4 px tail at the top, 11 px time, 15 px ticks. */
.chat {
  position: absolute;
  right: 4%;
  top: 12%;
  width: 340px;
  z-index: 0;
  font-size: 15px;
  line-height: 1.35;
  color: #111B21;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}
/* A settled shade behind the chat, darkest at the top left where the white
   title sits, fading out to the right and downward, so light text reads
   without the photo going dark. */
.chat::before {
  content: '';
  position: absolute;
  inset: -28px -32px -36px -40px;
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(17, 27, 33, 0.42) 0%, rgba(17, 27, 33, 0.22) 45%, rgba(17, 27, 33, 0) 85%);
  filter: blur(10px);
  z-index: -1;
  pointer-events: none;
}
.chat .job {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: -8px;
}
.chat .pin {
  width: 44px; height: 44px; border-radius: 50%;
  background: #FFFFFF; color: #3B4A54;
  display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.chat .pin svg { width: 22px; height: 22px; }
.chat .who { display: flex; flex-direction: column; gap: 6px; }
.chat .who .t { color: #FFFFFF; font-weight: 600; font-size: 16px; text-shadow: 0 1px 6px rgba(0,0,0,0.55); }
.chat .people {
  display: inline-flex; align-items: center; gap: 8px;
  background: #FFFFFF; border-radius: 999px; padding: 3px 12px 3px 3px;
  font-size: 13px; color: #3B4A54; white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.chat .people img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid #FFFFFF; }
.chat .call {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand); color: #FFFFFF;
  border-radius: 999px; padding: 10px 18px;
  font-weight: 600; font-size: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.chat .call svg { width: 18px; height: 18px; }
.chat .out, .chat .bub {
  position: relative;
  padding: 8px 10px 6px 12px;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.16);
  max-width: 290px;
}
.chat .out { background: #E0F2F3; border-top-right-radius: 4px; margin-right: 6px; }
.chat .out::after {
  content: ''; position: absolute; right: -7px; top: 0;
  border: 7px solid transparent; border-top-color: #E0F2F3; border-right: 0;
}
.chat .meta { display: block; text-align: right; font-size: 11px; color: #5B6B76; margin-top: 2px; }
.chat .meta svg { width: 15px; height: 15px; vertical-align: -3px; color: var(--brand); }
.chat .in { align-self: flex-start; display: flex; align-items: flex-start; gap: 8px; position: relative; padding-bottom: 14px; }
.chat .in > img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: 0 0 28px; margin-top: 2px; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.chat .bub { background: #FFFFFF; border-top-left-radius: 4px; }
.chat .bub::before {
  content: ''; position: absolute; left: -7px; top: 0;
  border: 7px solid transparent; border-top-color: #FFFFFF; border-left: 0;
}
.chat .from { display: block; font-size: 12px; font-weight: 700; color: var(--brand); margin-bottom: 1px; }
.chat .paid {
  position: absolute; left: 44px; bottom: -4px;
  display: inline-flex; align-items: center; gap: 6px;
  background: #FFFFFF; color: #111B21; border-radius: 999px;
  padding: 4px 10px 4px 8px; font-size: 12px; font-weight: 500;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.chat .paid svg { width: 14px; height: 14px; color: var(--brand); }

/* Rows: text one side, phone the other, lots of air */
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  padding: 96px 0;
}
.row.flip .text { order: 2; }
.row .text { max-width: 520px; justify-self: center; }
.row h2 { font-size: clamp(32px, 4.2vw, 60px); line-height: 1.05; font-weight: 700; }
.row p { font-size: clamp(16px, 1.3vw, 19px); color: var(--soft); margin-top: 20px; }
.row .more { display: inline-block; margin-top: 22px; font-weight: 600; text-decoration: none; color: var(--brand); }
.row .more::after { content: ' \203A'; }

/* The screenshot itself, no bezel, lifted with a soft shadow, as whatsapp.com shows its phones */
.phone {
  width: 300px;
  justify-self: center;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.12);
}
.phone img { width: 100%; display: block; }

/* The dark row */
.dark { background: var(--dark); color: #FFFFFF; }
.dark .row p { color: var(--dark-soft); }
.dark .row .more { color: var(--brand-light); }
.photo { justify-self: center; width: min(100%, 520px); border-radius: 24px; overflow: hidden; }
.photo img { width: 100%; aspect-ratio: 1; object-fit: cover; }

/* Download card */
.get { padding: 32px 0 96px; }
.get .box {
  background: var(--wash);
  border-radius: 25px;
  padding: 64px 32px;
  text-align: center;
}
.get h2 { font-size: clamp(32px, 4.2vw, 60px); line-height: 1.05; }
.get p { color: var(--soft); margin: 14px 0 28px; }
.get .note { font-size: 15px; color: var(--faint); margin: 14px 0 0; }

/* Footer */
footer { background: var(--dark); color: var(--dark-soft); padding: 64px 0 32px; }
footer .cols { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
footer .logo img { width: 48px; height: 48px; border-radius: 11px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.42); }
footer h3 { color: #FFFFFF; font-size: 15px; font-weight: 600; margin-bottom: 14px; }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin: 8px 0; font-size: 15px; }
footer a { color: var(--dark-soft); text-decoration: none; }
footer a:hover { color: #FFFFFF; }
footer .legal { border-top: 1px solid #2A3942; margin-top: 48px; padding-top: 24px; font-size: 14px; color: var(--dark-faint); display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* Legal pages share the chrome */
.legal-page { max-width: 760px; margin: 0 auto; padding: 32px 32px 64px; }
.legal-page h1 { font-size: clamp(32px, 4vw, 48px); margin-bottom: 8px; }
.legal-page h2 { font-size: 22px; margin: 32px 0 8px; }
.legal-page h3 { font-size: 18px; margin: 20px 0 6px; }
.legal-page h2 svg { width: 22px; height: 22px; vertical-align: -4px; margin-right: 8px; color: var(--brand); }
.legal-page p, .legal-page li { color: var(--soft); font-size: 17px; margin: 0 0 12px; }
.legal-page ul, .legal-page ol { padding-left: 22px; }
.legal-page .meta { color: var(--faint); font-size: 15px; margin-bottom: 24px; }
.legal-page strong { color: var(--text); }
.legal-page table { width: 100%; border-collapse: collapse; font-size: 16px; margin: 8px 0 16px; }
.legal-page th, .legal-page td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.legal-page .box { background: var(--wash); border-radius: 16px; padding: 16px 20px; margin: 12px 0; }
.legal-page .box * { color: var(--text); }
.legal-page .btn, .legal-page .pill { max-width: 360px; margin: 16px 0; }
.legal-page .steps { list-style: none; padding: 0; margin: 8px 0; }
.legal-page .steps li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.legal-page .steps li:last-child { border-bottom: none; }
.legal-page .step-number { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.legal-page .step-content { color: var(--soft); }
.legal-page a { color: var(--brand); }
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 24px; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 600; text-decoration: none; }
.btn svg { width: 22px; height: 22px; }

/* Error pages */
.err { text-align: center; padding: 96px 32px; max-width: 640px; margin: 0 auto; }
.err .code { font-size: 64px; font-weight: 700; color: var(--brand); }
.err h1 { font-size: 32px; margin: 8px 0 12px; }
.err p { color: var(--soft); }
.err .pill { margin-top: 24px; }
.err .note { margin-top: 24px; font-size: 15px; color: var(--faint); }

/* Tablet and phone */
@media (max-width: 1100px) {
  footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 0 16px 16px; }
  .top .wrap { height: 64px; gap: 12px; }
  .links { display: none; }
  .pill.small { padding: 10px 18px; font-size: 15px; }
  .menu { display: block; margin-left: auto; }
  .menu summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
  .menu summary::-webkit-details-marker { display: none; }
  .menu summary svg { width: 24px; height: 24px; }
  .menu[open] summary { background: var(--wash); }
  .menu .sheet { position: absolute; left: 0; right: 0; top: 64px; background: var(--page); border-bottom: 1px solid var(--hair); padding: 8px 16px 16px; display: grid; }
  .menu .sheet a { padding: 14px 8px; text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--hair); }
  .menu .sheet a:last-child { border-bottom: none; }
  .top .pill.small { margin-left: auto; }
  .menu { margin-left: 0; }
  .logo img { width: 46px; height: 46px; border-radius: 11px; }
  .card { height: clamp(320px, 46vw, 480px); border-radius: 20px; }
  .chat { right: 16px; top: 16px; width: 300px; font-size: 14px; gap: 10px; }
  .chat .call { padding: 8px 14px; font-size: 14px; }
  .card .copy { left: 24px; right: 24px; max-width: 460px; }
  .card h1 { font-size: clamp(36px, 7vw, 64px); }
  .row { grid-template-columns: 1fr; gap: 32px; padding: 56px 0; }
  .row.flip .text { order: 0; }
  .row .text { justify-self: start; }
  .phone { width: min(260px, 72vw); }
  .photo { width: 100%; }
  .get .box { padding: 40px 20px; border-radius: 20px; }
  .get .pill { width: 100%; }
  footer .cols { grid-template-columns: 1fr; gap: 24px; }
  .legal-page { padding: 24px 16px 48px; }
}

/* Phone: the hero turns portrait, the headline sits at the bottom */
@media (max-width: 600px) {
  .logo img { width: 44px; height: 44px; border-radius: 10px; }
  .card { height: 150vw; max-height: 720px; }
  .chat { left: 16px; right: 16px; top: 16px; width: auto; font-size: 13px; gap: 8px; }
  .chat .out, .chat .bub { max-width: 230px; }
  .chat .who .t { font-size: 14px; }
  .chat .call { padding: 7px 12px; font-size: 13px; }
  .card .shade { background: linear-gradient(180deg, rgba(17,27,33,0.05) 35%, rgba(17,27,33,0.78) 100%); }
  .card .copy { left: 20px; right: 20px; top: auto; bottom: 20px; transform: none; max-width: none; }
  .card h1 { font-size: clamp(32px, 9.5vw, 44px); }
  .card .lead { font-size: 15px; margin: 10px 0 16px; max-width: none; }
  .card .pill { width: 100%; }
}

/* Very small phones: icon only in the header */
@media (max-width: 360px) {
  .pill.small { padding: 10px 14px; }
}
