@import url("./fonts/plex.css");

/* ---------------------------------------------------------------- tokens */
/* Values come from the handoff's "Design Tokens" sheet. */
:root {
  --green: #2c6e37;
  --green-dark: #24562d;
  --green-tint: #f0f7f1;
  --green-tint-deep: #dceee0;
  --navy: #132747;
  --charcoal: #1f1d19;
  --offwhite: #f4f3ee;
  --page: #fafaf8;
  --border: #e8e6df;
  --text: #1f1d19;
  --text-2: #4e4a42;
  --muted: #8a857a;
  --muted-light: #b0aba0;
  --on-dark: #d6d3c8;
  --wa: #25d366;
  --wa-dark: #1ebe5a;
  --white: #fff;

  --radius: 8px;
  --pill: 9999px;
  --container: 1280px;
  --header-h: 64px;

  --focus: 2px solid #1e4383;
}

/* ------------------------------------------------------------------ base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

:where(a, button):focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
}

/* Sticky header would otherwise cover the top of anchored sections. */
[id] {
  scroll-margin-top: calc(var(--header-h) + 8px);
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --------------------------------------------------------------- buttons */
.btn {
  height: 48px;
  padding-inline: 24px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}

.btn--lg {
  height: 52px;
}

.btn--wa {
  background: var(--wa);
  color: var(--white);
  font-weight: 700;
}

.btn--wa:hover {
  background: var(--wa-dark);
}

.btn--outline {
  background: var(--white);
  color: var(--green);
  border-color: var(--green);
}

.btn--outline:hover {
  background: var(--green-tint);
}

.btn--ghost {
  background: transparent;
  color: var(--green);
}

.btn--ghost:hover {
  background: var(--green-tint-deep);
}

.btn--on-navy {
  background: rgb(255 255 255 / 0.1);
  color: var(--white);
  border-color: rgb(255 255 255 / 0.45);
}

.btn--on-navy:hover {
  background: rgb(255 255 255 / 0.2);
}

.icon-wa {
  width: 20px;
  height: 20px;
  flex: none;
  fill: currentColor;
}

/* ------------------------------------------------------------------ pill */
.eyebrow {
  align-self: flex-start;
  background: var(--green-tint);
  color: var(--green);
  border-radius: var(--pill);
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 600;
}

.eyebrow--on-dark {
  background: rgb(255 255 255 / 0.12);
  border: 1px solid rgb(255 255 255 / 0.25);
  color: var(--white);
  backdrop-filter: blur(4px);
}

/* ---------------------------------------------------------------- header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  box-shadow: 0 1px 2px rgb(31 29 25 / 0.06);
}

/* Logo in the left corner, menu button in the right one — the same physical
   layout in both languages. LTR gets that from source order; RTL needs the
   reverse to undo the flip. */
.header__bar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

[dir="rtl"] .header__bar {
  flex-direction: row-reverse;
}

.header__logo {
  display: flex;
  align-items: center;
}

.header__logo img {
  height: 40px;
  width: auto;
}

/* Sits at the far end so it balances against the logo. Centring it left a
   dead gap once the WhatsApp button came out of the header. */
.header__nav {
  display: none;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1;
}

.header__nav a {
  font-size: 15px;
  font-weight: 600;
  padding: 8px 4px;
  transition: color 0.18s;
}

.header__nav a:hover {
  color: var(--green);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Source order is [switcher, burger], which puts the burger on the outer edge
   under LTR. RTL needs the reverse to keep it there. */
[dir="rtl"] .header__actions {
  flex-direction: row-reverse;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}

.lang-switch a {
  padding: 8px 14px;
  color: var(--text-2);
  transition: background-color 0.18s, color 0.18s;
}

.lang-switch a:hover {
  background: var(--offwhite);
  color: var(--green);
}

/* aria-current marks the page you are already on. */
.lang-switch a[aria-current="page"] {
  background: var(--green);
  color: var(--white);
}

.lang-switch a[aria-current="page"]:hover {
  background: var(--green);
  color: var(--white);
}

.burger {
  width: 48px;
  height: 48px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  flex: none;
}

.burger:hover {
  background: var(--offwhite);
}

.burger span {
  width: 20px;
  height: 2px;
  background: var(--text);
}

/* Drawer anchored to the right edge, sliding in right-to-left. Physical
   `right` rather than a logical property because the menu button it belongs to
   is pinned right by the row-reverse above. */
.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  width: min(82vw, 320px);
  background: var(--white);
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: -8px 0 32px rgb(31 29 25 / 0.18);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.28s ease, visibility 0.28s;
}

.mobile-nav[data-open="true"] {
  transform: translateX(0);
  visibility: visible;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgb(31 29 25 / 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s;
}

.nav-backdrop[data-open="true"] {
  opacity: 1;
  visibility: visible;
}

body[data-nav-open="true"] {
  overflow: hidden;
}

/* The drawer is pinned right in both languages, so the close button belongs at
   its right edge — where the menu button the reader just tapped was. That is
   flex-start under RTL and flex-end under LTR. */
.mobile-nav__head {
  display: flex;
  justify-content: flex-start;
  padding-bottom: 8px;
}

[dir="ltr"] .mobile-nav__head {
  justify-content: flex-end;
}

.mobile-nav__close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--text);
}

.mobile-nav__close:hover {
  background: var(--offwhite);
}

.mobile-nav a {
  padding: 14px 8px;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--offwhite);
}

.mobile-nav a:hover {
  color: var(--green);
}

@media (min-width: 1024px) {
  .header__nav {
    display: flex;
  }

  .burger,
  .mobile-nav,
  .nav-backdrop {
    display: none !important;
  }
}

@media (min-width: 1024px) and (max-width: 1180px) {
  .header__nav {
    gap: 14px;
  }

  .header__nav a {
    font-size: 14px;
  }
}

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--charcoal);
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(31 29 25 / 0.75), transparent);
}

.hero__inner {
  position: relative;
  width: 100%;
  padding-block: 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
}

.hero h1 {
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 700;
  line-height: 1.35;
  color: var(--white);
  max-width: 760px;
  text-wrap: pretty;
}

.hero__sub {
  font-size: 18px;
  line-height: 1.8;
  color: var(--offwhite);
  max-width: 600px;
}

.hero__paths {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 640px;
}

.path-card {
  background: rgb(255 255 255 / 0.1);
  border: 1px solid rgb(255 255 255 / 0.35);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(4px);
  transition: background-color 0.18s;
}

.path-card:hover {
  background: rgb(255 255 255 / 0.2);
}

.path-card b {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
}

.path-card span {
  font-size: 14px;
  color: rgb(255 255 255 / 0.75);
}

/* -------------------------------------------------------------- sections */
.section {
  padding-block: 80px;
}

.section--tight {
  padding-block: 64px;
}

.section--white {
  background: var(--white);
}

.section--sand {
  background: var(--offwhite);
}

.section--navy {
  background: var(--navy);
}

.section--mint {
  background: var(--green-tint);
}

.section__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section__head h2,
.split h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.4;
}

.section__head p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-2);
  max-width: 680px;
  text-wrap: pretty;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ----------------------------------------------------------- molds split */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  align-items: center;
}

.split video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgb(31 29 25 / 0.08);
}

.split__copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.split__copy p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-2);
  max-width: 520px;
}

/* ----------------------------------------------------------------- cards */
/* 300px min gives 3 columns at container width: the 9 date-machine cards land
   as a clean 3x3, and the 5 dairy cards as 3+2. */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgb(31 29 25 / 0.06);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: 0 8px 24px rgb(31 29 25 / 0.1);
  transform: translateY(-1px);
}

/* height:auto is load-bearing — the width/height attributes on the <img> would
   otherwise win over aspect-ratio and stretch the photo to its intrinsic
   height, cropping it to a tall strip. */
.card img {
  aspect-ratio: 4 / 3;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
  display: block;
}

.card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card__body h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
}

.card__body p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-2);
  flex: 1;
}

.card__cta {
  color: var(--green);
  font-size: 14px;
  font-weight: 600;
}

/* Dairy machines have no photography yet. Rather than an empty grey box, the
   slot reads as a deliberate "coming soon" panel. */
.card--soon .card__slot {
  aspect-ratio: 4 / 3;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--green-tint) 0%, var(--green-tint-deep) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.card--soon .card__slot svg {
  width: 40px;
  height: 40px;
  stroke: var(--green);
  opacity: 0.8;
  fill: none;
  stroke-width: 1.5;
}

.card--soon .card__slot span {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  background: rgb(255 255 255 / 0.75);
  border-radius: var(--pill);
  padding: 4px 14px;
}

/* ----------------------------------------------------------- atrum/navy */
.atrum {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.atrum__copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
}

.atrum__copy h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.4;
  color: var(--white);
}

.atrum__copy p {
  font-size: 18px;
  line-height: 1.8;
  color: var(--offwhite);
  max-width: 600px;
  text-wrap: pretty;
}

.logo-chips {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.logo-chips span {
  background: var(--white);
  border-radius: var(--radius);
  padding: 8px 12px;
  display: inline-flex;
}

.logo-chips img {
  height: 36px;
  width: auto;
}

.atrum__map {
  width: 100%;
  height: 640px;
  border: 0;
  border-radius: 12px;
  display: block;
  background: var(--white);
}

/* --------------------------------------------------------------- partner */
.partner {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  max-width: 520px;
}

.partner img {
  height: 72px;
  width: auto;
  border-radius: 4px;
}

.partner h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
}

.partner p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-2);
}

.partner__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section--tight h2 {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 600;
  line-height: 1.45;
}

/* ----------------------------------------------------------------- stats */
/* 1px grid gap over a border-coloured background reads as hairline dividers. */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stats div {
  background: var(--white);
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
}

.stats b {
  font-size: 34px;
  font-weight: 700;
  color: var(--green);
  line-height: 1.2;
}

.stats span {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-2);
}

/* ------------------------------------------------------------------- cta */
.cta {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  text-align: center;
}

.cta h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.4;
}

.cta p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-2);
  max-width: 520px;
}

.cta .actions {
  justify-content: center;
}

/* ---------------------------------------------------------------- footer */
.footer {
  background: var(--charcoal);
  padding-block: 64px 32px;
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__col--brand {
  gap: 16px;
  align-items: flex-start;
}

.footer__col h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
}

.footer__col p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--offwhite);
}

.footer__col a {
  font-size: 14px;
  color: var(--on-dark);
  transition: color 0.18s;
}

.footer__col a:hover {
  color: var(--white);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.footer__legal {
  border-top: 1px solid #33302b;
  padding-block-start: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

/* --------------------------------------------------------- floating chat */
.wa-float {
  position: fixed;
  bottom: 16px;
  inset-inline-end: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--wa);
  color: var(--white);
  box-shadow: 0 8px 24px rgb(31 29 25 / 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  animation: wa-pulse 6s ease-in-out infinite;
}

.wa-float .icon-wa {
  width: 28px;
  height: 28px;
}

@keyframes wa-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
