/* builtonfive.com: the app's paper-cut look (colours from app/lib/core/theme.dart):
   cream paper, deep teal and gold, white tiles with a hard cut shadow and
   hand-cut corners, and the teal band with its gold wave and paper hills. */
@font-face { font-family: Baloo; src: url(fonts/baloo-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Baloo; src: url(fonts/baloo-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --cream: #FFF8EC; --tile: #FFFFFF; --ledge: #E8D9BC;
  --ink: #1E2A2B; --ink-soft: #4A5758;
  --teal: #0F5257; --teal-deep: #0A3A3D; --teal-mid: #14706F; --teal-tint: #D3ECEA;
  --gold: #F2A93B; --gold-deep: #C98420; --sand: #E8D3A6;
  /* Hand-cut: no two corners quite the same, as in the app's tiles. */
  --cut: 22px 18px 24px 20px / 20px 24px 18px 22px;
  --gutter: 16px;
  --section: clamp(28px, 4.5vw, 48px); /* half the space between two sections */
  font-family: Baloo, system-ui, sans-serif;
  color: var(--ink); background: var(--cream);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; line-height: 1.55; background: var(--cream); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
/* Side padding only: a shorthand here would cancel the sections' vertical spacing. */
.wrap { max-width: 1080px; margin: 0 auto; padding-inline: var(--gutter); }
/* Hidden by clipping, not by moving it off-screen: an element pushed far left
   becomes scrollable space in right-to-left pages. */
.skip { position: absolute; top: 8px; inset-inline-start: 16px; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.skip:focus { clip-path: none; width: auto; height: auto; background: var(--tile); padding: 8px 12px; z-index: 9; }

/* The teal band, as on the app's home screen: it ends in a gold wave and
   cream paper hills cut from the page colour. */
.band { background: var(--teal); color: var(--cream); position: relative; padding-bottom: 96px; }
.band::after {
  content: ""; position: absolute; inset: auto 0 -1px; height: 110px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 110' preserveAspectRatio='none'%3E%3Cpath d='M0 40 C240 0 420 70 720 34 C1000 0 1200 60 1440 26 V110 H0 Z' fill='%2314706F'/%3E%3Cpath d='M0 66 C260 34 460 92 760 60 C1040 30 1240 84 1440 54 V110 H0 Z' fill='%23F2A93B'/%3E%3Cpath d='M0 86 C300 62 520 106 820 82 C1080 62 1260 98 1440 80 V110 H0 Z' fill='%23FFF8EC'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}
.band a { color: var(--cream); }

/* Top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.3rem; text-decoration: none; white-space: nowrap; }
.band .brand { color: var(--cream); }
.brand img { width: 46px; height: 46px; }
/* Very narrow phones: the logo alone, so the language switch keeps its room. */
@media (max-width: 360px) { .brand-name { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; } }
.switch { display: flex; gap: 2px; background: var(--teal-deep); border-radius: 999px; padding: 4px; }
.switch a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--teal-tint); font-weight: 700; font-size: .95rem; }
.band .switch a { color: var(--teal-tint); }
.switch a[aria-current="true"] { background: var(--gold); color: var(--teal-deep); }
.band .switch a[aria-current="true"] { color: var(--teal-deep); }

/* Shared: white paper tiles with a hard cut shadow. */
.tile { background: var(--tile); border-radius: var(--cut); box-shadow: 4px 6px 0 var(--ledge); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3 { line-height: 1.5; }
h1 { font-size: clamp(2.2rem, 7.5vw, 3.7rem); }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); color: var(--teal); }
h3 { font-size: 1.25rem; }
.lead { font-size: 1.2rem; max-width: 34em; }
.band .lead { color: var(--teal-tint); }
section { padding-block: var(--section); }
.section-lead { color: var(--ink-soft); margin: 0 0 22px; max-width: 38em; font-size: 1.08rem; }

/* Opening */
.hero { display: grid; gap: 32px; align-items: center; padding-top: 12px; padding-bottom: 0; }
.badge { display: inline-flex; align-items: center; gap: 12px; background: var(--gold); color: var(--teal-deep); border-radius: 16px 14px 18px 15px; padding: 10px 20px 10px 16px; margin-top: 16px; box-shadow: 3px 5px 0 var(--teal-deep); }
:lang(ar) .badge { padding: 10px 16px 10px 20px; }
/* The store badges, side by side, wrapping on narrow phones. */
.badges { display: flex; flex-wrap: wrap; gap: 0 14px; }
/* The note under the badge: which devices it runs on. */
.devices { margin: 12px 0 0; color: var(--teal-tint); font-weight: 700; font-size: 1.05rem; }
.badge svg { width: 22px; height: 22px; flex: none; }
.badge span { display: flex; flex-direction: column; line-height: 1.25; }
.badge small { font-size: .82rem; }
.badge strong { font-size: 1.1rem; }
.phone { width: min(280px, 76vw); margin: 0 auto; border: 9px solid var(--teal-deep); border-radius: 38px; overflow: hidden; box-shadow: 8px 12px 0 rgba(10, 58, 61, .35); background: var(--teal-deep); }
.phone img { width: 100%; }
.hero .phone { transform: rotate(2deg); position: relative; z-index: 1; margin-bottom: -60px; }
:lang(ar) .hero .phone { transform: rotate(-2deg); }

/* The five pillars */
/* Two per row on phones, five across on wide screens. */
.pillars { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pillar { padding: 16px 12px 18px; text-align: center; }
.pillar .paper { width: 88px; height: 88px; object-fit: contain; margin: 0 auto 8px; filter: drop-shadow(3px 4px 0 rgba(10, 58, 61, .22)); }
/* The opening's moving parts (assets/site.js). Without the script, or with
   less motion asked for, everything stands still and the phone shows home. */
/* Hung over the space beside the phone, clear of the header; left out where
   the header fills the width. */
.lanterns { position: absolute; top: 0; inset-inline-end: calc(max(0px, 50% - 540px) + 330px); width: 104px; height: auto; pointer-events: none; }
@media (max-width: 819px) { .lanterns { inset-inline-end: calc(50% - 150px); width: 80px; top: 64px; } }
@media (max-width: 559px) { .lanterns { display: none; } }
.hero-logo { width: 112px; height: 112px; margin: 0 0 6px; filter: drop-shadow(3px 5px 0 rgba(10, 58, 61, .45)); }
@media (min-width: 820px) { .hero-logo { width: 132px; height: 132px; } }

/* The logo builds itself: the step and house rise, the five windows light up
   one by one, the dome drops on, then the finial and the crescent. */
.lb-p { animation: .55s cubic-bezier(.2, .9, .3, 1.3) both; transform-box: fill-box; transform-origin: 50% 100%; }
.lb-rise { animation-name: lb-rise; }
.lb-pop { animation-name: lb-pop; transform-origin: 50% 50%; }
.lb-drop { animation-name: lb-drop; }
.lb-w { animation-name: lb-light; animation-duration: .4s; }
.lb-1 { animation-delay: 0s; }
.lb-2 { animation-delay: 0.15s; }
.lb-3 { animation-delay: 0.55s; }
.lb-4 { animation-delay: 0.69s; }
.lb-5 { animation-delay: 0.83s; }
.lb-6 { animation-delay: 0.97s; }
.lb-7 { animation-delay: 1.11s; }
.lb-8 { animation-delay: 1.3s; }
.lb-9 { animation-delay: 1.75s; }
.lb-10 { animation-delay: 1.9s; }
@keyframes lb-rise { from { opacity: 0; transform: translateY(40px) scaleY(.6); } }
@keyframes lb-pop { from { opacity: 0; transform: scale(.2); } }
@keyframes lb-drop { from { opacity: 0; transform: translateY(-90px); } 70% { transform: translateY(6px); } }
@keyframes lb-light { from { opacity: 0; transform: scaleY(.1); } }
@media (prefers-reduced-motion: reduce) { .lb-p { animation: none; } }

/* The live phone: the screens lie on each other; the one on show is on top,
   the one leaving is thrown off like a page card in the app. */
.phone.live { position: relative; aspect-ratio: 540 / 1128; touch-action: pan-y; cursor: grab; }
.phone.live img + img { display: none; }
.live-phone .phone.live img { display: block; position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.live-phone .phone.live img.on { opacity: 1; z-index: 2; animation: card-in .55s ease-out; }
.live-phone .phone.live img.out { opacity: 1; z-index: 3; animation: card-out .6s cubic-bezier(.4, 0, .6, 1) forwards; }
@keyframes card-in { from { transform: scale(.92); } }
@keyframes card-out { to { transform: translateX(calc(var(--away) * 125%)) rotate(calc(var(--away) * 14deg)); opacity: .4; } }
.still .phone.live img.on, .still .phone.live img.out { animation: none; }
.dots { display: flex; justify-content: center; gap: 10px; margin-top: 16px; position: relative; z-index: 1; }
.dots button { width: 12px; height: 12px; padding: 0; border: none; border-radius: 50%; background: var(--teal-mid); cursor: pointer; }
.dots button[aria-current="true"] { background: var(--gold); width: 28px; border-radius: 99px; }
/* In the opening, the phone (and its dots) reach down over the paper hills. */
.phone-holder { position: relative; z-index: 1; margin-bottom: -60px; }
.phone-holder .phone { margin-bottom: 0; }

/* The five pillars rise when they come into view. */
.rise-ready .pillar { opacity: 0; transform: translateY(46px); }
.rise-ready .pillars.risen .pillar { animation: rise .7s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(var(--i) * .13s); }
@keyframes rise { from { opacity: 0; transform: translateY(46px) rotate(-2deg); } to { opacity: 1; transform: none; } }

/* Tiles lift a little under the pointer, like paper picked up. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .tile { transition: transform .2s ease, box-shadow .2s ease; }
  .pillar:hover, .feature:hover { transform: translate(-2px, -3px); box-shadow: 6px 9px 0 var(--ledge); }
}

@media (min-width: 820px) { .pillar .paper { width: 104px; height: 104px; } }
.pillar h3 { margin: 0; color: var(--teal); }
.pillar .ar-name { font-size: 1.2rem; color: var(--gold-deep); line-height: 1.6; font-weight: 700; }
.pillar p { margin: 8px 0 0; color: var(--ink-soft); font-size: 1rem; }

/* Everything in the app */
.features { display: grid; gap: 14px; }
.feature { display: grid; grid-template-columns: 80px 1fr; gap: 16px; align-items: center; padding: 16px 18px 16px 14px; }
:lang(ar) .feature { padding: 16px 14px 16px 18px; }
.feature img { width: 80px; height: 80px; object-fit: contain; filter: drop-shadow(3px 4px 0 rgba(10, 58, 61, .22)); }
.feature h3 { margin: 0 0 2px; color: var(--teal); }
.feature p { margin: 0; color: var(--ink-soft); }
.shots { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 34px 0 0; padding: 0; }
.shots figure { margin: 0; }
.shots .phone { width: 100%; max-width: 230px; }
.shots figcaption { text-align: center; margin-top: 14px; font-weight: 700; color: var(--teal); font-size: 1.1rem; }

/* Made for families */
.list { display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.list li { background: var(--tile); border-radius: 16px 13px 17px 14px; padding: 12px 16px; box-shadow: 3px 4px 0 var(--ledge); }
.family { display: grid; gap: 24px; align-items: center; }
.family img { width: 160px; margin: 0 auto; filter: drop-shadow(4px 6px 0 rgba(10, 58, 61, .22)); }

/* Privacy promise: a teal sheet on a deeper one. */
.promise { background: var(--teal); color: var(--cream); border-radius: var(--cut); padding: 30px 26px; box-shadow: 5px 7px 0 var(--teal-deep); display: grid; gap: 18px; align-items: center; }
.promise h2 { color: var(--cream); }
.promise p { margin: 0 0 8px; font-size: 1.15rem; color: var(--teal-tint); }
.promise a { color: var(--gold); font-weight: 700; }
.promise img { width: 130px; }

/* Privacy policy */
.prose { max-width: 44em; padding: 24px 22px 30px; margin: 10px auto 0; }
.prose h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); color: var(--teal); }
.prose h2 { font-size: 1.3rem; margin-top: 1.6em; }
.prose ul { padding-inline-start: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose .updated { color: var(--ink-soft); }

/* Footer */
.foot { padding-block: var(--section) 44px; border-top: 2px dashed var(--ledge); color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 8px 22px; }

@media (min-width: 820px) {
  .hero { grid-template-columns: 1.25fr 1fr; padding-top: 28px; }
  .features { grid-template-columns: 1fr 1fr; }
  .feature { grid-template-columns: 96px 1fr; }
  .feature img { width: 96px; height: 96px; }
  .family { grid-template-columns: 1fr 200px; }
  .family img { width: 200px; }
  .promise { grid-template-columns: 1fr 150px; padding: 36px 40px; }
  .promise img { width: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero .phone, :lang(ar) .hero .phone { transform: none; }
}
