/* Maal — mymaal.online
   The app's own palette, so the site and the thing it is selling are plainly
   the same product. Navy is the app's primary, gold its accent. */

:root {
  --navy: #123163;
  --navy-deep: #0b1f42;
  --gold: #e3b04b;
  --ink: #16223a;
  --ink-muted: #5c6b85;
  --page: #f4f7fc;
  --surface: #ffffff;
  --line: #e3e9f4;
  --radius: 18px;
  --wrap: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; }

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

a { color: inherit; }

/* ---- nav ---- */

.nav {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--navy);
}

.brand img { border-radius: 10px; }

.brand-lockup { display: flex; flex-direction: column; line-height: 1.15; }

.brand-name { font-weight: 800; font-size: 20px; }

/* Small enough to read as a strapline rather than as a second heading
   competing with the name it sits under. */
.brand-motto {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.01em;
}

.nav nav { display: flex; gap: 26px; }

.nav nav a {
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-muted);
}

.nav nav a:hover { color: var(--navy); }

/* The other language. A link rather than a flag: half the region's phones are
   set to English and half to Arabic, and a flag would name a country instead
   of a language. */
.nav nav a.lang {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
}

.nav nav a.lang:hover { background: var(--surface); }

/* ---- hero ---- */

.hero {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 40px 24px 72px;
  display: grid;
  grid-template-columns: 1fr 430px;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero h1 {
  font-size: clamp(38px, 5.5vw, 60px);
  font-weight: 800;
  color: var(--navy);
}

.hero h1 .accent { color: var(--ink-muted); }

.lede {
  margin: 24px 0 0;
  font-size: 18px;
  color: var(--ink-muted);
  max-width: 34em;
}

.badges { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
}

/* Not yet shipped, so it says so rather than pretending to be a live link. The
   platform marks are here to identify the store each one is bound for, not to
   suggest either company is involved. */
.badge-soon {
  gap: 10px;
  background: transparent;
  color: var(--ink-muted);
  border: 1px dashed var(--line);
}

.badge-soon svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

/* ---- the screenshots ----

   These are finished device mock-ups: the bezel, the island, the status bar
   and the 9:41 are all in the picture, so the site no longer draws a phone of
   its own around them — doing both framed each shot twice. The mock-ups have
   transparent corners, which are flattened onto the page colour when the JPEGs
   are exported; if --page ever changes, re-export them to match. */

.shot { justify-self: center; width: 100%; }

.shot img { width: 100%; }

/* The feature rows carry illustrations rather than bare screenshots:
   landscape, and with enough in them to be worth looking at, so the media
   column is wider than a phone alone would need. */
.feature .shot { max-width: 520px; }

/* Wider than the other shots because the picture is a hand as well as a
   phone, and the phone inside it is only about two thirds of the width. */
.hero-shot { justify-self: center; width: 100%; max-width: 430px; }

/* ---- the tour ----

   A scroller rather than a slideshow: it swipes on a phone and scrolls with a
   trackpad on its own, so the arrows and dots below are an addition rather than
   the only way through it. The mock-ups carry their own device frame, so there
   is nothing to draw around them. */

.tour {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 8px 0 8px;
}

.tour h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--navy);
  padding: 0 24px;
  margin-bottom: 28px;
}

.tour-viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* The row fades out at both edges rather than being cut off by them, so it
     reads as continuing past the screen. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

.tour-viewport::-webkit-scrollbar { display: none; }

.tour-viewport:focus-visible { outline: 2px solid var(--navy); outline-offset: 4px; }

.tour-track {
  display: flex;
  gap: 28px;
  padding: 0;
  margin: 0;
  list-style: none;
}

/* Space at each end so the first and last slides can come to rest in the
   middle. Only needed before the script runs: once it has cloned a set either
   side there is always a slide beyond the edge of the screen, and the row
   never runs out. Spacer items rather than padding on the track, because
   Chromium leaves a flex scroller's trailing padding out of its scrollable
   width. 158px is half a slide plus the gap the spacer itself picks up. */
.tour-track::before,
.tour-track::after {
  content: "";
  flex: 0 0 max(0px, calc(50% - 158px));
}

.tour-slide {
  flex: 0 0 auto;
  width: 260px;
  scroll-snap-align: center;
  text-align: center;
  /* Everything but the one in the middle sits back a little. Scale rather than
     width, so the slide's own box — and with it every snap position — stays
     exactly where it was. */
  transform: scale(0.9);
  opacity: 0.6;
  transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}

.tour-slide.is-middle { transform: none; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .tour-slide { transition: none; }
}

.tour-slide img { width: 100%; }

.tour-slide span {
  display: block;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.tour-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 26px;
}

.tour-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--navy);
  cursor: pointer;
}

.tour-arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tour-arrow:hover { background: var(--page); }

/* Mirrored with the page: on an Arabic page "next" is the way the reading
   goes, which is leftwards. */
[dir="rtl"] .tour-arrow svg { transform: scaleX(-1); }

.tour-dots { display: flex; align-items: center; gap: 9px; }

.tour-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: background 0.2s, width 0.2s;
}

.tour-dot.is-on { width: 26px; background: var(--navy); }

@media (prefers-reduced-motion: reduce) {
  .tour-dot { transition: none; }
}

/* ---- the three pillars ----

   This was three bare numerals — 3, 2, 0 — over wrapped captions, which asked
   the reader to work out what was being counted before it said anything. Each
   one now leads with the claim. */

.pillars {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.pillar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
}

.pillar svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 16px;
}

.pillar h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}

.pillar p { margin: 0; font-size: 15px; color: var(--ink-muted); }

/* ---- features ---- */

.features { max-width: var(--wrap); margin: 0 auto; padding: 96px 24px 0; }

.features h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 56px;
}

.feature {
  display: grid;
  grid-template-columns: 1fr 520px;
  gap: 56px;
  align-items: center;
  padding: 40px 0;
  border-top: 1px solid var(--line);
}

/* Alternating sides, so a column of three does not read as a list. */
.feature.reverse { grid-template-columns: 520px 1fr; }
.feature.reverse .feature-copy { order: 2; }

.feature h3 { font-size: 26px; font-weight: 800; color: var(--navy); }

.feature p { margin: 14px 0 0; color: var(--ink-muted); max-width: 40em; }

/* ---- why the name ----

   A short aside rather than a section with furniture: narrow measure, centred,
   no card. It is the one place on the page that is about the word rather than
   the product. */

.why {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 96px 24px 0;
}

.why-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.why h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 20px;
}

.why p { margin: 0 0 14px; color: var(--ink-muted); }

.why strong { color: var(--navy); }

/* ---- the bento ----

   Mixed tile sizes rather than a row of identical cards, so the eye is given
   somewhere to start. Three of these are not built yet and carry a badge that
   says so — a landing page that shows a feature without dating it is a page
   that lies by omission. */

.bento-wrap { max-width: var(--wrap); margin: 0 auto; padding: 96px 24px 0; }

.bento-wrap h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 36px;
}

.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-areas:
    "chat chat accounts accounts"
    "chat chat offline  goals"
    "scan scan shared   shared"
    "voice voice shared shared";
  gap: 18px;
}

.tile-chat { grid-area: chat; }
.tile-accounts { grid-area: accounts; }
.tile-offline { grid-area: offline; }
.tile-goals { grid-area: goals; }
.tile-scan { grid-area: scan; }
.tile-shared { grid-area: shared; }
.tile-voice { grid-area: voice; }

.tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

.tile svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--navy);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 16px;
}

.tile h3 { font-size: 19px; font-weight: 800; color: var(--navy); margin-bottom: 8px; }

.tile p { margin: 0; font-size: 15px; color: var(--ink-muted); }

/* The one filled tile, so the grid has a centre of gravity. */
.tile-scan {
  background: linear-gradient(150deg, #1b427f, var(--navy-deep));
  border-color: transparent;
}

.tile-scan h3 { color: #fff; }
.tile-scan p { color: rgba(255, 255, 255, 0.78); }
.tile-scan svg { stroke: var(--gold); }

.soon {
  position: absolute;
  top: 22px;
  inset-inline-end: 22px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #7a5a12;
  background: rgba(227, 176, 75, 0.18);
}

.soon-light { color: var(--navy-deep); background: var(--gold); }

/* The mocked-up exchange under "Chat with Maal". Deliberately drawn as a
   sketch rather than a screenshot, because there is no screen to shoot. */
.chat { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }

.chat-you {
  align-self: flex-end;
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 16px 16px 4px 16px;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.chat-maal {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 16px 16px 16px 4px;
  background: rgba(27, 122, 75, 0.1);
  color: #14603b;
  font-size: 14px;
  font-weight: 700;
}

[dir="rtl"] .chat-you { border-radius: 16px 16px 16px 4px; }

[dir="rtl"] .chat-maal { border-radius: 16px 16px 4px 16px; }

/* The two bubbles fade rather than pop, and the tile keeps the height of its
   longest line so the grid does not breathe while it plays. */
.chat-you,
.chat-maal {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

[data-chat] .chat-you,
[data-chat] .chat-maal {
  opacity: 0;
  transform: translateY(6px);
}

[data-chat] .chat-you.is-on,
[data-chat] .chat-maal.is-on {
  opacity: 1;
  transform: none;
}

/* Before the script runs there is nothing to animate, so the first exchange
   simply shows. Without this the tile would be blank with JavaScript off. */
html:not(.js-chat) [data-chat] .chat-you,
html:not(.js-chat) [data-chat] .chat-maal {
  opacity: 1;
  transform: none;
}

/* Maal thinking: the tick is replaced by three dots for as long as it takes. */
.chat-maal.is-thinking svg { display: none; }

.chat-maal.is-thinking::before {
  content: "•••";
  letter-spacing: 2px;
  animation: chat-think 1s steps(4, end) infinite;
}

@keyframes chat-think {
  0% { opacity: 0.35; }
  50% { opacity: 1; }
  100% { opacity: 0.35; }
}

/* The caret belongs to the typing, not to the sentence: it appears with the
   first character and goes at the last one, the way it would if someone had
   finished and taken their hands off the keys. */
.chat-you.is-typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-inline-start: 3px;
  vertical-align: -2px;
  background: currentColor;
  animation: chat-caret 1s step-end infinite;
}

@keyframes chat-caret {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  [data-chat] .chat-you,
  [data-chat] .chat-maal { opacity: 1; transform: none; }
  .chat-you.is-typing::after,
  .chat-maal.is-thinking::before { display: none; }
}

.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;
}

.chat-maal svg {
  width: 17px;
  height: 17px;
  margin: 0;
  stroke: #1b7a4b;
  stroke-width: 2.4;
  flex-shrink: 0;
}

/* ---- community ---- */

.community {
  max-width: var(--wrap);
  margin: 96px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 40px;
  /* Top of the mascot on the eyebrow, and he finishes a little below the
     button rather than being centred against the copy. */
  align-items: start;
}

.community h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 18px;
}

.community p { margin: 0 0 14px; color: var(--ink-muted); max-width: 40em; }

.community-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  /* WhatsApp's own green, because a button that says WhatsApp and is navy
     reads as a link to something else. */
  background: #1fa855;
}

.community-cta svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-cta:hover { background: #178c46; }

/* The mascot holding the code up. No card around him: the artwork already has
   its own backdrop, and a second frame around it read as a box sitting on the
   page. He is sized to run from the eyebrow to a little below the button, and
   the code has to render around 480px wide before it is big enough to scan off
   a screen — which is why this column is as wide as it is. */
.community-qr { justify-self: center; width: 100%; }

.community-qr img { width: 100%; max-width: 480px; }

/* ---- privacy ---- */

.privacy {
  max-width: var(--wrap);
  margin: 96px auto 0;
  padding: 48px;
  background: var(--navy);
  color: #fff;
  border-radius: 28px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: center;
}

.privacy h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; }

.privacy p { color: rgba(255, 255, 255, 0.78); max-width: 44em; }

/* The one paragraph in this panel that is a warning as much as a policy. */
.privacy-note {
  border-inline-start: 3px solid var(--gold);
  padding-inline-start: 16px;
}

.privacy .link { color: var(--gold); font-weight: 700; text-decoration: none; }

.privacy .link:hover { text-decoration: underline; }

/* ---- footer ---- */

footer {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 56px 24px 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  color: var(--navy);
}

.foot-brand img { border-radius: 8px; }

footer nav { display: flex; gap: 22px; }

footer nav a { font-size: 15px; color: var(--ink-muted); text-decoration: none; }

footer nav a:hover { color: var(--navy); }

.copy { margin-inline-start: auto; font-size: 14px; color: var(--ink-muted); }

/* ---- legal pages ---- */

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

.doc h1 { font-size: clamp(30px, 4.5vw, 42px); font-weight: 800; color: var(--navy); }

.doc .updated { margin: 12px 0 40px; font-size: 15px; color: var(--ink-muted); }

.doc h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin: 44px 0 12px;
}

.doc p, .doc li { color: var(--ink); }

.doc ul { padding-inline-start: 22px; }

.doc li { margin-bottom: 8px; }

.doc .callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--gold);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 28px 0;
}

.doc .callout p { margin: 0; }

.doc a { color: var(--navy); font-weight: 600; }

@media (max-width: 900px) {
  .hero, .feature, .feature.reverse, .privacy, .community { grid-template-columns: 1fr; }
  .hero { padding-bottom: 48px; gap: 40px; }
  /* On a phone the hero is the words. Stacked under them, the picture only
     pushed everything else further down the screen — and the feature rows
     below show the app soon enough. */
  .hero-shot { display: none; }
  /* No pictures on the feature rows here. The carousel above already shows
     every screen at a size worth looking at, and stacked under each heading
     these only repeated it smaller. They are lazy, so a phone does not
     download what it is not going to show. */
  .feature .shot { display: none; }
  .feature.reverse .feature-copy { order: 0; }
  .privacy { justify-items: center; padding: 36px 26px; }
  /* The mascot and the heading centre; the paragraphs do not. Three centred
     paragraphs give the eye no left edge to return to. */
  .privacy h2 { text-align: center; }
  .privacy img { max-width: 180px; }
  .pillars { grid-template-columns: 1fr; }
  /* Six tiles at phone width are six rows; the areas grid stops earning its
     keep well before that. */
  .bento {
    grid-template-columns: 1fr;
    grid-template-areas: "chat" "accounts" "offline" "goals" "scan" "shared" "voice";
  }
  .bento-wrap { padding-top: 64px; }
  .features { padding-top: 64px; }
  .copy { margin-inline-start: 0; width: 100%; }
}

@media (max-width: 640px) {
  .nav { padding: 18px 20px; }
  .nav nav { gap: 16px; }
  /* Four links do not fit beside the wordmark on a phone. The two that go
     nowhere the page does not already scroll to are the ones to drop. */
  .nav-optional { display: none; }
  /* At this width the strapline and the links fight for the same row, and the
     links are the ones with somewhere to go. */
  .brand-motto { display: none; }

  /* Body copy set at desktop size runs to a dozen words a line here and pushes
     everything worth seeing off the bottom of the screen. */
  body { font-size: 16px; }
  .lede { font-size: 16px; }
  .lede + .lede { margin-top: 14px; }
  .hero { padding-top: 24px; gap: 32px; }

  /* Two pills of different widths read as a mistake; full width reads as a
     pair. */
  .badges { gap: 10px; }
  .badge-soon { width: 100%; justify-content: center; }

  /* Section rhythm: 96px of air between sections is a third of the screen. */
  .features, .bento-wrap, .why { padding-top: 56px; }
  .tour h2 { margin-bottom: 20px; }
  .tour-track { gap: 20px; }
  .features h2 { margin-bottom: 28px; }
  .feature { padding: 28px 0; gap: 28px; }
  .feature h3 { font-size: 23px; }
  .community, .privacy { margin-top: 56px; }
  .bento { gap: 14px; }
}

/* ---- reveal on scroll ----

   Nothing here applies until the script adds .js-reveal to <html>, so with
   JavaScript blocked the page renders as it always did rather than staying
   invisible. Movement is short and the fade does the work; anyone who has
   asked their system for less motion gets none of it. */

.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.65s ease-out,
    transform 0.65s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.js-reveal [data-reveal].is-in { opacity: 1; transform: none; }

/* Within a row, the second and later items follow the first rather than all
   arriving together. Only where there is a row: once the layout stacks, a
   delay just holds up the thing already being looked at. */
@media (min-width: 901px) {
  .js-reveal [data-reveal]:nth-child(2) { transition-delay: 0.08s; }
  .js-reveal [data-reveal]:nth-child(3) { transition-delay: 0.16s; }
  .js-reveal [data-reveal]:nth-child(4) { transition-delay: 0.24s; }
  .js-reveal [data-reveal]:nth-child(5) { transition-delay: 0.32s; }
  .js-reveal [data-reveal]:nth-child(6) { transition-delay: 0.40s; }
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
