/* RemoMix Productions website.
   Brand colours, type and spacing come from brand/remomix-tokens.css (--rm-*). Dark theme always.
   Layer order: 1 fonts · 2 design system · 3 base · 4 components · 5 sections · 6 responsive · 7 motion. */

/* =============================================================== 1. Fonts */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("../brand/fonts/IBMPlexSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("../brand/fonts/IBMPlexSans-Medium.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("../brand/fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-display: swap; src: url("../brand/fonts/IBMPlexSans-Bold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: swap; src: url("../brand/fonts/IBMPlexSansArabic-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 500; font-display: swap; src: url("../brand/fonts/IBMPlexSansArabic-Medium.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-display: swap; src: url("../brand/fonts/IBMPlexSansArabic-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-display: swap; src: url("../brand/fonts/IBMPlexSansArabic-Bold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("../brand/fonts/IBMPlexMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../brand/fonts/IBMPlexMono-Medium.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 300 700; font-display: swap; src: url("../brand/fonts/SpaceGrotesk-Variable.woff2") format("woff2"); }

/* ======================================================= 2. Design system */
:root {
  /* Surfaces: glass mixes Dark Surface into the Dark Navy page (text passes on both ends). */
  --bg: var(--rm-dark-navy);
  --glass: color-mix(in srgb, var(--rm-dark-surface) 46%, transparent);
  --glass-strong: color-mix(in srgb, var(--rm-dark-surface) 78%, transparent);
  /* Card glass: mostly clear, so space shows through blurred; a light sheen from the top corner. */
  --glass-card: linear-gradient(135deg,
      color-mix(in srgb, var(--rm-white) 11%, transparent) 0%,
      color-mix(in srgb, var(--rm-white) 4%, transparent) 38%,
      color-mix(in srgb, var(--rm-dark-surface) 30%, transparent) 100%);
  --glass-edge: color-mix(in srgb, var(--rm-white) 16%, transparent);
  --glass-shine: color-mix(in srgb, var(--rm-white) 22%, transparent);
  --line: color-mix(in srgb, var(--rm-white) 9%, transparent);
  --line-strong: color-mix(in srgb, var(--rm-white) 18%, transparent);

  /* Brand gradients: Bright Blue to Orange Light (both pass on Dark Navy), and a border line. */
  --grad-text: linear-gradient(100deg, var(--rm-bright-blue) 0%, var(--rm-blue-mist) 45%, var(--rm-orange-light) 100%);
  --grad-line: linear-gradient(130deg, var(--rm-bright-blue), var(--rm-royal-blue) 45%, var(--rm-orange));
  --glow: color-mix(in srgb, var(--rm-bright-blue) 40%, transparent);
  --glow-orange: color-mix(in srgb, var(--rm-orange) 45%, transparent);

  /* Type */
  --f-display: var(--rm-font-display);
  --f-body: var(--rm-font-sans);
  --f-mono: var(--rm-font-mono);
  --lh: 1;                        /* Arabic: x 1.15 */
  --fs-hero: clamp(3rem, 1.1rem + 5.6vw, 6.5rem);
  --fs-h2: clamp(2.25rem, 1.2rem + 3.6vw, 4.5rem);
  --fs-h3: clamp(1.5rem, 1.15rem + 1.1vw, 2.1rem);
  --fs-lead: clamp(1.1rem, 1rem + .45vw, 1.4rem);

  /* Space and shape */
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --section-pad: clamp(44px, 5vw, 80px);
  --radius: 20px;
  --radius-lg: 28px;
  --header-h: 84px;

  /* Motion */
  --ease: cubic-bezier(.2, .7, .1, 1);
  --slash-skew: -27.2deg;         /* 90 - 62.8: the RM slash angle */
}
[dir="rtl"] { --lh: 1.15; }

/* ================================================================ 3. Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--rm-text-primary);
  font-family: var(--f-body); font-size: 16px; line-height: calc(1.6 * var(--lh));
  overflow-x: hidden; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
[dir="rtl"] body { font-family: var(--rm-font-arabic); }
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: var(--rm-link); }
h1, h2, h3, p, blockquote, figure { margin: 0; }
h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: calc(1.04 * var(--lh)); letter-spacing: -0.035em; }
[dir="rtl"] h2, [dir="rtl"] h3 { font-family: var(--rm-font-arabic); letter-spacing: 0; font-weight: 700; }
[dir="rtl"] [lang="en"] { font-family: var(--f-display); }
button { font: inherit; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
::selection { background: var(--rm-bright-blue); color: var(--rm-dark-navy); }
:focus-visible { outline: 3px solid var(--rm-focus-ring); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .icon-dir { transform: scaleX(-1); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 24px; text-align: center; }

/* Gradient text for *starred* words in titles. */
.grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

.skip-link {
  position: fixed; inset-inline-start: 16px; top: -100px; z-index: 100;
  background: var(--rm-action-primary); color: var(--rm-action-primary-text);
  padding: 12px 18px; border-radius: 10px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* Film grain over everything (very low opacity, no effect on contrast). */
.grain {
  position: fixed; inset: -50%; z-index: 70; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* Soft glow that follows the mouse (desktop only, switched on by site.js). */
.cursor-glow {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; opacity: 0;
  width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--rm-bright-blue) 16%, transparent), transparent 62%);
  mix-blend-mode: screen; transition: opacity .4s;
}
.has-glow .cursor-glow { opacity: 1; }

.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 65; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--grad-line); transform: scaleX(0); transform-origin: left center; }
[dir="rtl"] .progress span { transform-origin: right center; }

/* Reveal targets stay hidden only while the motion script is in charge. */
.motion [data-reveal] { opacity: 0; }
.motion-ready .card[data-reveal], .motion-ready .cta-band[data-reveal] { opacity: var(--fo, 1); }
/* Cards flying in from the sides must not widen the page. */
main { overflow-x: clip; }
.motion .split .w > span { transform: translateY(110%); }
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.split .w > span { display: inline-block; will-change: transform; }

/* ========================================================== 4. Components */
/* Buttons */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .25s, color .25s, border-color .25s, box-shadow .35s;
}
.btn .icon { width: 19px; height: 19px; transition: transform .35s var(--ease); }
.btn:hover .icon-dir { transform: translateX(4px); }
[dir="rtl"] .btn:hover .icon-dir { transform: scaleX(-1) translateX(4px); }
.btn-sm { min-height: 44px; padding: 0 20px; font-size: 15px; }
/* The single orange action on the page ("Let's Talk"). Navy text on Orange: 4.99:1. */
.btn-accent { background: var(--rm-action-accent); color: var(--rm-action-accent-text); box-shadow: 0 10px 30px -12px var(--glow-orange); }
.btn-accent:hover { background: var(--rm-orange-light); }
.btn-primary { background: var(--rm-action-primary); color: var(--rm-action-primary-text); box-shadow: 0 10px 34px -12px var(--glow); }
.btn-primary:hover { background: var(--rm-action-primary-hover); }
.btn-glass { background: var(--glass); color: var(--rm-white); border-color: var(--line-strong); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.btn-glass:hover { border-color: var(--rm-slate); background: var(--glass-strong); }
.btn[disabled] { cursor: progress; }

/* Section heading */
.section { position: relative; padding-block: var(--section-pad); }
.section[hidden] { display: none; }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(24px, 3.2vw, 40px); max-width: 920px; }
.label {
  justify-self: start; display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--glass);
  font-family: var(--f-mono); font-size: 12.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; color: var(--rm-text-secondary);
}
[dir="rtl"] .label { font-family: var(--rm-font-arabic); letter-spacing: 0; font-size: 14px; padding: 7px 10px 7px 14px; }
.label .idx { font-family: var(--f-mono); color: var(--rm-text-primary); }
.label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rm-orange); box-shadow: 0 0 10px var(--rm-orange); }
.section h2 { font-size: var(--fs-h2); }
.section-text { color: var(--rm-text-secondary); font-size: var(--fs-lead); max-width: 640px; }

/* Glass card: lift, glowing gradient border and a spotlight that follows the mouse (--mx/--my). */
.card {
  --mx: 50%; --my: 50%;
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--glass-edge); background: var(--glass-card);
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--glass-shine), inset 1px 0 0 color-mix(in srgb, var(--rm-white) 6%, transparent), 0 24px 60px -34px rgba(0, 0, 0, .7);
  transition: transform .5s var(--ease), border-color .3s, box-shadow .5s var(--ease);
  /* --rx/--ry: 3D tilt toward the mouse; --lift: hover lift;
     --fx/--fz/--fry/--fo: the fly-in from outside on scroll (all set by site.js). */
  --rx: 0deg; --ry: 0deg; --lift: 0px; --fx: 0px; --fz: 0px; --fry: 0deg;
  transform: perspective(1200px) translate3d(var(--fx), 0, var(--fz)) rotateX(var(--rx)) rotateY(calc(var(--ry) + var(--fry))) translateY(var(--lift));
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--rm-bright-blue) 16%, transparent), transparent 60%);
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: var(--grad-line);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.card:hover, .card:focus-within { --lift: -6px; border-color: transparent; box-shadow: 0 30px 70px -30px var(--glow), inset 0 1px 0 var(--glass-shine); }
.card:hover::before, .card:hover::after, .card:focus-within::after { opacity: 1; }
.shift { transition: transform .5s var(--ease); }
.card:hover .shift { transform: translateX(6px); }
[dir="rtl"] .card:hover .shift { transform: translateX(-6px); }

/* Icon tile with a gradient border */
.icon-tile {
  position: relative; width: 60px; height: 60px; display: grid; place-items: center; flex: none;
  border-radius: 16px; background: color-mix(in srgb, var(--rm-deep-blue) 55%, transparent); color: var(--rm-white);
  transition: transform .5s var(--ease), box-shadow .5s;
}
.icon-tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: var(--grad-line);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.icon-tile .icon { width: 26px; height: 26px; }
.card:hover .icon-tile { transform: rotate(-8deg) scale(1.05); box-shadow: 0 0 30px -4px var(--glow); }

/* Tags and status badge */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 13px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--rm-text-secondary); background: color-mix(in srgb, var(--rm-dark-navy) 40%, transparent); }
.status { display: inline-flex; align-items: center; gap: 9px; padding: 6px 13px; border-radius: 999px; border: 1px solid currentColor; font-size: 13px; font-weight: 600; white-space: nowrap; }
.status .dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(3.2); opacity: 0; } }
.status-available { color: var(--rm-success); }
.status-development { color: var(--rm-link); }
.status-soon { color: var(--rm-warning); }

/* ============================================================ 5. Sections */
/* ---------- Navbar: transparent, turns into a glass pill on scroll */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 50; padding: 12px var(--gutter) 0; transition: transform .45s var(--ease); }
.site-header.hidden { transform: translateY(-120%); }
.nav-shell {
  max-width: var(--max); margin-inline: auto; display: flex; align-items: center; gap: 20px;
  min-height: 68px; padding: 6px 8px 6px 18px; border-radius: 999px; border: 1px solid transparent;
  transition: background-color .35s, border-color .35s, box-shadow .35s;
}
[dir="rtl"] .nav-shell { padding: 6px 18px 6px 8px; }
.site-header.scrolled .nav-shell {
  background: color-mix(in srgb, var(--rm-dark-navy) 72%, transparent); border-color: var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 20px 50px -24px rgba(0, 0, 0, .7);
}
/* Primary logo at its digital minimum: 200 px wide. */
.brand-link { flex: none; display: block; padding-block: 4px; }
.brand-link img { width: 200px; height: auto; }
.site-nav { margin-inline-start: auto; display: flex; gap: 2px; }
.site-nav a {
  color: var(--rm-white); text-decoration: none; font-weight: 500; font-size: 15px;
  padding: 10px 16px; border-radius: 999px; transition: background-color .25s, color .25s;
}
.site-nav a:hover { background: color-mix(in srgb, var(--rm-white) 8%, transparent); }
.site-nav a.active { background: color-mix(in srgb, var(--rm-white) 12%, transparent); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.lang-btn, .menu-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  background: transparent; color: var(--rm-white); cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 999px; font-weight: 500; transition: background-color .25s, border-color .25s;
}
.lang-btn:hover, .menu-btn:hover { border-color: var(--rm-slate); background: color-mix(in srgb, var(--rm-white) 8%, transparent); }
.lang-btn:lang(ar) { font-family: var(--rm-font-arabic); }
.lang-btn:lang(en) { font-family: var(--f-body); }
.menu-btn { display: none; width: 44px; padding: 0; }

/* ---------- Hero */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100svh; display: flex; align-items: flex-end;
  background: var(--rm-dark-navy); color: var(--rm-white);
  padding-block: calc(var(--header-h) + 56px) clamp(40px, 7vh, 80px);
}
.hero-media { position: absolute; inset: 0; z-index: -3; will-change: transform; }
.hero-media canvas, .hero-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Glowing orbs drifting over the video. */
.orbs { position: absolute; inset: 0; z-index: -2; pointer-events: none; mix-blend-mode: screen; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; }
.orb-1 { width: 46vw; height: 46vw; left: -12vw; top: 8%; background: var(--rm-deep-blue); animation: drift-a 18s ease-in-out infinite alternate; }
.orb-2 { width: 34vw; height: 34vw; right: -8vw; top: -10%; background: var(--rm-royal-blue); opacity: .4; animation: drift-b 22s ease-in-out infinite alternate; }
.orb-3 { width: 18vw; height: 18vw; right: 22%; bottom: 18%; background: var(--rm-orange); opacity: .22; animation: drift-a 16s ease-in-out infinite alternate-reverse; }
@keyframes drift-a { to { transform: translate3d(8vw, 6vh, 0) scale(1.15); } }
@keyframes drift-b { to { transform: translate3d(-10vw, 10vh, 0) scale(.9); } }
/* Scrim: solid Dark Navy behind the copy so contrast never depends on the video frame. */
.hero-scrim {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to top, var(--rm-dark-navy) 0%, color-mix(in srgb, var(--rm-dark-navy) 92%, transparent) 46%, transparent 84%),
    linear-gradient(to bottom, color-mix(in srgb, var(--rm-dark-navy) 75%, transparent) 0%, transparent 22%);
}
.hero-inner { position: relative; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 26px;
  padding: 8px 16px 8px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--glass);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-family: var(--f-mono); font-size: 13px; color: var(--rm-slate);
}
[dir="rtl"] .hero-pill { font-family: var(--rm-font-arabic); padding: 8px 12px 8px 16px; }
.hero-pill .dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--rm-orange); }
.hero-pill .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--rm-orange); animation: pulse 1.8s ease-out infinite; }
/* Tagline as the headline: IBM Plex Sans Medium, White / Slate, English in both languages (brand rule). */
.hero h1 {
  font-family: var(--f-body); font-weight: 500; font-size: var(--fs-hero);
  line-height: .98; letter-spacing: -0.045em; max-width: 14ch;
}
[dir="rtl"] .hero h1 { font-family: var(--f-body); text-align: right; margin-inline-start: auto; margin-inline-end: 0; }
.hero h1 .line { display: block; }
.hero h1 .line-2 { color: var(--rm-slate); }
.hero-lower {
  display: grid; grid-template-columns: minmax(0, 1.1fr) auto; gap: 28px 56px; align-items: end;
  margin-top: clamp(28px, 4vh, 44px);
}
.hero-lead { font-family: var(--f-display); font-size: var(--fs-lead); font-weight: 500; color: var(--rm-white); max-width: 560px; }
[dir="rtl"] .hero-lead { font-family: var(--rm-font-arabic); }
.hero-text { margin-top: 10px; color: var(--rm-slate); font-size: 17px; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats {
  margin-top: clamp(28px, 5vh, 52px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-radius: var(--radius); border: 1px solid var(--glass-edge); background: var(--glass-card);
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--glass-shine);
}
.hero-stat { padding: 20px 24px; display: flex; align-items: baseline; gap: 14px; }
.hero-stat + .hero-stat { border-inline-start: 1px solid var(--line); }
.hero-stat-value { font-family: var(--f-display); font-size: clamp(2rem, 1.4rem + 2vw, 3rem); font-weight: 600; line-height: 1; letter-spacing: -0.04em; }
.hero-stat-label { color: var(--rm-slate); font-size: 14px; line-height: 1.35; }

/* ---------- Ticker of tools and standards */
.ticker {
  position: relative; overflow: hidden; direction: ltr; border-block: 1px solid var(--line); background: color-mix(in srgb, var(--rm-dark-surface) 25%, var(--bg));
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.ticker[hidden] { display: none; }
.ticker-track { display: flex; width: max-content; animation: ticker 38s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
  display: inline-flex; align-items: center; gap: 36px; padding: 22px 36px 22px 0; white-space: nowrap;
  font-family: var(--f-mono); font-size: 14px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--rm-text-secondary);
}
.ticker-item::after { content: ""; width: 6px; height: 16px; background: var(--rm-orange); transform: skewX(var(--slash-skew)); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Services: three large cards */
.services-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.service { display: flex; flex-direction: column; gap: 18px; min-height: 340px; padding: clamp(20px, 2.4vw, 28px); }
.service-top { display: flex; align-items: center; justify-content: space-between; }
.service-num { font-family: var(--f-mono); font-size: 14px; color: var(--rm-text-secondary); }
.service-big {
  position: absolute; inset-inline-end: -10px; bottom: -30px; z-index: -1; pointer-events: none;
  font-family: var(--f-display); font-size: 11rem; font-weight: 700; line-height: 1; letter-spacing: -0.06em;
  color: transparent; -webkit-text-stroke: 1px var(--line-strong);
}
.service h3 { font-size: var(--fs-h3); margin-top: auto; }
.service p { color: var(--rm-text-secondary); }

/* ---------- Giant moving words */
.kinetic { direction: ltr; overflow: hidden; display: grid; gap: .04em; padding-block: clamp(16px, 3vw, 48px); font-family: var(--f-display); font-size: clamp(3.5rem, 1rem + 10vw, 12rem); font-weight: 600; line-height: 1.02; }
.kinetic[hidden] { display: none; }
.kinetic-row { display: flex; width: max-content; white-space: nowrap; will-change: transform; }
.kinetic-word { display: inline-flex; align-items: center; gap: .3em; padding-inline-end: .3em; letter-spacing: -0.05em; }
.kinetic-word:lang(ar) { letter-spacing: 0; font-family: var(--rm-font-arabic); font-weight: 700; }
.kinetic-word::after { content: ""; width: .1em; height: .72em; background: var(--rm-orange); transform: skewX(var(--slash-skew)); }
.r1 .kinetic-word { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.r2 .kinetic-word { color: transparent; -webkit-text-stroke: 1.5px var(--rm-text-secondary); }
.r2 .kinetic-word::after { background: var(--rm-royal-blue); }

/* ---------- Products: product tiles in a bento grid */
.products-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.products-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.products-grid.cols-1 { grid-template-columns: minmax(0, 1fr); }
.product { display: flex; flex-direction: column; gap: 12px; min-height: 260px; padding: 22px; }
.product-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.product-logo { display: flex; align-items: center; height: 64px; min-width: 0; transition: transform .5s var(--ease); }
.product-logo img { height: 100%; width: auto; max-width: min(200px, 100%); object-fit: contain; object-position: left center; }
[dir=rtl] .product-logo img { object-position: right center; }
.card:hover .product-logo { transform: scale(1.04); }
.product-mark {
  position: absolute; inset-inline-end: -40px; bottom: -40px; z-index: -1; pointer-events: none; color: var(--line);
  transition: transform .8s var(--ease), color .5s;
}
.product-mark .icon { width: 220px; height: 220px; stroke-width: 1; }
.card:hover .product-mark { transform: rotate(-12deg) scale(1.08); color: var(--line-strong); }
.product h3 { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.25rem); margin-top: auto; }
.product p { color: var(--rm-text-secondary); max-width: 46ch; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.product-code { font-family: var(--f-mono); font-size: 12.5px; color: var(--rm-text-secondary); letter-spacing: .06em; }
.product-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; }
.product-link .icon { width: 18px; height: 18px; }

/* ---------- Showcase: a product shown large with its real screenshots */
.showcase-list { display: grid; gap: 20px; margin-bottom: 20px; }
.showcase {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center;
  gap: clamp(20px, 3vw, 44px); padding: clamp(20px, 3vw, 40px); min-height: 460px;
}
.showcase:hover, .showcase:focus-within { --lift: -4px; }
.showcase:nth-child(even) .showcase-media { order: -1; }   /* alternate sides */
.showcase-copy { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.showcase .product-logo { height: 72px; }
.showcase h3 { font-size: clamp(2.2rem, 1.4rem + 2.4vw, 3.6rem); }
.showcase-text { color: var(--rm-text-secondary); font-size: var(--fs-lead); max-width: 48ch; }
.points { display: grid; gap: 12px; }
.points li { display: flex; align-items: flex-start; gap: 12px; }
.points .icon { width: 22px; height: 22px; margin-top: 2px; color: var(--rm-orange-light); }
.showcase-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; border-top: 1px solid var(--line); }
.showcase-media { position: relative; min-width: 0; }

/* Phone screenshots in a fan; they spread a little on hover. */
.phones { position: relative; height: clamp(340px, 34vw, 480px); transform-style: preserve-3d; }
.phone {
  position: absolute; top: 50%; left: 50%; height: 86%; width: auto; max-width: none; aspect-ratio: 941 / 1672; object-fit: cover;
  border-radius: 22px; border: 1px solid var(--line-strong); background: var(--rm-dark-navy);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .85), 0 0 60px -24px var(--glow);
  transition: transform .8s var(--ease);
}
.phone-c { height: 100%; z-index: 2; transform: translate(-50%, -50%); }
.phone-l { z-index: 1; transform: translate(-112%, -48%) translateZ(-70px) rotate(-7deg); }
.phone-r { z-index: 1; transform: translate(12%, -48%) translateZ(-70px) rotate(7deg); }
.showcase:hover .phone-c { transform: translate(-50%, -52%) scale(1.02); }
.showcase:hover .phone-l { transform: translate(-120%, -50%) translateZ(-40px) rotate(-10deg); }
.showcase:hover .phone-r { transform: translate(20%, -50%) translateZ(-40px) rotate(10deg); }

/* Browser window frame (products and work). */
.browser {
  position: relative; overflow: hidden; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--rm-dark-navy);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .85), 0 0 60px -24px var(--glow);
}
.browser-bar {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; direction: ltr;
  background: color-mix(in srgb, var(--rm-dark-surface) 70%, var(--rm-dark-navy)); border-bottom: 1px solid var(--line);
}
.browser-bar span { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--line-strong); }
.browser-bar em {
  margin-inline: auto; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 3px 14px; border-radius: 999px; background: color-mix(in srgb, var(--rm-dark-navy) 60%, transparent);
  font: 400 12px/1.4 var(--f-mono); color: var(--rm-text-secondary);
}
.browser > img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; }
.browsers { position: relative; transform-style: preserve-3d; }   /* the floating frame is placed inside this box, never over the text */
.browsers.has-float { padding-bottom: 16%; }
.browser-main { width: 100%; transition: transform .8s var(--ease); }
.has-float .browser-main { width: 88%; }
.browser-float { position: absolute; z-index: 2; right: 0; bottom: 0; width: 50%; transform: translateZ(60px); transition: transform .8s var(--ease); }
.browser-float > img { aspect-ratio: 4 / 3; }
[dir="rtl"] .browser-float { right: auto; left: 0; }
.showcase:hover .browser-main { transform: translateY(-6px); }
.showcase:hover .browser-float { transform: translateY(-14px) translateZ(60px); }

/* ---------- Work: portfolio grid */
.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.work-tile { display: flex; flex-direction: column; color: var(--rm-text-primary); text-decoration: none; }
.work-cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-bottom: 1px solid var(--line); }
/* Generated cover art: brand gradient field + the RM slash, varied per tile with --h. */
.work-art {
  position: absolute; inset: 0; transition: transform .9s var(--ease);
  background:
    radial-gradient(circle at calc(20% + var(--h, 0) * 12%) 30%, color-mix(in srgb, var(--rm-bright-blue) 55%, transparent), transparent 55%),
    radial-gradient(circle at 85% calc(80% - var(--h, 0) * 10%), color-mix(in srgb, var(--rm-orange) 35%, transparent), transparent 45%),
    linear-gradient(160deg, var(--rm-deep-blue), var(--rm-dark-navy));
}
.work-art::before, .work-art::after { content: ""; position: absolute; top: -20%; height: 140%; transform: skewX(var(--slash-skew)); }
.work-art::before { inset-inline-start: calc(50% + var(--h, 0) * 6%); width: 16%; background: color-mix(in srgb, var(--rm-royal-blue) 70%, transparent); }
.work-art::after { inset-inline-start: calc(72% + var(--h, 0) * 4%); width: 3%; background: var(--rm-orange); box-shadow: 0 0 30px var(--rm-orange); }
.work-tile:hover .work-art { transform: scale(1.06); }
.work-name-art {
  position: absolute; inset-inline-start: 24px; bottom: 18px; z-index: 1;
  font-family: var(--f-display); font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); font-weight: 600; letter-spacing: -0.03em; color: var(--rm-white);
}
.work-tag {
  position: absolute; top: 16px; inset-inline-start: 16px; z-index: 2; padding: 6px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--rm-white); background: color-mix(in srgb, var(--rm-dark-navy) 82%, transparent); border: 1px solid var(--line-strong);
}
.work-overlay {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; opacity: 0;
  background: color-mix(in srgb, var(--rm-dark-navy) 82%, transparent); transition: opacity .4s;
}
.work-overlay span { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; background: var(--rm-white); color: var(--rm-dark-navy); font-weight: 600; transform: translateY(12px); transition: transform .5s var(--ease); }
.work-tile:hover .work-overlay, .work-tile:focus-visible .work-overlay { opacity: 1; }
.work-tile:hover .work-overlay span, .work-tile:focus-visible .work-overlay span { transform: none; }
.work-body { padding: 20px 24px 24px; display: grid; gap: 6px; }
.work-body h3 { font-size: 22px; }
.work-body p { color: var(--rm-text-secondary); font-size: 15px; }
.work-tile.soon { border-style: dashed; border-color: var(--line-strong); }
.work-tile.soon .work-art { filter: saturate(.35) brightness(.7); }
.work-tile.soon .work-art::after { box-shadow: none; }

/* Case study: the first project, full width, in a browser frame. */
.case {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center;
  gap: clamp(20px, 3vw, 44px); padding: clamp(16px, 2.4vw, 28px);
}
.case:hover, .case:focus-within { --lift: -4px; }
.case-media { display: block; min-width: 0; text-decoration: none; }
.case .browser > img { aspect-ratio: auto; }   /* website screenshots keep their own shape, nothing cropped */
.case:hover .browser-main { transform: translateY(-6px); }
.case:hover .browser-float { transform: translateY(-14px) translateZ(60px); }
.case-art { position: relative; aspect-ratio: 16 / 10; overflow: hidden; display: grid; place-items: center; }
.case-logo { position: relative; z-index: 1; width: min(60%, 360px); height: auto; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .55)); transition: transform .8s var(--ease); }
.case:hover .work-art { transform: scale(1.06); }
.case:hover .case-logo { transform: scale(1.04); }
.case-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-width: 0; }
.case-type { padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--rm-white); background: color-mix(in srgb, var(--rm-dark-navy) 60%, transparent); border: 1px solid var(--line-strong); }
.case h3 { font-size: clamp(2.2rem, 1.4rem + 2.4vw, 3.6rem); }
.case-copy p { color: var(--rm-text-secondary); font-size: var(--fs-lead); }
.case-copy .btn { margin-top: 8px; }
.case + .work-grid { margin-top: 20px; }

/* ---------- Values: one compact strip (5 side by side; a list on smaller screens) */
.values-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 0; }
.values-strip:hover, .values-strip:focus-within { --lift: 0px; }   /* the panel stays put; each item reacts */
.value-item { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px 18px; }
.value-item + .value-item { border-inline-start: 1px solid var(--line); }
.value-num { position: absolute; top: 22px; inset-inline-end: 22px; font-family: var(--f-mono); font-size: 12.5px; color: var(--rm-text-secondary); }
.icon-tile.sm { width: 44px; height: 44px; border-radius: 12px; }
.icon-tile.sm .icon { width: 20px; height: 20px; }
.card.values-strip:hover .icon-tile { transform: none; box-shadow: none; }
.card.values-strip .value-item:hover .icon-tile { transform: rotate(-8deg) scale(1.05); box-shadow: 0 0 30px -4px var(--glow); }
.value-copy { display: grid; gap: 8px; }
.value-item h3 { font-size: 21px; }
.value-item p { color: var(--rm-text-secondary); font-size: 14.5px; line-height: calc(1.55 * var(--lh)); }

/* ---------- About: founder card + quote */
.about-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: clamp(24px, 4vw, 56px); align-items: stretch; }
.founder { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: clamp(20px, 2.4vw, 28px); }
.avatar {
  position: relative; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, var(--rm-royal-blue), var(--rm-deep-blue) 60%, var(--rm-dark-navy));
  box-shadow: 0 0 60px -10px var(--glow);
}
.avatar::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%; padding: 2px; background: var(--grad-line);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.avatar img { width: 62px; height: auto; }
.avatar.has-photo { width: 156px; height: 156px; }
.avatar.has-photo .avatar-photo { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.founder strong { display: block; font-family: var(--f-display); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.founder .role { color: var(--rm-text-secondary); }
.founder p { color: var(--rm-text-secondary); font-size: 16px; }
.quote { position: relative; display: flex; flex-direction: column; justify-content: center; padding: clamp(22px, 3vw, 40px); }
.quote-mark { font-family: var(--f-body); font-weight: 700; font-size: 120px; line-height: .6; height: 50px; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mission { font-family: var(--f-display); font-size: clamp(1.6rem, 1rem + 2.2vw, 2.9rem); font-weight: 500; line-height: calc(1.2 * var(--lh)); letter-spacing: -0.02em; margin-top: 24px; }
[dir="rtl"] .mission { font-family: var(--rm-font-arabic); letter-spacing: 0; }
.motion .mission .mw { color: var(--rm-text-secondary); }

/* ---------- Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.contact-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }

/* Gradient band. Text sits on the blue part (white passes there); the orange end holds only the white QR card. */
.cta-band {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(28px, 5vw, 80px);
  padding: clamp(24px, 4.5vw, 56px); border-radius: var(--radius-lg); color: var(--rm-white);
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--rm-bright-blue) 45%, transparent), transparent 55%),
    linear-gradient(115deg, var(--rm-deep-blue) 0%, var(--rm-royal-blue) 50%, var(--rm-orange) 105%);
  /* oklab keeps the blue-to-orange middle clean instead of grey (older browsers use the line above). */
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--rm-bright-blue) 45%, transparent), transparent 55%),
    linear-gradient(in oklab 115deg, var(--rm-deep-blue) 0%, var(--rm-royal-blue) 50%, var(--rm-orange) 105%);
  box-shadow: 0 50px 120px -50px var(--glow-orange);
  --rx: 0deg; --ry: 0deg; --fx: 0px; --fz: 0px; --fry: 0deg;
  transform: perspective(1400px) translate3d(var(--fx), 0, var(--fz)) rotateX(var(--rx)) rotateY(calc(var(--ry) + var(--fry)));
  transition: transform .6s var(--ease);
}
[dir="rtl"] .cta-band {
  background:
    radial-gradient(circle at 88% 0%, color-mix(in srgb, var(--rm-bright-blue) 45%, transparent), transparent 55%),
    linear-gradient(-115deg, var(--rm-deep-blue) 0%, var(--rm-royal-blue) 50%, var(--rm-orange) 105%);
  background:
    radial-gradient(circle at 88% 0%, color-mix(in srgb, var(--rm-bright-blue) 45%, transparent), transparent 55%),
    linear-gradient(in oklab -115deg, var(--rm-deep-blue) 0%, var(--rm-royal-blue) 50%, var(--rm-orange) 105%);
}
/* The RM slashes, large and faint. */
.cta-art { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.cta-art::before, .cta-art::after { content: ""; position: absolute; top: -30%; height: 160%; transform: skewX(var(--slash-skew)); }
.cta-art::before { inset-inline-end: 30%; width: 14%; background: color-mix(in srgb, var(--rm-white) 7%, transparent); }
.cta-art::after { inset-inline-end: 22%; width: 2.5%; background: color-mix(in srgb, var(--rm-white) 14%, transparent); }
.cta-band .section-head { margin-bottom: 0; }
.cta-band .label { color: var(--rm-white); border-color: color-mix(in srgb, var(--rm-white) 30%, transparent); background: color-mix(in srgb, var(--rm-dark-navy) 30%, transparent); }
.cta-band .label .idx { color: var(--rm-white); }
.cta-band .grad { background: linear-gradient(100deg, var(--rm-white), var(--rm-orange-tint)); -webkit-background-clip: text; background-clip: text; }
.cta-band .section-text { color: var(--rm-white); }
.btn-light { background: var(--rm-white); color: var(--rm-dark-navy); box-shadow: 0 14px 40px -14px rgba(0, 0, 0, .55); }
.btn-light:hover { background: var(--rm-blue-mist); }
.cta-qr {
  margin: 0; display: grid; justify-items: center; gap: 12px; padding: 18px 18px 16px; border-radius: 22px;
  background: var(--rm-white); color: var(--rm-dark-navy); transform: rotate(3deg);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .6); transition: transform .6s var(--ease);
}
[dir="rtl"] .cta-qr { transform: rotate(-3deg); }
.cta-band:hover .cta-qr { transform: rotate(0deg) scale(1.03); }
.cta-qr img { width: 168px; height: 168px; }
.cta-qr figcaption { max-width: 168px; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.35; }
.contact-form-card { margin-top: 20px; max-width: 760px; }
.form-card { padding: clamp(20px, 3vw, 32px); }
.form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 500; font-size: 15px; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 52px; padding: 12px 16px; font: inherit; color: var(--rm-text-primary);
  background: var(--rm-bg-page); border: 1px solid var(--rm-text-secondary); border-radius: 12px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--rm-text-primary); }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { outline-offset: 0; box-shadow: 0 0 0 6px color-mix(in srgb, var(--rm-orange-light) 18%, transparent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.honeypot { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { display: none; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: 12px; border: 1px solid currentColor; font-weight: 500; }
.form-status.show { display: flex; }
.form-status.ok { color: var(--rm-success); }
.form-status.err { color: var(--rm-error); }
.form-status.info { color: var(--rm-text-primary); }

/* ---------- Footer */
.site-footer { position: relative; border-top: 1px solid var(--line); padding-block: 52px 28px; overflow: hidden; }
.site-footer::before {
  content: ""; position: absolute; left: 50%; top: -260px; width: 900px; height: 420px; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rm-deep-blue) 60%, transparent), transparent);
}
.footer-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
.footer-brand img { width: 200px; height: auto; }
.footer-brand p { margin-top: 18px; color: var(--rm-text-secondary); max-width: 34ch; font-size: 15px; }
.footer-col h2 { font-family: var(--f-mono); font-size: 12.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--rm-text-secondary); margin-bottom: 18px; }
[dir="rtl"] .footer-col h2 { font-family: var(--rm-font-arabic); letter-spacing: 0; font-size: 14px; }
.footer-col ul { display: grid; gap: 10px; }
.footer-col a { color: var(--rm-text-primary); text-decoration: none; transition: color .2s; }
.footer-col a:hover { color: var(--rm-link); }
.social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.social a { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--rm-text-primary); transition: border-color .25s, background-color .25s, transform .3s var(--ease); }
.social a:hover { border-color: var(--rm-slate); background: color-mix(in srgb, var(--rm-white) 8%, transparent); transform: translateY(-3px); }
.social .icon { width: 19px; height: 19px; }
.footer-bottom { position: relative; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; color: var(--rm-text-secondary); font-size: 14px; }
.footer-built { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* Credit line: 24-32 px high, official file from 02_Logo/Credit. */
.credit { height: 26px; width: auto; }
.footer-copy { font-family: var(--f-mono); font-size: 13px; }
.to-top {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: var(--glass); border: 1px solid var(--line-strong); color: var(--rm-white); transition: transform .35s var(--ease), border-color .25s;
}
.to-top:hover { transform: translateY(-4px); border-color: var(--rm-slate); }

/* ========================================================== 6. Responsive */
@media (max-width: 1100px) {
  /* Values become a compact list: icon beside the text, lines between rows. */
  .values-strip { grid-template-columns: 1fr; }
  .value-item { flex-direction: row; align-items: flex-start; gap: 18px; padding: 20px 22px; }
  .value-item + .value-item { border-inline-start: 0; border-top: 1px solid var(--line); }
  .value-num { top: 20px; }
  .value-copy { padding-inline-end: 28px; }   /* room for the number in the corner */
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  :root { --header-h: 76px; }
  .menu-btn { display: inline-flex; }
  .nav-cta { display: none; }
  .header-actions { margin-inline-start: auto; }
  .site-nav {
    position: fixed; inset: 0; z-index: -1; margin: 0;
    flex-direction: column; justify-content: center; gap: 6px; padding: 110px var(--gutter) 48px;
    background: var(--bg); visibility: hidden; opacity: 0; transition: opacity .35s, visibility .35s;
  }
  .site-nav a { font-family: var(--f-display); font-size: clamp(2.2rem, 9vw, 3.2rem); font-weight: 600; padding: 6px 0; border-radius: 0; background: none !important; }
  [dir="rtl"] .site-nav a { font-family: var(--rm-font-arabic); }
  .site-nav .nav-mobile-cta { display: inline-flex; margin-top: 24px; align-self: flex-start; font-family: var(--f-body); font-size: 17px; padding: 0 26px; border-radius: 999px; background: var(--rm-action-accent) !important; color: var(--rm-action-accent-text); }
  .menu-open .site-nav { visibility: visible; opacity: 1; }
  /* backdrop-filter and transform would trap the fixed overlay inside the header. */
  .menu-open .site-header { transform: none; }
  .menu-open .nav-shell { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
  .menu-open { overflow: hidden; }

  .hero-lower { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .service { min-height: 260px; }
  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product { min-height: 240px; }
  .product:last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* Showcase and case study: one column, picture first. */
  .showcase, .case { grid-template-columns: 1fr; min-height: 0; }
  .showcase-media, .showcase:nth-child(even) .showcase-media, .case-media { order: -1; }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
}
@media (min-width: 961px) { .site-nav .nav-mobile-cta { display: none; } }
@media (max-width: 640px) {
  /* Logo stays at its 200 px minimum, so the bar gives up side padding instead. */
  .site-header { padding: 8px 8px 0; }
  .nav-shell, [dir="rtl"] .nav-shell { padding-inline: 10px 6px; gap: 8px; }
  .header-actions { gap: 6px; }
  .lang-btn { padding: 0 11px; }
  .menu-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-stats { grid-template-columns: 1fr; }
  .hero-stat { padding: 14px 18px; }
  .hero-stat + .hero-stat { border-inline-start: 0; border-top: 1px solid var(--line); }
  .products-grid, .products-grid.cols-2, .work-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .service-big { font-size: 8rem; }
}
/* Phones: the copy fills most of the screen, so the solid part of the scrim reaches higher. */
@media (max-width: 700px) {
  .hero-scrim {
    background:
      linear-gradient(to top, var(--rm-dark-navy) 0%, var(--rm-dark-navy) 52%, color-mix(in srgb, var(--rm-dark-navy) 90%, transparent) 70%, transparent 92%),
      linear-gradient(to bottom, color-mix(in srgb, var(--rm-dark-navy) 75%, transparent) 0%, transparent 16%);
  }
}

/* Phones: the band stacks, the QR hides (you tap the button instead), and the gradient stays blue behind the text. */
@media (max-width: 700px) {
  .cta-band, [dir="rtl"] .cta-band {
    grid-template-columns: 1fr;
    background:
      radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--rm-bright-blue) 40%, transparent), transparent 60%),
      linear-gradient(170deg, var(--rm-deep-blue) 0%, var(--rm-royal-blue) 60%, var(--rm-orange) 135%);
    background:
      radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--rm-bright-blue) 40%, transparent), transparent 60%),
      linear-gradient(in oklab 170deg, var(--rm-deep-blue) 0%, var(--rm-royal-blue) 60%, var(--rm-orange) 135%);
  }
  .cta-qr { display: none; }
  .cta-band .btn { width: 100%; }
}

/* ================================================================== 3D */
/* 3D world (assets/world3d.js): a fixed WebGL canvas behind the whole page, and a veil above it
   that darkens the world behind the text once you leave the opening (--veil goes 0 -> 1). */
.world-gl { position: fixed; inset: 0; z-index: -2; display: block; width: 100%; height: 100%; }
.world-veil {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--veil, 0);
  background: radial-gradient(ellipse 62% 78% at 50% 50%, color-mix(in srgb, var(--rm-dark-navy) 72%, transparent), color-mix(in srgb, var(--rm-dark-navy) 22%, transparent));
}
.world-3d .hero { background: transparent; }
.world-3d #hero-media { display: none; }
.world-3d .orbs { opacity: .35; }
.world-3d .ticker { background: color-mix(in srgb, var(--rm-dark-navy) 55%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
/* Phones: the top of the hero stays open for the RM mark; the copy below keeps a solid backing. */
@media (max-width: 700px) {
  .world-3d .hero-scrim {
    background:
      linear-gradient(to top, var(--rm-dark-navy) 0%, var(--rm-dark-navy) 50%, color-mix(in srgb, var(--rm-dark-navy) 82%, transparent) 66%, transparent 86%),
      linear-gradient(to bottom, color-mix(in srgb, var(--rm-dark-navy) 55%, transparent) 0%, transparent 14%);
  }
}
/* Over the opening the scrim darkens behind the copy only, so the RM mark on the other side stays bright. Phones keep the full scrim. */
@media (min-width: 701px) {
  .world-3d .hero-scrim {
    background:
      linear-gradient(to top, var(--rm-dark-navy) 0%, color-mix(in srgb, var(--rm-dark-navy) 55%, transparent) 22%, transparent 50%),
      linear-gradient(to right, color-mix(in srgb, var(--rm-dark-navy) 85%, transparent) 0%, color-mix(in srgb, var(--rm-dark-navy) 55%, transparent) 42%, transparent 70%),
      linear-gradient(to bottom, color-mix(in srgb, var(--rm-dark-navy) 75%, transparent) 0%, transparent 22%);
  }
  .world-3d[dir="rtl"] .hero-scrim {
    background:
      linear-gradient(to top, var(--rm-dark-navy) 0%, color-mix(in srgb, var(--rm-dark-navy) 55%, transparent) 22%, transparent 50%),
      linear-gradient(to left, color-mix(in srgb, var(--rm-dark-navy) 85%, transparent) 0%, color-mix(in srgb, var(--rm-dark-navy) 55%, transparent) 42%, transparent 70%),
      linear-gradient(to bottom, color-mix(in srgb, var(--rm-dark-navy) 75%, transparent) 0%, transparent 22%);
  }
}
/* Headline words flip up from their baseline. */
.split .w { perspective: 700px; }
.split .w > span { transform-origin: 50% 100%; backface-visibility: hidden; }
.kinetic { transform-origin: 50% 50%; }

/* ============================================================== 7. Motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .card, .card:hover, .card:focus-within, .cta-band { transform: none; }
}
