/* ==========================================================================
   Abdulla Jouda — portfolio
   Light-first. Every colour, space and curve is a token; change it here.
   ========================================================================== */

@view-transition { navigation: auto; }

:root {
  /* Surfaces */
  --bg: #f7f5f0;
  --bg-sunk: #efebe2;
  --surface: #ffffff;
  --surface-2: #fbfaf7;

  /* Ink */
  --ink: #17150f;
  --ink-2: #3b3830;
  --muted: #6b665c;
  --line: #e6e1d6;
  --line-strong: #d4ccbb;

  /* Accent — Flutter blue.
     --accent for large marks and fills, --accent-text for body-size text (AA). */
  --accent: #0175c2;
  --accent-text: #02569b;
  --accent-soft: #dcefff;
  --olive: #0e8a7e;
  --olive-soft: #d8f2ee;
  --olive-text: #0b6158;
  --danger-soft: #fde8e8;
  --danger-text: #b42318;

  --shadow-sm: 0 1px 2px rgb(40 30 15 / .06), 0 1px 1px rgb(40 30 15 / .04);
  --shadow-md: 0 10px 30px -12px rgb(40 30 15 / .18), 0 2px 6px -2px rgb(40 30 15 / .06);
  --shadow-lg: 0 40px 80px -30px rgb(40 30 15 / .35), 0 18px 36px -18px rgb(40 30 15 / .25);

  /* Type */
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* Space */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px; --sp-10: 140px;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 36px;

  /* Motion */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --container: 1200px;
  --header-h: 76px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #12110e;
  --bg-sunk: #0c0b09;
  --surface: #1b1915;
  --surface-2: #17150f;
  --ink: #f3efe6;
  --ink-2: #d6d0c3;
  --muted: #a39d90;
  --line: #2c2923;
  --line-strong: #3d3930;
  --accent: #13b9fd;
  --accent-text: #54c5f8;
  --accent-soft: #0b2a3d;
  --olive: #4fd1c5;
  --olive-soft: #0f2a28;
  --olive-text: #7fe0d6;
  --danger-soft: #3a1514;
  --danger-text: #fda29b;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
  --shadow-md: 0 10px 30px -12px rgb(0 0 0 / .6);
  --shadow-lg: 0 40px 80px -30px rgb(0 0 0 / .8), 0 18px 36px -18px rgb(0 0 0 / .6);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
p, h1, h2, h3, h4, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }

::selection { background: var(--accent); color: #fff; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; inset-inline-start: 16px; top: -100px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px;
}
.skip-link:focus { top: 16px; }

.icon { width: 1.1em; height: 1.1em; flex: none; }

/* ------------------------------------------------------------- layout */

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.container--wide { max-width: 1320px; }
@media (max-width: 600px) { .container { padding-inline: 16px; } }

.section { padding-block: var(--sp-9); position: relative; }
.section--tight { padding-block: var(--sp-7); }
.section--sunk { background: var(--bg-sunk); }
@media (max-width: 700px) { .section { padding-block: var(--sp-8); } }

.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }

.section-head {
  display: flex; justify-content: space-between; align-items: end; gap: var(--sp-5);
  margin-bottom: var(--sp-7); flex-wrap: wrap;
}

/* --------------------------------------------------------------- type */

.h1, .h2, .h3, .h4, .display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.02;
  text-wrap: balance;
}
.display { font-size: clamp(44px, 7.2vw, 104px); font-weight: 700; letter-spacing: -.045em; line-height: .96; }
.h1 { font-size: clamp(40px, 5.6vw, 76px); }
.h2 { font-size: clamp(32px, 4vw, 54px); }
.h3 { font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -.02em; line-height: 1.15; }
.h4 { font-size: 18px; letter-spacing: -.01em; line-height: 1.3; }

.serif { font-family: var(--font-serif); font-weight: 400; font-style: italic; letter-spacing: -.01em; }
.accent { color: var(--accent); }

.lede { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.55; color: var(--ink-2); max-width: 58ch; text-wrap: pretty; }
.small { font-size: 14px; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.eyebrow::before {
  content: ""; width: 22px; height: 1.5px; background: var(--accent); border-radius: 2px;
}

/* ----------------------------------------------------------- buttons */

.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line-strong);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 24px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  font-weight: 600; font-size: 15px; letter-spacing: -.005em; white-space: nowrap;
  cursor: pointer; overflow: hidden; isolation: isolate;
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), background-color .25s, border-color .25s, color .25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0) scale(.98); transition-duration: .1s; }
.btn .icon { transition: transform .35s var(--ease-out); }
.btn:hover .icon { transform: translateX(3px); }
[dir="rtl"] .icon-arrow { scale: -1 1; }
[dir="rtl"] .btn:hover .icon { transform: translateX(-3px); }

.btn--primary { --btn-bg: var(--ink); --btn-fg: var(--bg); --btn-bd: var(--ink); }
.btn--primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--accent); border-radius: inherit;
  transform: translateY(101%); transition: transform .45s var(--ease-out);
}
.btn--primary:hover { --btn-bd: var(--accent); color: #fff; }
.btn--primary:hover::after { transform: translateY(0); }
.btn--secondary:hover { --btn-bd: var(--ink); }
.btn--ghost { --btn-bg: transparent; --btn-bd: transparent; padding-inline: 4px; }
.btn--ghost:hover { box-shadow: none; color: var(--accent-text); }
.btn--sm { height: 40px; padding: 0 16px; font-size: 14px; }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: transparent; border: 1px solid transparent; cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .3s var(--ease-out);
}
.icon-btn:hover { background: var(--bg-sunk); border-color: var(--line); }
.icon-btn:active { transform: scale(.92); }

/* --------------------------------------------------------- pills/tags */

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
}
.pill--accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.pill--neutral { background: var(--bg-sunk); border-color: transparent; color: var(--ink-2); }
.pill__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill__dot--live { background: #22a35a; box-shadow: 0 0 0 0 rgb(34 163 90 / .5); animation: pulse 2.2s var(--ease-out) infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgb(34 163 90 / .55); }
  70%, 100% { box-shadow: 0 0 0 9px rgb(34 163 90 / 0); }
}

.techline { display: flex; flex-wrap: wrap; gap: 6px; }
.tech {
  font-family: var(--font-mono); font-size: 12px; padding: 4px 10px; border-radius: 8px;
  background: var(--bg-sunk); color: var(--ink-2); border: 1px solid var(--line);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 10px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.chip b { color: var(--ink); }
.chip--accent { background: var(--surface); }

/* ------------------------------------------------------------ header */

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  display: flex; align-items: center;
  transition: transform .4s var(--ease-out);
}
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 58px; padding: 0 8px 0 10px; border-radius: 999px;
  border: 1px solid transparent;
  transition: background-color .35s, border-color .35s, box-shadow .35s, backdrop-filter .35s;
}
.is-scrolled .nav {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border-color: var(--line);
  box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.monogram {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--ink); color: var(--bg); font-family: var(--font-display); font-weight: 800; font-size: 14px; letter-spacing: .02em;
  transition: transform .5s var(--ease-spring), background-color .3s;
}
.brand:hover .monogram { transform: rotate(-8deg) scale(1.06); background: var(--accent); color: #fff; }

.nav-links { display: flex; gap: 2px; padding: 4px; border-radius: 999px; }
.nav-links a {
  position: relative; display: block; padding: 8px 16px; border-radius: 999px;
  font-size: 15px; font-weight: 500; color: var(--muted); transition: color .2s, background-color .2s;
}
.nav-links a:hover { color: var(--ink); background: var(--bg-sunk); }
.nav-links a[aria-current="page"] { color: var(--ink); background: var(--bg-sunk); }
.nav-links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--accent);
}

.nav-actions { display: flex; align-items: center; gap: 6px; }
.nav-toggle { display: none; }
[data-theme="light"] .icon-sun, [data-theme="dark"] .icon-moon { display: none; }

@media (max-width: 820px) {
  .nav-links, .nav-resume { display: none; }
  .nav-toggle { display: inline-grid; }
}

.scroll-progress {
  position: fixed; inset: 0 0 auto; height: 2px; z-index: 60;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--progress, 0));
}

/* drawer */
.nav-backdrop {
  position: fixed; inset: 0; z-index: 70; background: rgb(20 15 8 / .35);
  opacity: 0; pointer-events: none; transition: opacity .35s;
}
.nav-backdrop[data-open="true"] { opacity: 1; pointer-events: auto; }
.nav-drawer {
  position: fixed; top: 10px; inset-inline-end: 10px; bottom: 10px; z-index: 80; width: min(360px, calc(100% - 20px));
  display: flex; flex-direction: column; gap: var(--sp-5); padding: var(--sp-5);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  transform: translateX(calc(100% + 20px)); transition: transform .5s var(--ease-out); visibility: hidden;
}
[dir="rtl"] .nav-drawer { transform: translateX(calc(-100% - 20px)); }
.nav-drawer[data-open="true"] { transform: none; visibility: visible; }
.nav-drawer__head { display: flex; justify-content: space-between; align-items: center; }
.nav-drawer__links { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-drawer__links a {
  display: block; padding: 12px 6px; font-family: var(--font-display); font-weight: 700;
  font-size: 34px; letter-spacing: -.03em; border-bottom: 1px solid var(--line);
  transition: color .2s, padding .3s var(--ease-out);
}
.nav-drawer__links a:hover, .nav-drawer__links a[aria-current="page"] { color: var(--accent); padding-inline-start: 14px; }

/* -------------------------------------------------------------- hero */

.hero { position: relative; padding: calc(var(--header-h) + var(--sp-8)) 0 var(--sp-8); overflow: clip; }
.hero--page { padding-bottom: var(--sp-7); }
.hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hero__bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
  opacity: .7;
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
  animation: drift 18s var(--ease-in-out) infinite alternate;
}
.blob--a { width: 520px; height: 520px; background: #b9e2fc; top: -160px; right: -80px; }
.blob--b { width: 420px; height: 420px; background: #cfe7f7; bottom: -160px; left: -120px; animation-delay: -6s; animation-duration: 22s; }
.blob--c { width: 300px; height: 300px; background: #a8dcfb; top: 40%; left: 45%; animation-delay: -12s; opacity: .4; }
[data-theme="dark"] .blob { opacity: .14; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-40px, 30px, 0) scale(1.08); }
  100% { transform: translate3d(30px, -20px, 0) scale(.95); }
}

.hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: var(--sp-7); align-items: center; }
@media (max-width: 980px) { .hero__grid { grid-template-columns: 1fr; gap: var(--sp-6); } }

.hero__title { margin-top: var(--sp-5); }
.hero__title .serif { color: var(--accent); font-size: 1.08em; letter-spacing: -.02em; }
.hero__lede { margin-top: var(--sp-5); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--sp-6); }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: var(--sp-6); font-size: 14px; color: var(--muted); }
.hero__meta > * { display: inline-flex; align-items: center; gap: 8px; }
.hero__meta a:hover { color: var(--accent-text); }

/* word-by-word headline */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split .w > span { display: inline-block; transform: translateY(105%); animation: rise .9s var(--ease-out) forwards; animation-delay: calc(var(--i) * 55ms + 120ms); }
@keyframes rise { to { transform: translateY(0); } }

.fade-up { opacity: 0; transform: translateY(18px); animation: fadeUp .8s var(--ease-out) forwards; animation-delay: var(--d, 0ms); }
@keyframes fadeUp { to { opacity: 1; transform: none; } }

/* hero phones */
.hero-phones {
  --phone-w: clamp(170px, 17vw, 250px);
  position: relative; height: calc(var(--phone-w) * 2.35); display: grid; place-items: center;
}
.hero-phones__item {
  position: absolute; left: 50%; top: 50%;
  translate: calc(-50% + var(--x, 0px) + var(--px, 0px)) calc(-50% + var(--y, 0px) + var(--py, 0px));
  rotate: var(--r, 0deg);
  opacity: 0; animation: phoneIn 1.2s var(--ease-out) forwards; animation-delay: var(--d, 0ms);
}
.hero-phones__item--l { --x: calc(var(--phone-w) * -.72); --y: calc(var(--phone-w) * .14); --r: -9deg; --d: 420ms; z-index: 1; }
.hero-phones__item--c { z-index: 3; --d: 250ms; }
.hero-phones__item--r { --x: calc(var(--phone-w) * .72); --y: calc(var(--phone-w) * .2); --r: 9deg; --d: 560ms; z-index: 2; }
.hero-phones__item--l .float, .hero-phones__item--r .float { scale: .86; }
@keyframes phoneIn {
  from { opacity: 0; transform: translateY(80px) scale(.94); }
  to { opacity: 1; transform: none; }
}
.float { animation: bob 7s var(--ease-in-out) infinite alternate; }
.hero-phones__item--l .float { animation-delay: -2.5s; animation-duration: 8s; }
.hero-phones__item--r .float { animation-delay: -4.5s; animation-duration: 9s; }
@keyframes bob { from { transform: translateY(-8px); } to { transform: translateY(10px); } }
@media (max-width: 980px) {
  .hero-phones { --phone-w: clamp(150px, 34vw, 220px); margin-top: var(--sp-4); }
}


/* ------------------------------------------------------------- phone */

.phone {
  position: relative; width: var(--phone-w, 240px); aspect-ratio: 9 / 19.5; flex: none;
  padding: calc(var(--phone-w, 240px) * .032);
  border-radius: 16% / 7.4%;
  background: linear-gradient(145deg, #2b2a2e, #0d0d0f 40%, #1b1a1d);
  box-shadow:
    inset 0 0 0 1.5px #3a393d,
    inset 0 0 0 calc(var(--phone-w, 240px) * .012) #0b0b0c,
    var(--shadow-lg);
}
.phone::before, .phone::after {
  content: ""; position: absolute; width: 3px; border-radius: 2px; background: #1d1c1f;
}
.phone::before { left: -2px; top: 22%; height: 7%; box-shadow: 0 calc(var(--phone-w, 240px) * .2) 0 #1d1c1f; }
.phone::after { right: -2px; top: 28%; height: 12%; }
.phone__screen {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  border-radius: 13.5% / 6.2%; background: #fff;
  container-type: inline-size;
}
.phone__screen > img { width: 100%; height: 100%; object-fit: cover; }
.phone__island {
  position: absolute; z-index: 5; top: 2.4%; left: 50%; width: 31%; height: 3.3%;
  translate: -50% 0; border-radius: 999px; background: #000;
}
.phone__glare {
  position: absolute; inset: 0; z-index: 6; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, rgb(255 255 255 / .16) 0%, rgb(255 255 255 / 0) 32%);
}

.phone, .browser { direction: ltr; }

/* fanned group of phones (project cards) */
.fan {
  --phone-w: clamp(140px, 14.5vw, 204px);
  position: relative; height: calc(var(--phone-w) * 2.3); width: 100%;
}
.fan .phone {
  position: absolute; left: 50%; top: 50%;
  translate: calc(-50% + var(--fx, 0px)) calc(-50% + var(--fy, 0px));
  rotate: var(--fr, 0deg);
  transition: translate .8s var(--ease-out), rotate .8s var(--ease-out), scale .8s var(--ease-out);
}
.fan .phone:nth-child(1) { --fx: calc(var(--phone-w) * -.5); --fy: 4%; --fr: -6deg; z-index: 1; scale: .92; }
.fan .phone:nth-child(2) { z-index: 3; }
.fan .phone:nth-child(3) { --fx: calc(var(--phone-w) * .5); --fy: 6%; --fr: 6deg; z-index: 2; scale: .92; }
.fan--two .phone:nth-child(1) { --fx: calc(var(--phone-w) * -.32); }
.fan--two .phone:nth-child(2) { --fx: calc(var(--phone-w) * .32); --fy: 4%; --fr: 5deg; scale: .96; }
.project:hover .fan .phone:nth-child(1), .fan:focus-within .phone:nth-child(1) { --fx: calc(var(--phone-w) * -.82); --fr: -10deg; }
.project:hover .fan .phone:nth-child(3) { --fx: calc(var(--phone-w) * .82); --fr: 10deg; }
.project:hover .fan .phone:nth-child(2) { translate: -50% calc(-50% - 10px); }
.project:hover .fan--two .phone:nth-child(1) { --fx: calc(var(--phone-w) * -.48); --fr: -6deg; translate: calc(-50% + var(--fx)) -50%; }
.project:hover .fan--two .phone:nth-child(2) { --fx: calc(var(--phone-w) * .48); --fr: 7deg; translate: calc(-50% + var(--fx)) calc(-50% + 4%); }

/* browser frame (web projects) */
.browser {
  width: 100%; max-width: 560px; border-radius: 14px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
}
.browser__bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: var(--bg-sunk); border-bottom: 1px solid var(--line); }
.browser__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.browser__bar i:nth-child(1) { background: #ef6b5e; } .browser__bar i:nth-child(2) { background: #f4bf4f; } .browser__bar i:nth-child(3) { background: #61c454; }
.browser__url { flex: 1; margin-left: 10px; padding: 4px 12px; border-radius: 8px; background: var(--surface); font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.browser__screen { position: relative; aspect-ratio: 16 / 10; container-type: inline-size; }

/* ----------------------------------------------------------- marquee */

.marquee {
  position: relative; overflow: hidden; padding-block: var(--sp-5);
  border-block: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { direction: ltr; display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__group { display: flex; align-items: center; gap: 48px; padding-right: 48px; }
.marquee__item {
  display: inline-flex; align-items: center; gap: 48px;
  font-family: var(--font-display); font-weight: 600; font-size: clamp(22px, 2.6vw, 34px);
  letter-spacing: -.03em; color: var(--ink-2); white-space: nowrap;
}
.marquee__item::after { content: "✦"; font-size: .55em; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* -------------------------------------------------------------- stats */

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: var(--sp-6) var(--sp-5); border-inline-start: 1px solid var(--line); }
.stat:first-child { border-inline-start: 0; padding-inline-start: 0; }
.stat__value {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(44px, 5vw, 68px);
  letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums;
}
.stat__value em { font-style: normal; color: var(--accent); }
.stat__label { margin-top: var(--sp-3); color: var(--muted); font-size: 14.5px; max-width: 26ch; }
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: var(--sp-5) var(--sp-4); }
  .stat:nth-child(odd) { border-inline-start: 0; padding-inline-start: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* --------------------------------------------------------- showcase */

.showcase { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-7); }
.showcase__stage {
  --phone-w: min(20vw, 270px, calc((100vh - 220px) * 9 / 19.5));
  position: sticky; top: 0; height: 100vh; display: grid; place-items: center;
}
.stage__glow {
  position: absolute; width: min(90%, 560px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--stage-color, var(--accent)) 0%, transparent 65%);
  opacity: .28; transition: background 1s var(--ease-out);
}
.stage__ring {
  position: absolute; width: min(80%, 500px); aspect-ratio: 1; border-radius: 50%;
  border: 1px dashed var(--line-strong); animation: spin 60s linear infinite;
}
.stage__ring::after {
  content: ""; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; border-radius: 50%;
  background: var(--stage-color, var(--accent)); transition: background 1s;
}
@keyframes spin { to { rotate: 360deg; } }
.stage__set { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.stage__set .phone {
  position: absolute; left: 50%; top: 50%;
  transition: translate 1s var(--ease-out), rotate 1s var(--ease-out), opacity .6s var(--ease-out), scale 1s var(--ease-out);
  opacity: 0;
}
.stage__set .phone--front { translate: calc(-50% + var(--phone-w) * .22) calc(-50% + 70px); rotate: 4deg; scale: .94; z-index: 2; }
.stage__set .phone--back { translate: calc(-50% - var(--phone-w) * .38) calc(-50% + 110px); rotate: -14deg; scale: .78; z-index: 1; }
.stage__set.is-active .phone { opacity: 1; }
.stage__set.is-active .phone--front { translate: calc(-50% + var(--phone-w) * .22) -50%; rotate: 0deg; scale: 1; }
.stage__set.is-active .phone--back { translate: calc(-50% - var(--phone-w) * .4) calc(-50% + 16px); rotate: -8deg; scale: .86; transition-delay: 80ms; }
.stage__set.is-past .phone--front { translate: calc(-50% + var(--phone-w) * .22) calc(-50% - 70px); rotate: -4deg; }
.stage__set.is-past .phone--back { translate: calc(-50% - var(--phone-w) * .38) calc(-50% - 60px); }

.stage__counter {
  position: absolute; bottom: 7vh; left: 50%; translate: -50% 0;
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.stage__dots { display: flex; gap: 6px; }
.stage__dots i { width: 6px; height: 6px; border-radius: 999px; background: var(--line-strong); transition: width .5s var(--ease-out), background-color .5s; }
.stage__dots i.on { width: 22px; background: var(--ink); }

.step { min-height: 92vh; display: flex; flex-direction: column; justify-content: center; padding-block: var(--sp-7); }
.step__inner { opacity: .28; transition: opacity .6s var(--ease-out), transform .8s var(--ease-out); transform: translateX(-10px); }
[dir="rtl"] .step__inner { transform: translateX(10px); }
.step.is-active .step__inner { opacity: 1; transform: none; }
.step__num { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.step__num b { color: var(--app, var(--accent)); font-weight: 500; }
.step__name { margin-top: var(--sp-3); font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 5vw, 72px); letter-spacing: -.05em; line-height: 1; }
.step__name span { display: block; margin-top: 10px; font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: .42em; letter-spacing: -.01em; color: var(--app, var(--accent)); }
.step__body { margin-top: var(--sp-5); color: var(--ink-2); font-size: 17px; max-width: 46ch; }
.step__facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: var(--sp-6); margin-top: var(--sp-6); }
.step__facts dt { font-family: var(--font-display); font-weight: 700; font-size: 28px; letter-spacing: -.03em; }
.step__facts dd { font-size: 13px; color: var(--muted); }
.step .techline { margin-top: var(--sp-5); }
.step__link { margin-top: var(--sp-5); }
.step__phones { display: none; }

@media (max-width: 900px) {
  .showcase { grid-template-columns: 1fr; gap: 0; }
  .showcase__stage { display: none; }
  .step { min-height: 0; padding-block: var(--sp-7); border-top: 1px solid var(--line); }
  .step:first-child { border-top: 0; }
  .step__inner { opacity: 1; transform: none; }
  .step__phones { --phone-w: clamp(140px, 40vw, 200px); display: block; position: relative; height: calc(var(--phone-w) * 2.25); margin-bottom: var(--sp-5); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--app) 12%, var(--bg-sunk)); overflow: hidden; }
  .step__phones .phone { position: absolute; left: 50%; top: 9%; }
  .step__phones .phone--front { translate: calc(-50% + var(--phone-w) * .28) 0; z-index: 2; }
  .step__phones .phone--back { translate: calc(-50% - var(--phone-w) * .38) 6%; rotate: -8deg; scale: .86; }
  .step__facts { gap: var(--sp-5); }
}

/* -------------------------------------------------------------- cards */

.card {
  position: relative; padding: var(--sp-6); border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out), border-color .3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card__icon {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent-text); font-size: 22px;
  transition: transform .6s var(--ease-spring);
}
.card:hover .card__icon { transform: rotate(-8deg) scale(1.08); }
.card__title { margin-top: var(--sp-5); font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.02em; line-height: 1.2; }
.card__body { margin-top: var(--sp-3); color: var(--ink-2); font-size: 15.5px; }

/* --------------------------------------------------------------- CTA */

.cta {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(40px, 7vw, 96px); border-radius: var(--radius-xl);
  background: var(--ink); color: var(--bg); text-align: center;
}
.cta::before {
  content: ""; position: absolute; z-index: -1; width: 640px; height: 640px; left: 50%; top: 100%;
  translate: -50% -40%; border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 65%); opacity: .55;
  animation: breathe 8s var(--ease-in-out) infinite alternate;
}
@keyframes breathe { to { scale: 1.25; opacity: .75; } }
.cta .h2 { max-width: 18ch; margin-inline: auto; }
.cta p { margin: var(--sp-4) auto 0; max-width: 52ch; color: color-mix(in srgb, var(--bg) 72%, transparent); font-size: 17px; }
.cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: var(--sp-6); }
.cta .btn--primary { --btn-bg: var(--bg); --btn-fg: var(--ink); --btn-bd: var(--bg); }
.cta .btn--secondary { --btn-bg: transparent; --btn-fg: var(--bg); --btn-bd: color-mix(in srgb, var(--bg) 30%, transparent); }
.cta .btn--secondary:hover { --btn-bd: var(--bg); }

/* ------------------------------------------------------------ footer */

.site-footer { padding: var(--sp-8) 0 var(--sp-6); }
.site-footer__big {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -.06em; line-height: .85;
  font-size: clamp(56px, 13vw, 200px); color: var(--ink);
  display: flex; justify-content: space-between; align-items: end; gap: 16px;
  padding-bottom: var(--sp-6); border-bottom: 1px solid var(--line);
}
.site-footer__big a { transition: color .3s; }
.site-footer__big a:hover { color: var(--accent); }
.site-footer__inner { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); flex-wrap: wrap; padding-top: var(--sp-5); }
.site-footer__links { display: flex; gap: 22px; font-size: 14px; }
.site-footer__links a { color: var(--muted); transition: color .2s; }
.site-footer__links a:hover { color: var(--ink); }

/* ---------------------------------------------------------- projects */

.filters { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); margin-bottom: var(--sp-4); }
.filter {
  padding: 9px 18px; border-radius: 999px; border: 0; background: transparent; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted); transition: background-color .3s var(--ease-out), color .3s;
}
.filter:hover { color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.projects { display: grid; gap: var(--sp-6); }
.project {
  --app: var(--accent);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--sp-7); align-items: center;
  padding: var(--sp-5); border-radius: var(--radius-xl);
  background: var(--surface); border: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.project.is-filtered-in { animation: fadeUp .6s var(--ease-out) both; }
.project__media {
  position: relative; display: grid; place-items: center; align-self: stretch; min-height: 420px;
  padding: var(--sp-7) var(--sp-4); border-radius: calc(var(--radius-xl) - 10px); overflow: hidden;
  background:
    radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--app) 38%, transparent), transparent 60%),
    color-mix(in srgb, var(--app) 9%, var(--bg-sunk));
}
.project__media::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--app) 30%, transparent) 1px, transparent 1.3px);
  background-size: 20px 20px; opacity: .5;
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000, transparent 70%);
  mask-image: radial-gradient(circle at 50% 40%, #000, transparent 70%);
}
.project:nth-child(even) .project__media { order: 2; }
.project__body { padding-block: var(--sp-4); padding-inline: 0 var(--sp-4); }
.project:nth-child(even) .project__body { padding-block: var(--sp-4); padding-inline: var(--sp-4) 0; }
.project__head { display: flex; justify-content: space-between; align-items: start; gap: var(--sp-4); }
.project__kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.project__kicker b { color: var(--app); font-weight: 500; }
.project__name { margin-top: var(--sp-2); font-family: var(--font-display); font-weight: 700; font-size: clamp(32px, 3.4vw, 46px); letter-spacing: -.045em; line-height: 1; }
.project__name span { display: block; margin-top: 8px; font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: .5em; letter-spacing: -.01em; color: var(--ink-2); }
.project__role { margin-top: var(--sp-4); color: var(--muted); font-size: 15px; }
.project__points { display: grid; gap: 10px; margin-top: var(--sp-5); }
.project__points li { position: relative; padding-inline-start: 20px; font-size: 15px; color: var(--ink-2); line-height: 1.55; }
.project__points li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .62em; width: 7px; height: 7px; border-radius: 2px; background: var(--app); rotate: 45deg; }
.project__points b { color: var(--ink); font-weight: 600; }
.project .techline { margin-top: var(--sp-5); }
.project__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--sp-5); }

@media (max-width: 960px) {
  .project { grid-template-columns: 1fr; gap: var(--sp-5); padding: 12px; }
  .project:nth-child(even) .project__media { order: 0; }
  .project__media { min-height: 0; padding: var(--sp-6) 0; }
  .project__body, .project:nth-child(even) .project__body { padding: var(--sp-3) var(--sp-3) var(--sp-4); }
  .fan { --phone-w: clamp(110px, 30vw, 170px); }
}

.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: var(--sp-6); }
.client {
  display: flex; flex-direction: column; gap: 4px; padding: var(--sp-5);
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  transition: transform .4s var(--ease-out), border-color .3s, box-shadow .4s var(--ease-out);
}
.client b { font-family: var(--font-display); font-size: 20px; letter-spacing: -.02em; }
.client span { font-size: 13px; color: var(--muted); }
.client:is(a):hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: var(--shadow-md); }
.client:is(a) b::after { content: " ↗"; color: var(--accent); font-size: .8em; }

/* -------------------------------------------------------- experience */

.timeline { position: relative; display: grid; gap: var(--sp-5); padding-inline-start: 44px; }
.timeline::before, .timeline::after {
  content: ""; position: absolute; inset-inline-start: 11px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--line);
}
.timeline::after { background: var(--accent); transform-origin: top; transform: scaleY(var(--fill, 0)); }
.role { position: relative; padding: var(--sp-6); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.role::before {
  content: ""; position: absolute; inset-inline-start: -40px; top: 34px; z-index: 1; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line-strong); transition: border-color .4s, background-color .4s, box-shadow .4s;
}
.role.is-visible::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }
.role__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.role__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -.03em; line-height: 1.2; }
.role__title span { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--accent-text); }
.role__when { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.role__summary { margin-top: var(--sp-3); color: var(--ink-2); }
.role__body .project__points li::before { background: var(--accent); }
.role__body .techline { margin-top: var(--sp-5); }
@media (max-width: 600px) {
  .timeline { padding-inline-start: 28px; }
  .timeline::before, .timeline::after { inset-inline-start: 5px; }
  .role { padding: var(--sp-5); }
  .role::before { inset-inline-start: -29px; }
}

.matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.matrix__row { padding: var(--sp-5); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color .3s, transform .4s var(--ease-out); }
.matrix__row:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.matrix__key { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.matrix__val { margin-top: var(--sp-2); color: var(--ink-2); font-size: 15px; }
@media (max-width: 700px) { .matrix { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------- contact */

.contact-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: var(--sp-7); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-row {
  display: flex; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line);
  transition: padding .4s var(--ease-out);
}
a.contact-row:hover { padding-inline-start: 8px; }
a.contact-row:hover .contact-row__value { color: var(--accent-text); }
.contact-row__icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 18px; }
.contact-row__label { font-size: 13px; color: var(--muted); }
.contact-row__value { font-weight: 600; font-size: 17px; transition: color .2s; word-break: break-word; }
.social { display: flex; flex-wrap: wrap; gap: 8px; }
.social a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; transition: border-color .2s, transform .3s var(--ease-out); }
.social a:hover { border-color: var(--ink); transform: translateY(-2px); }

.form-card { padding: clamp(24px, 4vw, 40px); border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.form { display: grid; gap: var(--sp-4); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
@media (max-width: 560px) { .form__row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field textarea {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--ink); font: inherit; font-size: 15px;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.field__hint { font-size: 13px; color: var(--muted); }
.form__note { padding: 12px 16px; border-radius: 12px; font-size: 14px; }
.form__note--ok { background: var(--olive-soft); color: var(--olive-text); }
.form__note--error { background: var(--danger-soft); color: var(--danger-text); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; box-shadow: none; }

/* ------------------------------------------------------------ reveal */

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ================================================================ mock UI
   Illustrative app screens drawn in CSS. Everything is in em, and the root
   font-size is a fraction of the phone's width (cqw), so screens scale with
   whatever frame they sit in.
   ======================================================================= */

.m {
  --m-bg: #fff; --m-card: #f4f4f5; --m-ink: #111; --m-accent: #111; --m-soft: #eee; --m-grad: var(--m-accent); --m-line: rgb(0 0 0 / .07);
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: .85em;
  padding: 0 1.15em 5em; overflow: hidden;
  background: var(--m-bg); color: var(--m-ink);
  font-family: var(--font-body); font-size: 4.1cqw; line-height: 1.3; letter-spacing: -.005em; text-align: left;
}
.m--dark { --m-line: rgb(255 255 255 / .08); }
.m * { margin: 0; }
.m-status { display: flex; justify-content: space-between; align-items: center; padding: 1.1em .7em .15em; font-size: .8em; font-weight: 600; flex: none; }
.m-status__r { display: flex; gap: .3em; align-items: center; }
.m-status__r i { display: block; height: .7em; border-radius: .15em; background: currentColor; }
.m-status__r i:nth-child(1) { width: 1em; } .m-status__r i:nth-child(2) { width: .8em; opacity: .9; } .m-status__r i:nth-child(3) { width: 1.6em; border-radius: .25em; }
.m-head { display: flex; justify-content: space-between; align-items: center; gap: .6em; }
.m-kicker { font-size: .72em; opacity: .58; font-weight: 500; }
.m-title { font-family: var(--font-display); font-weight: 700; font-size: 1.6em; letter-spacing: -.035em; line-height: 1.05; }
.m-avatar { flex: none; display: grid; place-items: center; width: 2.3em; height: 2.3em; border-radius: 50%; background: var(--m-soft); color: var(--m-accent); font-weight: 700; font-size: .85em; }
.m-label { font-size: .74em; font-weight: 600; opacity: .55; text-transform: uppercase; letter-spacing: .06em; }
.m-card { background: var(--m-card); border-radius: 1.1em; padding: .95em; }
.m-hero { background: var(--m-grad); color: #fff; border-radius: 1.25em; padding: 1.1em; position: relative; overflow: hidden; }
.m-hero::after { content: ""; position: absolute; right: -2.5em; top: -2.5em; width: 7em; height: 7em; border-radius: 50%; background: rgb(255 255 255 / .12); }
.m-big { font-family: var(--font-display); font-weight: 700; font-size: 2.05em; letter-spacing: -.045em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.m-sm { font-size: .72em; opacity: .75; }
.m-row { display: flex; align-items: center; gap: .7em; }
.m-between { display: flex; justify-content: space-between; align-items: center; gap: .6em; }
.m-list { display: flex; flex-direction: column; gap: .8em; }
.m-list--lined > * + * { padding-top: .8em; border-top: 1px solid var(--m-line); }
.m-ico { flex: none; display: grid; place-items: center; width: 2.35em; height: 2.35em; border-radius: .8em; background: var(--m-soft); color: var(--m-accent); font-weight: 700; font-size: .92em; }
.m-grow { flex: 1; min-width: 0; }
.m-t { font-weight: 600; font-size: .9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-s { font-size: .72em; opacity: .55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-amt { font-weight: 650; font-size: .88em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-pos { color: #16a34a; } .m-neg { color: #dc2626; }
.m--dark .m-pos { color: #4ade80; } .m--dark .m-neg { color: #f87171; }
.m-chips { display: flex; gap: .4em; flex-wrap: nowrap; overflow: hidden; }
.m-chip { flex: none; font-size: .72em; padding: .4em .85em; border-radius: 99em; background: var(--m-soft); color: var(--m-accent); font-weight: 600; }
.m-chip.on { background: var(--m-accent); color: var(--m-on, #fff); }
.m-hero .m-chip { background: rgb(255 255 255 / .16); color: #fff; }
.m-hero .m-chip.on { background: #fff; color: var(--m-accent); }
.m-btn { display: grid; place-items: center; height: 2.9em; border-radius: 1em; background: var(--m-accent); color: var(--m-on, #fff); font-weight: 700; font-size: .9em; }
.m-search { display: flex; align-items: center; gap: .6em; height: 2.6em; padding: 0 .9em; border-radius: .9em; background: var(--m-card); font-size: .8em; opacity: .85; }
.m-search::before { content: ""; width: .85em; height: .85em; border-radius: 50%; border: .15em solid currentColor; opacity: .5; }
.m-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6em; }
.m-img { border-radius: .9em; background: var(--g, var(--m-soft)); aspect-ratio: var(--ar, 1); position: relative; overflow: hidden; }
.m-img::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 25%, rgb(255 255 255 / .35), transparent 50%); }

.m-bars { display: flex; align-items: flex-end; gap: .38em; height: 6.2em; }
.m-bars i { flex: 1; height: var(--h); border-radius: .3em .3em .12em .12em; background: var(--m-accent); opacity: var(--o, 1); transform-origin: bottom; transition: transform 1s var(--ease-out); transition-delay: calc(var(--n, 0) * 45ms + 150ms); }
.m-progress { height: .48em; border-radius: 99em; background: var(--m-soft); overflow: hidden; }
.m-progress i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--c, var(--m-accent)); transform-origin: left; transition: transform 1.2s var(--ease-out) .2s; }

@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }
.m-ring {
  --p: 70; --c: var(--m-accent); --t: .55em;
  position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--m-soft) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--t) - 1px), #000 calc(100% - var(--t)));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--t) - 1px), #000 calc(100% - var(--t)));
  transition: --p 1.4s var(--ease-out) .2s;
}
.m-ringwrap { position: relative; display: grid; place-items: center; }
.m-ringwrap > .m-ring { width: 100%; }
.m-ringwrap > .m-ring__in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }

.m-tab {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4.4em; padding: 0 1.4em .9em;
  display: flex; justify-content: space-around; align-items: center;
  background: var(--m-tabbg, var(--m-bg)); border-top: 1px solid var(--m-line);
}
.m-tab i { width: 1.25em; height: 1.25em; border-radius: .42em; background: currentColor; opacity: .22; }
.m-tab i.on { opacity: 1; color: var(--m-accent); border-radius: 50%; }
.m-homebar { position: absolute; z-index: 2; left: 50%; bottom: .5em; width: 35%; height: .3em; border-radius: 9em; background: currentColor; opacity: .3; translate: -50% 0; }

.m-bubble { max-width: 78%; padding: .6em .85em; border-radius: 1.1em; font-size: .82em; line-height: 1.35; background: var(--m-card); }
.m-bubble.me { align-self: flex-end; background: var(--m-accent); color: #fff; border-bottom-right-radius: .3em; }
.m-bubble.them { align-self: flex-start; border-bottom-left-radius: .3em; }
.m-story { flex: none; width: 3.1em; height: 3.1em; border-radius: 50%; padding: .16em; background: var(--m-grad); }
.m-story i { display: block; width: 100%; height: 100%; border-radius: 50%; border: .16em solid var(--m-bg); background: var(--g); }
.m-line { stroke: var(--m-accent); fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 400; stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s var(--ease-out) .2s; }
.m-area { fill: var(--m-accent); opacity: .12; }

/* web dashboard variant */
.m--web { font-size: 1.55cqw; padding: 0; gap: 0; flex-direction: row; }
.m-side { width: 17%; flex: none; padding: 1.4em 1em; background: var(--m-ink); color: #fff; display: flex; flex-direction: column; gap: .9em; }
.m-side i { display: block; height: .7em; border-radius: .3em; background: rgb(255 255 255 / .18); }
.m-side i.on { background: var(--m-accent); }
.m-main { flex: 1; padding: 1.4em 1.6em; display: flex; flex-direction: column; gap: 1.1em; min-width: 0; }
.m-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8em; }
.m-table { display: grid; gap: 0; font-size: .9em; }
.m-table > div { display: grid; grid-template-columns: 1.4fr 1fr 1fr .8fr; gap: .6em; padding: .6em .2em; border-bottom: 1px solid var(--m-line); }
.m-table > div:first-child { font-weight: 600; opacity: .55; font-size: .85em; }

/* Screens animate in once their frame scrolls into view. */
.phone:not(.is-live) .m-bars i, .browser:not(.is-live) .m-bars i { transform: scaleY(.04); }
.phone:not(.is-live) .m-progress i, .browser:not(.is-live) .m-progress i { transform: scaleX(0); }
.phone:not(.is-live) .m-ring { --p: 0 !important; }
.phone:not(.is-live) .m-line { stroke-dashoffset: 400; }

/* ------------------------------------------------------------- Arabic */

html[lang="ar"] {
  --font-display: "Alexandria", "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Arabic", "Inter", system-ui, sans-serif;
  --font-serif: "Amiri", "Instrument Serif", serif;
}
/* Arabic letters join; tracking breaks the script. */
html[lang="ar"] body *:not(.phone *):not(.browser *) { letter-spacing: 0 !important; }
html[lang="ar"] body { line-height: 1.85; }
html[lang="ar"] :is(.h1, .h2, .h3, .h4) { line-height: 1.45; font-weight: 700; }
html[lang="ar"] .display { font-size: clamp(36px, 5.4vw, 78px); line-height: 1.45; font-weight: 700; }
html[lang="ar"] .serif { font-style: normal; font-weight: 700; }
html[lang="ar"] .hero__title .serif { font-size: 1.12em; }
/* No clip mask: Arabic ascenders, dots and tails reach well past the line box. */
html[lang="ar"] .split .w { overflow: visible; padding: 0; margin: 0; }
html[lang="ar"] .split .w > span { opacity: 0; transform: translateY(.45em); animation-name: riseFade; animation-duration: 1s; }
@keyframes riseFade { to { opacity: 1; transform: none; } }
html[lang="ar"] :is(.eyebrow, .project__kicker, .matrix__key, .step__num, .role__when) { font-family: var(--font-body); font-size: 14px; font-weight: 600; }
html[lang="ar"] .step__name, html[lang="ar"] .project__name { line-height: 1.15; }
html[lang="ar"] .step__name span, html[lang="ar"] .project__name span { font-size: .48em; margin-top: 14px; }
html[lang="ar"] .site-footer__big { line-height: 1.2; font-size: clamp(52px, 11vw, 168px); }
html[lang="ar"] .nav-drawer__links a { font-size: 30px; }
html[lang="ar"] .stat__label, html[lang="ar"] .card__body, html[lang="ar"] .project__points li { line-height: 1.85; }

.lang-switch {
  display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--ink-2); border: 1px solid transparent;
  transition: background-color .2s, border-color .2s;
}
.lang-switch:hover { background: var(--bg-sunk); border-color: var(--line); color: var(--ink); }
.lang-switch[lang="ar"] { font-family: "IBM Plex Sans Arabic", var(--font-body); }
.lang-switch[lang="en"] { font-family: "Inter", var(--font-body); }
.brand > span:last-child { white-space: nowrap; }

/* Language + theme, one control */
.prefs {
  display: inline-flex; align-items: center; height: 42px; padding: 3px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .2s;
}
.prefs:hover { border-color: var(--line-strong); }
.prefs__lang { display: inline-flex; gap: 2px; }
.prefs__opt {
  display: grid; place-items: center; height: 34px; min-width: 40px; padding: 0 11px; border-radius: 999px;
  font-size: 13px; font-weight: 600; line-height: 1; color: var(--muted); white-space: nowrap;
  transition: background-color .25s var(--ease-out), color .2s;
}
.prefs__opt[lang="en"] { font-family: "Inter", var(--font-body); }
.prefs__opt[lang="ar"] { font-family: "IBM Plex Sans Arabic", var(--font-body); font-size: 14px; }
a.prefs__opt:hover { color: var(--ink); background: var(--bg-sunk); }
.prefs__opt.is-on { background: var(--ink); color: var(--bg); }
.prefs__sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line-strong); }
.prefs__theme {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background-color .2s, color .2s, transform .3s var(--ease-out);
}
.prefs__theme:hover { background: var(--bg-sunk); color: var(--ink); }
.prefs__theme:active { transform: scale(.9); }
.prefs__theme .icon { animation: themeSpin .5s var(--ease-out); }
@keyframes themeSpin { from { transform: rotate(-90deg) scale(.6); opacity: 0; } }

@media (max-width: 420px) {
  .brand { gap: 10px; font-size: 16px; }
  .nav-actions { gap: 2px; }
  .prefs__opt { min-width: 34px; padding: 0 8px; }
  .prefs__sep { margin: 0 2px; }
}

/* ---------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
  .split .w > span, .fade-up, .hero-phones__item { opacity: 1; transform: none; animation: none; }
  .reveal { opacity: 1; transform: none; }
  .marquee__track { animation: none; }
}
