/* Rasmor / rasmor.dev
   Tokens come from brand-tokens.json (kit v0.3). Oxide marks the intervention; use it sparingly. */

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope.woff") format("woff");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Plex Arabic";
  src: url("../fonts/plex-arabic-regular.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Arabic";
  src: url("../fonts/plex-arabic-medium.woff") format("woff");
  font-weight: 500 700;
  font-display: swap;
}

:root {
  --ink: #202A2D;
  --paper: #F5F3EC;
  --white: #FFFFFF;
  --oxide: #A63D26;
  --slate: #596568;
  --mist: #D4D7D2;

  --bg: var(--paper);
  --fg: var(--ink);
  --muted: var(--slate);
  --rule: var(--mist);

  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 64px);
  --max: 1440px;
  --header: 72px;
  --ease: cubic-bezier(.2, .7, .1, 1);

  color-scheme: light;
}

:root[lang="ar"] {
  --font: "Plex Arabic", "Manrope", ui-sans-serif, system-ui, sans-serif;
}

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

[lang="ar"] { font-family: "Plex Arabic", "Manrope", sans-serif; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--header);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "ss01" off;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
img, svg { display: block; }

:focus-visible {
  outline: 2px solid var(--oxide);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  inset-inline-start: var(--gutter);
  top: -100px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  text-decoration: none;
}
.skip:focus { top: 12px; }

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

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Wordmark: ink letters follow currentColor, the r accent stays oxide */
.wordmark { display: block; height: auto; color: currentColor; }
.wordmark .wm-oxide { fill: var(--oxide); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }
.site-header .wrap {
  height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: block; width: 116px; padding-block: 12px; color: var(--ink); }
.brand:focus-visible { outline-offset: 8px; }

.nav { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 36px); font-size: 15px; }
.nav a {
  text-decoration: none;
  padding-block: 6px;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  transition: background-size .35s var(--ease);
}
:root[dir="rtl"] .nav a { background-position: 100% 100%; }
.nav a:hover { background-size: 100% 1px; }
.nav .lang {
  font-family: "Plex Arabic", var(--font);
  padding-inline-start: clamp(16px, 2.4vw, 36px);
  border-inline-start: 1px solid var(--rule);
}
:root[lang="ar"] .nav .lang { font-family: "Manrope", sans-serif; }

@media (max-width: 640px) {
  .nav .hide-sm { display: none; }
  .nav a { padding-block: 12px; }
  .brand { width: 100px; }
}

/* Buttons */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 24px;
  background: var(--oxide);
  color: var(--white);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .25s var(--ease);
}
.btn:hover { background: #8E3320; }
.btn svg, .link svg { transition: transform .35s var(--ease); }
.btn:hover svg, .link:hover svg { transform: translateX(4px); }
:root[dir="rtl"] .btn svg, :root[dir="rtl"] .link svg { transform: scaleX(-1); }
:root[dir="rtl"] .btn:hover svg, :root[dir="rtl"] .link:hover svg { transform: scaleX(-1) translateX(4px); }

.link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  text-decoration-color: var(--rule);
  transition: text-decoration-color .25s var(--ease);
}
.link:hover { text-decoration-color: currentColor; }

/* Hero / the story.
   Without JS (or with reduced motion) this is a normal section showing the finished bridge.
   With JS, .story becomes a tall track and the stage pins while the segment turns. */
.story { position: relative; }
.story__stage {
  display: flex;
  align-items: center;
  padding-block: clamp(48px, 9vh, 120px);
}
.story__stage > .wrap { align-items: center; row-gap: 40px; }

.hero-copy { grid-column: 1 / span 6; }
.hero-title {
  font-size: clamp(64px, 11vw, 176px);
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.055em;
  margin-inline-start: -.04em;
}
:root[lang="ar"] .hero-title {
  font-size: clamp(56px, 9vw, 140px);
  line-height: 1.15;
  letter-spacing: 0;
  margin-inline-start: 0;
}
.hero-lede {
  max-width: 30ch;
  margin-block: clamp(24px, 4vh, 40px);
  font-size: clamp(19px, 1.7vw, 24px);
  line-height: 1.45;
  letter-spacing: -.01em;
}
:root[lang="ar"] .hero-lede { letter-spacing: 0; line-height: 1.7; }

.hero-track { grid-column: 8 / span 5; }
.mark { width: 100%; height: auto; overflow: visible; }
.mark .pier { fill: var(--ink); stroke: var(--ink); stroke-width: 6; stroke-linejoin: round; }
.mark .bar rect { fill: var(--oxide); stroke: var(--paper); stroke-width: 7; paint-order: stroke; }
.mark .arc { fill: none; stroke: var(--slate); stroke-width: 1.5; stroke-dasharray: 3 6; opacity: 0; }
.mark .ground { stroke: var(--rule); stroke-width: 1; }

.steps {
  position: relative;
  margin-top: 28px;
  padding-top: 16px;
  font-size: 14px;
  color: var(--muted);
}
.steps::before, .steps__fill {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  background: var(--rule);
}
.steps__fill { background: var(--oxide); height: 2px; top: -.5px; transform: scaleX(1); transform-origin: left center; }
:root[dir="rtl"] .steps__fill { transform-origin: right center; }
.steps ol { display: flex; justify-content: space-between; gap: 12px; }
.steps li { transition: color .3s var(--ease); }
.steps li.is-active { color: var(--ink); }

.captions { display: grid; margin-top: 20px; min-height: 5.4em; }
.captions p {
  grid-area: 1 / 1;
  max-width: 36ch;
  font-size: 17px;
  color: var(--muted);
}

/* Static fallback: show the last caption only, all steps active */
.captions p:not(:last-child) { display: none; }
.steps li { color: var(--ink); }

.js-story .story { height: 280vh; }
.js-story .story__stage {
  position: sticky;
  top: var(--header);
  height: calc(100vh - var(--header));
  height: calc(100svh - var(--header));
  padding-block: 0;
}
.js-story .captions p { display: block; opacity: 0; transform: translateY(8px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.js-story .captions p.is-active { opacity: 1; transform: none; }
.js-story .steps li { color: var(--muted); }
.js-story .steps li.is-active { color: var(--ink); }

/* Short laptop screens: keep the pinned hero inside the viewport */
@media (min-width: 901px) and (max-height: 760px) {
  .hero-title { font-size: min(11vw, 19vh); }
  .hero-lede { margin-block: 20px 28px; }
}

/* Phones and tablets: the copy scrolls normally and only the figure pins.
   The whole hero never fits a phone screen once Safari's bars are showing. */
@media (max-width: 900px) {
  .hero-copy, .hero-track { grid-column: 1 / -1; }
  .hero-figure { max-width: 460px; }
  .story__stage { padding-block: 40px 72px; }
  .story__stage > .wrap { row-gap: 48px; }

  .js-story .story { height: auto; }
  .js-story .story__stage { position: static; height: auto; padding-block: 40px 24px; }
  .js-story .hero-track { height: 200vh; }
  .js-story .hero-figure {
    position: sticky;
    top: calc(var(--header) + 24px);
    width: min(100%, 460px, 52vh);
  }
  .js-story .steps { margin-top: 20px; }
  .js-story .captions { margin-top: 14px; min-height: 6.4em; }
  .js-story .captions p { font-size: 16px; }
}

/* Sections */
.section { padding-block: clamp(88px, 14vw, 200px); }
.section--ink {
  --bg: var(--ink);
  --fg: var(--paper);
  --muted: rgba(245, 243, 236, .68);
  --rule: rgba(245, 243, 236, .16);
  background: var(--bg);
  color: var(--fg);
}
.section--white { background: var(--white); }

.statement {
  grid-column: 1 / span 10;
  font-size: clamp(32px, 4.6vw, 72px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.035em;
  text-wrap: balance;
}
:root[lang="ar"] .statement { letter-spacing: 0; line-height: 1.4; }
.statement em { font-style: normal; color: var(--muted); }

.h2 {
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.03em;
}
:root[lang="ar"] .h2 { letter-spacing: 0; line-height: 1.35; }

.lead { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.55; color: var(--muted); max-width: 40ch; }

/* What we're building: ruled rows, not cards */
.rows { grid-column: 1 / -1; margin-top: clamp(64px, 9vw, 128px); border-bottom: 1px solid var(--rule); }
.row {
  display: grid;
  grid-template-columns: 56px minmax(0, 5fr) minmax(0, 6fr);
  gap: 16px clamp(16px, 3vw, 48px);
  align-items: start;
  padding-block: clamp(28px, 3.5vw, 44px);
  border-top: 1px solid var(--rule);
}
.row h3 { font-size: clamp(21px, 2vw, 28px); font-weight: 500; line-height: 1.2; letter-spacing: -.02em; }
:root[lang="ar"] .row h3 { letter-spacing: 0; line-height: 1.5; }
.row p { color: var(--muted); max-width: 46ch; }
.icon { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; }
.row .icon { margin-top: 2px; }
@media (max-width: 720px) {
  .row { grid-template-columns: 40px minmax(0, 1fr); }
  .row p { grid-column: 2; }
  .row .icon { width: 28px; height: 28px; }
}

/* How we work */
.approach-head { grid-column: 1 / span 4; align-self: start; position: sticky; top: calc(var(--header) + 48px); }
.approach-head .lead { margin-top: 20px; }
.principles { grid-column: 6 / span 7; }
.principle {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 8px 24px;
  padding-block: 36px;
  border-top: 1px solid var(--rule);
}
.principle:first-child { border-top: 0; padding-top: 0; }
.principle .icon { color: var(--slate); width: 28px; height: 28px; margin-top: 4px; }
.principle h3 { font-size: clamp(24px, 2.4vw, 34px); font-weight: 500; line-height: 1.15; letter-spacing: -.025em; }
:root[lang="ar"] .principle h3 { letter-spacing: 0; line-height: 1.45; }
.principle p { grid-column: 2; color: var(--muted); max-width: 50ch; }
@media (max-width: 900px) {
  .approach-head { grid-column: 1 / -1; position: static; margin-bottom: 56px; }
  .principles { grid-column: 1 / -1; }
}

/* Company */
.company-copy { grid-column: 1 / span 5; }
.company-copy .lead { margin-top: 24px; }
.route-wrap { grid-column: 7 / span 6; }
.route-wrap h3 { font-size: 15px; font-weight: 500; color: var(--slate); margin-bottom: 28px; }
.route {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-top: 28px;
}
.route::before {
  content: "";
  position: absolute;
  top: 6px;
  inset-inline: 0;
  border-top: 1px dashed var(--slate);
  opacity: .55;
}
.route::after {
  content: "";
  position: absolute;
  top: 5px;
  inset-inline-start: 0;
  width: 33.33%;
  height: 3px;
  background: var(--oxide);
}
.route li { position: relative; }
.route li::before {
  content: "";
  position: absolute;
  top: -28px;
  inset-inline-start: 0;
  width: 13px;
  height: 13px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
}
.route li:first-child::before { background: var(--ink); }
.section--white .route li::before { background: var(--white); }
.section--white .route li:first-child::before { background: var(--ink); }
.route strong { display: block; font-size: clamp(20px, 1.9vw, 26px); font-weight: 500; letter-spacing: -.02em; line-height: 1.2; }
:root[lang="ar"] .route strong { letter-spacing: 0; line-height: 1.5; }
.route span { display: block; margin-top: 6px; font-size: 14px; color: var(--slate); }
.route-note { margin-top: 32px; color: var(--slate); max-width: 46ch; }

.now {
  grid-column: 1 / -1;
  margin-top: clamp(80px, 10vw, 140px);
  padding-top: 40px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 24px clamp(16px, 4vw, 64px);
}
.now p { font-size: clamp(19px, 1.7vw, 23px); line-height: 1.5; max-width: 44ch; }
.now .link { margin-top: 20px; }
@media (max-width: 900px) {
  .company-copy, .route-wrap { grid-column: 1 / -1; }
  .route-wrap { margin-top: 64px; }
  .now { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .route { grid-template-columns: 1fr; gap: 28px; padding-top: 0; padding-inline-start: 36px; }
  .route::before { top: 0; bottom: 0; inset-inline-start: 6px; inset-inline-end: auto; border-top: 0; border-inline-start: 1px dashed var(--slate); }
  .route::after { top: 0; inset-inline-start: 5px; width: 3px; height: 34%; }
  .route li::before { top: 6px; inset-inline-start: -36px; }
}

/* Contact: the closing beat */
.contact { padding-block: clamp(96px, 14vw, 200px) clamp(56px, 7vw, 96px); }
.contact .h-xl {
  grid-column: 1 / span 9;
  font-size: clamp(44px, 7.2vw, 116px);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.05em;
  text-wrap: balance;
}
:root[lang="ar"] .contact .h-xl { letter-spacing: 0; line-height: 1.3; font-size: clamp(40px, 6vw, 96px); }
.contact-mark { grid-column: 10 / span 3; align-self: end; }
.contact-mark .mark .pier { fill: var(--paper); stroke: var(--paper); }
.contact-mark .mark .bar rect { stroke: var(--ink); }
.contact-body {
  grid-column: 1 / -1;
  margin-top: clamp(48px, 6vw, 80px);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 32px clamp(16px, 4vw, 64px);
  align-items: end;
}
.contact-body .lead { max-width: 36ch; }
.email-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 24px; justify-content: flex-end; }
.email {
  font-size: clamp(26px, 3.6vw, 52px);
  font-weight: 500;
  letter-spacing: -.03em;
  text-decoration: none;
  background: linear-gradient(var(--oxide), var(--oxide)) no-repeat 0 100% / 100% 3px;
  padding-bottom: 6px;
  direction: ltr;
  font-family: "Manrope", sans-serif;
}
.email:hover { background-size: 100% 100%; color: var(--white); }
.email { transition: background-size .45s var(--ease), color .3s var(--ease); }
.copy {
  appearance: none;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  min-height: 40px;
  padding: 0 16px;
  cursor: pointer;
  transition: border-color .25s var(--ease);
}
.copy:hover { border-color: currentColor; }
@media (max-width: 900px) {
  .contact .h-xl { grid-column: 1 / -1; }
  .contact-mark { grid-column: 1 / span 6; max-width: 220px; margin-top: 48px; }
  .contact-body { grid-template-columns: 1fr; }
  .email-row { justify-content: flex-start; }
}

/* Footer */
.site-footer { background: var(--ink); color: var(--paper); padding-block: 0 40px; }
.site-footer .inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  padding-top: 40px;
  border-top: 1px solid rgba(245, 243, 236, .16);
  align-items: end;
}
.site-footer .wordmark { width: clamp(140px, 16vw, 220px); color: var(--paper); }
.site-footer .tagline { margin-top: 16px; color: rgba(245, 243, 236, .68); font-size: 15px; }
.site-footer .meta { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 14px; color: rgba(245, 243, 236, .68); justify-content: flex-end; }
.site-footer .meta a { text-decoration: none; }
.site-footer .meta a:hover { color: var(--paper); }
.site-footer .ar-name { font-family: "Plex Arabic", sans-serif; font-size: 18px; color: var(--paper); }
@media (max-width: 720px) {
  .site-footer .inner { grid-template-columns: 1fr; }
  .site-footer .meta { justify-content: flex-start; gap: 0 24px; }
  .site-footer .meta > * { padding-block: 12px; }
}

/* Reveal (only when JS is on and motion is allowed) */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.js-reveal [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
