/* Noba: coming soon
   Tokens mirror the NOBA-app Figma file (💠 UI page: Colors + Typography).
   Radius rule: interactive = pill (100px), glass surfaces = 20px. */

:root {
  --brand-primary: #0A8D86;
  --brand-ink: #05625D; /* darker teal for small text, AA on the bottom of the gradient */
  --brand-lime: linear-gradient(133deg, #EEF3A8 5%, #AEBF1A 98%);
  --brand-word: linear-gradient(170deg, #5ABCB7 10%, #0B7570 112%);

  --text-primary: #373737;
  --text-secondary: #4E5B66; /* Figma #778693 darkened to pass AA down to the bottom of the gradient */

  --bg-white: #FFFFFF;
  --bg-top: #F7FAFF;
  --bg-bottom: #B9E1E3;

  --glass: rgba(255, 255, 255, 0.4);
  --glass-edge: #F7FAFF;

  --r-pill: 100px;
  --r-card: 20px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(16px, 4vw, 56px);

  --font: "Afacad", system-ui, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Afacad", system-ui, sans-serif;

  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  color: var(--text-primary);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%) fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* Soft colour fields from the app's splash screen */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.backdrop img {
  position: absolute;
  width: max(1100px, 95vw);
  height: auto;
  right: -18vw;
  top: -12vh;
  opacity: 0.9;
  filter: blur(8px);
}
[dir="rtl"] .backdrop img { right: auto; left: -18vw; transform: scaleX(-1); }

/* Nav: a fixed frame that never mirrors, so the language switch stays under the cursor */
.nav {
  direction: ltr;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px var(--gutter);
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}
/* Brand lockup (+10% vs. the old nav size), first line of the hero copy */
.brand {
  direction: ltr; /* the logo lockup never mirrors */
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 24px;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 53px;
  height: 53px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid var(--glass-edge);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.brand__word {
  font-size: 29px;
  font-weight: 500;
  letter-spacing: -0.01em;
  background: var(--brand-word);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Language switch: two options, thumb slides to the active one */
.lang {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.lang__thumb {
  position: absolute;
  inset-block: 4px;
  inset-inline-start: 4px;
  width: calc(50% - 4px);
  border-radius: var(--r-pill);
  background: var(--brand-primary);
  box-shadow: 0 4px 12px -4px rgba(10, 92, 88, 0.45);
  transition: transform 0.35s var(--ease-out);
}
:root[lang="ar"] .lang__thumb { transform: translateX(100%); }
.lang button {
  position: relative;
  min-width: 56px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.25s var(--ease-out);
}
.lang button[lang="ar"] { font-family: var(--font-ar); font-weight: 500; }
.lang button[aria-pressed="true"] { color: var(--bg-white); cursor: default; }
.lang button:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }

/* Main: hero grows to fill the viewport, perks bar sits under it */
main { display: flex; flex-direction: column; }

/* Hero */
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(8px, 2vh, 24px) var(--gutter) clamp(16px, 3vh, 32px);
}

.pill {
  display: inline-flex;
  margin: 0;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  font-size: 15px;
  font-weight: 500;
  color: var(--brand-ink);
}

h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(44px, 6.4vw, 88px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
h1 em {
  font-style: normal;
  background: var(--brand-word);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 24px 0 0;
  max-width: 40ch;
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.4;
  color: var(--text-secondary);
}

/* Store badges: official Apple / Google artwork, never redrawn.
   Not live yet, so they are inert buttons with a "Coming soon" tooltip. */
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.store {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  font: inherit;
  cursor: default;
}
.store img { height: 52px; width: auto; }
.store:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 3px; }

.store__tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--brand-ink);
  color: var(--bg-white);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 20px -8px rgba(5, 98, 93, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 4px);
  transition: opacity 0.15s var(--ease-out), transform 0.15s var(--ease-out), visibility 0s linear 0.15s;
}
.store__tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: var(--brand-ink);
}
.store:hover .store__tip,
.store:focus-visible .store__tip,
.store.is-tipped .store__tip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}
@media (prefers-reduced-motion: reduce) {
  .store__tip { transform: translate(-50%, 0); }
}

/* Phones: device mockups (frame baked into the transparent WebP) */
.hero__visual {
  position: relative;
  display: grid;
  justify-items: center;
  align-items: center;
  min-height: clamp(380px, 52vh, 600px);
}
.phone {
  margin: 0;
  /* tracks viewport height too, so hero + perks + footer fit on laptop screens */
  width: clamp(196px, min(20vw, 27vh), 278px);
  filter: drop-shadow(0 28px 32px rgba(10, 92, 88, 0.22)) drop-shadow(0 8px 12px rgba(10, 92, 88, 0.14));
}
.phone img {
  width: 100%;
  height: auto;
  aspect-ratio: 760 / 1571;
}
.phone--back {
  position: absolute;
  --x: -46%;
  --r: -7deg;
  transform: translate(var(--x), -5%) rotate(var(--r));
  opacity: 0.94;
}
.phone--front {
  position: relative;
  --x: 22%;
  --r: 3deg;
  transform: translate(var(--x), 4%) rotate(var(--r));
}

[dir="rtl"] .phone--back { --x: 46%; --r: 7deg; }
[dir="rtl"] .phone--front { --x: -22%; --r: -3deg; }

/* Perks: the app's small-card pattern, folded into one glass bar */
.perks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: calc(1320px - 2 * var(--gutter));
  width: calc(100% - 2 * var(--gutter));
  margin: 0 auto;
  padding: 8px;
  border-radius: var(--r-card);
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.perk {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
}
.perk + .perk { border-inline-start: 1px solid rgba(255, 255, 255, 0.75); }
.perk__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-lime);
}
.perk h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: -0.01em;
}
.perk p {
  margin: 2px 0 0;
  font-size: 15px;
  color: var(--text-secondary);
}

/* Footer: company details under a hairline, no box */
.footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 12px 48px;
  max-width: calc(1320px - 2 * var(--gutter));
  width: calc(100% - 2 * var(--gutter));
  margin: 20px auto 0;
  padding: 20px 0 16px;
  border-top: 1px solid rgba(5, 98, 93, 0.14);
  font-size: 15px;
  color: var(--text-secondary);
}
.footer__brand { display: flex; gap: 14px; align-items: flex-start; }
.footer__mark { width: 44px; height: 44px; border-radius: 13px; flex: none; }
.footer__about { margin: 0; max-width: 28ch; color: var(--text-primary); font-size: 16px; line-height: 1.45; }
.footer__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  justify-content: space-between;
  gap: 24px;
  margin: 0;
}
.footer__cols dt {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-primary);
}
.footer__cols dd { margin: 0 0 2px; color: var(--text-primary); }
.footer__copy { grid-column: 1 / -1; margin: 0; padding-top: 4px; font-size: 13px; }
.footer a {
  color: var(--brand-ink);
  text-decoration: none;
  border-radius: 4px;
}
.footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer a:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 4px; }

/* Arabic */
:root[lang="ar"] body { font-family: var(--font-ar); }
:root[lang="ar"] h1 {
  max-width: 13ch;
  font-size: clamp(40px, 5.4vw, 74px);
  line-height: 1.22;
  letter-spacing: 0;
}
:root[lang="ar"] h1 em { padding-block: 0.12em; }
:root[lang="ar"] .lede { line-height: 1.75; font-size: clamp(17px, 1.35vw, 19px); }
:root[lang="ar"] .perk h2 { font-size: 17px; line-height: 26px; letter-spacing: 0; }
:root[lang="ar"] .perk p { font-size: 14px; line-height: 1.6; }
:root[lang="ar"] .brand__word { font-family: var(--font); }
:root[lang="ar"] .footer__cols dt { font-size: 13px; letter-spacing: 0; }

/* Entry motion: copy cascades in, phones settle into place */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    animation: rise 0.8s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 80ms + 80ms);
  }
  .phone--front { animation: settle-front 1.1s var(--ease-out) 0.25s both; }
  .phone--back { animation: settle-back 1.1s var(--ease-out) 0.4s both; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes settle-front {
  from { opacity: 0; transform: translate(var(--x), 14%) rotate(0deg); }
  to { opacity: 1; transform: translate(var(--x), 4%) rotate(var(--r)); }
}
@keyframes settle-back {
  from { opacity: 0; transform: translate(calc(var(--x) * 0.65), 4%) rotate(0deg); }
  to { opacity: 0.94; transform: translate(var(--x), -5%) rotate(var(--r)); }
}

/* Tablet */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; }
  .hero__copy { max-width: 640px; }
  .hero__visual { min-height: 500px; order: -1; } /* stacked: product first, copy below */
  .phone { width: 234px; }
}

/* Mobile */
@media (max-width: 767px) {
  body { display: block; }
  .nav { gap: 8px; }
  /* pill gives way to the language switch on narrow screens */
  .pill { display: block; min-width: 0; padding: 6px 12px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lang { flex: none; }
  .lang button { min-width: 48px; min-height: 34px; padding: 0 12px; font-size: 14px; }
  .brand { margin-bottom: 20px; }
  .hero { padding-top: 8px; gap: 8px; }
  h1 { font-size: clamp(40px, 12vw, 52px); }
  .lede { font-size: 18px; margin-top: 16px; }
  .stores { margin-top: 28px; gap: 10px; }
  .store img { height: 48px; }

  .hero__visual { min-height: 420px; padding-block: 0 24px; margin: 0 calc(-1 * var(--gutter)); }
  /* symmetric offsets keep the pair centred on screen */
  .phone { width: 168px; }
  .phone--back { --x: -28%; }
  .phone--front { --x: 28%; }
  [dir="rtl"] .phone--back { --x: 28%; }
  [dir="rtl"] .phone--front { --x: -28%; }

  .perks { grid-template-columns: 1fr; padding: 4px; }
  .perk + .perk { border-inline-start: 0; border-top: 1px solid rgba(255, 255, 255, 0.75); }

  .footer { grid-template-columns: 1fr; gap: 24px; margin-top: 32px; padding-top: 28px; }
  .footer__cols { grid-template-columns: 1fr; gap: 20px; }
  .backdrop img { right: -60vw; top: -6vh; }
  [dir="rtl"] .backdrop img { right: auto; left: -60vw; }
}

/* Small phones (iPhone SE 1st gen and similar) */
@media (max-width: 374px) {
  .pill { padding: 5px 10px; font-size: 12px; }
  .lang button { min-width: 44px; padding: 0 10px; font-size: 13px; }
}

@media (prefers-reduced-transparency: reduce) {
  .pill,
  .brand__mark,
  .lang,
  .perks {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
