/* MGA Studio v5: the main site, with v1's interactive iPhone in the hero. On wide screens the
   phone travels down with the visitor and docks beside the content as a companion; the page's
   own sections are presented as a scroll story (colour per section, a huge backdrop word,
   a progress rail, and content tied to scroll). */

@property --u { syntax: '<length>'; inherits: true; initial-value: 3.4px; }
@property --vh { syntax: '<length>'; inherits: true; initial-value: 8px; }
/* Section palette: registered so the whole page can glide from one section's colours to the next */
@property --sbg { syntax: '<color>'; inherits: true; initial-value: #15171C; }
@property --sfg { syntax: '<color>'; inherits: true; initial-value: #F1EADF; }
@property --sfg2 { syntax: '<color>'; inherits: true; initial-value: #B9B4AC; }
@property --sacc { syntax: '<color>'; inherits: true; initial-value: #E9876F; }
@property --scard { syntax: '<color>'; inherits: true; initial-value: #1F2228; }
@property --sline { syntax: '<color>'; inherits: true; initial-value: #34363B; }
@property --sword { syntax: '<color>'; inherits: true; initial-value: #1E2025; }
@property --sglow { syntax: '<color>'; inherits: true; initial-value: rgba(210, 85, 58, .4); }

/* ---------- Brand tokens ---------- */
:root {
  --ink: #15171C;
  --sand: #F1EADF;
  --paper: #FAF7F1;
  --clay: #D2553A;
  --clay-deep: #B24228;
  --olive: #0E3A31;
  --olive-2: #15493E;
  --sage: #7E8B6A;
  --radius: 22px;
  --wrap: 1180px;
  --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.2, .9, .25, 1);

  /* Geometry. --room is the column kept free for the docked phone; app.js keeps it exact. */
  --nav-h: 68px;
  --ph: clamp(520px, calc(100vh - var(--nav-h) - 72px), 800px);
  --pw: calc(var(--ph) / 2.08);
  --bz: calc(var(--pw) * .034);
  --dgap: clamp(28px, 3vw, 56px);
  --room: 0px;
  --rail-space: 0px;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.0451, 0.1531, 0.2916, 0.4376, 0.576, 0.6982, 0.7999, 0.8803, 0.9407, 0.9835, 1.0117, 1.0283, 1.0364, 1.0384, 1.0364, 1.0322, 1.0268, 1.0212, 1.0159, 1.0113, 1.0074, 1.0044, 1.0021, 1.0005, 0.9995, 0.9989, 0.9986, 0.9985, 0.9986, 0.9988, 0.999, 0.9992, 0.9994, 0.9996, 0.9997, 0.9998, 0.9999, 1);
  }
}

/* Theme tokens (main site), used by the detail sheet; sections take their colours from the palette above */
:root {
  --bg: var(--sand);
  --surface: var(--paper);
  --text: var(--ink);
  --text-2: #4a4d55;
  --text-3: #3b3e46;
  --line: rgba(21, 23, 28, .12);
  --phone-frame: var(--ink);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0F1114;
  --surface: #181B20;
  --text: #F1EADF;
  --text-2: rgba(241, 234, 223, .7);
  --text-3: rgba(241, 234, 223, .82);
  --line: rgba(241, 234, 223, .12);
  --phone-frame: #2A2D34;
  color-scheme: dark;
}
[data-theme="dark"] .only-light, :root:not([data-theme="dark"]) .only-dark { display: none !important; }

/* The palette glides between sections */
:root {
  transition: --sbg .8s var(--ease-out), --sfg .55s var(--ease-out), --sfg2 .55s var(--ease-out), --sacc .55s var(--ease-out),
    --scard .8s var(--ease-out), --sline .8s var(--ease-out), --sword .9s var(--ease-out), --sglow .9s var(--ease-out);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--sbg);
  color: var(--sfg);
  line-height: 1.75;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p, figure, dl, dd { margin: 0; }
[hidden] { display: none !important; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { unicode-bidi: isolate; direction: ltr; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: fixed; inset-inline-start: 16px; top: 12px; z-index: 60;
  padding: .5em 1em; border-radius: 999px; background: var(--ink); color: var(--paper);
  translate: 0 -200%; transition: translate .3s var(--ease-out);
}
.skip:focus-visible { translate: 0 0; }

.eyebrow { font-size: 14px; font-weight: 500; color: var(--sacc); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ''; width: 18px; height: 2px; background: currentColor; border-radius: 2px; flex: none; }
.h2 { font-size: clamp(30px, 3.6vw, 46px); font-weight: 700; text-wrap: balance; }
html[lang="en"] .h2 { letter-spacing: -.01em; }
.lead { font-size: 18px; color: var(--sfg2); max-width: 640px; margin-top: 14px; }

/* The single logo, in its dark and reversed variants; the active palette picks one */
.logo-dual { display: grid; }
.logo-dual svg { grid-area: 1 / 1; width: 100%; height: auto; transition: opacity .5s; overflow: visible; }
.logo-dual .rev, .pal-dark .logo-dual .std { opacity: 0; }
.pal-dark .logo-dual .rev { opacity: 1; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 26px; border-radius: 999px; font-weight: 500; font-size: 16px; transition: transform .2s, background .2s, border-color .2s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-lg { height: 58px; padding: 0 38px; font-size: 18px; }
.btn-clay { background: #C04A30; color: #fff; }
.btn-clay:hover { background: #A93F27; }
.btn-ghost { border: 1.5px solid color-mix(in srgb, var(--sfg) 22%, transparent); color: var(--sfg); }
.btn-ghost:hover { border-color: var(--sfg); }

/* ---------- Backdrop: one huge word per section ---------- */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bdw {
  position: absolute; top: calc(50% + var(--nav-h) / 2);
  inset-inline-start: var(--rail-space); inset-inline-end: var(--room);
  text-align: center; white-space: nowrap; font-weight: 700; line-height: 1.2;
  color: var(--sword); opacity: 0;
  translate: 0 calc(-50% + var(--drift, 0px)); scale: .94;
  transition: opacity .8s var(--ease-out), scale 1.2s var(--spring);
}
.bdw.on { opacity: 1; scale: 1; }
.bdw.latin { direction: ltr; letter-spacing: -.035em; }

/* ---------- Nav (takes the palette of the section underneath) ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 40; height: var(--nav-h);
  background: color-mix(in srgb, var(--sbg) 84%, transparent);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  color: var(--sfg);
  border-bottom: 1px solid color-mix(in srgb, var(--sfg) 10%, transparent);
}
.nav-inner { max-width: 1320px; margin: 0 auto; height: 100%; display: flex; align-items: center; gap: 28px; padding: 0 24px; }
.nav-brand { display: flex; align-items: center; gap: 10px; flex: none; }
.nav-logo { width: 32px; }
.nav-name { font-weight: 700; font-size: 18px; direction: ltr; white-space: nowrap; }
.nav-name span { font-weight: 500; opacity: .62; }
.nav-links { display: flex; gap: 4px; font-size: 15px; }
.nav-links a { padding: .3em .85em; border-radius: 999px; opacity: .74; transition: opacity .2s, background-color .2s; white-space: nowrap; }
.nav-links a:hover, .nav-links a[aria-current="true"] { opacity: 1; background: color-mix(in srgb, var(--sfg) 9%, transparent); }
.nav-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.nav-btn { height: 40px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--sfg) 20%, transparent); color: inherit; transition: border-color .2s; }
.nav-btn:hover { border-color: currentColor; }
.lang { font: 500 14px var(--font); padding: 0 16px; }
.theme-toggle { width: 40px; display: inline-grid; place-items: center; }
.theme-toggle svg { width: 18px; height: 18px; }
.railbar { display: none; }

/* ---------- Rail: section progress and jump links (wide screens) ---------- */
.rail {
  position: fixed; z-index: 35; inset-inline-start: 22px; top: calc(50% + var(--nav-h) / 2); translate: 0 -50%;
  display: none; flex-direction: column; gap: 8px; color: var(--sfg);
  opacity: 0; pointer-events: none; transition: opacity .5s var(--ease-out);
}
.rail.show { opacity: 1; pointer-events: auto; }
.rail-i { position: relative; display: flex; align-items: center; height: 44px; width: 18px; justify-content: center; border-radius: 6px; }
.rail-bar { position: relative; width: 2px; height: 100%; border-radius: 2px; overflow: hidden; background: color-mix(in srgb, var(--sfg) 20%, transparent); transition: width .4s var(--spring); }
.rail-bar i { position: absolute; inset: 0; border-radius: inherit; background: var(--sacc); transform-origin: 50% 0; scale: 1 var(--p, 0); }
.rail-i.done .rail-bar i { scale: 1 1; background: color-mix(in srgb, var(--sfg) 55%, transparent); }
.rail-i.on .rail-bar { width: 3px; }
.rail-l {
  position: absolute; inset-inline-start: calc(100% + 6px); top: 50%; translate: 0 -50%;
  white-space: nowrap; padding: .15em .75em; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--sfg); color: var(--sbg); opacity: 0; pointer-events: none;
  transition: opacity .25s, scale .35s var(--spring); scale: .9; transform-origin: center;
}
.rail-i:hover .rail-l, .rail-i:focus-visible .rail-l { opacity: 1; scale: 1; }

/* ---------- The phone (one device; companion on wide screens, in the hero on narrow ones) ---------- */
.companion { position: fixed; top: 0; left: 0; z-index: 30; transform-origin: 0 0; opacity: 0; transition: opacity .4s; }
.companion.ready { opacity: 1; }
.companion.moving { will-change: transform; }
.device {
  --r: calc(var(--pw) * .165);
  position: relative; width: var(--pw); height: var(--ph); border-radius: var(--r);
  background: #0c0d10;
  box-shadow: 0 0 0 1.5px #3b3d43, 0 0 0 3px #1a1b1f, inset 0 0 0 1px rgba(255, 255, 255, .06),
    0 60px 110px -50px var(--sglow), 0 30px 50px -30px rgba(0, 0, 0, .5);
}
.device.bump { animation: bump .6s var(--spring); }

/* Enlarge button on the phone's corner, and the focus overlay it opens */
.expand-btn { position: absolute; top: calc(var(--pw) * .02); inset-inline-end: calc(var(--pw) * -.13); z-index: 5; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  color: var(--sfg); background: color-mix(in srgb, var(--sbg) 70%, transparent); border: 1px solid color-mix(in srgb, var(--sfg) 22%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: transform .3s var(--spring), background .2s; }
.expand-btn:hover { transform: scale(1.08); background: color-mix(in srgb, var(--sbg) 90%, transparent); }
.expand-btn:focus-visible { outline: 2px solid var(--sacc); outline-offset: 2px; }
.expand-btn svg { width: 16px; height: 16px; }
.expand-btn .ex-close, .focus .expand-btn .ex-open { display: none; }
.focus .expand-btn .ex-close { display: block; }
.focus .expand-btn { color: #fff; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .28); inset-inline-end: calc(var(--pw) * -.16); }
.focus { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; }
.focus[hidden] { display: none; }
.focus-scrim { position: absolute; inset: 0; background: rgba(10, 11, 14, .5); backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1); opacity: 0; transition: opacity .45s var(--ease-out); cursor: zoom-out; }
.focus.on .focus-scrim { opacity: 1; }
.focus-holder { position: relative; transform: scale(var(--fs, 1)); }
.focus-lock, .focus-lock body { overflow: hidden !important; }
.focus-lock main { overflow: hidden !important; }
/* On narrow screens the phone already spans the width, so there is nothing to enlarge */
@media (max-width: 900px) { .expand-btn { display: none; } }
@media print { .expand-btn, .focus { display: none !important; } }
@keyframes bump { 40% { transform: scale(1.025); } }
.hw { position: absolute; width: 3px; background: #2a2c31; border-radius: 2px; }
.hw-action { inset-inline-start: -4.5px; top: 17%; height: 4.5%; }
.hw-up { inset-inline-start: -4.5px; top: 25%; height: 8%; }
.hw-down { inset-inline-start: -4.5px; top: 35%; height: 8%; }
.hw-power { inset-inline-end: -4.5px; top: 28%; height: 12%; }
.screen {
  position: absolute; inset: var(--bz); border-radius: calc(var(--r) - var(--bz));
  overflow: hidden; background: var(--olive); container-type: size; isolation: isolate; transform: translateZ(0);
}

/* ---------- OS, sized in --u = 1% of the screen width (from v1) ---------- */
.os {
  --u: 1cqw; --vh: 1cqh;
  --icon: min(calc(var(--u) * 16), calc(var(--vh) * 8.4));
  --pad: calc(var(--u) * 7); --top: calc(var(--u) * 14); --rows: 6;
  position: absolute; inset: 0; color: #fff; font-size: calc(var(--u) * 3.8); line-height: 1.5;
  overflow: hidden; user-select: none; -webkit-user-select: none; font-family: var(--font);
}
.os ::selection { background: rgba(210, 85, 58, .35); }
.wall { position: absolute; inset: 0; overflow: hidden; background: var(--olive); }
.wall svg { position: absolute; inset: -4% -6%; width: 112%; height: 108%; max-width: none; transform: translateX(calc(var(--pg, 0) * var(--pgdir, -1) * 2.2%)); transition: transform .9s var(--ease); }
.wl { transform: translate(calc(var(--px, 0) * var(--d) * 1px), calc(var(--py, 0) * var(--d) * .6px)); transition: transform .5s ease-out; }
.statusbar { position: absolute; top: 0; inset-inline: 0; height: var(--top); z-index: 55; display: flex; align-items: center; justify-content: space-between; padding: calc(var(--u) * 1) calc(var(--u) * 8.4) 0; pointer-events: none; direction: ltr; transition: color .3s; }
.os[data-tone="dark"] .statusbar { color: var(--ink); }
.sb-time { font-weight: 700; font-size: calc(var(--u) * 4.2); min-width: calc(var(--u) * 15); text-align: center; font-family: system-ui, -apple-system, sans-serif; }
.sb-icons { display: flex; align-items: center; gap: calc(var(--u) * 1.4); }
.sb-icons svg { fill: currentColor; height: calc(var(--u) * 3); width: auto; }
.sb-battery { height: calc(var(--u) * 3.1) !important; }
.island {
  position: absolute; z-index: 60; top: calc(var(--u) * 2.8); left: 50%; translate: -50% 0;
  width: calc(var(--u) * 31); height: calc(var(--u) * 9.2); background: #000; border-radius: 99px;
  display: grid; place-items: center; overflow: hidden; pointer-events: none;
  transition: width .5s var(--ease), height .5s var(--ease);
}
.island-msg { opacity: 0; font-size: calc(var(--u) * 3.2); font-weight: 500; color: #fff; white-space: nowrap; display: flex; align-items: center; gap: calc(var(--u) * 1.6); transition: opacity .2s; }
.island-msg svg { width: calc(var(--u) * 4); height: calc(var(--u) * 4); color: #34C759; }
.island.wide { width: calc(var(--u) * 58); height: calc(var(--u) * 11); }
.island.wide .island-msg { opacity: 1; transition-delay: .18s; }

.home { position: absolute; inset: 0; padding-top: var(--top); display: flex; flex-direction: column; transform-origin: 50% 40%; }
.pager { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; touch-action: pan-x pan-y; }
.pager::-webkit-scrollbar { display: none; }
.pager.dragging { scroll-snap-type: none; cursor: grabbing; }
.hp { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; display: grid; grid-template-columns: repeat(4, var(--icon)); grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); justify-content: space-between; padding: calc(var(--u) * 3) var(--pad) calc(var(--u) * 1); }
.ic { position: relative; display: flex; flex-direction: column; align-items: center; align-self: start; width: var(--icon); justify-self: center; border-radius: calc(var(--icon) * .23); touch-action: pan-x pan-y; }
.ic:focus-visible { outline: none; }
.ic-img { width: var(--icon); height: var(--icon); border-radius: calc(var(--icon) * .2237); overflow: hidden; position: relative; display: grid; place-items: center; background: var(--c, #222); box-shadow: 0 calc(var(--u) * .6) calc(var(--u) * 2) rgba(0, 0, 0, .22); transition: transform .25s var(--ease), filter .2s; flex: none; }
.ic-img img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; pointer-events: none; }
.ic-img.contain { background: #fff; }
.ic-img.contain img { width: 66%; height: 66%; object-fit: contain; }
.ic-img.mono-ic { color: var(--sand); font-weight: 700; font-size: calc(var(--icon) * .56); line-height: 1; padding-bottom: 8%; }
.ic-img.mono-ic::after { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255, 255, 255, .16), transparent 55%); }
.ic-img.folder { background: rgba(255, 255, 255, .26); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--icon) * .1); padding: calc(var(--icon) * .17); }
.ic-img.folder img { border-radius: 24%; aspect-ratio: 1; height: auto; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.ic:hover .ic-img { filter: brightness(1.06); }
.ic:active .ic-img { transform: scale(.92); filter: brightness(.88); }
.ic:focus-visible .ic-img, .wg:focus-visible .wbox, .wrow:focus-visible { box-shadow: 0 0 0 calc(var(--u) * .7) var(--olive), 0 0 0 calc(var(--u) * 1.5) var(--sand); }
.ic-label { margin-top: calc(var(--u) * 1.3); width: calc(var(--icon) + var(--u) * 6); font-size: calc(var(--u) * 2.95); font-weight: 500; line-height: 1.3; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.hbadge { position: absolute; top: calc(var(--u) * -1.3); inset-inline-end: calc(var(--u) * -1.3); min-width: calc(var(--u) * 5.6); height: calc(var(--u) * 5.6); padding-inline: calc(var(--u) * 1.4); border-radius: 99px; background: var(--clay); color: #fff; font: 500 calc(var(--u) * 3.1)/calc(var(--u) * 5.6) var(--mono); text-align: center; z-index: 2; }
/* Gentle hint from the page: a soft ring around one dock icon */
.ic.pulse .ic-img::before { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(241, 234, 223, .75); animation: pulse 1.8s var(--ease-out) 3; z-index: 2; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(241, 234, 223, .7); } 100% { box-shadow: 0 0 0 calc(var(--u) * 4) rgba(241, 234, 223, 0); } }

/* Widgets */
.wg { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; align-items: stretch; min-height: 0; height: 100%; text-align: start; touch-action: pan-x pan-y; }
.wg.wide { grid-column: 1 / -1; }
.wg:focus-visible { outline: none; }
.wbox { flex: 0 1 auto; min-height: 0; aspect-ratio: 1; border-radius: calc(var(--u) * 5.6); padding: calc(var(--u) * 3.8); position: relative; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 calc(var(--u) * 1) calc(var(--u) * 4) rgba(0, 0, 0, .25); transition: transform .25s var(--ease); }
.wg.wide .wbox { aspect-ratio: 2.13; }
.wg:active .wbox { transform: scale(.97); }
.wg > .ic-label { width: 100%; flex: none; margin-bottom: calc(var(--u) * 3.4); }
.glass { background: rgba(21, 23, 28, .42); backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .18), 0 calc(var(--u) * 1) calc(var(--u) * 4) rgba(0, 0, 0, .2) !important; }
.w-studio { background: var(--sand); color: var(--ink); flex-direction: row !important; align-items: center; gap: calc(var(--u) * 4.6); }
.w-studio svg { height: 82%; width: auto; flex: none; }
.w-studio .w-tag { display: block; font-weight: 700; font-size: calc(var(--u) * 5); line-height: 1.25; margin: 0 0 calc(var(--u) * 1.6); }
.w-studio .w-plat { font-family: var(--mono); font-size: calc(var(--u) * 2.5); color: rgba(21, 23, 28, .66); letter-spacing: .04em; }
.w-title { font-size: calc(var(--u) * 3.1); font-weight: 500; opacity: .8; margin: 0; line-height: 1.3; }
.w-big { font-family: var(--mono); font-weight: 500; font-size: calc(var(--u) * 11); line-height: 1; letter-spacing: -.04em; margin-top: auto; direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .w-big { text-align: right; }
.w-cap { font-size: calc(var(--u) * 2.9); line-height: 1.35; margin: calc(var(--u) * 1.4) 0 0; font-weight: 500; }
.w-tabib { background: #0273FD; color: #fff; }
.w-tabib .w-logo { width: calc(var(--u) * 9); height: calc(var(--u) * 9); }
.w-tabib .w-big { font-size: calc(var(--u) * 9.5); }
.w-tabib .w-sw { display: flex; gap: calc(var(--u) * .8); margin-top: calc(var(--u) * 1.6); }
.w-tabib .w-sw i { width: calc(var(--u) * 3.2); height: calc(var(--u) * 3.2); border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .45); }
.w-roles.glass { background: rgba(14, 22, 20, .78); }
.w-roles { padding: calc(var(--u) * 3.6) calc(var(--u) * 4.2); }
.w-roles .w-head { display: flex; justify-content: space-between; align-items: baseline; }
.w-roles .w-total { font-family: var(--mono); font-size: calc(var(--u) * 3.2); opacity: .75; }
.rbar { display: flex; height: calc(var(--u) * 2.6); border-radius: 99px; overflow: hidden; gap: calc(var(--u) * .6); margin: calc(var(--u) * 2.4) 0 calc(var(--u) * 1.8); }
.rbar i { display: block; border-radius: 99px; }
.wrows { display: grid; gap: calc(var(--u) * .4); margin-top: auto; }
.wrow { display: flex; align-items: center; gap: calc(var(--u) * 2); font-size: calc(var(--u) * 3.2); border-radius: calc(var(--u) * 2); padding: calc(var(--u) * .5) calc(var(--u) * 1.2); margin-inline: calc(var(--u) * -1.2); text-align: start; }
.wrow:hover { background: rgba(255, 255, 255, .08); }
.wrow:focus-visible { outline: none; }
.wrow b { font-weight: 500; flex: 1; }
.rdot { width: calc(var(--u) * 2.4); height: calc(var(--u) * 2.4); border-radius: 50%; flex: none; }
.r-scratch { background: var(--clay); }
.r-improved { background: var(--sage); }
.r-design { background: #6FA8FF; }

/* Search pill on top, page dots underneath, like the iOS home screen */
.pagebar { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: calc(var(--u) * 1.4); padding: calc(var(--u) * 1.2) 0 calc(var(--u) * 2); }
.search-pill, .hdots { height: calc(var(--u) * 7.4); border-radius: 99px; background: rgba(255, 255, 255, .17); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .2); }
.search-pill { display: flex; align-items: center; gap: calc(var(--u) * 1.4); padding-inline: calc(var(--u) * 3.6); font-size: calc(var(--u) * 3.3); font-weight: 500; transition: background .2s; }
.search-pill:hover { background: rgba(255, 255, 255, .26); }
.search-pill svg { width: calc(var(--u) * 3.6); height: calc(var(--u) * 3.6); }
.hdots { display: flex; align-items: center; padding-inline: calc(var(--u) * 1.6); }
.pagebar .hdots { height: calc(var(--u) * 3.6); background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.hdots button { width: calc(var(--u) * 4.6); height: 100%; display: grid; place-items: center; }
.hdots button::before { content: ''; width: calc(var(--u) * 1.8); height: calc(var(--u) * 1.8); border-radius: 50%; background: rgba(255, 255, 255, .42); transition: background .25s; }
.hdots button[aria-current="true"]::before { background: #fff; }
.search-pill:focus-visible, .hdots button:focus-visible { outline: 2px solid var(--sand); outline-offset: 2px; }
.hdock { margin: 0 calc(var(--u) * 3) calc(var(--u) * 3); height: calc(var(--icon) + var(--u) * 8); border-radius: calc(var(--u) * 9.4); background: rgba(255, 255, 255, .19); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .22); display: flex; align-items: center; justify-content: center; gap: calc((var(--u) * 100 - var(--pad) * 2 - var(--icon) * 4) / 3); flex: none; }
/* Home icons align to the top of their grid cell; in the dock they sit in the middle */
.hdock .ic { align-self: center; }
.hdock .ic-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ic-img.sysic { background: linear-gradient(170deg, var(--c1), var(--c2)); }
.ic-img.sysic svg { width: calc(var(--icon) * .56); height: calc(var(--icon) * .56); }
.pull { transition: transform .35s var(--ease); }

/* Folder: the four mobility apps */
.folder-view { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * 5); background: rgba(10, 22, 19, .42); backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3); animation: fvIn .35s var(--ease); }
.fv-title { font-size: calc(var(--u) * 6.4); font-weight: 700; text-shadow: 0 1px 6px rgba(0, 0, 0, .3); }
.fv-panel { width: 82%; padding: calc(var(--u) * 6) calc(var(--u) * 5); border-radius: calc(var(--u) * 9); background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .28); display: grid; grid-template-columns: repeat(2, 1fr); gap: calc(var(--u) * 6) calc(var(--u) * 3); justify-items: center; animation: fvPanel .45s var(--ease); }
.fv-panel .ic { --icon: calc(var(--u) * 19); }
.fv-panel .ic-label { font-size: calc(var(--u) * 3.3); }
@keyframes fvIn { from { opacity: 0; } }
@keyframes fvPanel { from { opacity: 0; transform: scale(.6); } }

/* Spotlight */
.spotlight { position: absolute; inset: 0; z-index: 9; background: rgba(10, 22, 19, .55); backdrop-filter: blur(28px) saturate(1.3); -webkit-backdrop-filter: blur(28px) saturate(1.3); padding: var(--top) calc(var(--u) * 4.4) 0; display: flex; flex-direction: column; user-select: text; -webkit-user-select: text; animation: fvIn .22s ease-out; }
.sp-bar { display: flex; align-items: center; gap: calc(var(--u) * 3); padding-top: calc(var(--u) * 2); }
.sp-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: calc(var(--u) * 2); height: calc(var(--u) * 10); padding-inline: calc(var(--u) * 3.2); background: rgba(255, 255, 255, .16); border-radius: calc(var(--u) * 3.2); }
.sp-field:focus-within { background: rgba(255, 255, 255, .22); box-shadow: 0 0 0 1.5px rgba(241, 234, 223, .7); }
.sp-field svg { width: calc(var(--u) * 4.2); height: calc(var(--u) * 4.2); opacity: .7; flex: none; }
.sp-field input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: #fff; font: 400 max(16px, calc(var(--u) * 4.2)) var(--font); }
.sp-field input::placeholder { color: rgba(255, 255, 255, .6); }
.sp-field input::-webkit-search-cancel-button { filter: invert(1); opacity: .6; }
.sp-cancel { font-size: calc(var(--u) * 3.9); font-weight: 500; color: var(--sand); }
.sp-results { flex: 1; overflow-y: auto; padding: calc(var(--u) * 4) 0 calc(var(--u) * 8); scrollbar-width: none; overscroll-behavior: contain; }
.sp-results::-webkit-scrollbar { display: none; }
.sp-h { font-size: calc(var(--u) * 3.2); font-weight: 500; opacity: .75; margin: 0 calc(var(--u) * 1) calc(var(--u) * 2); display: flex; justify-content: space-between; }
.sp-list { display: grid; grid-template-columns: minmax(0, 1fr); background: rgba(255, 255, 255, .09); border-radius: calc(var(--u) * 4.4); padding: calc(var(--u) * 1) 0; }
.sp-row { display: flex; align-items: center; gap: calc(var(--u) * 3.2); text-align: start; padding: calc(var(--u) * 2) calc(var(--u) * 3.4); position: relative; }
.sp-row + .sp-row::before { content: ''; position: absolute; top: 0; inset-inline: calc(var(--u) * 16.4) 0; border-top: .5px solid rgba(255, 255, 255, .14); }
.sp-row:hover, .sp-row:focus-visible { background: rgba(255, 255, 255, .08); outline: none; }
.sp-row .ic-img { --icon: calc(var(--u) * 10); box-shadow: none; }
.sp-row .sp-t { flex: 1; min-width: 0; }
.sp-row b { display: block; font-weight: 500; font-size: calc(var(--u) * 3.8); line-height: 1.35; }
.sp-row small { display: block; font-size: calc(var(--u) * 3); opacity: .72; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-row mark { background: rgba(210, 85, 58, .55); color: inherit; border-radius: 3px; padding: 0 1px; }
.sp-empty { text-align: center; opacity: .8; padding: calc(var(--u) * 10) calc(var(--u) * 4); font-size: calc(var(--u) * 3.6); }

/* ---------- App view inside the phone (case studies and system apps, from v1) ---------- */
.app { position: absolute; inset: 0; z-index: 30; background: var(--paper); color: var(--ink); overflow: hidden; user-select: text; -webkit-user-select: text; --muted: rgba(21, 23, 28, .66); --hair: rgba(21, 23, 28, .1); }
.app::after { content: ''; position: absolute; inset-inline: 0; bottom: 0; height: calc(var(--u) * 9); z-index: 7; pointer-events: none; background: linear-gradient(to top, var(--paper) 35%, rgba(250, 247, 241, 0)); }
.app-cover { position: absolute; inset: 0; z-index: 5; background: var(--c); opacity: 0; pointer-events: none; }
.splash { position: absolute; z-index: 35; pointer-events: none; display: none; }
.splash .ic-img { box-shadow: none; }
.app-scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; padding-bottom: calc(var(--u) * 16); }
.app-scroll::-webkit-scrollbar { display: none; }
.app-top { position: absolute; top: 0; inset-inline: 0; z-index: 8; height: calc(var(--top) + var(--u) * 10); display: flex; align-items: flex-end; justify-content: center; padding: 0 calc(var(--u) * 4) calc(var(--u) * 2); pointer-events: none; }
.app-top::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .25s; background: rgba(250, 247, 241, .82); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); border-bottom: .5px solid var(--hair); }
.app.scrolled .app-top::before { opacity: 1; }
.app-top-title { font-weight: 700; font-size: calc(var(--u) * 4); opacity: 0; transform: translateY(calc(var(--u) * 1.5)); transition: opacity .25s, transform .25s; max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app.scrolled .app-top-title { opacity: 1; transform: none; }
.app-x { position: absolute; inset-inline-end: calc(var(--u) * 4); bottom: calc(var(--u) * 1.6); width: calc(var(--u) * 8.4); height: calc(var(--u) * 8.4); border-radius: 50%; display: grid; place-items: center; pointer-events: auto; background: rgba(255, 255, 255, .2); color: #fff; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .3); transition: background .2s, color .2s; }
.app-x svg { width: 42%; height: 42%; }
.app[data-tone="dark"] .app-x, .app.scrolled .app-x { background: rgba(21, 23, 28, .07); color: var(--ink); box-shadow: none; }
.app-x:focus-visible { outline-offset: 2px; }
.home-ind { position: absolute; z-index: 9; bottom: 0; left: 50%; transform: translateX(-50%); width: calc(var(--u) * 46); height: calc(var(--u) * 7.5); display: grid; place-items: center; touch-action: none; }
.home-ind span { width: calc(var(--u) * 35); height: calc(var(--u) * 1.35); border-radius: 99px; background: var(--ink); opacity: .85; transition: width .2s, opacity .2s; }
.home-ind:hover span { width: calc(var(--u) * 38); opacity: 1; }
.home-ind:focus-visible { outline: none; }
.home-ind:focus-visible span { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--clay); }

.cs-hero { --tint: color-mix(in oklab, var(--c) 72%, #0b0c0f); background: radial-gradient(120% 70% at 50% 0%, color-mix(in oklab, var(--c) 80%, #fff 6%) 0%, transparent 70%), var(--tint); color: #fff; padding: calc(var(--top) + var(--u) * 10) 0 calc(var(--u) * 12); position: relative; }
.carousel { position: relative; }
.track { display: flex; gap: calc(var(--u) * 4); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; --shot: calc(var(--u) * 52); padding: 0 calc(50% - var(--shot) / 2); overscroll-behavior-x: contain; cursor: grab; }
.track.dragging { scroll-snap-type: none; cursor: grabbing; }
.track::-webkit-scrollbar { display: none; }
.track:focus-visible { outline: 2px solid var(--sand); outline-offset: -2px; border-radius: 0; }
.shot { margin: 0; flex: 0 0 var(--shot); scroll-snap-align: center; border-radius: calc(var(--u) * 6.2); overflow: hidden; background: #000; padding: calc(var(--u) * 1.1); box-shadow: 0 calc(var(--u) * 4) calc(var(--u) * 8) rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .14); transition: transform .45s var(--ease), opacity .45s; transform: scale(.9); opacity: .55; }
.shot.on { transform: none; opacity: 1; }
.shot img { width: 100%; aspect-ratio: 414 / 900; object-fit: cover; border-radius: calc(var(--u) * 5.2); pointer-events: none; -webkit-user-drag: none; background: rgba(255, 255, 255, .06); }
.carousel.mac .track { --shot: calc(var(--u) * 84); }
.carousel.mac .shot { border-radius: calc(var(--u) * 2.4); padding: calc(var(--u) * 5) 0 0; background: #e9e6e1; position: relative; }
.carousel.mac .shot::before { content: ''; position: absolute; top: calc(var(--u) * 1.8); left: calc(var(--u) * 2.4); width: calc(var(--u) * 1.6); height: calc(var(--u) * 1.6); border-radius: 50%; background: #ff5f57; box-shadow: calc(var(--u) * 2.6) 0 0 #febc2e, calc(var(--u) * 5.2) 0 0 #28c840; }
.carousel.mac .shot img { aspect-ratio: 1400 / 1063; border-radius: 0; }
.car-ctrl { display: flex; justify-content: center; align-items: center; gap: calc(var(--u) * 4); margin-top: calc(var(--u) * 5); }
.car-btn { width: calc(var(--u) * 9); height: calc(var(--u) * 9); border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .25); transition: background .2s, opacity .2s; }
.car-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .28); }
.car-btn:disabled { opacity: .3; cursor: default; }
.car-btn svg { width: 38%; height: 38%; }
[dir="rtl"] .car-btn svg { transform: scaleX(-1); }
.car-btn:focus-visible { outline: 2px solid var(--sand); outline-offset: 2px; }
.car-count { font-family: var(--mono); font-size: calc(var(--u) * 3.3); opacity: .8; min-width: calc(var(--u) * 14); text-align: center; direction: ltr; }
.cs-solo { display: grid; place-items: center; padding: calc(var(--u) * 6) 0 calc(var(--u) * 2); }
.cs-solo .ic-img { --icon: calc(var(--u) * 34); box-shadow: 0 calc(var(--u) * 5) calc(var(--u) * 10) rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .1); }
.cs-solo p { margin: calc(var(--u) * 5) 0 0; font-family: var(--mono); font-size: calc(var(--u) * 3); opacity: .75; letter-spacing: .06em; }
.cs-sheet { position: relative; background: var(--paper); margin-top: calc(var(--u) * -7); border-radius: calc(var(--u) * 7) calc(var(--u) * 7) 0 0; padding: calc(var(--u) * 7) calc(var(--u) * 6) 0; }
.cs-head { display: flex; align-items: center; gap: calc(var(--u) * 4); }
.cs-head .ic-img { --icon: calc(var(--u) * 18); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), inset 0 0 0 .5px rgba(0, 0, 0, .08); }
.cs-head h2 { margin: 0; font-size: calc(var(--u) * 6.6); line-height: 1.25; font-weight: 700; outline: none; }
html[lang="en"] .cs-head h2 { letter-spacing: -.015em; }
.cs-tag { margin: calc(var(--u) * .6) 0 0; color: var(--muted); font-size: calc(var(--u) * 3.6); line-height: 1.45; }
.cs-badges { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 1.8); margin: calc(var(--u) * 5) 0 0; }
.cs-role, .cs-live { display: inline-flex; align-items: center; gap: calc(var(--u) * 1.4); font-size: calc(var(--u) * 3.1); font-weight: 500; line-height: 1; padding: calc(var(--u) * 1.6) calc(var(--u) * 2.8); border-radius: 99px; }
.cs-role::before { content: ''; width: calc(var(--u) * 1.8); height: calc(var(--u) * 1.8); border-radius: 50%; background: currentColor; }
.app .cs-role.role-scratch { background: #F6DCD3; color: #9A3420; }
.app .cs-role.role-improved { background: #E3E7DA; color: #48553A; }
.app .cs-role.role-design { background: #DCE8FF; color: #1D4FB8; }
.cs-live { background: var(--ink); color: var(--sand); }
.cs-live svg { width: calc(var(--u) * 3.4); height: calc(var(--u) * 3.4); }
.cs-get { display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 2); margin-top: calc(var(--u) * 5); height: calc(var(--u) * 11); border-radius: calc(var(--u) * 3.4); background: #C04A30; color: #fff; font-weight: 700; font-size: calc(var(--u) * 3.8); transition: filter .2s, transform .2s; }
.cs-get:hover { filter: brightness(1.06); }
.cs-get:active { transform: scale(.98); }
.cs-get svg { width: calc(var(--u) * 4.6); height: calc(var(--u) * 4.6); }
.cs-desc { font-size: calc(var(--u) * 3.95); line-height: 1.75; margin: calc(var(--u) * 5) 0 0; text-wrap: pretty; }
html[lang="en"] .cs-desc { line-height: 1.6; }
.cs-h { font-size: calc(var(--u) * 3.2); font-weight: 500; color: var(--muted); margin: calc(var(--u) * 8) 0 calc(var(--u) * 2.4); }
.cs-points { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: calc(var(--u) * 4.4); box-shadow: inset 0 0 0 .5px var(--hair); }
.cs-points li { display: flex; gap: calc(var(--u) * 3); align-items: flex-start; padding: calc(var(--u) * 3) calc(var(--u) * 4); font-size: calc(var(--u) * 3.7); line-height: 1.5; position: relative; }
.cs-points li + li::before { content: ''; position: absolute; top: 0; inset-inline: calc(var(--u) * 11) 0; border-top: .5px solid var(--hair); }
.cs-points svg { width: calc(var(--u) * 4.4); height: calc(var(--u) * 4.4); flex: none; margin-top: calc(var(--u) * .5); color: var(--cc, var(--c)); }
.cs-brands { display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(var(--u) * 2.4); }
.cs-brands button { display: grid; justify-items: center; gap: calc(var(--u) * 1.2); font-size: calc(var(--u) * 2.9); font-weight: 500; line-height: 1.3; text-align: center; border-radius: calc(var(--u) * 3); padding: calc(var(--u) * 1) 0; }
.cs-brands button:hover { background: rgba(21, 23, 28, .05); }
.cs-brands img { width: calc(var(--u) * 14); height: calc(var(--u) * 14); border-radius: 23%; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.cs-info { margin: 0; background: #fff; border-radius: calc(var(--u) * 4.4); box-shadow: inset 0 0 0 .5px var(--hair); }
.cs-info div { display: flex; justify-content: space-between; gap: calc(var(--u) * 4); padding: calc(var(--u) * 3.2) calc(var(--u) * 4); font-size: calc(var(--u) * 3.6); }
.cs-info div + div { border-top: .5px solid var(--hair); }
.cs-info dt { color: var(--muted); }
.cs-info dd { margin: 0; font-weight: 500; text-align: end; }
.chips { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 1.2); justify-content: flex-end; }
.chips span { background: var(--sand); border-radius: 99px; padding: calc(var(--u) * .3) calc(var(--u) * 2.2); font-size: calc(var(--u) * 3.2); }
.cs-stats { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 2.4); }
.cs-stats div { background: #fff; border-radius: calc(var(--u) * 4); padding: calc(var(--u) * 3.6); box-shadow: inset 0 0 0 .5px var(--hair); }
.cs-stats .num { font-size: calc(var(--u) * 8); line-height: 1.1; display: block; color: #1D4FB8; text-align: start; }
[dir="rtl"] .cs-stats .num { text-align: right; }
.cs-stats span:last-child { font-size: calc(var(--u) * 3.2); color: var(--muted); line-height: 1.4; display: block; margin-top: calc(var(--u) * 1); }
.cs-palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: calc(var(--u) * 1.4); }
.cs-palette span { aspect-ratio: 1; border-radius: calc(var(--u) * 2.4); box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .12); }
.cs-icons { display: grid; grid-template-columns: repeat(8, 1fr); gap: calc(var(--u) * 1.4); color: #0273FD; }
.cs-icons span { aspect-ratio: 1; display: grid; place-items: center; background: #fff; border-radius: calc(var(--u) * 2.4); box-shadow: inset 0 0 0 .5px var(--hair); }
.cs-icons svg { width: 55%; height: 55%; }
.cs-next { width: 100%; margin-top: calc(var(--u) * 8); display: flex; align-items: center; gap: calc(var(--u) * 3.4); padding: calc(var(--u) * 3.4); border-radius: calc(var(--u) * 4.4); background: var(--sand); text-align: start; transition: background .2s; }
.cs-next:hover { background: #EADFCF; }
.cs-next .ic-img { --icon: calc(var(--u) * 12); box-shadow: none; }
.cs-next small { display: block; font-size: calc(var(--u) * 3); color: var(--muted); }
.cs-next b { display: block; font-size: calc(var(--u) * 3.9); font-weight: 700; line-height: 1.35; }
.cs-next .chev { margin-inline-start: auto; width: calc(var(--u) * 4); height: calc(var(--u) * 4); opacity: .5; }
[dir="rtl"] .cs-next .chev { transform: scaleX(-1); }

/* System apps: Studio, About, Mail */
.sys { padding: calc(var(--top) + var(--u) * 10) calc(var(--u) * 6) 0; }
.sys-head { text-align: center; }
.sys-head .logo-big svg { width: calc(var(--u) * 30); height: auto; margin: 0 auto calc(var(--u) * 5); display: block; }
.sys-head .eyebrow-s { font-size: calc(var(--u) * 3.2); color: var(--muted); margin: 0 0 calc(var(--u) * 1); }
.sys-head h2 { margin: calc(var(--u) * 2) 0; font-size: calc(var(--u) * 7.2); line-height: 1.25; font-weight: 700; text-wrap: balance; outline: none; }
.sys-lead { color: var(--muted); font-size: calc(var(--u) * 3.8); margin: 0 auto; max-width: 34ch; line-height: 1.6; }
.sgroup { background: #fff; border-radius: calc(var(--u) * 4.4); box-shadow: inset 0 0 0 .5px var(--hair); overflow: hidden; }
.sgrow { display: flex; gap: calc(var(--u) * 3.4); padding: calc(var(--u) * 3.4) calc(var(--u) * 4); position: relative; align-items: flex-start; }
.sgrow + .sgrow::before { content: ''; position: absolute; top: 0; inset-inline: calc(var(--u) * 15.4) 0; border-top: .5px solid var(--hair); }
.gicon { width: calc(var(--u) * 7.4); height: calc(var(--u) * 7.4); border-radius: calc(var(--u) * 1.9); display: grid; place-items: center; color: #fff; flex: none; }
.gicon svg { width: 62%; height: 62%; }
.gicon.n { font-family: var(--mono); font-size: calc(var(--u) * 3.4); background: var(--sand) !important; color: var(--ink); }
.sgrow b { display: block; font-weight: 700; font-size: calc(var(--u) * 3.8); line-height: 1.4; }
.sgrow p { margin: calc(var(--u) * .6) 0 0; font-size: calc(var(--u) * 3.3); color: var(--muted); line-height: 1.55; }
.seg { display: flex; background: rgba(21, 23, 28, .06); border-radius: calc(var(--u) * 2.4); padding: calc(var(--u) * .6); margin: calc(var(--u) * 3.4) calc(var(--u) * 4); }
.seg button { flex: 1; padding: calc(var(--u) * 1.6); border-radius: calc(var(--u) * 1.9); font-size: calc(var(--u) * 3.4); font-weight: 500; }
.seg button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.big-cta { display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 2); width: 100%; height: calc(var(--u) * 12); border-radius: calc(var(--u) * 3.6); margin-top: calc(var(--u) * 7); background: var(--ink); color: var(--sand); font-weight: 700; font-size: calc(var(--u) * 3.9); transition: background .2s, transform .2s; }
.big-cta:hover { background: var(--olive); }
.big-cta:active { transform: scale(.98); }
.big-cta.clay { background: #C04A30; color: #fff; }
.big-cta.ghost { background: rgba(21, 23, 28, .06); color: var(--ink); margin-top: calc(var(--u) * 2.4); }
.big-cta svg { width: calc(var(--u) * 4.6); height: calc(var(--u) * 4.6); }
.snote { text-align: center; font-size: calc(var(--u) * 3.1); color: var(--muted); margin: calc(var(--u) * 3) 0 0; }
.sa-head { text-align: center; }
.sa-head .avatar { display: grid; place-items: center; width: calc(var(--u) * 30); aspect-ratio: 1; margin: 0 auto calc(var(--u) * 4); border-radius: calc(var(--u) * 8); background: var(--sand); }
.sa-head .avatar svg { width: 46%; height: auto; }
.sa-head h2 { margin: 0; font-size: calc(var(--u) * 7); font-weight: 700; line-height: 1.25; outline: none; }
.sa-head .role-line { color: var(--muted); font-size: calc(var(--u) * 3.4); margin: calc(var(--u) * 1) 0 0; }
.sa-body p { font-size: calc(var(--u) * 3.9); line-height: 1.75; margin: calc(var(--u) * 5) 0 0; }
.sa-stats { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 2.4); }
.sa-stats div { background: #fff; border-radius: calc(var(--u) * 4); padding: calc(var(--u) * 3.6); box-shadow: inset 0 0 0 .5px var(--hair); }
.sa-stats .num { font-size: calc(var(--u) * 8); line-height: 1.1; display: block; color: #B24228; text-align: start; }
[dir="rtl"] .sa-stats .num { text-align: right; }
.sa-stats span:last-child { font-size: calc(var(--u) * 3.1); color: var(--muted); display: block; margin-top: calc(var(--u) * 1); line-height: 1.45; }
.mailapp { padding-top: calc(var(--top) + var(--u) * 13); }
.mail-nav { display: flex; align-items: center; justify-content: space-between; padding: 0 calc(var(--u) * 5) calc(var(--u) * 4); }
.mail-nav h2 { margin: 0; font-size: calc(var(--u) * 7); font-weight: 700; outline: none; }
.mail-send { width: calc(var(--u) * 10); height: calc(var(--u) * 10); border-radius: 50%; background: #C04A30; color: #fff; display: grid; place-items: center; }
.mail-send svg { width: 46%; height: 46%; }
[dir="rtl"] .mail-send svg { transform: scaleX(-1); }
.mfield { display: flex; align-items: center; gap: calc(var(--u) * 2.4); padding: calc(var(--u) * 3) calc(var(--u) * 5); border-top: .5px solid var(--hair); font-size: calc(var(--u) * 3.7); min-height: calc(var(--u) * 12); }
.mfield span:first-child { color: var(--muted); min-width: calc(var(--u) * 15); }
.mchip { background: #E9EEF9; color: #1D4FB8; border-radius: 99px; padding: calc(var(--u) * .6) calc(var(--u) * 2.8); font-family: var(--mono); font-size: calc(var(--u) * 3.3); direction: ltr; }
.mbody { border-top: .5px solid var(--hair); padding: calc(var(--u) * 5); }
.mbody .m-title { font-size: calc(var(--u) * 5.6); font-weight: 700; margin: 0 0 calc(var(--u) * 2); line-height: 1.3; }
.mbody p { margin: 0 0 calc(var(--u) * 3); font-size: calc(var(--u) * 3.9); line-height: 1.7; }
.mbody .m-ghost { color: rgba(21, 23, 28, .6); }
.mbody .m-sign { margin-top: calc(var(--u) * 5); font-size: calc(var(--u) * 3.6); color: var(--muted); }
.mail-actions { padding: 0 calc(var(--u) * 5); }

/* ---------- Sections ---------- */
main { position: relative; z-index: 1; }
.sec { position: relative; }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
.section-head { margin-bottom: 52px; }
.section-head .h2 { transition: letter-spacing .9s var(--ease-out); }
.dotgrid { position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle, color-mix(in srgb, var(--sfg) 15%, transparent) 1.4px, transparent 1.7px); background-size: 40px 40px; -webkit-mask: radial-gradient(70% 80% at 50% 45%, #000 20%, transparent 80%); mask: radial-gradient(70% 80% at 50% 45%, #000 20%, transparent 80%); }

/* Hero */
.hero { height: 100vh; height: 100svh; min-height: 620px; }
.hero-inner {
  position: relative; max-width: 1280px; height: 100%; margin: 0 auto;
  padding: calc(var(--nav-h) + 20px) 32px 28px;
  display: grid; grid-template-columns: minmax(0, 620px) var(--pw); grid-template-areas: "copy slot" "stats slot";
  grid-template-rows: 1fr auto; column-gap: clamp(56px, 9vw, 160px); align-items: center; justify-content: center;
}
.hero-copy { grid-area: copy; min-width: 0; align-self: end; max-width: 640px; will-change: opacity; }
.hero-slot { grid-area: slot; width: var(--pw); height: var(--ph); align-self: center; justify-self: center; position: relative; }
.hero-logo { width: 84px; margin-bottom: 26px; }
.hero .eyebrow { color: var(--sacc); }
.hero-title { font-size: clamp(42px, 5vw, 74px); font-weight: 700; line-height: 1.14; text-wrap: balance; }
html[lang="en"] .hero-title { letter-spacing: -.02em; line-height: 1.06; }
.hero-sub { margin-top: 20px; font-size: 19px; color: var(--sfg2); max-width: 520px; text-wrap: pretty; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-hint { margin-top: 24px; display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; color: var(--sfg2); }
.hint-arrow { width: 34px; height: 1px; background: currentColor; position: relative; flex: none; }
.hint-arrow::after { content: ''; position: absolute; inset-inline-end: -1px; top: -3.5px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-inline-end: 1px solid currentColor; transform: rotate(45deg); }
[dir="rtl"] .hint-arrow::after { transform: rotate(-45deg); }
.stats { grid-area: stats; position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin: 40px 0 0; border-top: 1px solid var(--sline); max-width: 680px; align-self: start; }
.stats > div { padding: 18px 0 0; padding-inline-end: 16px; position: relative; }
.stats > div::before { content: ''; position: absolute; top: -1px; inset-inline-start: 0; width: 1.5px; height: 12px; background: var(--sfg); }
.stats dt { font: 500 34px/1.1 var(--mono); direction: ltr; unicode-bidi: isolate; text-align: start; }
[dir="rtl"] .stats dt { text-align: right; }
.stats dd { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--sfg2); }

/* What I do */
.manifesto { padding-block: 120px 0; }
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.service { background: var(--scard); border: 1px solid var(--sline); border-radius: 22px; padding: 24px; transition: transform .35s cubic-bezier(.2, .7, .2, 1), border-color .35s, opacity .7s cubic-bezier(.2, .7, .2, 1); }
.service:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--clay) 45%, transparent); }
.service-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--clay) 14%, transparent); color: var(--sacc); margin-bottom: 18px; }
.service-icon svg { width: 24px; height: 24px; }
.service h3 { font-size: 19px; margin-bottom: 8px; }
.service p { font-size: 15px; color: var(--sfg2); }
.process { position: relative; padding: 80px 0 110px; }
.process-stick { position: relative; }
.ruler-title { font-size: 15px; font-weight: 500; color: var(--sfg2); margin: 0 0 18px; }
.ruler-line { position: relative; height: 1.5px; background: var(--sline); }
.ruler-line i { position: absolute; inset: 0; background: var(--sfg); transform-origin: 0 50%; scale: var(--draw, 1) 1; }
[dir="rtl"] .ruler-line i { transform-origin: 100% 50%; }
.ruler { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.ruler li { position: relative; padding: 30px 0 0; padding-inline-end: 26px; opacity: .5; translate: 0 12px; transition: opacity .6s var(--ease-out), translate .8s var(--spring); }
.ruler li.lit { opacity: 1; translate: 0 0; }
.ruler li::before { content: ''; position: absolute; top: -7.5px; inset-inline-start: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--sbg); box-shadow: inset 0 0 0 1.5px var(--sfg); transition: background-color .4s, box-shadow .4s, scale .5s var(--spring); scale: .7; }
.ruler li.lit::before { background: var(--sfg); scale: 1; }
.ruler li.cur::before { background: var(--sacc); box-shadow: 0 0 0 5px color-mix(in srgb, var(--sacc) 22%, transparent); }
.tick { display: inline-block; font: 500 13px var(--mono); color: var(--sacc); margin-bottom: 6px; }
.ruler h3 { font-size: 24px; margin-bottom: 8px; transition: color .4s; }
.ruler li.cur h3 { color: var(--sacc); }
.ruler p { font-size: 15px; color: var(--sfg2); }

/* Products and client work */
#products, #clients, .about { padding-block: 120px; }
.feature { position: relative; display: grid; grid-template-columns: 1fr 1.05fr; gap: 44px; align-items: center; background: var(--scard); border-radius: 32px; padding: 44px; margin-bottom: 26px; border: 1px solid var(--sline); overflow: hidden; cursor: pointer; font: inherit; color: inherit; text-align: start; width: 100%; transition: border-color .35s, box-shadow .35s, opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); }
.feature::after { content: ''; position: absolute; inset-inline-end: -120px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%; background: var(--c); opacity: .1; pointer-events: none; }
.feature:hover, .feature:focus-visible { border-color: color-mix(in srgb, var(--c) 50%, transparent); box-shadow: 0 30px 60px -36px rgba(0, 0, 0, .5); outline: none; }
.feature:nth-child(even) .phones { order: -1; }
.feature-copy { position: relative; z-index: 1; display: block; }
.feature-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.feature-head h3 { font-size: 32px; }
.idx { display: block; font-size: 12px; color: var(--sfg2); font-family: var(--mono); line-height: 1.4; }
.feature-tag { display: block; font-size: 19px; font-weight: 500; color: var(--ct-l); margin-bottom: 12px; }
.pal-dark .feature-tag { color: var(--ct-d); }
.feature-desc { display: block; color: var(--sfg2); }
.points { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; }
.points li { position: relative; padding-inline-start: 22px; font-size: 15px; }
.points li::before { content: ''; position: absolute; inset-inline-start: 2px; top: .7em; width: 7px; height: 7px; background: var(--clay); transform: rotate(45deg); }
.brands { display: flex; align-items: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.brands > span { font-size: 13px; color: var(--sfg2); margin-inline-end: 4px; }
.brands img { width: 40px; height: 40px; border-radius: 10px; }
.feature-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.phones { position: relative; z-index: 1; display: flex; justify-content: center; gap: 14px; }
.phone { margin: 0; flex: 0 1 31%; max-width: 190px; border-radius: 26px; overflow: hidden; border: 5px solid var(--phone-frame); background: var(--phone-frame); box-shadow: 0 24px 50px -24px rgba(21, 23, 28, .45); }
.phone img { width: 100%; height: auto; }
/* Scroll parallax: each screenshot drifts at its own rate (app.js sets --par from -1 to 1) */
.phones .phone { translate: 0 calc(var(--par, 0) * var(--k, 0px)); transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.phones .phone:nth-child(1) { --k: 44px; }
.phones .phone:nth-child(2) { --k: -30px; margin-top: -44px; }
.phones .phone:nth-child(3) { --k: 22px; }
.feature:hover .phone:nth-child(1) { transform: translateX(-10px) rotate(-3deg); }
.feature:hover .phone:nth-child(2) { transform: translateY(-12px); }
.feature:hover .phone:nth-child(3) { transform: translateX(10px) rotate(3deg); }
.feature.in-phone, .card.in-phone, .showcase.in-phone { box-shadow: 0 0 0 2px var(--sacc), 0 26px 50px -30px rgba(0, 0, 0, .5); }
.open-hint { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--sacc); }
.open-hint svg { width: 15px; height: 15px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
#productCards { margin-top: 26px; }
.card { font: inherit; color: inherit; text-align: start; cursor: pointer; width: 100%; position: relative; overflow: hidden; background: var(--scard); border: 1px solid var(--sline); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s, border-color .35s, opacity .7s; }
.card > span { display: block; position: relative; }
.card:hover, .card:focus-visible { transform: translateY(-5px); box-shadow: 0 26px 50px -30px rgba(0, 0, 0, .55); border-color: color-mix(in srgb, var(--c) 50%, transparent); outline: none; }
.card.reveal.in:hover { transform: translateY(-5px); }
.card-glow { position: absolute !important; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(320px circle at var(--x, 50%) var(--y, 0), color-mix(in srgb, var(--c) 24%, transparent), transparent 70%); }
.card:hover .card-glow { opacity: 1; }
.card .app-icon { transition: transform .45s cubic-bezier(.3, 1.4, .5, 1); }
.card:hover .app-icon { transform: rotate(-6deg) scale(1.06); }
.card-head { display: flex !important; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.card-title { font-size: 21px; font-weight: 700; line-height: 1.3; }
.card-tag { font-size: 15px; font-weight: 500; color: var(--sacc); margin: 4px 0 10px; }
.card-desc { font-size: 14.5px; color: var(--sfg2); flex: 1; }
.card-shots { display: flex !important; gap: 8px; margin-top: 18px; }
.card-shots img { width: 30%; aspect-ratio: 9 / 19.5; object-fit: cover; object-position: top; border-radius: 10px; border: 3px solid var(--phone-frame); transition: transform .4s cubic-bezier(.2, .7, .2, 1); }
.card:hover .card-shots img:nth-child(1) { transform: translateY(-4px) rotate(-2deg); }
.card:hover .card-shots img:nth-child(3) { transform: translateY(-4px) rotate(2deg); }
.card-shots.mac img { width: 100%; aspect-ratio: 1080 / 820; border-radius: 10px; border-width: 2px; }
.card-foot { display: flex !important; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 18px; }
.card-more { font-size: 13px; font-weight: 500; color: var(--sacc); white-space: nowrap; opacity: 0; transition: opacity .3s; display: inline-flex; align-items: center; gap: 6px; }
.card-more svg { width: 14px; height: 14px; }
.card:hover .card-more, .card:focus-visible .card-more { opacity: 1; }
.app-icon { width: 60px; height: 60px; border-radius: 14px; object-fit: cover; background: #fff; box-shadow: 0 0 0 1px var(--sline); flex: none; }
.app-icon.contain { object-fit: contain; padding: 8px; }
.mono-icon { display: inline-flex; align-items: center; justify-content: center; background: var(--c); color: #fff; font-size: 30px; font-weight: 700; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font: 500 12px var(--mono); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--sline); color: var(--sfg2); direction: ltr; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--olive); background: rgba(14, 58, 49, .09); padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.live i { width: 7px; height: 7px; background: #2E9E6A; transform: rotate(45deg); }
.pal-dark .live { color: var(--sfg); background: color-mix(in srgb, var(--sfg) 12%, transparent); }
.role { display: inline-flex !important; align-items: center; gap: 6px; width: fit-content; font-size: 12.5px; font-weight: 500; padding: 3px 10px; border-radius: 999px; margin: 0 0 10px; border: 1px solid currentColor; }
.role::before { content: ''; width: 6px; height: 6px; transform: rotate(45deg); background: currentColor; }
.role-scratch { color: var(--clay-deep); }
.role-improved { color: #2F5F9E; }
.role-design { color: #6D3FD8; }
.pal-dark .role-scratch { color: #F5B3A1; }
.pal-dark .role-improved { color: #A9C9FF; }
.pal-dark .role-design { color: #C9B6FF; }

/* Design showcase (TabibBot) */
.showcase { position: relative; overflow: hidden; cursor: pointer; margin-bottom: 26px; border-radius: 32px; padding: 44px 0 32px; color: #F3F6FF; background: radial-gradient(900px 420px at 85% -10%, rgba(2, 115, 253, .55), transparent 60%), radial-gradient(700px 400px at 0% 110%, rgba(2, 88, 194, .45), transparent 60%), #071226; border: 1px solid rgba(120, 160, 255, .18); text-align: start; font: inherit; width: 100%; display: block; transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1), box-shadow .35s; }
.showcase > span { display: block; }
.sc-top { display: grid !important; grid-template-columns: 1.3fr .7fr; gap: 40px; padding: 0 44px; align-items: end; }
.sc-copy, .sc-tag, .sc-desc { display: block; }
.sc-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.sc-brand img { width: 34px; height: 34px; }
.sc-brand span { direction: ltr; }
.sc-brand em { font-style: normal; font-size: 12.5px; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: rgba(2, 115, 253, .28); border: 1px solid rgba(120, 160, 255, .35); }
.showcase h3 { font-size: 36px; margin-top: 18px; }
.sc-tag { font-size: 18px; font-weight: 500; color: #9DC3FF; margin-top: 6px; }
.sc-desc { color: rgba(243, 246, 255, .8); margin-top: 14px; max-width: 640px; }
.showcase .points li { color: rgba(243, 246, 255, .88); }
.showcase .points li::before { background: #4C9BFF; }
.showcase .role-design { color: #C9B6FF; margin-top: 14px; }
.sc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.sc-stats div { padding: 16px 18px; border-radius: 18px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(120, 160, 255, .16); }
.sc-stats dt { font: 500 34px/1 var(--mono); direction: ltr; text-align: start; }
[dir="rtl"] .sc-stats dt { text-align: right; }
.sc-stats dd { margin: 8px 0 0; font-size: 13px; color: rgba(243, 246, 255, .74); }
.filmstrip { display: block; margin-top: 38px; overflow: hidden; direction: ltr; -webkit-mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.film-track { display: flex; gap: 18px; width: max-content; padding: 8px 0 30px; animation: slide 70s linear infinite; }
.film-track.scrub { animation: none; transform: translateX(calc(var(--fp, 0) * -34%)); }
.showcase:hover .film-track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-50%); } }
.film-track .phone { flex: none; width: 170px; border-color: #1B2436; background: #1B2436; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8); }
.film-track .phone:nth-child(even) { margin-top: 22px; }
.sc-system { display: flex !important; align-items: center; gap: 22px; flex-wrap: wrap; padding: 26px 44px 0; margin-top: 10px; border-top: 1px solid rgba(120, 160, 255, .14); }
.sc-swatches { display: flex; gap: 6px; }
.sc-swatches span { width: 26px; height: 26px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .18); }
.sc-icons { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.ds-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, .06); color: #BFD6FF; }
.ds-icon svg { width: 20px; height: 20px; }
.showcase .card-more { color: #9DC3FF; opacity: 1; }

/* About */
.about-grid { display: grid; grid-template-columns: 320px 1fr; gap: 56px; align-items: center; }
.about-card { background: var(--scard); border: 1px solid var(--sline); border-radius: 28px; padding: 30px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.about-photo { width: 150px; height: 150px; border-radius: 40px; margin-bottom: 18px; display: grid; place-items: center; background: var(--sand); box-shadow: inset 0 0 0 1px rgba(21, 23, 28, .08); }
.about-photo svg { width: 64px; height: auto; }
.about-name { font-size: 24px; font-weight: 700; }
.about-role { font-size: 14px; color: var(--sfg2); margin-top: 4px; }
.about-tags { justify-content: center; margin-top: 18px; }
.about-body { font-size: 18px; color: var(--sfg2); margin-top: 16px; max-width: 640px; }
.about-points { margin-top: 22px; }
.about-points li { font-size: 16px; font-weight: 500; }

/* Contact + footer */
.contact { position: relative; overflow: hidden; padding-block: 130px 0; text-align: center; }
.contact-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; padding-bottom: 130px; transform-origin: 50% 30%; }
.contact-logo { width: 84px; margin-bottom: 8px; }
.contact .lead { margin: 0 0 14px; }
.contact .h2 { font-size: clamp(36px, 5vw, 64px); }
.contact-note { font-size: 14px; color: var(--sfg2); }
.contact-mail { font-family: var(--mono); font-size: 16px; direction: ltr; border-bottom: 1px solid var(--sline); padding-bottom: 2px; }
.contact-mail:hover { border-color: var(--sfg); }
.footer { position: relative; color: var(--sfg2); border-top: 1px solid var(--sline); padding: 26px 0; text-align: start; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13.5px; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--sfg); direction: ltr; }
.footer-logo { width: 30px; }

/* Project detail sheet (narrow screens) */
.sheet { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 28px; background: var(--surface); color: var(--text); box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .6); overflow: auto; overscroll-behavior: contain; }
.sheet::backdrop { background: rgba(10, 11, 14, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet[open] { animation: sheetIn .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(30px) scale(.98); } to { opacity: 1; transform: none; } }
.sheet-inner { position: relative; padding: 34px; }
.sheet-close { position: absolute; top: 18px; inset-inline-end: 18px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 15px; z-index: 2; }
.sheet-head { display: flex; align-items: center; gap: 18px; padding-inline-end: 50px; }
.sheet-head h3 { font-size: 30px; }
.sheet-head h3:focus { outline: none; }
.sheet .card-tag { color: var(--clay-deep); }
[data-theme="dark"] .sheet .card-tag { color: #F2A48F; }
.sheet .app-icon { box-shadow: 0 0 0 1px var(--line); }
.app-icon.big { width: 76px; height: 76px; border-radius: 18px; font-size: 34px; }
.sheet-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.sheet-badges .role { margin: 0; }
.sheet .live { color: var(--olive); background: rgba(14, 58, 49, .09); }
[data-theme="dark"] .sheet .live { color: #8FDCB2; background: rgba(46, 158, 106, .16); }
.sheet .role-scratch { color: var(--clay-deep); }
.sheet .role-improved { color: #2F5F9E; }
.sheet .role-design { color: #6D3FD8; }
[data-theme="dark"] .sheet .role-scratch { color: #F2A48F; }
[data-theme="dark"] .sheet .role-improved { color: #8DB4F0; }
[data-theme="dark"] .sheet .role-design { color: #B9A1FF; }
.sheet-shots { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 26px 4px 18px; margin: 0 -4px; scrollbar-width: thin; }
.sheet-shots .phone { flex: 0 0 210px; scroll-snap-align: start; }
.sheet-shots.mac .window { flex: 0 0 min(560px, 82%); margin: 0; scroll-snap-align: start; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.sheet-desc { font-size: 17px; color: var(--text-3); margin-top: 18px; }
.sheet-label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.sheet .tags li { border-color: var(--line); color: var(--text-2); }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.sheet-fam { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.sheet-fam span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--bg); font-size: 14px; font-weight: 500; }
[dir="rtl"] .sheet-fam span { padding: 6px 6px 6px 12px; }
.sheet-fam img { width: 28px; height: 28px; border-radius: 8px; }

/* ---------- Wide screens: the companion column, the rail ---------- */
@media (min-width: 901px) and (min-height: 560px) {
  :root { --rail-space: 64px; }
  .rail { display: flex; }
  .sec:not(.hero) { padding-inline-start: var(--rail-space); padding-inline-end: var(--room); }
  .hero-slot { visibility: hidden; }
  /* The four steps pin while a line draws through them */
  .process { height: 150vh; padding: 0; }
  .process-stick { position: sticky; top: calc(var(--nav-h) + 22vh); padding: 40px 0 60px; }
}
/* Narrower wide screens: tighter content beside the phone */
@media (min-width: 901px) and (max-width: 1279px) {
  .services { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .feature { grid-template-columns: 1fr; padding: 32px; gap: 28px; }
  .feature:nth-child(even) .phones { order: 0; }
  .about-grid { grid-template-columns: 260px 1fr; gap: 36px; }
  .sc-top { grid-template-columns: 1fr; padding: 0 32px; }
  .sc-system { padding: 22px 32px 0; }
  .phones .phone { max-width: 160px; }
}
@media (min-width: 1280px) and (max-width: 1439px) {
  .feature { padding: 36px; gap: 32px; }
  .feature-head h3 { font-size: 28px; }
  .services { gap: 12px; }
  .service { padding: 20px; }
}
/* Short desktop windows */
@media (min-width: 901px) and (max-height: 820px) {
  .hero-logo { width: 64px; margin-bottom: 18px; }
  .hero-title { font-size: clamp(40px, 4.4vw, 62px); }
  .hero-sub { font-size: 17px; margin-top: 14px; }
  .hero-cta { margin-top: 22px; }
  .hero-hint { margin-top: 16px; }
  .stats { margin-top: 26px; }
  .stats dt { font-size: 28px; }
}

/* ---------- Narrow screens: the phone stays in the hero; project taps open the sheet ---------- */
@media (max-width: 900px), (max-height: 559px) {
  :root { --nav-h: 58px; }
  .companion { display: none; }
  .nav-inner { gap: 14px; padding: 0 16px; }
  .nav-links { display: none; }
  .railbar { display: flex; position: absolute; inset: 100% 16px auto; gap: 4px; height: 3px; margin-top: -3px; }
  .railbar span { position: relative; flex: 1; border-radius: 2px; overflow: hidden; background: color-mix(in srgb, var(--sfg) 16%, transparent); }
  .railbar i { position: absolute; inset: 0; background: var(--sacc); transform-origin: 0 50%; scale: var(--p, 0) 1; }
  [dir="rtl"] .railbar i { transform-origin: 100% 50%; }
  .railbar .done i { scale: 1 1; background: color-mix(in srgb, var(--sfg) 50%, transparent); }

  .hero { height: auto; min-height: 0; padding: calc(var(--nav-h) + 40px) 0 64px; }
  .hero-inner { height: auto; padding: 0 24px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "slot" "stats"; grid-template-rows: auto; row-gap: 44px; max-width: 680px; }
  .hero-copy { align-self: start; }
  .hero-hint .hint-arrow { transform: rotate(90deg); width: 22px; }
  [dir="rtl"] .hero-hint .hint-arrow { transform: rotate(-90deg); }
  .hero-slot { --pw: min(360px, calc(100vw - 48px)); --ph: calc(var(--pw) * 2.05); --bz: calc(var(--pw) * .03); }
  .stats { margin-top: 0; max-width: none; }

  .bdw { inset-inline: 0; }
  .services, .ruler { grid-template-columns: 1fr 1fr; row-gap: 28px; }
  .ruler-line { display: none; }
  .ruler li::before { display: none; }
  .ruler li { border-top: 1.5px solid var(--sline); }
  .ruler li.lit { border-top-color: var(--sfg); }
  .cards { grid-template-columns: 1fr 1fr; }
  .feature { grid-template-columns: 1fr; padding: 30px 22px; gap: 28px; }
  .feature:nth-child(even) .phones { order: 0; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .sc-top { grid-template-columns: 1fr; padding: 0 24px; }
  .sc-system { padding: 22px 24px 0; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .nav-cta { display: none; }
  .nav-name { font-size: 16px; }
  .hero { padding-top: calc(var(--nav-h) + 30px); }
  .hero-inner { padding: 0 16px; row-gap: 34px; }
  .hero-logo { width: 60px; margin-bottom: 18px; }
  .hero-title { font-size: clamp(36px, 10.4vw, 48px); }
  .hero-sub { font-size: 17px; }
  .hero-slot { --pw: min(calc(100vw - 32px), 400px); --ph: calc(var(--pw) * 1.8); --bz: 6px; }
  .hero-slot .device { --r: 34px; }
  .hero-slot .os { --rows: 5; --icon: min(calc(var(--u) * 16), calc(var(--vh) * 9.2)); }
  .hero-slot .hw { display: none; }
  .stats { grid-template-columns: 1fr 1fr; row-gap: 22px; }
  .stats dt { font-size: 30px; }
  .manifesto { padding-block-start: 76px; }
  .process { padding: 56px 0 72px; }
  #products, #clients, .about { padding-block: 76px; }
  .services, .ruler, .cards { grid-template-columns: 1fr; }
  .ruler li { padding-inline-end: 0; }
  .feature { padding: 24px 18px; border-radius: 26px; }
  .feature-head h3 { font-size: 26px; }
  .phones { gap: 10px; }
  .phone { border-width: 4px; border-radius: 20px; }
  .showcase { border-radius: 26px; padding-top: 30px; }
  .showcase h3 { font-size: 28px; }
  .sc-top { padding: 0 18px; gap: 24px; }
  .sc-system { padding: 20px 18px 0; }
  .film-track .phone { width: 130px; }
  .sheet-inner { padding: 24px 18px; }
  .sheet-shots .phone { flex-basis: 170px; }
  .card-more { opacity: 1; }
  .btn-lg { padding: 0 28px; }
  .contact { padding-top: 90px; }
  .contact-inner { padding-bottom: 90px; }
}
@media (max-width: 380px) {
  .nav-name span { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  :root { transition-duration: .2s; }
  *, *::before, *::after { animation: none !important; }
  .wall svg, .wl, .bdw, .ruler li, .rail-bar, .rail-l { transition-duration: .2s !important; }
  .bdw { scale: 1 !important; translate: 0 -50% !important; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .phones .phone, .film-track.scrub { translate: none !important; transform: none !important; }
  .ruler li { translate: none !important; }
  .contact-inner { transform: none !important; }
}

/* No transitions while the page sets itself up (palette, deep link) */
.booting, .booting *, .booting *::before, .booting *::after { transition: none !important; }

/* Test mode for headless screenshots: <main> is the scroller instead of the window */
html.scroll-frame, html.scroll-frame body { height: 100%; overflow: hidden; }
html.scroll-frame main { height: 100vh; overflow-y: auto; overflow-x: clip; scrollbar-width: none; }
html.scroll-frame main::-webkit-scrollbar { display: none; }

/* ---------- Print / PDF: A4 landscape, one section per page, light paper colours ---------- */
@page { size: A4 landscape; margin: 0; }
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* Keep x clipped: in RTL a wide element (the filmstrip) otherwise shifts every page off the paper */
  html, body, html.scroll-frame, html.scroll-frame body { height: auto !important; overflow-y: visible !important; overflow-x: clip !important; }
  .filmstrip { overflow: hidden !important; }
  html.scroll-frame main, main { height: auto !important; overflow: visible !important; }
  body { font-size: 12.5px; }
  /* Interactive chrome has no place on paper; the cover uses a still of the phone instead */
  .skip, .nav, .rail, .railbar, .backdrop, .companion, .sheet, .hero-hint, .hero-cta, .dotgrid, .open-hint, .card-more, .card-glow, .feature::after { display: none !important; }
  .reveal, .ruler li { opacity: 1 !important; transform: none !important; translate: none !important; transition: none !important; }
  .film-track { animation: none !important; transform: none !important; }
  .process-stick { position: static !important; }
  .wrap { max-width: none; padding: 0 16mm; }

  /* Each section carries its own palette, since the screen version tints the whole page per section */
  .sec { --room: 0px !important; --rail-space: 0px !important; padding-inline: 0 !important; background: var(--sbg); color: var(--sfg); break-before: page; min-height: 210mm; padding-block: 12mm !important; }
  .hero { break-before: avoid; height: 210mm !important; min-height: 0; padding: 0 !important; }
  .hero, .contact { --sbg: #15171C; --sfg: #F1EADF; --sfg2: #B9B4AC; --sacc: #E9876F; --scard: #1F2228; --sline: rgba(241, 234, 223, .16); }
  #services { --sbg: #FAF7F1; --sfg: #15171C; --sfg2: #4a4d55; --sacc: #B24228; --scard: #F1EADF; --sline: rgba(21, 23, 28, .14); }
  #products { --sbg: #F1EADF; --sfg: #15171C; --sfg2: #4a4d55; --sacc: #B24228; --scard: #FAF7F1; --sline: rgba(21, 23, 28, .14); }
  #clients { --sbg: #0E3A31; --sfg: #F1EADF; --sfg2: #C9D2C4; --sacc: #F0A08B; --scard: #15493E; --sline: rgba(241, 234, 223, .16); }
  #about { --sbg: #E4E6DA; --sfg: #15171C; --sfg2: #4a4d55; --sacc: #56633F; --scard: #FAF7F1; --sline: rgba(21, 23, 28, .14); }

  /* Cover */
  /* The slot is pinned to the page edge: in grid it drifted off the page */
  .hero-inner { position: relative; height: 210mm !important; padding: 16mm 16mm !important; padding-inline-end: 104mm !important; grid-template-columns: minmax(0, 1fr) !important; grid-template-areas: "copy" "stats" !important; max-width: none !important; }
  .hero-copy { opacity: 1 !important; transform: none !important; }
  .hero-title { font-size: 50px !important; }
  .hero-slot { position: absolute !important; inset-inline-end: 18mm; top: 40mm; width: 72mm !important; height: 132mm !important; background: url(assets/print/hero-phone-ar.png) center / contain no-repeat; }
  .hero-slot:lang(en) { background-image: url(assets/print/hero-phone-en.png); }
  /* On a narrow print viewport app.js moves the live phone into the slot; in RTL that blanks every page, so print the still only */
  .hero-slot > * { display: none !important; }
  .stats dt { font-size: 26px; }

  /* Services + process share a page */
  .h2 { font-size: 28px; }
  .lead { font-size: 13px; }
  .section-head { margin-bottom: 7mm !important; }
  .services { grid-template-columns: repeat(4, 1fr) !important; gap: 4mm !important; }
  .service { padding: 5mm !important; }
  .service p { font-size: 11px; }
  .process { padding: 10mm 0 0 !important; }
  .ruler h3 { font-size: 17px; }
  .ruler p { font-size: 11px; }

  /* Products: one featured project per page, then the cards */
  #products { padding: 0 !important; }
  #products .section-head { padding-top: 12mm; }
  .feature { break-inside: avoid; grid-template-columns: 1fr 1fr !important; gap: 10mm; height: 150mm; margin: 0 0 0 !important; padding: 9mm 11mm !important; border-radius: 18px; box-shadow: none !important; }
  .feature + .feature { break-before: page; margin-top: 14mm !important; height: 180mm; }
  .feature:nth-child(even) .phones { order: -1 !important; }
  .feature .phone { max-width: 46mm; box-shadow: none !important; }
  .feature-desc, .feature .points li { font-size: 12px; }
  /* Cards page stays sand to the bottom */
  #productCards { break-before: page; padding-top: 12mm; min-height: 196mm; align-content: start; grid-template-columns: repeat(3, 1fr) !important; gap: 4mm !important; }
  .card { padding: 5mm !important; border-radius: 14px; break-inside: avoid; box-shadow: none !important; transform: none !important; }
  .card-title { font-size: 15px; }
  .card-desc, .card-tag { font-size: 11px; }
  .card .role { margin: 0 0 6px !important; }
  #productCards .card-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: none; }
  .card .app-icon { width: 38px; height: 38px; border-radius: 10px; }
  .card-head { margin-bottom: 2.5mm !important; }
  .card-shots { margin-top: 2.5mm !important; gap: 2mm !important; }
  .card-foot { margin-top: 2.5mm !important; }
  .card-shots img { width: 10mm; border-width: 2px; border-radius: 5px; }
  .card-shots.mac img { width: 100%; max-width: 30mm; }
  .tags li { font-size: 9.5px; padding: 2px 7px; }

  /* Clients: the design showcase on one page, the cards on the next */
  #clients { padding: 11mm 0 !important; }
  .showcase { break-after: page; padding: 8mm 0 5mm !important; border-radius: 16px; box-shadow: none !important; }
  .sc-top { padding: 0 9mm !important; gap: 8mm !important; grid-template-columns: 1.3fr .7fr !important; }
  .showcase h3 { font-size: 24px; margin-top: 3mm; }
  .sc-desc { font-size: 11px; }
  .showcase .points { display: none; }
  .film-track { padding: 2mm 0 4mm !important; gap: 4mm !important; }
  .film-track .phone { width: 25mm !important; border-width: 2px; border-radius: 9px; box-shadow: none !important; }
  /* Fit the strip to the page */
  .film-track { width: 100% !important; justify-content: center; }
  .film-track .phone:nth-child(n+9) { display: none; }
  .filmstrip { margin-top: 5mm; -webkit-mask: none !important; mask: none !important; }
  .sc-system { padding: 4mm 9mm 0 !important; }
  .sc-icons { display: none !important; }
  #clientCards { grid-template-columns: repeat(4, 1fr) !important; gap: 3.5mm !important; padding-top: 12mm; min-height: 186mm; align-content: start; }
  #clients .card-shots { display: none !important; }
  #clients .card .tags { display: none; }

  /* About and contact */
  .about { display: flex; flex-direction: column; justify-content: center; }
  .about-grid { grid-template-columns: 90mm 1fr !important; gap: 14mm !important; }
  .about-body { font-size: 13px; }
  .contact { display: flex; flex-direction: column; justify-content: center; }
  .footer { display: none; }
}
