/* ==========================================================
   صاغ — styles
   Mobile-first. The hero companion is driven by JS: .stage[data-step] (scroll step),
   --sy / --ss (companion offset + scale),
   --px / --py (pointer parallax), and per-caption --o / --shift.
   ========================================================== */

/* ---------- Fonts (OFL; licences in /fonts) ---------- */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: "Alexandria";
  src: url("/fonts/alexandria.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/fonts/ibm-plex-sans-arabic-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/fonts/ibm-plex-sans-arabic-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/fonts/ibm-plex-sans-arabic-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/fonts/ibm-plex-sans-arabic-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #ffffff;          /* page background */
  --bg-2: #f4f2ee;        /* soft band (approach section), card art panels */
  --surface: #ffffff;     /* cards, pills */
  --line: rgba(26, 26, 23, 0.12);
  --text: #1a1a17;
  --muted: rgba(26, 26, 23, 0.6);
  --accent: #d1ff33;      /* brand lime: fills and highlights */
  --accent-deep: #a6c41a; /* lime "lip" under buttons */
  --accent-ink: #1a1a17;  /* text on lime */
  --accent-text: #4f6200; /* lime is unreadable as text on white; olive instead */
  --panel: #1a1a17;       /* dark contact panel */
  --on-panel: #f2efe6;

  /* Brand fonts (self-hosted in /fonts) */
  --font-ar: "IBM Plex Sans Arabic", system-ui, sans-serif;          /* Arabic body + labels */
  --font-ar-display: "Alexandria", "IBM Plex Sans Arabic", system-ui, sans-serif; /* Arabic headlines */
  --font-latin: "Bricolage Grotesque", system-ui, sans-serif;       /* English headlines + body */
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;     /* small uppercase labels */
  /* per-language roles (English page overrides below) */
  --font-body: var(--font-ar);
  --font-display: var(--font-ar-display);

  --nav-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body.is-loading { overflow: hidden; }
/* English page: Latin display face for everything */
html[lang="en"] {
  --font-body: var(--font-latin);
  --font-display: var(--font-latin);
}
h1, h2, h3,
.statement__text,
.builder__sentence { font-family: var(--font-display); }

svg { display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 8px; }

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

.container { max-width: 1120px; margin-inline: auto; padding-inline: 20px; }

.eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-text);
  direction: ltr;
  unicode-bidi: isolate;
}

.eyebrow--ar {
  font-family: var(--font-ar);
  font-size: 15px;
  letter-spacing: 0;
  direction: inherit;
}

/* ---------- Logo tile + buttons (raised "lip" look) ---------- */
.logo-tile {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  box-shadow: 0 3px 0 var(--accent-deep);
  flex: none;
}
.logo-tile svg {
  width: 64%;
  fill: none; stroke: var(--accent-ink); stroke-width: 2.6; stroke-linejoin: round;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 15px/1 var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--accent-deep);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--accent-deep); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-deep); }

/* ---------- Splash ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  cursor: pointer;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.splash.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
/* mini design canvas (same look as the hero companion) */
.splash__cv {
  direction: ltr;
  width: 248px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 50px -24px rgba(26, 26, 23, 0.28);
  animation: rise 0.7s var(--ease) both;
}
.splash__bar {
  display: flex; align-items: center; gap: 5px;
  padding: 8px 11px;
  border-bottom: 1px solid rgba(26, 26, 23, 0.08);
  font: 500 9.5px var(--font-mono);
  color: var(--muted);
}
.splash__bar i { width: 6px; height: 6px; border-radius: 50%; background: rgba(26, 26, 23, 0.18); }
.splash__bar span { margin-inline-start: 6px; }
.splash__area {
  display: grid; place-items: center;
  height: 148px;
  background-image: radial-gradient(rgba(26, 26, 23, 0.13) 1px, transparent 1.2px);
  background-size: 14px 14px;
}
.splash__word { position: relative; font: 700 44px/1 var(--font-latin); letter-spacing: -0.01em; color: var(--text); }
/* selection grows from the top-left corner to wrap the word */
.splash__sel {
  position: absolute; left: -10px; top: -8px;
  width: 0; height: 0;
  border: 1.5px solid var(--text);
  animation: sel-draw 0.9s 0.35s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
.splash__sel i { position: absolute; width: 7px; height: 7px; background: #fff; border: 1.5px solid var(--text); }
.splash__sel i:nth-child(1) { left: -5px; top: -5px; }
.splash__sel i:nth-child(2) { right: -5px; top: -5px; }
.splash__sel i:nth-child(3) { left: -5px; bottom: -5px; }
.splash__sel i:nth-child(4) { right: -5px; bottom: -5px; }
.splash__size {
  position: absolute; left: 50%; top: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 2px 7px; border-radius: 5px;
  background: var(--text); color: var(--accent);
  font: 500 9px/1.5 var(--font-mono);
  white-space: nowrap;
  opacity: 0;
  animation: fade-in 0.3s 1.2s forwards;
}
.splash__cur {
  position: absolute; right: -16px; bottom: -18px;
  width: 18px; fill: var(--text); stroke: #fff; stroke-width: 1.4; stroke-linejoin: round;
}
@keyframes sel-draw { to { width: calc(100% + 20px); height: calc(100% + 16px); } }
@keyframes fade-in { to { opacity: 1; } }
.splash__skip {
  position: absolute;
  bottom: max(24px, env(safe-area-inset-bottom));
  font-size: 13px;
  color: var(--muted);
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  padding-top: env(safe-area-inset-top);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: 1120px;
  height: var(--nav-h);
  margin-inline: auto;
  padding-inline: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__name { font: 700 19px/1 var(--font-latin); letter-spacing: 0.02em; direction: ltr; unicode-bidi: isolate; }
.nav__end { display: flex; align-items: center; gap: 24px; }
.nav__link { font-size: 15px; color: var(--muted); white-space: nowrap; transition: color 0.2s; }
.nav__link:hover { color: var(--text); }
.nav__lang {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 700 13px/1 var(--font-latin);
  transition: border-color 0.2s, background-color 0.2s;
}
.nav__lang:lang(ar) { font: 700 15px/1 var(--font-ar); }
.nav__lang:hover { border-color: var(--text); background: var(--surface); }
/* very narrow phones: no room for the text link next to the button */
@media (max-width: 420px) {
  html[lang="en"] .nav__link { display: none; }
}
@media (max-width: 480px) {
  .nav__end { gap: 12px; }
  .nav__end .btn { padding: 0 14px; font-size: 14px; }
}

/* ---------- Companion section (hero + services) ---------- */
.flip-section {
  position: relative;
  height: 700vh;
  height: 700svh;
}

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  --tile: min(clamp(200px, 60vw, 290px), 34svh);
}

.stage__glow {
  position: absolute;
  left: 50%;
  top: 60%;
  width: min(1300px, 180vw);
  height: 900px;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(209, 255, 51, 0.3), rgba(209, 255, 51, 0.08) 55%, transparent);
  pointer-events: none;
}

/* Captions — stacked in one slot at the top; JS sets --o (0..1) and --shift */
.captions {
  position: absolute;
  top: calc(var(--nav-h) + 7svh);
  left: 16px;
  right: 16px;
  z-index: 2;
  text-align: center;
}
.caption {
  position: absolute;
  inset: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: 10px;
  opacity: var(--o, 0);
  transform: translate3d(0, calc(var(--shift, 0) * 1px), 0);
  visibility: hidden;
}
.caption[data-step="0"] { --o: 1; visibility: visible; }
.caption--hero { gap: 14px; }
.caption--hero .caption__text { max-width: 60ch; }

.hero__title {
  font-size: clamp(44px, 9vw, 130px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
}
/* second line: dark text on a lime highlighter band (lime text alone is unreadable on white) */
.hero__title em {
  font-style: normal;
  color: var(--text);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 100% 0.42em;
  background-position: 0 82%;
  padding-inline: 0.12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
/* Alexandria has tall ascenders/descenders; give Arabic headlines more room */
html[lang="ar"] .hero__title { line-height: 1.3; }
html[lang="ar"] .contact__title { line-height: 1.35; }

.caption__title {
  font-size: clamp(34px, 4.2vw, 60px);
  font-weight: 700;
  line-height: 1.15;
}
.caption__text {
  max-width: 36ch;
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--muted);
}

/* Companion: a cursor working in a small design canvas (one object per scroll step) */
.comp-wrap {
  --comp: calc(var(--tile) * 1.1);
  position: absolute;
  left: 50%;
  top: 61%;
  width: var(--comp);
  height: var(--comp);
  transform:
    translate(-50%, -50%)
    translateY(var(--sy, 0px))
    scale(var(--ss, 1));
  perspective: 1200px;
  z-index: 1;
}
@media (min-width: 900px) { .comp-wrap { --comp: calc(var(--tile) * 1.3); } }

.comp {
  direction: ltr;
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 50px -24px rgba(26, 26, 23, 0.28);
  transform: rotateX(calc(var(--py, 0) * -6deg)) rotateY(calc(var(--px, 0) * 8deg));
}
.comp__bar {
  display: flex; align-items: center; gap: 5px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(26, 26, 23, 0.08);
  font: 500 10px var(--font-mono);
  color: var(--muted);
}
.comp__bar i { width: 7px; height: 7px; border-radius: 50%; background: rgba(26, 26, 23, 0.18); }
.comp__file { margin-inline-start: 8px; }
.comp__zoom { margin-inline-start: auto; }
.comp__area {
  position: relative;
  border-radius: 0 0 20px 20px;
  background-image: radial-gradient(rgba(26, 26, 23, 0.13) 1px, transparent 1.2px);
  background-size: 14px 14px;
}

/* the five objects, stacked; the active step's one fades in */
.obj {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  overflow: hidden;
  border-radius: 0 0 20px 20px;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.45s, transform 0.6s var(--ease);
}
.obj-logo { width: 36%; aspect-ratio: 1; border-radius: 22%; background: var(--accent); box-shadow: 0 6px 0 var(--accent-deep); display: grid; place-items: center; }
.obj-logo svg { width: 58%; fill: none; stroke: var(--text); stroke-width: 2.2; stroke-linejoin: round; }
.obj-id { display: grid; justify-items: center; gap: 10px; }
.obj-id b { font: 700 calc(var(--comp) * 0.14) / 1 var(--font-latin); color: var(--text); }
.obj-id span { display: flex; gap: 8px; }
.obj-id i { width: calc(var(--comp) * 0.06); aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--line); }
.obj-id i:nth-child(1) { background: var(--accent); }
.obj-id i:nth-child(2) { background: var(--text); }
.obj-id i:nth-child(3) { background: var(--accent-text); }
.obj-id i:nth-child(4) { background: var(--bg-2); }
.obj-web { width: 76%; height: 58%; border: 2px solid var(--text); border-radius: 10px; display: grid; grid-template-rows: auto 1fr; overflow: hidden; background: #fff; }
.obj-web em { display: flex; gap: 4px; padding: 6px 8px; border-bottom: 2px solid var(--text); }
.obj-web em i { width: 6px; height: 6px; border-radius: 50%; background: var(--text); }
.obj-web > div { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; padding: 10px; }
.obj-web p { margin: 0; display: grid; gap: 6px; align-content: start; }
.obj-web u { height: 6px; border-radius: 6px; background: rgba(26, 26, 23, 0.18); }
.obj-web u:nth-child(2) { width: 80%; }
.obj-web u:nth-child(3) { width: 60%; }
.obj-web s { width: 50%; height: 12px; margin-top: 6px; border-radius: 99px; background: var(--text); }
.obj-web > div > span { border-radius: 8px; background: var(--accent); }
.obj-app { position: relative; width: 32%; height: 76%; padding: 16% 10% 10%; border: 2px solid var(--text); border-radius: 18px; display: grid; grid-template-rows: 1fr auto; background: #fff; }
.obj-app em { position: absolute; top: 6px; left: 50%; width: 30%; height: 6px; margin-left: -15%; border-radius: 6px; background: var(--text); }
.obj-app p { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
.obj-app p i { aspect-ratio: 1; border-radius: 6px; border: 1.5px solid var(--text); }
.obj-app p i.on { background: var(--accent); }
.obj-app s { height: 8px; border-radius: 8px; background: var(--text); }
.obj-ship { display: flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 99px; background: var(--accent); box-shadow: 0 5px 0 var(--accent-deep); font: 700 15px var(--font-latin); color: var(--text); }
.obj-ship svg { width: 20px; fill: none; stroke: var(--text); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.stage[data-step="4"] .obj-ship { animation: press 0.5s 1.1s ease-out; }
@keyframes press { 40% { transform: translateY(4px); box-shadow: 0 1px 0 var(--accent-deep); } }

/* selection box + size label, and the cursor; they glide to each step's object */
.sel {
  position: absolute;
  border: 1.5px solid var(--text);
  pointer-events: none;
  transition: left 0.9s var(--glide), top 0.9s var(--glide), width 0.9s var(--glide), height 0.9s var(--glide);
}
.sel i { position: absolute; width: 8px; height: 8px; background: #fff; border: 1.5px solid var(--text); }
.sel i:nth-child(1) { left: -5px; top: -5px; }
.sel i:nth-child(2) { right: -5px; top: -5px; }
.sel i:nth-child(3) { left: -5px; bottom: -5px; }
.sel i:nth-child(4) { right: -5px; bottom: -5px; }
.sel__size {
  position: absolute; left: 50%; top: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 2px 7px; border-radius: 5px;
  background: var(--text); color: var(--accent);
  font: 500 9.5px/1.5 var(--font-mono);
  white-space: nowrap;
}
.cur {
  position: absolute; z-index: 3;
  display: flex; align-items: flex-start; gap: 2px;
  transition: left 1.05s var(--glide), top 1.05s var(--glide);
  animation: curbob 2.6s ease-in-out infinite;
}
.cur svg { width: 20px; fill: var(--text); stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }
.cur span { margin-top: 15px; padding: 2px 8px; border-radius: 6px 6px 6px 2px; background: var(--accent); font: 600 10.5px/1.5 var(--font-mono); color: var(--text); }
@keyframes curbob { 50% { transform: translate(2px, 3px); } }
.comp-wrap { --glide: cubic-bezier(0.65, 0, 0.35, 1); }

.stage[data-step="0"] .obj[data-s="0"] { opacity: 1; transform: none; transition-delay: 0.25s; }
.stage[data-step="0"] .sel { left: 30%; top: 30%; width: 40%; height: 40%; }
.stage[data-step="0"] .cur { left: calc(70% - 6px); top: calc(70% - 6px); }
.stage[data-step="1"] .obj[data-s="1"] { opacity: 1; transform: none; transition-delay: 0.25s; }
.stage[data-step="1"] .sel { left: 14%; top: 28%; width: 72%; height: 44%; }
.stage[data-step="1"] .cur { left: calc(86% - 6px); top: calc(72% - 6px); }
.stage[data-step="2"] .obj[data-s="2"] { opacity: 1; transform: none; transition-delay: 0.25s; }
.stage[data-step="2"] .sel { left: 10%; top: 16%; width: 80%; height: 62%; }
.stage[data-step="2"] .cur { left: calc(90% - 6px); top: calc(78% - 6px); }
.stage[data-step="3"] .obj[data-s="3"] { opacity: 1; transform: none; transition-delay: 0.25s; }
.stage[data-step="3"] .sel { left: 32%; top: 8%; width: 36%; height: 80%; }
.stage[data-step="3"] .cur { left: calc(68% - 6px); top: calc(88% - 6px); }
.stage[data-step="4"] .obj[data-s="4"] { opacity: 1; transform: none; transition-delay: 0.25s; }
.stage[data-step="4"] .sel { left: 22%; top: 40%; width: 56%; height: 20%; }
.stage[data-step="4"] .cur { left: calc(78% - 6px); top: calc(60% - 6px); }

.comp-shadow {
  position: absolute;
  left: 12%;
  right: 12%;
  top: calc(100% + var(--comp) * 0.08);
  height: calc(var(--comp) * 0.08);
  border-radius: 50%;
  background: rgba(26, 26, 23, 0.14);
  filter: blur(14px);
  transform: translateX(calc(var(--px, 0) * 12px));
}

/* "scroll and flip" pill */
.scroll-pill {
  position: absolute;
  bottom: max(20px, env(safe-area-inset-bottom));
  inset-inline-end: 20px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
  transition: opacity 0.4s;
}
.scroll-pill span {
  width: 2px; height: 12px; border-radius: 2px; background: var(--text);
  animation: nudge 1.4s var(--ease) infinite;
}
.scroll-pill.is-hidden { opacity: 0; }
@keyframes nudge { 0% { transform: translateY(-3px); opacity: 0.3; } 50% { opacity: 1; } 100% { transform: translateY(4px); opacity: 0.3; } }

/* ---------- Projects ---------- */
.projects { padding: 96px 0 40px; }
.projects .section-sub { max-width: 46ch; color: var(--muted); }
.projects__grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .projects__grid { grid-template-columns: repeat(2, 1fr); gap: 20px; } }

.project {
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.project:hover { transform: translateY(-4px); box-shadow: 0 24px 48px -28px rgba(26, 26, 23, 0.35); }

.project__media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  background: var(--media-bg, var(--bg-2));
  overflow: hidden;
}
.project__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}
.project__media[data-fit="contain"] img { object-fit: contain; padding: 10% 18%; }
.project:hover .project__media img { transform: scale(1.04); }
.project__initial { font: 700 64px/1 var(--font-display); color: rgba(255, 255, 255, 0.85); }

.project__body { display: grid; align-content: start; justify-items: start; gap: 8px; padding: 24px 26px 28px; }
.project__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--muted); }
.project__year { font-family: var(--font-mono); letter-spacing: 0.08em; }
.project__title { font-size: clamp(26px, 2.6vw, 34px); font-weight: 700; line-height: 1.2; }
.project__text { color: var(--muted); max-width: 44ch; }
.project__link {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 2px;
  border-bottom: 2px solid var(--accent);
  font-weight: 600;
  transition: border-color 0.2s;
}
.project__link::after { content: "↗"; font-family: var(--font-latin); }
[dir="rtl"] .project__link::after { content: "↖"; }
.project__link:hover { border-color: var(--accent-text); }
.project__links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 6px; }
.project__links .project__link { margin: 0; }
/* status badge sits on the image's top corner, so it adds no height to the card */
.project__status {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 16px -8px rgba(26, 26, 23, 0.45);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
}
.project__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.project__status[data-status="soon"] { background: var(--accent); color: var(--accent-ink); }
.project__status[data-status="soon"]::before { animation: soon-pulse 1.6s ease-in-out infinite; }
.project__status[data-status="closed"] { background: rgba(255, 255, 255, 0.92); color: var(--muted); }
@keyframes soon-pulse { 50% { opacity: 0.3; } }

/* ---------- Statement: words light up with scroll ---------- */
.statement { position: relative; height: 220vh; height: 220svh; }
.statement__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  padding-inline: 20px;
}
.statement__text {
  max-width: 1200px;
  text-align: center;
  font-size: clamp(34px, 5.4vw, 80px);
  font-weight: 700;
  line-height: 1.25;
}
.statement__line { display: block; }
.statement .w { color: rgba(26, 26, 23, 0.14); transition: color 0.35s var(--ease); }
.statement .w.is-on { color: var(--text); }
/* second line: dark text on a lime highlighter band (same treatment as the hero), drawn once the line is lit */
.statement__mark {
  color: inherit;
  background-color: transparent; /* drop the browser's default <mark> yellow */
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0% 0.42em;
  background-position: right 82%;
  padding-inline: 0.12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size 0.8s var(--ease);
}
[dir="ltr"] .statement__mark { background-position: left 82%; }
.statement__mark.is-on { background-size: 100% 0.42em; }
.statement s { position: relative; text-decoration: none; }
.statement s::after {
  content: "";
  position: absolute;
  inset-inline: -0.06em;
  top: 0.55em;
  height: 0.09em;
  border-radius: 1em;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.statement s.is-struck::after { transform: scaleX(1); }
[dir="ltr"] .statement s::after { transform-origin: left; }

/* ---------- Approach ---------- */
.approach { background: var(--bg-2); padding: 72px 0 120px; }
.section-head { display: grid; justify-items: center; gap: 12px; margin-bottom: 40px; text-align: center; }
.section-title { font-size: clamp(34px, 4.2vw, 60px); font-weight: 700; line-height: 1.2; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.step { padding: 26px; border-radius: 28px; background: var(--surface); }
.step h3 { font-size: 28px; font-weight: 700; line-height: 1.3; margin: 22px 0 6px; }
.step p { color: var(--muted); }
.step__art {
  position: relative;
  height: 120px;
  border-radius: 20px;
  background: var(--bg-2);
  overflow: hidden;
}
.step__no {
  position: absolute;
  top: 14px;
  inset-inline-end: 16px;
  font: 500 13px/1 var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* art 1: chat bubbles + typing */
.art-chat { position: absolute; inset: 18px 44px 18px 44px; display: grid; align-content: start; gap: 8px; justify-items: start; }
.art-chat i { display: block; height: 22px; border-radius: 8px; background: #e2ddd2; }
.art-chat i:nth-child(1) { width: 62%; }
.art-chat i:nth-child(2) { width: 42%; }
.art-chat b {
  justify-self: end;
  display: inline-flex; gap: 5px; align-items: center;
  margin-top: 6px; padding: 7px 12px;
  border-radius: 99px;
  background: var(--accent);
}
.art-chat u { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-ink); animation: typing 1.2s infinite; }
.art-chat u:nth-child(2) { animation-delay: 0.15s; }
.art-chat u:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.35; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }

/* art 2: a straight line to the goal */
.art-line {
  position: absolute; top: 50%; inset-inline: 15%;
  height: 4px; margin-top: -2px; border-radius: 4px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform 1.1s 0.3s var(--ease);
}
.art-line i {
  position: absolute; top: 50%; left: -7px;
  width: 14px; height: 14px; margin-top: -7px; border-radius: 50%;
  background: var(--accent);
}
.step.is-in .art-line { transform: scaleX(1); }
[dir="ltr"] .art-line { transform-origin: left; }
[dir="ltr"] .art-line i { left: auto; right: -7px; }

/* art 3: stacked tiles */
.art-stack { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; transform: translate(-50%, -50%); }
.art-stack .logo-tile { position: absolute; inset: 0; width: 56px; height: 56px; border-radius: 16px; transform: rotate(-6deg); }
.art-stack .logo-tile:nth-child(1) { translate: 12px 12px; background: var(--accent-deep); }
.art-stack .logo-tile:nth-child(2) { translate: 6px 6px; background: #bfe02a; }

/* ---------- Contact ---------- */
.contact { padding: 80px 16px; }
.contact__panel {
  position: relative;
  max-width: 1120px;
  margin-inline: auto;
  padding: 72px 24px 80px;
  border-radius: 40px;
  background: var(--panel);
  color: var(--on-panel);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.contact__panel::before {
  content: "";
  position: absolute;
  left: 50%; top: -260px;
  width: 760px; height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(209, 255, 51, 0.22), transparent);
  z-index: -1;
}
.contact__title { font-size: clamp(40px, 5.6vw, 80px); font-weight: 700; line-height: 1.15; }
.contact__title em { font-style: normal; color: var(--accent); }
.contact__sub { margin: 16px 0 36px; font-size: 18px; color: rgba(242, 239, 230, 0.6); }

.builder {
  max-width: 560px;
  margin-inline: auto;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.04);
  text-align: start;
}
.builder__sentence {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  line-height: 2;
  color: rgba(242, 239, 230, 0.7);
}
.token {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px dashed var(--accent);
  border-radius: 8px 8px 2px 2px;
  background: rgba(209, 255, 51, 0.12);
  color: var(--on-panel);
  font: inherit;
  line-height: 1.5;
  cursor: pointer;
  transition: background-color 0.2s;
}
.token::after { content: "↻"; font-size: 0.5em; color: var(--accent); }
.token:hover { background: rgba(209, 255, 51, 0.2); }
.token.is-changed { animation: swap 0.35s var(--ease); }
@keyframes swap { 0% { transform: translateY(6px); opacity: 0.2; } 100% { transform: none; opacity: 1; } }

.builder__row { display: flex; gap: 10px; margin-top: 20px; }
/* narrow phones: field on its own line, button below */
@media (max-width: 420px) {
  .builder__row { flex-wrap: wrap; }
  .builder__row .builder__input { flex: 1 1 100%; }
  .builder__row .btn--send { flex: 1 1 100%; }
}
.builder__input {
  flex: 1;
  min-width: 0;
  height: 54px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: #0f0f0e;
  color: var(--on-panel);
  font: inherit;
  font-size: 16px;
}
.builder__input::placeholder { color: rgba(242, 239, 230, 0.4); }
.builder__input:focus { outline: none; border-color: var(--accent); }
.btn--send { min-height: 54px; padding: 0 22px; font-size: 16px; }
.btn--send svg { width: 18px; height: 18px; fill: var(--accent-ink); }
.builder__hint { margin-top: 14px; font-size: 13px; color: rgba(242, 239, 230, 0.45); }
.builder__hint.is-error { color: #ffb4a8; }

.contact__pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 32px; }
.pill {
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  font-size: 15px;
  color: rgba(242, 239, 230, 0.8);
  transition: border-color 0.2s, color 0.2s;
}
.pill:hover { border-color: var(--accent); color: var(--on-panel); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0 max(36px, env(safe-area-inset-bottom)); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer__brand b { display: block; font: 700 18px/1.2 var(--font-latin); direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .footer__brand b { text-align: right; }
.footer__brand small { font-size: 13px; color: var(--muted); }

.footer__links { display: flex; align-items: center; gap: 8px 22px; flex-wrap: wrap; }
.footer__links a { padding: 6px 0; font-size: 13px; line-height: 1.4; font-weight: 500; opacity: 0.7; text-decoration: underline; text-underline-offset: 4px; }
.footer__links a:hover { opacity: 1; }

/* ---------- Privacy notice (/privacy, /en/privacy): long text, one calm column ---------- */
.legal { padding: calc(var(--nav-h) + 56px) 20px 72px; }
.legal__doc { max-width: 720px; margin-inline: auto; font-size: 16px; line-height: 1.9; overflow-wrap: anywhere; }
.legal__title { margin: 0 0 12px; font: 700 clamp(34px, 6vw, 52px)/1.3 var(--font-display); }
html[lang="en"] .legal__title { line-height: 1.12; letter-spacing: -0.02em; }
.legal__title + p { margin-top: 0; font-size: 13.5px; color: var(--muted); }
.legal__doc h2 { margin: 44px 0 10px; padding-top: 22px; border-top: 1px solid var(--line); font: 700 22px/1.45 var(--font-display); scroll-margin-top: calc(var(--nav-h) + 12px); }
.legal__doc p { margin: 0 0 12px; }
.legal__doc ul { margin: 0 0 14px; padding-inline-start: 22px; }
.legal__doc li { margin-bottom: 6px; }
.legal__doc li::marker { color: var(--accent-text); }
.legal__doc a { color: var(--accent-text); font-weight: 500; text-underline-offset: 4px; }
.legal__doc strong { font-weight: 700; }

/* keep the end of the footer clear of the floating WhatsApp button on phones */
@media (max-width: 760px) {
  .footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* ---------- Floating WhatsApp button ---------- */
.fab {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  inset-inline-start: 20px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 4px 0 var(--accent-deep);
  transition: transform 0.15s var(--ease);
}
.fab::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: rgba(209, 255, 51, 0.35);
  z-index: -1;
  animation: ring 2.4s ease-out infinite;
}
.fab svg { width: 24px; height: 24px; fill: var(--accent-ink); }
.fab:hover { transform: translateY(-2px); }
@keyframes ring { 0% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0s);
}
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
.no-js .statement .w, .no-js .statement__line { color: var(--text); }
.no-js .statement__mark { background-size: 100% 0.42em; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .splash { display: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .art-line { transform: none; transition: none; }
  .obj, .sel, .cur { transition: none; }
  .statement .w, .statement s::after, .statement__mark { transition: none; }
  .btn:hover, .fab:hover { transform: none; }
}
