/* ============================================================
   i8chat — marketing site
   Single-viewport video landing + shared subpage styles.
   ============================================================ */

/* Display font, self-hosted. BubbledotICG-FinePos via OnlineWebFonts,
   CC BY 4.0 - credit: Font made from onlinewebfonts.com/fonts. */
@font-face {
  font-family: "BubbledotICG-FinePos";
  src: url("/fonts/BubbledotICG-FinePos.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Pixel Circle";
  src: url("/fonts/GeistPixel-Circle.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000000;
  --text: #ffffff;
  --muted: #8e8e8e;
  --nav-text: #2e2e2e;
  --pill-dark: #28282a;
  --sign-in-text: #c8c8c8;
  --nav-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  --trust-bg: #28282a;
  --trust-border: rgba(255, 255, 255, 0.4);
  --trust-text: #c4c2c3;
  --font-sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: "BubbledotICG-FinePos", "Geist Pixel Circle", monospace;
  --font-arabic: "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;

  /* Layout scale — one source of truth for gutters and rhythm */
  --page-pad-x: clamp(14px, 3vw, 32px);
  --page-pad-y: clamp(16px, 2.4vh, 28px);
  --gap-section: clamp(56px, 9vh, 96px);
  --gap-block: clamp(24px, 4vh, 36px);
  --gap-card: 16px;
  --pad-card: 26px;
  --content-max: 1060px;
}

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

html {
  color-scheme: dark;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #ffffff;
  color: #000000;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Inline icon (replaces the Font Awesome webfont) */
.fai {
  width: 1em;
  height: 1em;
  display: inline-block;
  fill: currentColor;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

button {
  font: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
}

/* Pill-shaped controls need a matching focus ring; fields keep their own
   radius (a global 999px here reshapes inputs while focused). */
.nav-pill a:focus-visible,
.signin:focus-visible,
.cta:focus-visible,
.burger:focus-visible,
.menu-signin:focus-visible,
.tier-cta:focus-visible {
  border-radius: 999px;
}

/* ------------------------------------------------------------
   Background video
   ------------------------------------------------------------ */
.bg {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
  z-index: 0;
}

.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 0;
}

/* ------------------------------------------------------------
   Page frame — one viewport, three regions
   ------------------------------------------------------------ */
/* No z-index here: a stacking context on .page would trap the header
   (z-60) beneath the fixed menu overlay (z-40). DOM order keeps the
   page above .bg. */
.page {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: var(--page-pad-y) var(--page-pad-x);
}

.site-header,
.hero,
.stats,
.mobile-menu {
  position: relative;
  z-index: 1;
}

/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */
.site-header {
  z-index: 60;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 720px;
  gap: clamp(18px, 2.8vw, 28px);
  animation: slideDown 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.logo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.5vw, 28px);
  letter-spacing: -0.02em;
  color: #ffffff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}

.logo:hover {
  transform: scale(1.04);
}

.nav-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  max-width: 430px;
  height: clamp(44px, 5.2vw, 48px);
  padding: 4px 8px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: var(--nav-shadow);
}

.nav-pill a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 clamp(8px, 1.2vw, 12px);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(13px, 1.4vw, 15px);
  letter-spacing: -0.01em;
  color: var(--nav-text);
  opacity: 0.5;
  white-space: nowrap;
  transition: opacity 0.25s ease;
  border-radius: 999px;
}

.nav-pill a:hover {
  opacity: 0.75;
}

.nav-pill a.active {
  opacity: 1;
}

.nav-pill a.active::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  background: #000;
  box-shadow: -5px 0 0 #000, 5px 0 0 #000;
}

.signin {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: clamp(44px, 5.2vw, 48px);
  padding: 0 clamp(16px, 2vw, 22px);
  border-radius: 999px;
  background: var(--pill-dark);
  color: var(--sign-in-text);
  font-weight: 500;
  font-size: clamp(13px, 1.4vw, 15px);
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: var(--nav-shadow);
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.signin:hover {
  background: #323234;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Burger (mobile only) */
.burger {
  display: none;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--pill-dark);
  box-shadow: var(--nav-shadow);
  place-items: center;
  transition: background 0.3s ease;
}

.burger-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.burger-bar {
  display: block;
  width: 18px;
  height: 1.5px;
  border-radius: 2px;
  background: #ffffff;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease, background 0.3s ease;
}

.burger[aria-expanded="true"] {
  background: #ffffff;
}

.burger[aria-expanded="true"] .burger-bar {
  background: #000000;
}

.burger[aria-expanded="true"] .burger-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.burger[aria-expanded="true"] .burger-bar:nth-child(2) {
  opacity: 0;
}

.burger[aria-expanded="true"] .burger-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 900px;
}

/* Trust row */
.trust {
  --trust-size: clamp(36px, 4.5vw, 42px);
  display: inline-flex;
  align-items: center;
  margin-bottom: clamp(16px, 2.5vh, 26px);
}

.trust-avatar {
  position: relative;
  width: var(--trust-size);
  height: var(--trust-size);
  padding: 5px;
  border-radius: 50%;
  background: var(--trust-bg);
  border: 1px solid var(--trust-border);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.trust-avatar-inner {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #ffffff;
}

.trust-avatar .fai {
  color: #111;
  width: calc(var(--trust-size) * 0.34);
  height: calc(var(--trust-size) * 0.34);
}

.trust-avatar:nth-child(1) {
  z-index: 1;
}

.trust-avatar:nth-child(2),
.trust-avatar:nth-child(3) {
  margin-left: calc(var(--trust-size) * -0.42);
}

.trust-avatar:nth-child(2) {
  z-index: 2;
}

.trust-avatar:nth-child(3) {
  z-index: 4;
}

.trust-avatar:nth-child(1):hover {
  transform: translateY(-2px);
}

.trust-avatar:nth-child(2):hover {
  transform: translateY(-4px);
}

.trust-avatar:nth-child(3):hover {
  transform: translateY(-2px);
}

.trust-pill {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  height: var(--trust-size);
  margin-left: calc(var(--trust-size) * -0.42);
  padding-left: calc(var(--trust-size) * 0.58);
  padding-right: clamp(14px, 1.8vw, 18px);
  border-radius: 999px;
  background: var(--trust-bg);
  border: 1px solid var(--trust-border);
}

.trust-pill span {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(12px, 1.4vw, 13.5px);
  color: var(--trust-text);
  white-space: nowrap;
}

/* Headline */
.headline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 6.2vw, 80px);
  letter-spacing: -0.04em;
  line-height: 1.12;
  color: #ffffff;
  overflow: hidden;
  max-width: 100%;
}

.headline span {
  display: block;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(14px);
  animation: headlineFade 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.headline span:nth-child(1) {
  animation-delay: 0.12s;
}

.headline span:nth-child(2) {
  animation-delay: 0.3s;
}

/* The headline container itself never runs the reveal animation —
   its lines animate individually. */
.headline.anim {
  animation: none;
  opacity: 1;
  transform: none;
  filter: none;
}

/* Flip-disk headline ticker — replaces the visual headline when JS
   runs and motion is allowed; the h1 stays in the DOM for readers. */
.flip-matrix {
  display: none;
  width: min(860px, 100%);
}

.hero.matrix-on .headline {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hero.matrix-on .flip-matrix {
  display: block;
}

.fm-grid {
  display: grid;
  gap: min(0.35vw, 3px);
  direction: ltr;
}

.fm-disk {
  position: relative;
  aspect-ratio: 1;
}

.fm-flip {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(0deg);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fm-disk.on .fm-flip {
  transform: rotateX(180deg);
}

.fm-flip::before,
.fm-flip::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.fm-flip::before {
  background: #1a1a1d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.fm-flip::after {
  background: #f4f4f4;
  transform: rotateX(180deg);
  box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.25),
    0 0 7px rgba(255, 255, 255, 0.4);
}

/* Subhead */
.subhead {
  max-width: min(500px, 92%);
  margin-top: clamp(14px, 2.2vh, 22px);
  font-size: clamp(calc(13.5px + 2pt), calc(1.55vw + 2pt), calc(16.5px + 2pt));
  font-weight: 400;
  line-height: 1.55;
  color: #d0d0d0;
  opacity: 0.8;
}

/* CTA */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: clamp(18px, 3vh, 30px);
  padding: clamp(11px, 1.6vh, 13px) clamp(22px, 3vw, 28px);
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(13.5px, 1.5vw, 14.5px);
  letter-spacing: -0.01em;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15),
    0 0 22px rgba(255, 255, 255, 0.32), 0 0 44px rgba(255, 255, 255, 0.12);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease;
}

.cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25),
    0 0 30px rgba(255, 255, 255, 0.45), 0 0 60px rgba(255, 255, 255, 0.2);
}

.cta.anim {
  animation-name: revealPulse;
}

/* ------------------------------------------------------------
   Stats footer
   ------------------------------------------------------------ */
.stats {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(10px, 2vw, 24px);
  width: 100%;
  max-width: 920px;
  padding-top: clamp(10px, 2vh, 18px);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(4px, 0.8vh, 8px);
  text-align: center;
}

.stat-icon {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 33px);
  line-height: 1;
  color: #ffffff;
}

.stat-value {
  font-family: var(--font-sans);
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 600;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.stat-label {
  font-size: clamp(11px, 1.2vw, 12.5px);
  color: var(--muted);
}

/* ------------------------------------------------------------
   Home one-pager
   ------------------------------------------------------------ */

/* First screen: hero + stats fill the viewport under the sticky header,
   so the page still opens as the full-bleed video landing. */
.hero-screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: calc(100dvh - 84px);
}

.hero-screen .hero {
  flex: 1;
  margin-inline: auto;
}

.hero-screen .stats {
  margin-inline: auto;
}

/* Scroll cue */
.scroll-cue {
  display: grid;
  place-items: center;
  gap: 6px;
  width: fit-content;
  margin: clamp(12px, 2vh, 20px) auto 0;
  padding: 6px 4px;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7a7a80;
  transition: color 0.25s ease;
}

.scroll-cue:hover {
  color: #ffffff;
}

.scroll-cue .fai {
  width: 12px;
  height: 12px;
  animation: cueBob 1.8s ease-in-out infinite;
}

@keyframes cueBob {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.75;
  }
  50% {
    transform: translateY(4px);
    opacity: 1;
  }
}

/* Content below the fold sits on near-black so it reads against the
   video, which stays fixed behind the hero. */
.sections {
  position: relative;
  /* Bleed across the page gutter so the backdrop reaches both screen
     edges, then restore the gutter as padding so content stays aligned. */
  width: calc(100% + 2 * var(--page-pad-x));
  margin-inline: calc(-1 * var(--page-pad-x));
  padding: var(--gap-section) var(--page-pad-x) clamp(28px, 5vh, 48px);
  /* Also swallow the page's bottom padding so the backdrop runs to the
     very end of the document. */
  margin-bottom: calc(-1 * var(--page-pad-y));
  margin-top: clamp(24px, 5vh, 56px);
  /* Translucent so the video stays visible behind the content — the
     cards carry their own contrast, and the fixed scrim underneath
     keeps text on the backdrop readable. */
  background: rgba(0, 0, 0, 0.55);
}

/* The fade happens above the solid block, over the hero's tail — content
   never sits inside the fade, so nothing ever lands on raw video. */
.sections::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -120px;
  height: 120px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

/* Cap content to the same measure as the subpages */
.sections > .section,
.sections > .site-footer {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
}

.sections > .section:first-child {
  margin-top: 0;
}

/* Anchor targets must clear the sticky header. */
.sections .section,
.hero-screen {
  scroll-margin-top: 92px;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Legal row (home) */
.legal-row {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: clamp(8px, 1.4vh, 14px);
  font-size: 11px;
  color: #5c5c60;
}

.legal-row a {
  color: #7a7a80;
  transition: color 0.2s ease;
}

.legal-row a:hover {
  color: #ffffff;
}

/* ------------------------------------------------------------
   Shared entrance animation
   ------------------------------------------------------------ */
.anim {
  opacity: 0;
  transform: translateY(22px) scale(0.98);
  filter: blur(6px);
  animation: reveal 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* The flip board is 513 disks in English and 1102 in Arabic, each with two
   pseudo-faces: 2052 to 4408 render objects. The generic .anim reveal blurs
   its target for 850ms, and because the board is display:none until main.js
   reveals it, that blur starts on the very frame the board first paints -
   the browser rasterises the whole subtree offscreen and Gaussian-blurs it
   ~51 times. `forwards` then parks it at blur(0), which is not `none` and
   keeps the render surface alive for the life of the page.

   The board fades and slides in exactly as before; only the blur is dropped.
   Same exemption pattern as .headline.anim above. */
@keyframes revealFlat {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.flip-matrix.anim {
  filter: none;
  animation-name: revealFlat;
}

@keyframes revealPulse {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
    filter: blur(6px);
  }
  60% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  78% {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3),
      0 0 34px rgba(255, 255, 255, 0.5), 0 0 64px rgba(255, 255, 255, 0.22);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15),
      0 0 22px rgba(255, 255, 255, 0.32), 0 0 44px rgba(255, 255, 255, 0.12);
  }
}

@keyframes headlineFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------------------------------------------------------------
   Mobile menu
   ------------------------------------------------------------ */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: overlayIn 0.28s ease both;
}

.mobile-menu {
  position: fixed;
  top: 88px;
  left: 16px;
  right: 16px;
  z-index: 50;
  margin: 0 auto;
  max-width: 420px;
  background: #ffffff;
  border-radius: 28px;
  padding: 22px 18px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  animation: menuIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
  max-height: calc(100dvh - 104px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.menu-overlay[hidden],
.mobile-menu[hidden] {
  display: none;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
}

.mobile-menu nav a {
  position: relative;
  display: block;
  padding: 13px 8px;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--nav-text);
  opacity: 0.65;
  border-radius: 14px;
  animation: linkIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.mobile-menu nav a:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.04);
}

.mobile-menu nav a.active {
  opacity: 1;
}

.mobile-menu nav a.active::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  background: #000;
  box-shadow: -5px 0 0 #000, 5px 0 0 #000;
}

.mobile-menu nav a:nth-child(1) { animation-delay: 0.06s; }
.mobile-menu nav a:nth-child(2) { animation-delay: 0.11s; }
.mobile-menu nav a:nth-child(3) { animation-delay: 0.16s; }
.mobile-menu nav a:nth-child(4) { animation-delay: 0.21s; }
.mobile-menu nav a:nth-child(5) { animation-delay: 0.26s; }

.mobile-menu .menu-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
  padding: 13px;
  border-radius: 999px;
  background: var(--pill-dark);
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
  animation: linkIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.31s both;
}

@keyframes overlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes linkIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.menu-open,
body.scrolls.menu-open {
  overflow: hidden;
  overflow-y: hidden;
}

/* ------------------------------------------------------------
   Scrolling pages (home one-pager + product, pricing, case
   studies, contact)
   ------------------------------------------------------------ */
body.scrolls {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
}

body.scrolls .bg {
  position: fixed;
}

/* Scrim — the video has bright regions; keep subpage copy readable. */
body.scrolls .bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.66),
    rgba(0, 0, 0, 0.5)
  );
}

/* Subpages scroll, so the header must stay put — otherwise the burger
   scrolls away and the fixed menu has no trigger left on screen. No
   backdrop: the pills carry their own contrast. */
body.scrolls .site-header {
  position: sticky;
  top: 0;
  padding-block: 10px;
}

body.scrolls .page {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: visible;
  justify-content: flex-start;
}

.page-main {
  flex: 1;
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding-top: clamp(40px, 7vh, 72px);
  padding-bottom: clamp(40px, 7vh, 72px);
}

.page-hero {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-title {
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(32px, 5.4vw, 62px);
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #ffffff;
}

.page-sub {
  max-width: min(560px, 92%);
  margin: clamp(14px, 2.2vh, 22px) auto 0;
  font-size: clamp(14px, 1.4vw, 16.5px);
  line-height: 1.6;
  color: #d0d0d0;
  opacity: 0.8;
}

.section {
  margin-top: var(--gap-section);
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--gap-block);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 3.2vw, 36px);
  letter-spacing: -0.03em;
  color: #ffffff;
}

.section-sub {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-card);
}

.card {
  border-radius: 20px;
  background: rgba(20, 20, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: var(--pad-card);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.28);
}

.card .fai {
  width: 17px;
  height: 17px;
  color: #ffffff;
}

.card h3 {
  margin-top: 14px;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.card p {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #a8a8a8;
}

/* Numbered steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-card);
  counter-reset: step;
}

.step {
  position: relative;
  border-radius: 20px;
  background: rgba(20, 20, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: var(--pad-card);
}

.step-num {
  font-family: var(--font-display);
  font-size: 26px;
  color: #ffffff;
}

.step h3 {
  margin-top: 12px;
  font-size: 16.5px;
  font-weight: 600;
  color: #ffffff;
}

.step p {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #a8a8a8;
}

/* Pricing tiers */
.tiers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-card);
  align-items: stretch;
}

.tier {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: rgba(20, 20, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: var(--pad-card);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.3s ease;
}

.tier:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.3);
}

.tier.featured {
  background: rgba(40, 40, 42, 0.82);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 34px rgba(255, 255, 255, 0.1);
}

.tier-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tier-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--trust-text);
}

.tier-price {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: clamp(38px, 4.6vw, 54px);
  letter-spacing: -0.03em;
  line-height: 1;
  color: #ffffff;
}

.tier-price small {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.tier-desc {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: #a8a8a8;
}

.tier ul {
  list-style: none;
  margin-top: 18px;
  display: grid;
  gap: 10px;
  flex: 1;
}

.tier li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 13.5px;
  line-height: 1.5;
  color: #d0d0d0;
}

.tier li .fai {
  width: 11px;
  height: 11px;
  color: #ffffff;
  opacity: 0.85;
}

.tier-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
  padding: 12px;
  border-radius: 999px;
  background: var(--pill-dark);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-weight: 600;
  font-size: 13.5px;
  transition: background 0.25s ease, transform 0.25s ease;
}

.tier-cta:hover {
  background: #323234;
  transform: translateY(-1px);
}

.tier.featured .tier-cta {
  background: #ffffff;
  border-color: transparent;
  color: #000000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15),
    0 0 22px rgba(255, 255, 255, 0.28);
}

.tier.featured .tier-cta:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25),
    0 0 30px rgba(255, 255, 255, 0.4);
}

.pricing-note {
  margin-top: 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

/* Case studies */
.case {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  border-radius: 24px;
  background: rgba(20, 20, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 28px;
}

.case + .case {
  margin-top: 16px;
}

.case p.case-metric {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  letter-spacing: -0.03em;
  line-height: 1;
  color: #ffffff;
}

.case p.case-metric-label {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.case-tag .fai {
  width: 12px;
  height: 12px;
}

.case-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--trust-bg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-weight: 500;
  color: var(--trust-text);
}

.case h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.case p {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.65;
  color: #a8a8a8;
}

.case-stats {
  display: flex;
  gap: 26px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.case-stats div strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.case-stats div span {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
}

/* FAQ */
.faq {
  max-width: 680px;
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

.faq details {
  border-radius: 18px;
  background: rgba(20, 20, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 0 20px;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 0;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  padding-bottom: 18px;
  font-size: 13.5px;
  line-height: 1.65;
  color: #a8a8a8;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.contact-form {
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.contact-form label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  margin-top: 6px;
  padding: 13px 16px;
  border-radius: 14px;
  background: rgba(20, 20, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.25s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(255, 255, 255, 0.45);
}

.contact-form textarea {
  min-height: 130px;
  resize: vertical;
}

.contact-form ::placeholder {
  color: #6f6f74;
}

.contact-form button {
  justify-self: center;
  margin-top: 6px;
}

.contact-form .field-error {
  border-color: rgba(239, 68, 68, 0.7);
}

.contact-form .form-error {
  display: none;
  font-size: 12.5px;
  color: #f87171;
  text-align: center;
}

.contact-form.has-error .form-error {
  display: block;
}

/* CTA band */
.cta-band {
  text-align: center;
  padding: clamp(30px, 5vh, 48px) 20px;
  border-radius: 28px;
  background: rgba(20, 20, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.cta-band .section-title {
  font-size: clamp(24px, 3.6vw, 40px);
}

.cta-band p {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

.cta-band .cta {
  margin-top: 22px;
}

/* Footer (subpages) */
.site-footer {
  flex-shrink: 0;
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 20px 0 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer .brand {
  font-family: var(--font-display);
  font-size: 16px;
  color: #ffffff;
}

.site-footer nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.site-footer a {
  font-size: 12.5px;
  color: var(--muted);
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: #ffffff;
}

.site-footer .copyright {
  font-size: 12px;
  color: #5c5c60;
}

/* ------------------------------------------------------------
   Language switcher
   ------------------------------------------------------------ */
.lang-switch {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: clamp(44px, 5.2vw, 48px);
  padding: 0 clamp(12px, 1.6vw, 16px);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--sign-in-text);
  font-size: clamp(12px, 1.3vw, 13.5px);
  font-weight: 500;
  white-space: nowrap;
  transition: border-color 0.25s ease, color 0.25s ease;
}

.lang-switch:hover {
  border-color: rgba(255, 255, 255, 0.6);
  color: #ffffff;
}

.mobile-menu .menu-lang {
  display: block;
  margin-top: 8px;
  padding: 11px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--nav-text);
  opacity: 0.65;
  border-radius: 14px;
}

/* ------------------------------------------------------------
   RTL (Arabic pages)
   ------------------------------------------------------------ */
[dir="rtl"] body,
[dir="rtl"] button,
[dir="rtl"] input,
[dir="rtl"] textarea {
  font-family: var(--font-arabic);
}

/* Arabic display type: bold Plex Arabic punched through a uniform
   round-dot mask. The dot geometry matches the Latin Bubbledot face
   exactly, while the letterforms stay real Arabic type. Browsers
   without mask support fall back to solid bold Plex. */
[dir="rtl"] .headline,
[dir="rtl"] .page-title,
[dir="rtl"] .section-title,
[dir="rtl"] .cta-band .section-title {
  font-family: var(--font-arabic);
  font-weight: 700;
  letter-spacing: 0;
  -webkit-mask-image: radial-gradient(circle, #000 42%, transparent 48%);
  mask-image: radial-gradient(circle, #000 42%, transparent 48%);
  -webkit-mask-size: 0.095em 0.095em;
  mask-size: 0.095em 0.095em;
  -webkit-mask-repeat: repeat;
  mask-repeat: repeat;
}

[dir="rtl"] .headline {
  font-size: clamp(34px, 6.6vw, 82px);
  line-height: 1.3;
}

[dir="rtl"] .page-title {
  font-size: clamp(36px, 5.8vw, 70px);
}

[dir="rtl"] .section-title {
  font-size: clamp(26px, 3.6vw, 42px);
  line-height: 1.4;
}

[dir="rtl"] .subhead,
[dir="rtl"] .page-sub {
  line-height: 1.9;
}

/* Latin metric strings (750/hr, 800ms) must not be bidi-reordered */
[dir="rtl"] .stat-value,
[dir="rtl"] .case-metric,
[dir="rtl"] .case-stats strong,
[dir="rtl"] .tier-price {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Trust row overlap mirrors */
[dir="rtl"] .trust-avatar:nth-child(2),
[dir="rtl"] .trust-avatar:nth-child(3) {
  margin-left: 0;
  margin-right: calc(var(--trust-size) * -0.42);
}

[dir="rtl"] .trust-pill {
  margin-left: 0;
  margin-right: calc(var(--trust-size) * -0.42);
  padding-left: clamp(14px, 1.8vw, 18px);
  padding-right: calc(var(--trust-size) * 0.58);
}

@media (max-width: 720px) {
  .lang-switch {
    height: 40px;
    margin-inline-start: auto;
    margin-inline-end: 12px;
  }
}

/* ------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .anim,
  .site-header,
  .headline span,
  .cta.anim {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 960px) {
  .cards,
  .steps,
  .tiers,
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .case {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  :root {
    --gap-section: clamp(40px, 7vh, 56px);
    --gap-block: 20px;
    --gap-card: 12px;
    --pad-card: 20px;
  }

  .nav-pill,
  .signin {
    display: none;
  }

  .site-header {
    max-width: none;
    justify-content: space-between;
  }

  .logo {
    font-size: 24px;
  }

  .burger {
    display: grid;
  }

  .headline {
    letter-spacing: -0.08em;
    line-height: 1.05;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 14px;
  }

  .cards,
  .steps,
  .tiers,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .tier.featured {
    order: -1;
  }

  .case-stats {
    flex-wrap: wrap;
    gap: 18px;
  }
}

@media (max-width: 720px) {
  /* The portrait crop of the video centers its bright band behind the
     headline; a light scrim keeps the hero readable on phones. */
  body:not(.subpage) .bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.26);
  }
}

@media (max-width: 420px) {
  .trust {
    --trust-size: 34px;
  }

  .trust-pill span {
    font-size: 12px;
  }

  .headline {
    letter-spacing: -0.09em;
    line-height: 1.04;
  }
}

@media (max-height: 700px) {
  .trust {
    margin-bottom: 16px;
  }

  .subhead {
    margin-top: 10px;
  }

  .cta {
    margin-top: 14px;
  }

  .stats {
    padding-top: 8px;
  }
}

/* Illustrative-example disclaimer on the case studies page. */
.section-note {
  max-width: 62ch;
  margin: 0 auto 28px;
  color: var(--muted, #8e8e8e);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}
