/* YOUMNA × SiFi — landing page.
   Brand: YOUMNA VI 29.07.26 — Core #0C0B0B, Momentum #CAFF85, Clarity #E8E8E6.
   Type: Forma DJR (→ Inter), IvyPresto Text Italic (→ Instrument Serif Italic),
   Forma DJR Banner / system voice (→ Space Mono), Forma DJR Arabic (→ IBM Plex Sans Arabic).
   Arabic is the default language; English swaps in via data-en. Mobile first. */

:root {
  color-scheme: dark;
  --core: #0c0b0b;
  --steady: #23220d;
  --momentum: #caff85;
  --pulse: #e7ffcf;
  --clarity: #e8e8e6;
  --clarity-lift: #f1f1ef;   /* one step up from Clarity for input wells; never pure white */
  --rooted: #c1beb9;
  --system: #b9c3c9;
  --direct: #485cd3;
  --text: var(--clarity);
  --muted: rgba(232, 232, 230, .62);
  --dim: rgba(232, 232, 230, .58);
  --line: rgba(232, 232, 230, .14);
  --line-2: rgba(232, 232, 230, .28);
  /* the VI has no error colour; these two are the only non-palette values,
     one per surface, and exist purely so a failed field is legible. */
  --err: #ff9b8a;
  --err-on-light: #8f2f22;
  --gutter: 20px;
  --maxw: 1400px;
  --ease: cubic-bezier(.19, 1, .22, 1);
  --fa: 'IBM Plex Sans Arabic', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fe: 'Inter', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs: 'Instrument Serif', 'Times New Roman', serif;
  --fm: 'Space Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

/* the dark colour-scheme makes the UA default text pure white; pin the root to Clarity
   so nothing can fall back to #fff */
html { color: var(--text); background: var(--core); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0; background: var(--core); color: var(--text);
  font-family: var(--fa); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
html[lang="en"] body { font-family: var(--fe); line-height: 1.6; }

img, svg { max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.14; letter-spacing: -0.02em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.38; letter-spacing: 0; font-weight: 700; }
p { margin: 0; }
a { color: inherit; }
ol, ul { margin: 0; padding: 0; list-style: none; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 1100px) { :root { --gutter: 44px; } }
@media (min-width: 1500px) { :root { --gutter: 64px; } }

/* system / tech voice */
.mono {
  font-family: var(--fm); font-size: 15.5px; font-weight: 400;
  letter-spacing: .1em; text-transform: uppercase; color: var(--momentum);
}
html[lang="ar"] .mono { font-family: var(--fa); font-size: 17px; letter-spacing: normal; text-transform: none; }

/* human voice */
em {
  font-family: var(--fs); font-style: italic; font-weight: 400;
  color: var(--momentum); font-size: 1.08em; letter-spacing: 0;
}
html[lang="ar"] em { font-family: var(--fa); font-style: normal; font-size: 1em; font-weight: 600; }

.skip {
  position: absolute; inset-block-start: -60px; inset-inline-start: 12px; z-index: 100;
  background: var(--momentum); color: var(--core); padding: 10px 16px;
  text-decoration: none; font-size: 14px; font-weight: 600;
}
.skip:focus { inset-block-start: 12px; }
:focus-visible { outline: 2px solid var(--momentum); outline-offset: 3px; }

/* lime rule with end marks, from the brand's pixel language */
.rule {
  position: relative; height: 1px;
  width: calc(100% - var(--gutter) * 2);
  max-width: calc(var(--maxw) - var(--gutter) * 2);
  margin-inline: auto;
  background: var(--momentum); opacity: .85;
}
.rule::before, .rule::after {
  content: ""; position: absolute; inset-block-start: -3px;
  width: 7px; height: 7px; background: var(--momentum);
}
.rule::before { inset-inline-start: 0; }
.rule::after { inset-inline-end: 0; }

/* ---------- nav ---------- */
.nav { position: sticky; inset-block-start: 0; z-index: 50; background: rgba(12, 11, 11, .9); backdrop-filter: blur(10px); }
.nav-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
/* the co-brand lockup: our wordmark and SiFi's, same height, same Clarity white */
.brand { display: inline-flex; align-items: center; gap: 16px; padding-block: 10px; text-decoration: none; }
.brand img { width: auto; display: block; }
.brand-y, .brand-s { height: 24px; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-tag { display: none; }
@media (min-width: 760px) { .nav-tag { display: block; } }

.lang {
  font-family: var(--fm); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  background: transparent; color: var(--text); border: 1px solid var(--line-2);
  padding: 12px 14px; min-height: 44px; display: inline-flex; align-items: center;
  cursor: pointer; white-space: nowrap;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
/* Space Mono has no Arabic glyphs: the toggle needs its own face when it says العربية */
.lang[lang="ar"] { font-family: var(--fa); font-size: 12.5px; letter-spacing: normal; text-transform: none; }
.lang:hover { border-color: var(--momentum); color: var(--momentum); }

/* ---------- buttons (rectangular, per the brand) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  background: var(--momentum); color: var(--core); border: 1px solid var(--momentum);
  border-radius: 2px; padding: 15px 26px; width: 100%;
  transition: filter .2s var(--ease), transform .15s var(--ease);
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
@media (min-width: 560px) { .close .btn { width: auto; min-width: 260px; } }

.btn-submit { margin-block-start: 4px; }
.btn-submit:disabled { cursor: default; opacity: .85; filter: none; }

/* ---------- hero ---------- */
.hero { padding-block: 20px 40px; }
.hero-in { display: grid; gap: 26px; }

.kicker { margin-block-end: 16px; }
h1 { font-size: clamp(30px, 8.6vw, 62px); }
h1 span { display: block; }
.accent { font-family: var(--fs); font-style: italic; font-weight: 400; color: var(--momentum); letter-spacing: 0; }
html[lang="ar"] .accent { font-family: var(--fa); font-style: normal; font-weight: 700; }

.lead { margin-block-start: 16px; max-width: 46ch; font-size: clamp(15px, 3.8vw, 17px); color: var(--muted); }

.offer {
  display: flex; align-items: center; gap: 18px;
  margin-block-start: 22px; padding-block: 16px;
  border-block: 1px solid var(--line);
}
.offer-num { font-family: var(--fe); font-size: clamp(40px, 11vw, 56px); font-weight: 400; line-height: 1; color: var(--momentum); letter-spacing: -0.03em; }
.offer-num span { font-size: .62em; }
.offer-head { font-size: 16px; font-weight: 600; }
.offer-sub { margin-block-start: 3px; font-size: 14px; color: var(--muted); }
@media (max-width: 400px) {
  .offer { gap: 12px; align-items: flex-start; }
  .offer-num { font-size: 34px; }
  .offer-sub { font-size: 13px; }
}

/* mashrabiya — the brand's three states: noise, processing, infrastructure.
   These are Samar's own SVGs, used as drawn; the squares are placed freehand, not on a
   lattice, which is why rebuilding them from a grid never matched. Only the white page
   behind them was removed so they sit on Core. */
/* the graph ends exactly where the headline ends: app.js measures the headline and
   publishes its width as --graph-w. Without JS it falls back to the text measure. */
.pattern { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 26px 0 0; width: var(--graph-w, 100%); max-width: 48ch; }
.pattern img { width: 100%; height: auto; display: block; }
@media (min-width: 620px) { .pattern { gap: 28px; } }

/* The dense block is a true lattice, so it stays drawn in cells. It is square and the cells
   are fractions of it, so the panel grows with its column instead of being a wide band with
   a small pattern floating in it — and it starts and ends level with the list beside it. */
.pattern-lg {
  align-self: stretch; height: 100%; margin: 0;
  display: grid; grid-template-columns: 1fr; place-items: center;
  max-width: none; background: var(--steady); padding: 5%; gap: 0;
}
/* the panel takes the full height of the row so it starts and ends level with the list;
   the pattern inside stays square, so the cells never stretch into rectangles */
.pattern-lg .pixels {
  aspect-ratio: 1; width: 100%; height: auto; max-height: 100%;
  grid-template-columns: repeat(var(--cols, 16), 1fr);
  grid-template-rows: repeat(var(--cols, 16), 1fr);
  gap: 3px;
}
.pattern-lg .pixels i { width: auto; height: auto; }
.pixels {
  display: grid; justify-content: start;
  grid-template-columns: repeat(var(--cols, 16), var(--cell));
  gap: var(--pgap);
}
.pixels i {
  width: var(--cell); height: var(--cell);
  background: var(--momentum); opacity: 0; transition: opacity .45s var(--ease);
}
.pixels i.on { opacity: 1; }

/* ---------- form ---------- */
/* Clarity is the palette's surface colour and the VI assigns it to this card. Text on it is
   Core; the field borders are Rooted; the button is Core carrying a Momentum label. */
.form-card {
  background: var(--clarity); color: var(--core);
  padding: 26px 20px; scroll-margin-block-start: 76px;
}
.form-card h2 { font-size: clamp(21px, 5.4vw, 25px); color: var(--core); }
.form-sub { margin-block-start: 8px; color: rgba(12, 11, 11, .66); font-size: 14.5px; }
#leadForm { margin-block-start: 24px; transition: opacity .26s var(--ease); }
.is-sent #leadForm { opacity: 0; }

.row { display: grid; gap: 0; }
@media (min-width: 520px) { .row { grid-template-columns: 1fr 1fr; gap: 14px; } }

.field { margin-block-end: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--core); margin-block-end: 7px; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--core);
  background: var(--clarity-lift); border: 1px solid var(--rooted); border-radius: 2px; padding: 12px 13px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { resize: vertical; min-height: 80px; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--core); box-shadow: 0 0 0 3px rgba(12, 11, 11, .12);
}
.field input::placeholder { color: rgba(12, 11, 11, .42); }
.field.bad input { border-color: var(--err-on-light); }

.err { display: none; margin-block-start: 5px; font-size: 13px; color: var(--err-on-light); }
.field.bad .err, .form-err.show { display: block; }
.form-err { margin-block-start: 12px; text-align: center; }

.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.btn-submit { margin-block-start: 4px; }
.btn-submit:disabled { cursor: default; opacity: .85; filter: none; }
.spin {
  display: none; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(12, 11, 11, .28); border-block-start-color: var(--core);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.is-loading .spin { display: inline-block; }

/* the card turns into a thank-you */
.done {
  text-align: center; padding-block: 26px 12px;
  opacity: 0; transform: translateY(10px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.done.in { opacity: 1; transform: none; }
.done-mark {
  display: grid; place-items: center; width: 46px; height: 46px;
  margin: 0 auto 20px; border: 1px solid var(--core);
  transform: rotate(45deg) scale(.6); opacity: 0;
  transition: transform .55s var(--ease) .12s, opacity .4s var(--ease) .12s;
}
.done.in .done-mark { transform: rotate(45deg) scale(1); opacity: 1; }
.done-mark i { display: block; width: 13px; height: 13px; background: var(--momentum); }
.done-h { font-size: clamp(24px, 6.4vw, 30px); font-weight: 700; margin-block-end: 8px; color: var(--core); }
.done p { color: rgba(12, 11, 11, .66); }
.echo { margin-block-start: 10px; font-family: var(--fm); font-size: 12.5px; color: var(--core); overflow-wrap: anywhere; }

/* between a big phone and the desktop split, a full-bleed form card looks stretched */
@media (min-width: 620px) and (max-width: 939px) {
  .form-card { width: 100%; max-width: 600px; margin-inline: auto; }
}

/* ---------- sections ---------- */
.section { padding-block: 54px; }
.sec-head { margin-block-end: 40px; }
.sec-head h2 { font-size: clamp(27px, 6.6vw, 44px); }
.sec-head h2 span { display: block; }
/* The two lines end together because the Arabic is stretched with kashida — the brand's own
   device — not by opening gaps between the words. English stays ragged; it has no kashida. */
#how .sec-head h2 { width: fit-content; font-size: clamp(23px, 5.4vw, 34px); }
.sec-sub { margin-block-start: 14px; color: var(--muted); font-size: clamp(15px, 4vw, 16.5px); max-width: 46ch; }
@media (min-width: 900px) {
  .sec-head-row { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; }
  .sec-sub { margin-block-start: 0; padding-block-end: 8px; }
}

/* the path: one vertical line, five dots, no numbers */
.path { position: relative; }
/* The connector is drawn inside each step, from the same edge its own square is anchored to,
   so the two can never drift apart — one rail spanning the whole list was measured from a
   different box and that is where the misalignment came from. */
.step { position: relative; padding-inline-start: 42px; padding-block-end: 30px; }
.step:last-child { padding-block-end: 0; }
.step::before {
  content: ""; position: absolute; z-index: 1;
  inset-inline-start: 0; inset-block-start: 6px;
  width: 14px; height: 14px;
  background: var(--core); border: 2px solid var(--line-2);
  transition: border-color .5s var(--ease), background-color .5s var(--ease);
}
.step::after {
  content: ""; position: absolute; z-index: 0;
  inset-inline-start: 6px;          /* square: 14px from 0 → centre 7. line: 2px from 6 → centre 7. */
  inset-block-start: 26px;          /* 6 (square top) + 14 (square) + 6 (breathing) */
  bottom: 0;
  border-inline-start: 2px solid var(--line-2);
}
.step:last-child::after { content: none; }
.step.in::before { background: var(--momentum); border-color: var(--momentum); }
.step h3 { font-size: clamp(20px, 5.4vw, 26px); }

@media (min-width: 900px) {
  .path { max-width: 1080px; margin-inline: auto; }
  .step { width: 50%; padding-block-end: 40px; padding-inline-start: 0; }
  .step:nth-child(odd) { text-align: end; padding-inline-end: 46px; }
  .step:nth-child(even) { margin-inline-start: 50%; padding-inline-start: 46px; }
  /* the square straddles the centre line; the connector sits on the same centre */
  .step:nth-child(odd)::before { inset-inline-start: auto; inset-inline-end: -7px; }
  .step:nth-child(odd)::after { inset-inline-start: auto; inset-inline-end: -1px; }
  .step:nth-child(even)::before { inset-inline-start: -7px; }
  .step:nth-child(even)::after { inset-inline-start: -1px; }
}

/* what your right hand handles */
.work-in { display: grid; gap: 30px; }
@media (min-width: 940px) { .work-in { grid-template-columns: 0.75fr 1.25fr; gap: 56px; align-items: stretch; } }

.handles-col { display: grid; gap: 22px; }
/* the lead-in starts on the same edge as the diamonds below it */
.handles-lead { color: var(--muted); font-size: clamp(16px, 4.2vw, 18px); max-width: 44ch; }

.handles { display: grid; gap: 20px; }
.hand { display: flex; gap: 14px; align-items: center; }
/* The VI's stroke diamond: an outline in Direct with the number upright inside it, never
   filled. Rotating the box itself pushed its corners ~5px outside the column and broke the
   alignment, so the box stays square and only the outline turns. */
.badge {
  flex: none; position: relative;
  width: 36px; height: 36px; display: grid; place-items: center;
  /* Space Mono Regular, the numbering face in the VI — in both languages, so the Arabic
     font switch never takes it over */
  font-family: var(--fm); font-weight: 400;
  font-size: 9px; letter-spacing: 0; text-transform: none;
  color: var(--direct);
}
html[lang="ar"] .badge { font-family: var(--fm); font-size: 9px; letter-spacing: 0; }
/* inset 2px leaves the diamond wider than the numerals sitting inside it */
.badge::before {
  content: ""; position: absolute; inset: 2px;
  border: 1px solid var(--direct); transform: rotate(45deg);
  transition: border-color .5s var(--ease);
}
.badge > span { position: relative; display: block; }
.hand h3 { font-size: clamp(17px, 4.4vw, 20px); font-weight: 600; }

/* ---------- close ---------- */
.close { padding-block: 52px 58px; }
.close-in { display: grid; gap: 24px; align-items: center; }
.close h2 { font-size: clamp(26px, 6.4vw, 40px); }
@media (min-width: 760px) { .close-in { grid-template-columns: 1fr auto; gap: 40px; } }

/* ---------- footer ---------- */
.foot { padding-block: 22px 30px; }
.foot-in { display: grid; gap: 10px; text-align: center; color: var(--dim); }
.foot .mono { color: var(--dim); }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--momentum); }
.foot-b { display: flex; gap: 14px; justify-content: center; }
@media (min-width: 760px) { .foot-c { text-align: end; } }
.foot-b a { display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 760px) {
  .foot-in { grid-template-columns: auto auto; justify-content: space-between; align-items: center; text-align: start; }
}

/* ---------- desktop hero split ---------- */
@media (min-width: 940px) {
  .hero { padding-block: 54px 48px; }
  .hero-in { grid-template-columns: 1.1fr .9fr; gap: 54px; align-items: start; }
  .lead, .pattern { max-width: 52ch; }
  .form-card { padding: 30px 28px; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); }
}

/* On a phone the first screen is the pitch alone — the form starts below the fold,
   so nothing of it peeks before the visitor has read anything.
   81px = nav 60 + rule 1 + hero padding-top 20. "safe center" keeps the top reachable
   on short phones where the copy is taller than the screen. */
@media (max-width: 939px) and (min-height: 461px) {
  .hero-copy {
    min-height: calc(100vh - 80px);
    min-height: calc(100svh - 80px);
    display: flex; flex-direction: column;
  }
  /* The kicker stays close to the headline — they are one title block. The leftover
     height is split three ways instead: before the offer, before the strip, and below it,
     so nothing crowds the bottom edge.
     When the copy is taller than the screen these autos collapse to 0 and it just flows. */
  .hero-copy > .offer { margin-block-start: auto; }
  .hero-copy > .pattern { margin-block-start: auto; margin-block-end: auto; }
}

/* a phone held sideways should not give 60 of its 360px to a wordmark */
@media (max-height: 460px) and (orientation: landscape) {
  .nav { position: static; }
  .nav-in { min-height: 48px; }
  .form-card { scroll-margin-block-start: 16px; }
}

/* ---------- reveal ---------- */
.js .rise { opacity: 0; transform: translateY(12px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .rise.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .rise { opacity: 1; transform: none; transition: none; }
  #leadForm, .done, .done-mark, .pixels i { transition: none; }
  .done-mark { transform: rotate(45deg); }
  .pixels i { transition: none; }
  .btn:active { transform: none; }
}
