/* ==========================================================================
   e·stebdal — Ads landing page (EN + AR)
   Mobile-first. Built from Figma "Landing Page 01 – Final Mobile".
   ========================================================================== */

/* ---------- Design tokens (from Figma variables) ---------- */
:root {
  --purple: #8341ed;
  --ink: #111111;
  --surface-light: #f6f6f6;
  --white: #ffffff;
  --border: #e0e0e0;
  --text-secondary: #585858;
  --text-muted: #ababab;
  --panel: #2a2a2a;
  --border-dark: #393939;
  --yellow: #f4e9a6;
  --radius-full: 9999px;

  --font-sans: "General Sans", system-ui, -apple-system, sans-serif;
  --font-display: "Bricolage Grotesque", var(--font-sans);
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --font-ar: "IBM Plex Sans Arabic", system-ui, sans-serif;

  /* Mobile design is 390px wide; on bigger screens the content stays a centered column */
  --page-max: 480px;
  --gutter: 20px;
}

/* Arabic page: every text style switches to IBM Plex Sans Arabic */
html[lang="ar"] {
  --font-sans: var(--font-ar);
  --font-display: var(--font-ar);
  --font-mono: var(--font-ar);
}

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

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

body {
  margin: 0;
  background: var(--surface-light);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, p {
  margin: 0;
}

img {
  display: block;
}

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

.wrap {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.font-ar {
  font-family: var(--font-ar);
}

.nowrap {
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.btn--purple {
  background: var(--purple);
  color: var(--surface-light);
}

.btn--grey {
  background: var(--border);
  color: var(--ink);
}

/* Header-size button */
.btn--sm {
  height: 52px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 20px;
}

/* Hero-size button */
.btn--md {
  height: 56px;
  padding: 12px 24px;
  font-size: 16px;
  line-height: 24px;
}

html[lang="ar"] .btn--sm {
  line-height: 22px;
}

html[lang="ar"] .btn--md {
  height: 60px;
}

/* ---------- Header ---------- */
.site-header {
  padding-top: 20px;
  padding-bottom: 16px;
}

/* Header keeps the same layout in both languages (logo on the right) */
.site-header__nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}

.site-header__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.lang-switch .font-ar {
  line-height: 22px;
}

/* ---------- Hero ---------- */
.hero {
  padding-top: 24px;
  padding-bottom: 48px;
}

.hero__content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

html[lang="ar"] .eyebrow {
  letter-spacing: 0;
}

.hero__title {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 60px;
  line-height: 46px;
  font-variation-settings: "opsz" 96;
}

html[lang="ar"] .hero__title {
  font-weight: 700;
  font-size: 48px;
  line-height: 44px;
  font-variation-settings: normal;
}

.hero__title > span {
  display: block;
}

.text-purple {
  color: var(--purple);
}

.hero__lede {
  font-size: 18px;
  line-height: 28px;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.hero__note {
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

html[lang="ar"] .hero__note {
  line-height: 22px;
}

.proof {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.proof__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--white);
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
}

html[lang="ar"] .proof__item {
  line-height: 22px;
}

/* "7 days → under 3" illustration
   The line SVG sits at its Figma position; ::before / ::after extend its two
   straight ends to the edges of the screen so it always runs out of frame. */
.process {
  --line-x: -24.4px; /* SVG left edge, relative to the content column */
  --dot-x: calc(var(--line-x) + 303.6px); /* centre of the circle on the path */
  position: relative;
  height: 220px;
  margin-top: 28px;
}

.process__line {
  position: absolute;
  top: 111px;
  inset-inline-start: var(--line-x);
  width: 400px;
  height: 70px;
  max-width: none;
}

html[dir="rtl"] .process__line {
  transform: scaleX(-1);
}

.process::before,
.process::after {
  content: "";
  position: absolute;
  height: 10px;
}

/* Black lead-in: from the screen edge to where the squiggle starts */
.process::before {
  top: 162px;
  inset-inline-start: calc(50% - 50vw);
  inset-inline-end: calc(100% - var(--line-x) - 7px);
  background: var(--ink);
}

/* Purple tail: from where the straight line ends to the screen edge */
.process::after {
  top: 137.76px;
  inset-inline-start: calc(var(--line-x) + 393px);
  inset-inline-end: calc(50% - 50vw);
  background: var(--purple);
}

.process__label {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 120px;
  text-align: center;
}

.process__label--before {
  top: 59px;
  inset-inline-start: -0.4px;
  padding-inline: 16px;
}

/* Centred on the circle: label is 120px wide, so start 60px before the dot */
.process__label--after {
  top: 69px;
  inset-inline-start: calc(var(--dot-x) - 60px);
}

.tag {
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.06em;
  color: var(--surface-light);
  white-space: nowrap;
}

html[lang="ar"] .tag {
  line-height: 18px;
  letter-spacing: 0;
}

.tag--ink {
  background: var(--ink);
}

.tag--purple {
  background: var(--purple);
}

.process__caption {
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ---------- Shared section headings ---------- */
.heading-callout {
  font-weight: 600;
  font-size: 28px;
  line-height: 34px;
  letter-spacing: -0.01em;
}

.heading-section {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 44px;
  line-height: 48px;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 96;
}

html[lang="ar"] .heading-callout {
  line-height: 42px;
  letter-spacing: 0;
}

html[lang="ar"] .heading-section {
  font-weight: 700;
  font-size: 40px;
  line-height: 58px;
  letter-spacing: 0;
  font-variation-settings: normal;
}

/* ---------- Conversation ("One return. Six handoffs.") ---------- */
.conversation {
  background: var(--ink);
  color: var(--surface-light);
}

.conversation > .wrap {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-block: 48px;
}

.conversation__heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conversation__heading .heading-section {
  color: var(--yellow);
}

.thread {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Chat bubble. Bubbles are 32px narrower than the column so they can sit
   to one side; the 18px gap between them holds a thin connector line. */
.msg {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: calc(100% - 32px);
  padding: 18px 20px;
  border-radius: 22px;
  border-end-start-radius: 4px;
  background: var(--panel);
}

.msg + .msg {
  margin-top: 18px;
}

.msg:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 100%;
  inset-inline-start: 24px;
  width: 1px;
  height: 18px;
  background: var(--border-dark);
}

/* First bubble: light, on the other side, tail on the other corner */
.msg--first {
  align-self: flex-end;
  background: var(--surface-light);
  color: var(--ink);
  border-end-start-radius: 22px;
  border-end-end-radius: 4px;
}

.msg--first:not(:last-child)::after {
  inset-inline-start: auto;
  inset-inline-end: 47px;
}

.msg__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-weight: 500;
  white-space: nowrap;
}

.msg__step {
  font-size: 16px;
  line-height: 24px;
}

.msg__delay {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.06em;
  color: var(--yellow);
}

html[lang="ar"] .msg__delay {
  font-size: 14px;
  line-height: 22px;
  letter-spacing: 0;
}

.msg--first .msg__step {
  color: var(--panel);
}

.msg--first .msg__delay {
  color: var(--purple);
}

.msg__text {
  font-size: 16px;
  line-height: 26px;
}

/* Closing "customer is typing…" message */
.closing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.typing {
  display: flex;
  gap: 6px;
  padding-inline-end: 20px;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-light);
}

.closing__bubble {
  width: calc(100% - 32px);
  padding: 24px;
  border-radius: 24px;
  border-end-end-radius: 4px;
  background: var(--surface-light);
  color: var(--ink);
  font-weight: 500;
  font-size: 16px;
  line-height: 26px;
}

html[lang="ar"] .closing__bubble {
  font-weight: 600;
}

/* ---------- Returns timeline ("The same return. Four steps, one place.") ---------- */
.timeline > .wrap {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 48px;
}

html[lang="ar"] .timeline .heading-section {
  font-size: 44px;
  line-height: 48px;
  letter-spacing: -0.01em;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  gap: 16px;
}

/* Rail: numbered circle + purple line running down to the next step */
.step__rail {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  width: 52px;
}

.step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 4px solid var(--surface-light);
  border-radius: 999px;
  background: var(--purple);
  color: var(--surface-light);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 18px;
  line-height: 18px;
}

.step__line {
  flex: 1;
  width: 4px;
  min-height: 1px;
  border-radius: 999px;
  background: var(--purple);
}

/* Last line runs past its card to the bottom edge of the section */
.step:last-child .step__line {
  flex: none;
  height: 349px;
}

.step__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding-bottom: 24px;
}

.step__copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 16px;
}

.step__title {
  font-weight: 600;
  font-size: 22px;
  line-height: 28px;
}

.step__desc {
  font-size: 16px;
  line-height: 26px;
}

/* Sample product UI card */
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 20px;
  background: var(--white);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card__title {
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
}

.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 14px;
  line-height: 18px;
  text-transform: uppercase;
  white-space: nowrap;
}

.sample {
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  line-height: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html[lang="ar"] .sample {
  letter-spacing: 0;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-light);
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
}

.options {
  display: flex;
  gap: 6px;
}

.option {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 12px 0 13px;
  border-radius: 10px;
  background: var(--surface-light);
  font-weight: 600;
  font-size: 13px;
  line-height: 14px;
}

.option--active {
  background: var(--ink);
  color: var(--surface-light);
}

.thumbs {
  display: flex;
  gap: 6px;
}

.thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--panel);
}

.thumb--mid {
  background: var(--text-secondary);
}

.btn--ink {
  background: var(--ink);
  color: var(--surface-light);
}

.btn--block {
  width: 100%;
  height: 48px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 20px;
}

.notified {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--purple);
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
}

/* Step 3's card uses a slightly tighter gap in Figma */
.card--tight {
  gap: 9.5px;
}

/* ---------- Benefits ("What changes for your team.") ---------- */
.heading-statement {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  line-height: 42px;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 14;
}

html[lang="ar"] .heading-statement {
  line-height: 58px;
  letter-spacing: 0;
  font-variation-settings: normal;
}

/* Arrows and other direction-aware icons point the other way in Arabic */
html[dir="rtl"] .flip-rtl {
  transform: scaleX(-1);
}

.benefits {
  background: var(--purple);
  color: var(--surface-light);
}

.benefits > .wrap {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-block: 48px;
}

.metrics {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border-radius: 28px;
  background: var(--ink);
}

/* "7 →" — the before value */
.metric__before {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 22px;
  line-height: 28px;
  white-space: nowrap;
}

.metric__value {
  overflow: hidden;
  color: var(--yellow);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 32px;
  line-height: 40px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.metric__label {
  font-size: 18px;
  line-height: 28px;
}

html[lang="ar"] .metric__before {
  line-height: 32px;
}

html[lang="ar"] .metric__value {
  line-height: 48px;
  letter-spacing: 0;
}

html[lang="ar"] .metric__label {
  font-weight: 500;
  font-size: 16px;
  line-height: 26px;
}

.benefits__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.btn--light {
  background: var(--surface-light);
  color: var(--ink);
}

/* Large pill button (Book a demo, Finish setup, Final CTA) */
.btn--lg {
  height: 60px;
  padding: 12px 24px;
  font-size: 16px;
  line-height: 24px;
}

.source-note {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 18px;
}

html[lang="ar"] .source-note {
  font-weight: 500;
  font-size: 14px;
  line-height: 22px;
}

/* ---------- Setup ("Installed e·stebdal but never finished setup?") ---------- */
.setup {
  background: var(--ink);
  color: var(--surface-light);
}

.setup > .wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-block: 48px;
}

.setup__copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

html[lang="ar"] .setup .heading-callout {
  line-height: 32px;
}

.setup__lede {
  color: var(--border);
  font-size: 18px;
  line-height: 28px;
}

.setup__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--panel);
  font-weight: 500;
  font-size: 16px;
  line-height: 26px;
}

/* ---------- FAQ ("Three quick answers.") ---------- */
.faq > .wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-block: 48px;
}

/* Accordion built on <details>. js/faq.js animates the open/close: the card
   height, the toggle's footprint and the circle all move on one timeline.
   Visual state is driven by .is-open (set by the script), not [open], so the
   closing animation can play before the answer is hidden. */
.faq__item {
  --faq-speed: 320ms;
  --faq-ease: cubic-bezier(0.4, 0, 0.2, 1);
  padding: 12px;
  border-radius: 22px;
  background: var(--white);
}

html[lang="ar"] .faq__item.is-open {
  padding-bottom: 24px;
}

.faq__item summary {
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

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

.faq__item summary:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 4px;
  border-radius: 12px;
}

.faq__q {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 18px;
  line-height: 26px;
}

html[lang="ar"] .faq__q {
  line-height: 28px;
}

/* Toggle: grey "+" when closed, purple "×" (the + turned 45°) when open.
   The open slot is 62.2px — the footprint of the rotated circle in Figma. */
.faq__toggle {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

.faq__item.is-open .faq__toggle {
  width: 62.225px;
  height: 62.225px;
}

.faq__circle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--surface-light);
  transition: transform var(--faq-speed) var(--faq-ease), background-color var(--faq-speed) var(--faq-ease);
}

.faq__item.is-open .faq__circle {
  background: var(--purple);
  transform: rotate(45deg);
}

/* Dark and light "+" are stacked and cross-faded instead of swapped */
.faq__circle img {
  transition: opacity var(--faq-speed) var(--faq-ease);
}

.faq__icon-open {
  position: absolute;
  opacity: 0;
}

.faq__item.is-open .faq__icon-open {
  opacity: 1;
}

.faq__item.is-open .faq__icon-closed {
  opacity: 0;
}

.faq__a {
  font-size: 16px;
  line-height: 26px;
}

@media (prefers-reduced-motion: reduce) {
  .faq__item {
    --faq-speed: 0ms;
  }
}

/* ---------- Final CTA ("Returns no longer suck.") ---------- */
.final-cta {
  background: var(--purple);
  color: var(--surface-light);
}

.final-cta > .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-block: 48px;
}

.final-cta__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 48px;
  line-height: 50px;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 14;
  text-align: center;
}

html[lang="ar"] .final-cta__title {
  font-weight: 700;
  line-height: 70px;
  letter-spacing: 0;
  font-variation-settings: normal;
}

.final-cta .btn {
  width: 100%;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--surface-light);
}

.site-footer > .wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-block: 24px;
}

.site-footer__note {
  color: var(--border);
  font-size: 16px;
  line-height: 26px;
}

.site-footer__legal {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.site-footer__copy,
.site-footer__privacy {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 18px;
}

.site-footer__copy {
  color: var(--text-muted);
}

.site-footer__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-footer__privacy {
  display: flex;
  align-items: center;
  height: 44px;
}

.site-footer__privacy:hover {
  text-decoration: underline;
}

.btn--panel {
  background: var(--panel);
  color: var(--surface-light);
}

/* Small footer pill (language switch) */
.btn--xs {
  height: 44px;
  padding: 12px 24px;
  font-size: 14px;
  line-height: 22px;
}
