/* ============================================================
   SADA GROUP — DESIGN SYSTEM v5
   Layout is built on two rules:
     1. One documented z-index scale (--z-*). Nothing invents its own.
     2. Every section is a .panel — a box sitting on the 3D background.
   ============================================================ */

/* ── 1. DESIGN TOKENS ─────────────────────────────────────── */
:root {
  /* Palette — dark */
  --clr-bg:          #040812;
  --clr-bg-2:        #060d1e;
  --clr-bg-card:     rgba(8, 16, 38, 0.72);
  --clr-bg-glass:    rgba(10, 20, 48, 0.65);
  --clr-bg-elevated: rgba(14, 28, 64, 0.85);
  --clr-panel:       rgba(8, 15, 36, 0.86);
  --clr-panel-brd:   rgba(255, 255, 255, 0.07);

  /* Accents */
  --clr-a1:        #00f5d4;
  --clr-a2:        #7c3aed;
  --clr-a3:        #f59e0b;
  --clr-a4:        #00cc66;
  --clr-a1-dim:    rgba(0, 245, 212, 0.12);
  --clr-a1-border: rgba(0, 245, 212, 0.28);
  --clr-a2-dim:    rgba(124, 58, 237, 0.12);
  --clr-a2-border: rgba(124, 58, 237, 0.3);
  --clr-a3-dim:    rgba(245, 158, 11, 0.12);
  --clr-a4-dim:    rgba(0, 204, 102, 0.12);

  /* Text */
  --clr-text:       #e8f0fe;
  --clr-text-2:     #8899bb;
  --clr-text-muted: #5a6b90;

  /* Borders & status */
  --clr-border:   rgba(255, 255, 255, 0.06);
  --clr-border-h: rgba(0, 245, 212, 0.22);
  --clr-success:  #10b981;
  --clr-warning:  #f59e0b;
  --clr-error:    #ef4444;

  /* Gradients */
  --grad-hero:
    radial-gradient(ellipse 80% 60% at 12% 40%, rgba(124,58,237,0.16) 0%, transparent 58%),
    radial-gradient(ellipse 60% 45% at 88% 12%, rgba(0,245,212,0.11) 0%, transparent 52%),
    radial-gradient(ellipse 50% 50% at 50% 95%, rgba(0,204,102,0.06) 0%, transparent 45%);
  --grad-accent: linear-gradient(135deg, var(--clr-a1) 0%, var(--clr-a2) 100%);
  --grad-text:   linear-gradient(135deg, var(--clr-a1) 0%, #a78bfa 50%, var(--clr-a1) 100%);

  /* Typography — one family, IBM Plex, across the whole site */
  --font-display: "IBM Plex Sans Condensed", "IBM Plex Sans", "IBM Plex Sans Arabic", sans-serif;
  --font-body:    "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  /* Kurdish/Arabic: Plex first, Noto Kufi picks up any glyph Plex lacks. */
  --font-arabic:  "IBM Plex Sans Arabic", "Noto Kufi Arabic", "IBM Plex Sans", sans-serif;

  /* Every step scales with the viewport, so nothing is ever cramped
     on a phone or oversized on a 4K monitor. */
  --text-xs:   clamp(0.76rem, 0.73rem + 0.15vw, 0.85rem);
  --text-sm:   clamp(0.875rem, 0.84rem + 0.18vw, 0.97rem);
  --text-base: clamp(1rem, 0.96rem + 0.22vw, 1.12rem);
  --text-lg:   clamp(1.1rem, 1.04rem + 0.32vw, 1.3rem);
  --text-xl:   clamp(1.24rem, 1.15rem + 0.45vw, 1.5rem);
  --text-2xl:  clamp(1.42rem, 1.28rem + 0.7vw, 1.85rem);
  --text-3xl:  clamp(1.7rem, 1.45rem + 1.15vw, 2.3rem);
  --text-4xl:  clamp(2.05rem, 1.65rem + 1.8vw, 2.95rem);
  --text-5xl:  clamp(2.5rem, 1.9rem + 2.9vw, 3.8rem);
  --text-6xl:  clamp(3rem, 2.1rem + 4.4vw, 4.9rem);

  --w-light: 300; --w-regular: 400; --w-medium: 500; --w-semi: 600; --w-bold: 700;
  --lh-tight: 1.18; --lh-snug: 1.35; --lh-normal: 1.55; --lh-relaxed: 1.75;
  --measure: 68ch;

  /* Spacing */
  --s1: 0.25rem; --s2: 0.5rem;  --s3: 0.75rem; --s4: 1rem;
  --s5: 1.25rem; --s6: 1.5rem;  --s8: 2rem;    --s10: 2.5rem;
  --s12: 3rem;   --s16: 4rem;   --s20: 5rem;   --s24: 6rem;

  /* Radius */
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px;
  --r-2xl: 24px; --r-3xl: 32px; --r-full: 9999px;

  /* Shadows */
  --sh-sm:      0 2px 8px rgba(0,0,0,0.5);
  --sh-md:      0 4px 24px rgba(0,0,0,0.6);
  --sh-lg:      0 8px 48px rgba(0,0,0,0.7);
  --sh-card:    0 4px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.05);
  --sh-panel:   0 12px 60px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.06);
  --sh-glow-a1: 0 0 40px rgba(0,245,212,0.18);

  /* Transitions */
  --t-fast:   150ms cubic-bezier(0.4,0,0.2,1);
  --t-base:   280ms cubic-bezier(0.4,0,0.2,1);
  --t-slow:   500ms cubic-bezier(0.4,0,0.2,1);
  --t-spring: 600ms cubic-bezier(0.34,1.56,0.64,1);

  /* Layout */
  --max-w:      1200px;
  --nav-h:      72px;
  --section-py: clamp(3.5rem, 7vw, 6rem);
  --panel-p:    clamp(1.5rem, 4vw, 3.5rem);

  /* ── The z-index scale. Every layered element uses one of these. ── */
  --z-canvas:    0;    /* 3D background            */
  --z-content:   1;    /* main, footer             */
  --z-raise:     2;    /* in-panel raised bits     */
  --z-scrolltop: 300;  /* back-to-top button       */
  --z-menu:      380;  /* mobile menu drawer       */
  --z-navbar:    400;  /* fixed navbar (above it)  */
  --z-modal:     600;  /* project modal            */
  --z-palette:   650;  /* quick-actions palette    */
  --z-toast:     700;  /* toasts                   */
  --z-progress:  800;  /* scroll progress bar      */
  --z-loader:    900;  /* first-paint loader       */
  --z-skip:      950;  /* skip link                */
  --z-cursor:    1000; /* cursor ring              */
}

/* ── LIGHT THEME ──────────────────────────────────────────── */
/* The same studio by daylight. Colour lives in the page itself: a cool
   blue-grey sheet with a blueprint grid and soft brand light falling
   across it, so the strips between panels read as a surface. Panels are
   frosted a step above it, cards are the only pure white, and they cast
   a faint blue shadow rather than a grey one. The accents follow the
   logo's blue, since the neon teal cannot hold contrast on a pale page,
   and every text colour below passes WCAG AA on white. */
[data-theme="light"] {
  --clr-bg:          #dfe7f4;                  /* page, behind everything */
  --clr-bg-2:        #d2dcee;                  /* deeper wells: footer    */
  --clr-panel:       rgba(244, 247, 254, 0.88); /* section panels          */
  --clr-bg-card:     #ffffff;                  /* cards on top of panels  */
  --clr-bg-glass:    rgba(248, 250, 255, 0.86);
  --clr-bg-elevated: #ffffff;
  --clr-bg-inset:    #edf2fb;                  /* fields and pills sunk into a surface */
  --clr-panel-brd:   rgba(30, 64, 145, 0.14);

  --clr-a1: #1a5fe0; --clr-a2: #6d28d9; --clr-a3: #b45309; --clr-a4: #047857;
  --clr-a1-dim:    rgba(26, 95, 224, 0.1);
  --clr-a1-border: rgba(26, 95, 224, 0.3);
  --clr-a2-dim:    rgba(109, 40, 217, 0.1);
  --clr-a2-border: rgba(109, 40, 217, 0.28);
  --clr-a3-dim:    rgba(180, 83, 9, 0.11);
  --clr-a4-dim:    rgba(4, 120, 87, 0.11);

  --clr-text:       #0b1530;
  --clr-text-2:     #3a4a6b;
  --clr-text-muted: #56678a;

  --clr-border:   rgba(30, 64, 145, 0.14);
  --clr-border-h: rgba(26, 95, 224, 0.45);
  /* The dark theme's status colours are too pale to read on white. */
  --clr-success:  #047857;
  --clr-warning:  #b45309;
  --clr-error:    #dc2626;

  --grad-hero:
    radial-gradient(ellipse 70% 55% at 6% 26%, rgba(109, 40, 217, 0.2) 0%, transparent 62%),
    radial-gradient(ellipse 62% 50% at 96% 4%, rgba(26, 95, 224, 0.26) 0%, transparent 58%),
    radial-gradient(ellipse 72% 52% at 64% 104%, rgba(13, 148, 136, 0.18) 0%, transparent 56%);
  --grad-text: linear-gradient(135deg, var(--clr-a1) 0%, var(--clr-a2) 55%, var(--clr-a1) 100%);

  --sh-sm:      0 1px 3px rgba(20, 40, 90, 0.12);
  --sh-md:      0 8px 20px -6px rgba(20, 40, 90, 0.2);
  --sh-card:    0 1px 2px rgba(20, 40, 90, 0.06), 0 12px 30px -14px rgba(26, 72, 180, 0.3);
  --sh-panel:   inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 6px rgba(20, 40, 90, 0.05),
                0 32px 70px -30px rgba(26, 60, 150, 0.34);
  --sh-lg:      0 22px 50px -14px rgba(20, 40, 90, 0.3);
  --sh-glow-a1: 0 12px 32px -10px rgba(26, 95, 224, 0.42);
}

/* ── LIGHT THEME · SURFACES ───────────────────────────────── */
/* Page: brand light over a fine blueprint grid. The loader wears the
   same sheet, so it fades into the page without a seam. */
[data-theme="light"] #bg-canvas,
[data-theme="light"] .loader {
  background:
    var(--grad-hero),
    linear-gradient(rgba(30, 64, 145, 0.07) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(30, 64, 145, 0.07) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--clr-bg);
}

/* Panels: a coloured rule along the top and a wash of blue light in the
   far corner, so each one reads as lit glass instead of a white sheet. */
[data-theme="light"] .panel::before {
  height: 2px;
  inset-inline: 8%;
  background: linear-gradient(90deg, transparent, var(--clr-a1) 30%, var(--clr-a2) 70%, transparent);
  opacity: 0.5;
}
[data-theme="light"] .panel::after {
  inset-block-start: -190px;
  inset-inline-end: -170px;
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(26, 95, 224, 0.13) 0%, rgba(109, 40, 217, 0.06) 42%, transparent 70%);
}

[data-theme="light"] :is(.glass-card, .service-card, .member-card, .stat-card,
  .project-card, .contact__form, .skill-item, .flip-card__face) {
  border-color: rgba(30, 64, 145, 0.13);
}

/* Service icons become solid brand tiles: the strongest colour on a
   white card, and the thing the eye lands on first. */
[data-theme="light"] .service-card__icon {
  background: var(--grad-accent);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(26, 95, 224, 0.7);
}
[data-theme="light"] .member-card::after { opacity: 0.16; }

/* Fields, pills and tabs sink a step below the surface they sit on, so
   they read as controls rather than more white. */
[data-theme="light"] :is(.form-input, .form-textarea) {
  background: var(--clr-bg-inset);
  border-color: rgba(30, 64, 145, 0.2);
}
[data-theme="light"] :is(.form-input, .form-textarea):focus { background: #fff; }
[data-theme="light"] .chip:not([aria-pressed="true"]),
[data-theme="light"] .tab-btn:not(.active),
[data-theme="light"] .filter-chip:not(.active) { background: var(--clr-bg-inset); }

/* Teal glows are dark-theme only; daylight versions take the blue. */
[data-theme="light"] .tab-btn.active { box-shadow: 0 8px 18px -8px rgba(26, 95, 224, 0.6); }
[data-theme="light"] .badge--new { box-shadow: 0 4px 14px -4px rgba(26, 95, 224, 0.55); }

/* Covers behind project art go airy instead of dim. */
[data-theme="light"] :is(.project-card__media, .modal__media)::before {
  filter: blur(26px) saturate(150%) brightness(1.08);
  opacity: 0.55;
}

[data-theme="light"] ::selection { background: rgba(26, 95, 224, 0.18); }

/* ── 2. RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--s4));
  -webkit-text-size-adjust: 100%;
  /* Must live on <html>, not <body>. On <body> it makes the body its own
     scroll container, which stops IntersectionObserver from ever reporting
     an intersection with the viewport — every reveal section stays at
     opacity 0 forever. On <html> the value propagates to the viewport
     instead, so no extra scroll container is created. */
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--clr-text);
  background: var(--clr-bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background var(--t-slow), color var(--t-slow);
}

/* Scroll lock goes on <html> because <html> is the scrolling element. */
html.is-locked { overflow: hidden; }

[dir="rtl"] { font-family: var(--font-arabic); }
/* Arabic-script faces sit lower and need more room between lines. */
[dir="rtl"] p, [dir="rtl"] li { line-height: 1.95; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4 { line-height: 1.45; }
[dir="rtl"] .ltr-force {
  direction: ltr;
  display: inline-block;
  text-align: start;
  font-family: var(--font-mono);
}

/* Arabic script is cursive and has no monospace cut here: letter-spacing
   pulls the joins apart and the mono stack falls back mid-word. Any label
   that carries translated copy drops both in RTL. Latin-only bits
   (.ltr-force, .font-mono values, counters) keep their treatment. */
[dir="rtl"] :is(
  .section-eyebrow, .hero__typed, .hero__eyebrow, .hero__scroll,
  .leader__role, .badge, .stat-card__label, .contact-info__label,
  .contact__socials-label, .member-card__primary-label,
  .member-card__tools-label, .deck__hint, .form-label,
  .available-pill, .team__members-title, .copy-btn, .loader__code,
  .hero__logo-caption, .projects__empty, .contact__note, .footer__tagline,
  .logo-flip__title, .logo-flip__hint, .planner__label, .planner__legend,
  .project-card__back-label, .palette__group-title, .palette__hint,
  .sphere__hint, .contact-info__time-note, .token__name
) {
  font-family: var(--font-arabic);
  letter-spacing: normal;
  text-transform: none;
}

h1,h2,h3,h4,h5,h6 { line-height: var(--lh-tight); color: var(--clr-text); font-weight: var(--w-bold); }
p { line-height: var(--lh-relaxed); }
/* Long-form copy stops at a comfortable measure instead of running
   the full width of a wide panel. */
.about__text p, .leader__bio, .section-subtitle,
.hero__description, .footer__tagline { max-width: var(--measure); }
a { color: var(--clr-a1); text-decoration: none; transition: color var(--t-fast); }
img, video, svg, canvas { max-width: 100%; display: block; }
img { height: auto; }
button { font-family: var(--font-body); border: none; background: none; color: inherit; cursor: pointer; }
input, textarea, select { font-family: var(--font-body); font-size: var(--text-base); }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--clr-a1); outline-offset: 3px; border-radius: var(--r-sm); }

.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }

/* Read by screen readers, invisible on screen. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── 3. BACKGROUND CANVAS ─────────────────────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-canvas);
  pointer-events: none;
  background: var(--grad-hero), var(--clr-bg);
}

/* ── 4. CURSOR ────────────────────────────────────────────── */
/* A ring that trails the native cursor on a real mouse. It never hides or
   replaces the cursor itself: the OS draws that one, so it cannot lag no
   matter how busy the page gets. The script moves the ring with `translate`
   and hover grows it with `scale`, so neither ever triggers layout. */
.cursor-follower {
  position: fixed;
  top: -18px;
  left: -18px;
  width: 36px; height: 36px;
  border: 1.5px solid var(--clr-a1-border);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor);
  opacity: 0;
  will-change: transform;
  transition: opacity var(--t-base), scale var(--t-base), border-color var(--t-base);
}
.cursor-follower.is-visible { opacity: 1; }
.cursor-follower.is-hover { scale: 1.5; border-color: var(--clr-a2-border); }

@media (hover: none), (pointer: coarse) {
  .cursor-follower { display: none; }
}

/* ── 5. SCROLL PROGRESS ───────────────────────────────────── */
/* Full width and scaled by the scroll handler: scaleX runs on the
   compositor, where a width change re-laid-out the bar every frame. */
#scroll-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  background: var(--grad-accent);
  z-index: var(--z-progress);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
  box-shadow: 0 0 10px var(--clr-a1);
  pointer-events: none;
}
[dir="rtl"] #scroll-progress { transform-origin: right center; }

/* ── 6. LOADER ────────────────────────────────────────────── */
.loader {
  position: fixed; inset: 0;
  background: var(--grad-hero), var(--clr-bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: var(--s6);
  z-index: var(--z-loader);
  transition: opacity 0.7s ease, visibility 0.7s ease;
  /* The 3D mark keeps the logo's colours: its blue, and its navy, which
     turns to ice on the dark page where navy would disappear. Each has a
     face, a lit rim and a side that darkens towards the back. */
  --mk-a: #3b82ff; --mk-a-rim: #9cc2ff; --mk-a-side: #1e4fc7; --mk-a-deep: #0a1a4a;
  --mk-b: #e4ecfc; --mk-b-rim: #ffffff; --mk-b-side: #8c9cc4; --mk-b-deep: #253457;
}
[data-theme="light"] .loader {
  --mk-a: #1f66f0; --mk-a-rim: #8bb4ff; --mk-a-side: #1546b8; --mk-a-deep: #0b2a78;
  --mk-b: #12265a; --mk-b-rim: #5a78c0; --mk-b-side: #0b1a40; --mk-b-deep: #040a1e;
}
.loader.done { opacity: 0; visibility: hidden; pointer-events: none; }

/* The mark, as a 3D model (markup and notes in index.html). The two halves
   slide together along the logo's own diagonal, the traces draw out to
   their dots, the </> lands in front, and then the whole piece sways so
   its depth shows. Every motion is transform or opacity. */
.loader__model {
  --size: clamp(132px, 34vw, 168px);
  position: relative;
  width: var(--size); height: var(--size);
  /* Room under the mark for its shadow and the echo rings, so they never
     run into the wordmark below. */
  margin-block-end: calc(var(--size) * 0.2);
  transition: scale 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.loader.is-complete .loader__model { scale: 1.06; }
.loader.done .loader__model { scale: 1.22; }
.sada3d__defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Light behind the mark, and its shadow on the floor. */
.loader__model::before,
.loader__model::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.loader__model::before {
  inset: -32%;
  background: radial-gradient(circle, color-mix(in srgb, var(--mk-a) 24%, transparent) 0%, transparent 60%);
  animation: sdGlow 3.4s ease-in-out infinite;
}
.loader__model::after {
  inset-inline: 20%;
  inset-block-end: -15%;
  height: 11%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.5), transparent);
  animation: sdShadow 3.4s ease-in-out infinite;
}
[data-theme="light"] .loader__model::after {
  background: radial-gradient(closest-side, rgba(16, 34, 90, 0.3), transparent);
}

/* "Sada" means echo: rings spread across the floor once the S is whole. */
.sada3d__echo {
  position: absolute;
  inset-inline: 6%;
  inset-block-end: -21%;
  height: 24%;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--mk-a) 60%, transparent);
  opacity: 0;
  animation: sdEcho 2.7s cubic-bezier(0.2, 0.6, 0.35, 1) 1.1s infinite;
}
.sada3d__echo:nth-of-type(2) { animation-delay: 2s; }
.sada3d__echo:nth-of-type(3) { animation-delay: 2.9s; }

.sada3d {
  position: absolute; inset: 0;
  perspective: 720px;
  animation: sdFloat 3.4s ease-in-out infinite;
}
.sada3d__body {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(10deg) rotateY(-24deg);
  animation: sdSway 6.4s ease-in-out infinite;
}
.sada3d__part {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
}
.sada3d__part > svg,
.sada3d__plate {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  overflow: visible;
}
/* Slice d sits d × 2px behind the face; the sides darken as they recede. */
.sada3d__part > svg {
  transform: translateZ(calc(11px - var(--d) * 2px));
  color: color-mix(in oklab, var(--side), var(--deep) calc((var(--d) - 2) * 11%));
}
.sada3d__part > .is-rim { color: var(--rim); }
.sada3d__part > .is-face { color: var(--face); }
.sada3d__part--top {
  --face: var(--mk-a); --rim: var(--mk-a-rim); --side: var(--mk-a-side); --deep: var(--mk-a-deep);
  animation: sdInTop 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.05s backwards;
}
.sada3d__part--bottom {
  --face: var(--mk-b); --rim: var(--mk-b-rim); --side: var(--mk-b-side); --deep: var(--mk-b-deep);
  animation: sdInBottom 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.2s backwards;
}
/* Fades go on the slices, never the halves: opacity on a preserve-3d
   element would flatten it into a single plane while it fades. */
.sada3d__part--top > svg { animation: sdFade 0.45s ease 0.05s backwards; }
.sada3d__part--bottom > svg { animation: sdFade 0.45s ease 0.2s backwards; }

.sada3d__plate--traces { transform: translateZ(17px); }
.sd-trace {
  fill: none;
  stroke-width: 16;
  stroke-dasharray: 241;
  animation: sdDraw 0.55s cubic-bezier(0.6, 0, 0.2, 1) 0.75s backwards;
}
.sd-trace--a { stroke: var(--mk-a); }
.sd-trace--b { stroke: var(--mk-b); }
.sd-dot--a { fill: var(--mk-a); }
.sd-dot--b { fill: var(--mk-b); }
.sd-dot {
  transform-box: fill-box;
  transform-origin: center;
  animation: sdPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 1.1s backwards;
}
.sada3d__plate--code {
  transform: translateZ(25px);
  fill: none;
  stroke: var(--mk-b);
  stroke-width: 12;
  stroke-linejoin: miter;
  animation: sdCode 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.9s backwards;
}

@keyframes sdInTop    { from { transform: translate3d(-36%, -30%, -140px) rotateZ(-16deg); } }
@keyframes sdInBottom { from { transform: translate3d(36%, 30%, -140px) rotateZ(-16deg); } }
@keyframes sdFade     { from { opacity: 0; } }
@keyframes sdDraw     { from { stroke-dashoffset: 241; } }
@keyframes sdPop      { from { transform: scale(0); } }
@keyframes sdCode     { from { opacity: 0; transform: translateZ(80px) scale(0.4); } }
@keyframes sdSway {
  0%, 100% { transform: rotateX(12deg) rotateY(-28deg); }
  50%      { transform: rotateX(5deg) rotateY(28deg); }
}
@keyframes sdFloat  { 50% { translate: 0 -7px; } }
@keyframes sdShadow { 50% { transform: scale(0.8); opacity: 0.6; } }
@keyframes sdGlow   { 50% { opacity: 0.6; } }
@keyframes sdEcho {
  0%   { transform: scale(0.3); opacity: 0; }
  18%  { opacity: 0.9; }
  100% { transform: scale(1.65); opacity: 0; }
}

.loader__inner {
  position: relative; width: 120px; height: 120px;
  display: grid; place-items: center;
}
.loader__ring {
  position: absolute; border-radius: 50%;
  border: 2px solid transparent; animation: spin 2s linear infinite;
}
.loader__ring:nth-child(1) { width: 120px; height: 120px; border-top-color: var(--clr-a1); animation-duration: 1.5s; }
.loader__ring:nth-child(2) { width: 90px;  height: 90px;  border-inline-end-color: var(--clr-a2); animation-duration: 2s; animation-direction: reverse; }
.loader__ring:nth-child(3) { width: 60px;  height: 60px;  border-bottom-color: var(--clr-a4); animation-duration: 1s; }

.loader__text { font-size: var(--text-base); color: var(--clr-a1); font-weight: var(--w-bold); letter-spacing: 0.1em; }
.loader__name { font-family: var(--font-display); font-size: var(--text-4xl); letter-spacing: 0.25em; }
/* Two-tone like the logo's wordmark. */
.loader__name span { color: var(--mk-a); }
.loader__code { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--clr-a4); opacity: 0.5; animation: blinkCode 1.8s infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blinkCode { 0%,100% { opacity: 0.3; } 50% { opacity: 0.7; } }

/* ── 7. SKIP LINK ─────────────────────────────────────────── */
.skip-link {
  position: fixed;
  inset-block-start: -100px;
  inset-inline-start: var(--s4);
  background: var(--clr-a1); color: #04121a;
  padding: var(--s3) var(--s5); border-radius: var(--r-md);
  font-weight: var(--w-semi); z-index: var(--z-skip);
  transition: inset-block-start var(--t-fast);
}
.skip-link:focus { inset-block-start: var(--s3); }

/* ── 8. LAYOUT ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(var(--s4), 4vw, var(--s10));
  position: relative;
}

main { position: relative; z-index: var(--z-content); }

.section { padding-block: var(--section-py); position: relative; }
#hero + .section { padding-block-start: calc(var(--section-py) * 0.6); }

/* ── 9. PANEL — the box every section sits in ─────────────── */
.panel {
  position: relative;
  transition: border-color var(--t-slow), box-shadow var(--t-slow), background var(--t-slow);
  background: var(--clr-panel);
  border: 1px solid var(--clr-panel-brd);
  border-radius: var(--r-3xl);
  padding: var(--panel-p);
  box-shadow: var(--sh-panel);
  /* No backdrop-filter: the 3D canvas behind redraws continuously, so a
     blur here was recomputed for every visible panel on every frame. The
     near-opaque --clr-panel keeps the depth without that cost. */
  overflow: hidden;
}
/* Hairline highlight along the top edge */
.panel::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--clr-a1-border), transparent);
  pointer-events: none;
}
/* Soft accent bloom in one corner so panels read as lit, not flat */
.panel::after {
  content: "";
  position: absolute;
  inset-block-start: -120px;
  inset-inline-end: -120px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--clr-a1-dim) 0%, transparent 70%);
  pointer-events: none;
}
.panel > * { position: relative; z-index: var(--z-raise); }

/* ── 10. SECTION HEADINGS ─────────────────────────────────── */
.section-head { margin-block-end: var(--s10); max-width: 720px; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .section-eyebrow { justify-content: center; }
.section-head--center .section-subtitle { margin-inline: auto; }

.section-eyebrow {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--font-mono); font-size: var(--text-xs);
  font-weight: var(--w-medium); letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--clr-a1);
  margin-block-end: var(--s3);
}
.section-eyebrow::before {
  content: ""; width: 28px; height: 1px; background: var(--clr-a1); flex-shrink: 0;
}

.section-title {
  font-size: clamp(var(--text-3xl), 4.5vw, var(--text-5xl));
  margin-block-end: var(--s3);
  overflow-wrap: break-word;
}
.section-subtitle {
  font-size: var(--text-lg);
  color: var(--clr-text-2);
  max-width: 620px;
  line-height: var(--lh-relaxed);
}

/* Static on purpose: background-position cannot animate on the compositor,
   so a looping shimmer repainted the text on every frame. */
.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  background-size: 200% auto;
}

/* ── 11. LOGO MARK ────────────────────────────────────────── */
.logo-mark {
  --logo-size: 38px;
  position: relative;
  display: grid; place-items: center;
  width: var(--logo-size); height: var(--logo-size);
  flex-shrink: 0;
  border-radius: calc(var(--logo-size) / 5);
  overflow: hidden;
  background: var(--clr-bg-elevated);
  border: 1px solid var(--clr-a1-border);
}
.logo-mark img { width: 100%; height: 100%; object-fit: cover; }
.logo-mark__text {
  display: none;
  font-family: var(--font-display);
  font-size: calc(var(--logo-size) / 2.4);
  letter-spacing: 0.08em;
  color: var(--clr-a1);
}
.logo-mark--fallback { background: var(--grad-accent); border-color: transparent; }
.logo-mark--fallback .logo-mark__text { display: block; color: #fff; }

/* ── 12. NAVBAR ───────────────────────────────────────────── */
.navbar {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: var(--nav-h);
  z-index: var(--z-navbar);
}
.navbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4);
  height: 100%;
  padding-inline: clamp(var(--s4), 4vw, var(--s10));
  border-block-end: 1px solid transparent;
  transition: background var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
}
.navbar.scrolled .navbar__inner {
  background: var(--clr-bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-block-end-color: var(--clr-border);
  box-shadow: 0 4px 32px rgba(0,0,0,0.3);
}
[data-theme="light"] .navbar.scrolled .navbar__inner {
  background: rgba(248, 250, 255, 0.84);
  box-shadow: 0 10px 30px -12px rgba(26, 60, 150, 0.25);
}

.navbar__logo {
  display: flex; align-items: center; gap: var(--s3);
  color: var(--clr-text); flex-shrink: 0;
}
.navbar__logo-name {
  font-family: var(--font-display);
  font-size: 1.5rem; letter-spacing: 0.1em; line-height: 1;
  white-space: nowrap;
}
[dir="rtl"] .navbar__logo-name { font-family: var(--font-display); direction: ltr; }
.navbar__logo-dot { color: var(--clr-a1); }
.navbar__logo:hover .navbar__logo-name { color: var(--clr-a1); }

.navbar__links { display: flex; align-items: center; gap: var(--s1); min-width: 0; }

.nav-link {
  font-size: var(--text-sm); font-weight: var(--w-medium);
  color: var(--clr-text-2);
  padding: var(--s2) var(--s3);
  border-radius: var(--r-md);
  transition: color var(--t-fast), background var(--t-fast);
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--clr-a1); background: var(--clr-a1-dim); }

.navbar__actions { display: flex; align-items: center; gap: var(--s2); flex-shrink: 0; }

.icon-btn {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: var(--r-lg);
  color: var(--clr-text-2);
  border: 1px solid var(--clr-border);
  background: transparent;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.icon-btn:hover { color: var(--clr-a1); border-color: var(--clr-a1-border); background: var(--clr-a1-dim); }

/* Language dropdown */
.lang-dropdown { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: var(--s2);
  height: 42px; padding-inline: var(--s3);
  border-radius: var(--r-lg);
  color: var(--clr-text-2);
  border: 1px solid var(--clr-border);
  font-family: var(--font-mono); font-size: var(--text-xs);
  font-weight: var(--w-semi); letter-spacing: 0.08em;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.lang-btn:hover { color: var(--clr-a1); border-color: var(--clr-a1-border); background: var(--clr-a1-dim); }

.lang-menu {
  position: absolute;
  inset-block-start: calc(100% + var(--s2));
  inset-inline-end: 0;
  min-width: 220px;
  background: var(--clr-bg-elevated);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  padding: var(--s2);
  box-shadow: var(--sh-lg);
  backdrop-filter: blur(20px);
  opacity: 0; visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transition: opacity var(--t-base), transform var(--t-base), visibility var(--t-base);
}
.lang-menu.open { opacity: 1; visibility: visible; transform: none; }

.lang-option {
  display: flex; align-items: center; gap: var(--s3);
  width: 100%; padding: var(--s3) var(--s4);
  border-radius: var(--r-lg);
  font-size: var(--text-sm); color: var(--clr-text-2);
  text-align: start;
  transition: color var(--t-fast), background var(--t-fast);
}
.lang-option:hover { background: var(--clr-a1-dim); color: var(--clr-a1); }
.lang-option.selected { color: var(--clr-a1); font-weight: var(--w-semi); background: var(--clr-a1-dim); }
/* Script badge in place of flag emoji, which Windows cannot draw and which
   had no correct choice for Kurdish anyway. */
.lang-badge {
  display: inline-grid; place-items: center;
  min-width: 30px; height: 30px;
  padding-inline: var(--s1);
  border-radius: var(--r-md);
  background: var(--clr-a1-dim);
  border: 1px solid var(--clr-a1-border);
  color: var(--clr-a1);
  font-family: var(--font-arabic);
  font-size: var(--text-xs);
  font-weight: var(--w-bold);
  letter-spacing: 0;
  line-height: 1;
  flex-shrink: 0;
}
.lang-option.selected .lang-badge { background: var(--grad-accent); color: #fff; border-color: transparent; }
.lang-option__name { flex: 1; }
.lang-option__code { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--clr-text-muted); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; width: 42px; height: 42px;
  border-radius: var(--r-lg); border: 1px solid var(--clr-border);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.hamburger:hover { border-color: var(--clr-a1-border); background: var(--clr-a1-dim); }
.hamburger__line {
  width: 20px; height: 2px; background: var(--clr-text-2);
  border-radius: var(--r-full); transition: transform var(--t-base), opacity var(--t-base);
}
.hamburger.open .hamburger__line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open .hamburger__line:nth-child(2) { opacity: 0; }
.hamburger.open .hamburger__line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer — sits below the navbar so the hamburger stays clickable */
.mobile-menu {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  z-index: var(--z-menu);
  background: var(--clr-bg-glass);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  overflow-y: auto;
  opacity: 0; visibility: hidden;
  transform: translateY(-12px);
  transition: opacity var(--t-base), transform var(--t-base), visibility var(--t-base);
}
[data-theme="light"] .mobile-menu { background: rgba(240, 244, 252, 0.97); }
.mobile-menu.open { opacity: 1; visibility: visible; transform: none; }
.mobile-menu__inner {
  display: flex; flex-direction: column; gap: var(--s1);
  padding: var(--s6) clamp(var(--s4), 5vw, var(--s10)) var(--s16);
}
.mobile-menu .nav-link {
  font-size: var(--text-lg); font-weight: var(--w-semi);
  padding: var(--s4) var(--s3);
  border-block-end: 1px solid var(--clr-border);
  border-radius: 0;
}
.mobile-menu__cta { margin-block-start: var(--s6); }

/* ── 13. BUTTONS ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s2);
  padding: var(--s3) var(--s5);
  min-height: 46px;
  border-radius: var(--r-lg);
  font-size: var(--text-base); font-weight: var(--w-semi);
  line-height: 1.2;
  border: 2px solid transparent;
  text-align: center;
  transition: transform var(--t-base), box-shadow var(--t-base), background var(--t-base), color var(--t-base), border-color var(--t-base);
}
.btn { position: relative; overflow: hidden; }
/* A light sweeps across the button on hover. */
.btn::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.28), transparent);
  transform: skewX(-18deg);
  /* Moved with translate, not inset: an inset transition re-laid-out the
     button on every frame. 400% of its own width is the same -60% → 120%
     trip across the button. */
  transition: translate 620ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.btn:hover::after { translate: 400% 0; }
[dir="rtl"] .btn:hover::after { translate: -400% 0; }
.btn svg { flex-shrink: 0; position: relative; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; pointer-events: none; }

.btn--primary {
  background: var(--grad-accent); color: #fff;
  box-shadow: 0 4px 20px rgba(0,245,212,0.2);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,245,212,0.3); }
[data-theme="light"] .btn--primary { box-shadow: 0 8px 20px -8px rgba(26, 95, 224, 0.6); }
[data-theme="light"] .btn--primary:hover { box-shadow: 0 14px 28px -10px rgba(26, 95, 224, 0.7); }

.btn--outline { color: var(--clr-a1); border-color: var(--clr-a1); background: transparent; }
.btn--outline:hover { background: var(--clr-a1-dim); transform: translateY(-2px); }

.btn--ghost { color: var(--clr-text-2); border-color: var(--clr-border); background: transparent; }
.btn--ghost:hover { color: var(--clr-a1); border-color: var(--clr-a1-border); background: var(--clr-a1-dim); }

.btn--sm { min-height: 38px; padding: var(--s2) var(--s4); font-size: var(--text-sm); }
.btn--lg { min-height: 54px; padding: var(--s4) var(--s6); font-size: var(--text-lg); }
.btn--full { width: 100%; }

.btn__spinner {
  width: 16px; height: 16px; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.35);
  border-block-start-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── 14. BADGES & TAGS ────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: var(--s1);
  padding: var(--s1) var(--s3);
  border-radius: var(--r-full);
  font-size: var(--text-xs); font-weight: var(--w-semi);
  letter-spacing: 0.04em; white-space: nowrap;
  border: 1px solid transparent;
}
.badge--accent  { background: var(--clr-a1-dim); color: var(--clr-a1); border-color: var(--clr-a1-border); }
.badge--purple  { background: var(--clr-a2-dim); color: var(--clr-a2); border-color: var(--clr-a2-border); }
.badge--success { background: rgba(16,185,129,0.12); color: var(--clr-success); border-color: rgba(16,185,129,0.3); }
.badge--warning { background: var(--clr-a3-dim); color: var(--clr-a3); border-color: rgba(245,158,11,0.3); }
.badge--muted   { background: var(--clr-border); color: var(--clr-text-2); border-color: var(--clr-border); }
/* The glow is static: a pulsing box-shadow repaints on every frame. */
.badge--new {
  background: var(--grad-accent); color: #fff;
  border-color: transparent; letter-spacing: 0.12em;
  box-shadow: 0 2px 12px rgba(0,245,212,0.35);
}

.tech-tag {
  display: inline-block;
  padding: var(--s1) var(--s3);
  border-radius: var(--r-md);
  background: var(--clr-a1-dim);
  border: 1px solid var(--clr-border);
  color: var(--clr-text-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.5;
  white-space: nowrap;
  /* Tech names and "+3" counters are Latin — keep them LTR inside RTL pages. */
  direction: ltr;
  unicode-bidi: isolate;
}
.tech-tag--more { color: var(--clr-a1); }
/* A technology we have projects in is a button that filters the project
   grid; the dot marks it as one. */
.tech-tag--link { cursor: pointer; }
.tech-tag--link::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  margin-inline-end: 6px;
  border-radius: 50%;
  background: var(--clr-a1);
  vertical-align: middle;
  opacity: 0.75;
}
.tech-tag--link:hover, .tech-tag--link:focus-visible {
  background: var(--clr-a1-dim);
  border-color: var(--clr-a1-border);
  color: var(--clr-a1);
}

/* ── 15. GLASS CARD (shared card surface) ─────────────────── */
.glass-card, .service-card, .member-card, .stat-card, .project-card, .contact__form, .skill-item {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-2xl);
  box-shadow: var(--sh-card);
  transition:
    transform var(--t-spring),
    border-color var(--t-base),
    box-shadow var(--t-base),
    background var(--t-base);
}

/* A soft accent light that follows the mouse (effects.js writes --mx and
   --my). Without a mouse it sits centred along the top edge. */
.service-card, .project-card, .skill-item, .contact__form { position: relative; isolation: isolate; }
/* Stat cards tilt in 3D around a floating number, and `isolation` would
   flatten them, so their glow is layered with z-index instead. */
.stat-card { position: relative; }
.stat-card > * { position: relative; z-index: 1; }
.service-card::after, .stat-card::after, .skill-item::after,
.flip-card__face::after, .contact__form::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), var(--clr-a1-dim), transparent 70%);
  opacity: 0;
  transition: opacity var(--t-base);
  pointer-events: none;
  z-index: -1;
}
.stat-card::after { z-index: 0; }
.service-card:hover::after, .stat-card:hover::after, .skill-item:hover::after,
.flip-card__face:hover::after, .contact__form:hover::after { opacity: 1; }
.skill-item:hover { transform: translateY(-3px); border-color: var(--clr-border-h); }

/* ── 16. REVEAL ANIMATIONS ────────────────────────────────── */
/* Opacity and transform only, both compositor-run. A blur-in here left
   `filter: blur(0)` and will-change on every panel for good, keeping each
   one on its own full-size GPU surface long after the reveal finished. */
.reveal, .reveal--left, .reveal--right {
  opacity: 0;
  transition:
    opacity 680ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 680ms cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal { transform: translateY(32px) scale(0.985); }
.reveal--left { transform: translateX(-28px); }
.reveal--right { transform: translateX(28px); }
[dir="rtl"] .reveal--left { transform: translateX(28px); }
[dir="rtl"] .reveal--right { transform: translateX(-28px); }
.reveal.visible, .reveal--left.visible, .reveal--right.visible {
  opacity: 1; transform: none;
}

[data-stagger] > * {
  opacity: 0; transform: translateY(22px) scale(0.97);
  transition:
    opacity 560ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 560ms cubic-bezier(0.16, 1, 0.3, 1);
}
[data-stagger] > *.visible { opacity: 1; transform: none; }

/* ── 17. HERO ─────────────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding-block: calc(var(--nav-h) + var(--s12)) var(--s24);
  overflow: hidden;
}
.hero__aura {
  position: absolute; inset: 0;
  background: var(--grad-hero);
  pointer-events: none;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(var(--s8), 5vw, var(--s20));
  align-items: center;
}

.hero__content { min-width: 0; }

.hero__eyebrow {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: var(--s2) var(--s4);
  border-radius: var(--r-full);
  background: var(--clr-a1-dim);
  border: 1px solid var(--clr-a1-border);
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: 0.16em; color: var(--clr-a1);
  text-transform: uppercase;
  margin-block-end: var(--s5);
}
.hero__eyebrow-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--clr-a1); flex-shrink: 0;
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: 0.4; transform: scale(0.8); }
}

.hero__heading { margin-block-end: var(--s5); }
.hero__name-wrap { display: block; overflow: hidden; }
.hero__name {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(3rem, 11vw, 7rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  animation: riseIn 0.9s cubic-bezier(0.16,1,0.3,1) both;
}
[dir="rtl"] .hero__name { font-family: var(--font-arabic); font-size: clamp(2.2rem, 8vw, 4.5rem); line-height: 1.2; }
.hero__name--sub {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  background-size: 200% auto;
  animation: riseIn 0.9s 0.12s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: none; }
}

.hero__title {
  font-size: clamp(var(--text-xl), 2.5vw, var(--text-3xl));
  font-weight: var(--w-semi);
  color: var(--clr-text);
  margin-block-end: var(--s2);
}
/* "> We build mobile apps_" — typed by effects.js. One line is reserved
   so the copy below never jumps while a phrase is typed or deleted. */
.hero__typed {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  color: var(--clr-text-2);
  min-height: 1.6em;
  line-height: 1.6;
  margin-block-end: var(--s5);
}
.hero__typed-prompt { color: var(--clr-a4); font-weight: var(--w-bold); }
.hero__typed-word { color: var(--clr-a1); font-weight: var(--w-semi); }
.hero__typed-caret {
  display: inline-block;
  width: 0.55em; height: 1.15em;
  margin-inline: 2px 4px;
  vertical-align: text-bottom;
  background: var(--clr-a1);
  border-radius: 2px;
  animation: caretBlink 1.05s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }
[dir="rtl"] .hero__typed { font-size: var(--text-lg); }
[dir="rtl"] .hero__typed-caret { width: 3px; }
.hero__description {
  font-size: var(--text-lg);
  color: var(--clr-text-2);
  max-width: 620px;
  margin-block-end: var(--s8);
}

.hero__actions {
  display: flex; flex-wrap: wrap; gap: var(--s4);
  margin-block-end: var(--s6);
}

.available-pill {
  display: inline-flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s5);
  border-radius: var(--r-full);
  background: rgba(16,185,129,0.09);
  border: 1px solid rgba(16,185,129,0.28);
  color: var(--clr-success);
  font-size: var(--text-sm); font-weight: var(--w-medium);
}
.available-pill__dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--clr-success);
  animation: pulseDot 2s infinite;
}

/* Hero visual — one 3D scene. The orbit rings are tilted planes in the
   same rendering context as the card, so each ring passes behind the
   card on its far side and in front of it on the near side. Every
   element carries its own perspective() so the tilt handler's
   perspective on the card is not applied twice. */
.hero__visual {
  position: relative;
  display: grid; place-items: center;
  min-height: 340px;
  transform-style: preserve-3d;
}
.hero__orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed var(--clr-a1-border);
  pointer-events: none;
  transform-style: preserve-3d;
}
.hero__orbit--1 {
  --tilt: rotateX(72deg) rotateY(-10deg);
  --untilt: rotateY(10deg) rotateX(-72deg);
  width: min(440px, 96%); aspect-ratio: 1;
  border-width: 1.5px;
  animation: orbit3d 26s linear infinite;
}
.hero__orbit--2 {
  --tilt: rotateX(64deg) rotateY(22deg);
  --untilt: rotateY(-22deg) rotateX(-64deg);
  width: min(340px, 78%); aspect-ratio: 1;
  border-color: var(--clr-a2-border);
  animation: orbit3d 18s linear infinite reverse;
}
@keyframes orbit3d {
  from { transform: perspective(1100px) var(--tilt) rotateZ(0deg); }
  to   { transform: perspective(1100px) var(--tilt) rotateZ(360deg); }
}
/* The dot turns against its ring every frame, so it always faces the
   viewer and stays a round light instead of a flattened sliver. */
.hero__orbit-dot {
  position: absolute;
  inset-block-start: -6px; inset-inline-start: calc(50% - 6px);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--clr-a1);
  box-shadow: 0 0 18px var(--clr-a1);
  animation: orbitDot 26s linear infinite;
}
.hero__orbit--2 .hero__orbit-dot {
  background: var(--clr-a2); box-shadow: 0 0 18px var(--clr-a2);
  animation-duration: 18s;
  animation-direction: reverse;
}
@keyframes orbitDot {
  from { transform: rotateZ(0deg) var(--untilt); }
  to   { transform: rotateZ(-360deg) var(--untilt); }
}

/* The card itself: a wrapper that floats and tilts (tilt-card), holding a
   button that turns over to show the team. Both faces carry the surface,
   and the .depth layers on them sit at different heights above it. */
.hero__logo-card {
  position: relative;
  transform: perspective(1000px);
  transform-style: preserve-3d;
  transition: transform var(--t-base);
}
.logo-flip {
  display: block;
  border-radius: var(--r-3xl);
  transform-style: preserve-3d;
  text-align: center;
}
.logo-flip:focus-visible { outline-offset: 10px; border-radius: var(--r-3xl); }
.logo-flip__inner {
  display: grid;
  transform-style: preserve-3d;
  transition: transform 900ms cubic-bezier(0.34, 1.25, 0.64, 1);
}
.logo-flip.is-flipped .logo-flip__inner { transform: rotateY(180deg); }

.logo-flip__face {
  grid-area: 1 / 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s4);
  padding: var(--s8);
  border-radius: var(--r-3xl);
  /* Tint over a solid base rather than a backdrop blur: the card floats
     and tilts over the animated canvas, so a blur re-ran every frame. */
  background-color: var(--clr-bg-2);
  background-image: linear-gradient(var(--clr-bg-card), var(--clr-bg-card));
  border: 1px solid var(--clr-a1-border);
  box-shadow: var(--sh-glow-a1), var(--sh-card);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.logo-flip__face--back {
  transform: rotateY(180deg);
  gap: var(--s5);
  background-image:
    radial-gradient(circle at 50% 0%, var(--clr-a2-dim), transparent 65%),
    linear-gradient(var(--clr-bg-card), var(--clr-bg-card));
}

/* Layers that float above their card. With no perspective (a card at
   rest) translateZ has no visible effect; once the card tilts or turns,
   each layer moves by its own depth. */
.depth {
  transform: translateZ(var(--z, 0px));
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.depth--1 { --z: 18px; }
.depth--2 { --z: 36px; }
.depth--3 { --z: 60px; }

.logo-flip__cue {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--clr-border);
  color: var(--clr-text-muted);
  transition: rotate var(--t-spring), color var(--t-fast), border-color var(--t-fast);
}
.logo-flip:hover .logo-flip__cue { rotate: 180deg; color: var(--clr-a1); border-color: var(--clr-a1-border); }

.logo-flip__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--w-bold);
  color: var(--clr-text);
  max-width: 16ch;
}
.logo-flip__roles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3);
  width: min(300px, 100%);
}
.logo-flip__role {
  display: flex; flex-direction: column; align-items: center; gap: var(--s2);
  padding: var(--s3) var(--s2);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--member-accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--member-accent) 32%, transparent);
  font-size: var(--text-xs);
  font-weight: var(--w-semi);
  line-height: 1.3;
  color: var(--clr-text);
}
.logo-flip__role-icon {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  background: var(--clr-bg-elevated);
  color: var(--member-accent);
}
.logo-flip__role-icon svg { width: 20px; height: 20px; }
.logo-flip__hint {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
}
.hero__logo-card .logo-mark {
  width: min(var(--logo-size), 46vw);
  height: auto; aspect-ratio: 1;
  border-radius: var(--r-2xl);
}
.hero__logo-caption {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clr-text-2);
  text-align: center;
}

.hero__scroll {
  position: absolute;
  inset-block-end: var(--s6);
  inset-inline-start: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: var(--s2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
}
.hero__scroll-line {
  width: 1px; height: 42px;
  background: linear-gradient(to bottom, var(--clr-a1), transparent);
}
.hero__scroll:hover { color: var(--clr-a1); }

/* ── 18. ABOUT ────────────────────────────────────────────── */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(var(--s8), 4vw, var(--s16));
  align-items: start;
}
.about__text { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.about__text p { color: var(--clr-text-2); }
.about__highlight {
  padding: var(--s5);
  border-radius: var(--r-xl);
  background: var(--clr-a1-dim);
  border-inline-start: 3px solid var(--clr-a1);
  color: var(--clr-text) !important;
  font-weight: var(--w-medium);
}
.about__actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-block-start: var(--s2); }

.about__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
}
.stat-card {
  display: flex; flex-direction: column; gap: var(--s1);
  padding: var(--s6) var(--s4);
  text-align: center;
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--clr-border-h); }
/* tilt-card makes stat cards 3D; the value and label are .depth layers. */
.tilt-card { transform-style: preserve-3d; }
.stat-card__value {
  font-family: var(--font-display);
  font-size: clamp(var(--text-4xl), 6vw, var(--text-5xl));
  line-height: 1;
  /* "10+" must stay "10+" in RTL, not flip to "+10". */
  direction: ltr;
  unicode-bidi: isolate;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.stat-card__label {
  font-size: var(--text-xs);
  color: var(--clr-text-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── 19. SERVICES ─────────────────────────────────────────── */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: var(--s5);
}
.service-card {
  display: flex; flex-direction: column; gap: var(--s3);
  padding: var(--s6);
  height: 100%;
}
.service-card:hover {
  transform: translateY(-6px);
  border-color: var(--clr-border-h);
  box-shadow: var(--sh-glow-a1), var(--sh-card);
}
.service-card__icon {
  display: grid; place-items: center;
  width: 54px; height: 54px;
  border-radius: var(--r-xl);
  background: var(--clr-a1-dim);
  border: 1px solid var(--clr-a1-border);
  color: var(--clr-a1);
}
.service-card__icon svg { width: 26px; height: 26px; }
.service-card__title { font-size: var(--text-lg); }
.service-card__desc { font-size: var(--text-sm); color: var(--clr-text-2); }

/* The deck variant is one big card at a time, so it gets more room. */
.service-card--deck {
  gap: var(--s4);
  padding: clamp(var(--s5), 3.5vw, var(--s8));
  min-height: 260px;
}
.service-card--deck .service-card__title { font-size: var(--text-2xl); }
.service-card--deck .service-card__desc { font-size: var(--text-base); flex: 1; }
.service-card__top {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
}
.service-card__index {
  font-size: var(--text-2xl);
  font-weight: var(--w-bold);
  color: var(--clr-a1);
  opacity: 0.3;
  direction: ltr;
}
.service-card__cta {
  display: inline-flex; align-items: center; gap: var(--s2);
  align-self: flex-start;
  font-size: var(--text-sm);
  font-weight: var(--w-semi);
  color: var(--clr-a1);
}
/* The arrow slides with translate; animating gap re-laid-out the card. */
.service-card__cta svg { transition: translate var(--t-spring); }
.service-card__cta:hover svg { translate: var(--s2) 0; }
[dir="rtl"] .service-card__cta svg { transform: scaleX(-1); }
[dir="rtl"] .service-card__cta:hover svg { translate: calc(var(--s2) * -1) 0; }

/* The service deck sits a touch wider than the team deck. */
.deck--wide { max-width: 760px; }
.deck--wide .deck__card > .service-card {
  background-color: var(--clr-bg-2);
  background-image: linear-gradient(var(--clr-bg-card), var(--clr-bg-card));
  box-shadow: var(--sh-card);
  height: 100%;
}
.deck--wide .deck__card:not(.is-front) > .service-card > * {
  opacity: 0;
  transition: opacity 260ms ease;
}
.deck--wide .deck__card.is-front > .service-card > * {
  opacity: 1;
  transition: opacity 380ms ease 120ms;
}
.deck--wide .deck__card.is-front > .service-card {
  box-shadow: var(--sh-lg), 0 0 0 1px var(--clr-border-h);
  border-color: var(--clr-border-h);
}
.deck__card.is-front .service-card__icon { transform: rotate(-4deg) scale(1.05); }
.service-card__icon { transition: transform var(--t-spring); }

/* ── 22b. FLIP CARDS — project covers turn over ───────────── */
/* The wrapper carries no surface of its own: each face is the card. */
.flip-card, .project-card.flip-card {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  perspective: 1600px;
  overflow: visible;
}
.flip-card__inner {
  display: grid;
  transform-style: preserve-3d;
  transition: transform 720ms cubic-bezier(0.22, 1, 0.28, 1);
  height: 100%;
}
.flip-card.is-flipped .flip-card__inner { transform: rotateY(180deg); }

/* Both faces share one grid cell, so the card is as tall as the taller
   of the two and neither face can be clipped. */
.flip-card__face {
  grid-area: 1 / 1;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-color: var(--clr-bg-2);
  background-image: linear-gradient(var(--clr-bg-card), var(--clr-bg-card));
  border: 1px solid var(--clr-border);
  border-radius: var(--r-2xl);
  box-shadow: var(--sh-card);
  overflow: hidden;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
.flip-card__face--back { transform: rotateY(180deg); }
.flip-card__face--back .section-eyebrow { margin-block-end: 0; }
.flip-card:hover .flip-card__face { border-color: var(--clr-border-h); box-shadow: var(--sh-lg); }

.project-card__back {
  display: flex; flex-direction: column; justify-content: center; gap: var(--s4);
  padding: var(--s6);
  flex: 1;
}
.project-card__back-desc { font-size: var(--text-sm); color: var(--clr-text-2); }
.project-card__back-block { display: flex; flex-direction: column; gap: var(--s3); }
.project-card__back-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-text-muted);
}

.flip-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  flex-shrink: 0;
  margin-inline-start: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--clr-border);
  color: var(--clr-text-2);
  transition: transform 520ms cubic-bezier(0.22, 1, 0.28, 1),
              color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.flip-btn:hover {
  color: var(--clr-a1);
  border-color: var(--clr-a1-border);
  background: var(--clr-a1-dim);
  transform: rotate(180deg);
}
.flip-btn--back:hover { transform: rotate(-180deg); }

/* ── 20. TEAM ─────────────────────────────────────────────── */
.leader {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: clamp(var(--s6), 4vw, var(--s10));
  align-items: center;
  padding: clamp(var(--s5), 3vw, var(--s8));
  border-radius: var(--r-2xl);
  background: linear-gradient(135deg, var(--clr-a1-dim) 0%, transparent 60%), var(--clr-bg-card);
  border: 1px solid var(--clr-a1-border);
  box-shadow: var(--sh-card);
  margin-block-end: var(--s12);
}
.leader__photo {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-2xl);
  overflow: hidden;
  background: var(--clr-bg-elevated);
  border: 1px solid var(--clr-a1-border);
  box-shadow: var(--sh-glow-a1);
  display: grid; place-items: center;
  transition: transform var(--t-base);
}
.leader__photo img { width: 100%; height: 100%; object-fit: cover; }
.leader__initials {
  display: none;
  font-family: var(--font-display);
  font-size: 4.5rem;
  color: var(--clr-a1);
  letter-spacing: 0.08em;
}
.leader__photo--fallback .leader__initials { display: block; }

.leader__body { display: flex; flex-direction: column; gap: var(--s3); align-items: start; min-width: 0; }
.leader__name {
  font-size: clamp(var(--text-2xl), 3.5vw, var(--text-4xl));
  line-height: var(--lh-tight);
}
.leader__role {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--clr-a1);
  letter-spacing: 0.06em;
}
.leader__bio { color: var(--clr-text-2); }

.team__members-title {
  display: flex; align-items: center; gap: var(--s3);
  font-size: var(--text-xl);
  margin-block-end: var(--s6);
}
.team__members-count {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--r-lg);
  background: var(--grad-accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1;
  flex-shrink: 0;
}

.member-card {
  display: flex; flex-direction: column; gap: var(--s4);
  padding: clamp(var(--s5), 3.5vw, var(--s8));
  height: 100%;
  position: relative;
  overflow: hidden;
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-2xl);
}
/* Accent rail along the top edge */
.member-card::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 4px;
  background: linear-gradient(to right, var(--member-accent, var(--clr-a1)), transparent);
}
[dir="rtl"] .member-card::before {
  background: linear-gradient(to left, var(--member-accent, var(--clr-a1)), transparent);
}
/* Accent bloom in the far corner */
.member-card::after {
  content: "";
  position: absolute;
  inset-block-start: -90px;
  inset-inline-end: -90px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--member-accent, var(--clr-a1)) 0%, transparent 68%);
  opacity: 0.1;
  pointer-events: none;
}
.member-card--a1 { --member-accent: var(--clr-a1); }
.member-card--a2 { --member-accent: var(--clr-a2); }
.member-card--a3 { --member-accent: var(--clr-a3); }
.member-card--a4 { --member-accent: var(--clr-a4); }

.member-card__top {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
}
.member-card__icon {
  display: grid; place-items: center;
  width: 56px; height: 56px;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--member-accent, var(--clr-a1)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--member-accent, var(--clr-a1)) 30%, transparent);
  color: var(--member-accent, var(--clr-a1));
  transition: transform var(--t-spring);
}
.member-card__icon svg { width: 26px; height: 26px; }
.deck__card.is-front .member-card__icon { transform: rotate(-4deg) scale(1.04); }
.member-card__index {
  font-size: var(--text-2xl);
  font-weight: var(--w-bold);
  color: var(--member-accent, var(--clr-a1));
  opacity: 0.35;
  direction: ltr;
}
.member-card__role {
  font-size: var(--text-xl);
  color: var(--member-accent, var(--clr-a1));
}

/* "Leads with — Kotlin" */
.member-card__primary {
  display: inline-flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
  align-self: flex-start;
  padding: var(--s2) var(--s4);
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--member-accent, var(--clr-a1)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--member-accent, var(--clr-a1)) 32%, transparent);
}
.member-card__primary-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clr-text-2);
}
.member-card__primary-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--w-semi);
  color: var(--member-accent, var(--clr-a1));
  direction: ltr;
}

.member-card__desc { font-size: var(--text-sm); color: var(--clr-text-2); flex: 1; }

.member-card__tools {
  padding-block-start: var(--s4);
  border-block-start: 1px dashed var(--clr-border);
  display: flex; flex-direction: column; gap: var(--s3);
}
.member-card__tools-label {
  display: flex; align-items: center; gap: var(--s2);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-text-muted);
}
.member-card__tools-label svg { color: var(--member-accent, var(--clr-a1)); flex-shrink: 0; }
.member-card__tool-list { display: flex; flex-wrap: wrap; gap: var(--s2); }
.tech-tag--tool {
  border-color: color-mix(in srgb, var(--member-accent, var(--clr-a1)) 28%, transparent);
  color: var(--clr-text);
}
.deck__card.is-front .tech-tag--tool { animation: toolIn 420ms cubic-bezier(0.16,1,0.3,1) backwards; }
.deck__card.is-front .member-card__tool-list > :nth-child(1) { animation-delay: 40ms; }
.deck__card.is-front .member-card__tool-list > :nth-child(2) { animation-delay: 80ms; }
.deck__card.is-front .member-card__tool-list > :nth-child(3) { animation-delay: 120ms; }
.deck__card.is-front .member-card__tool-list > :nth-child(4) { animation-delay: 160ms; }
.deck__card.is-front .member-card__tool-list > :nth-child(5) { animation-delay: 200ms; }
.deck__card.is-front .member-card__tool-list > :nth-child(6) { animation-delay: 240ms; }
@keyframes toolIn {
  from { opacity: 0; transform: translateY(8px) scale(0.9); }
  to   { opacity: 1; transform: none; }
}

/* ── 20b. CARD DECK — swipe/drag to swap ──────────────────── */
.deck {
  --deck-shift: 22px;
  --deck-drop: 16px;
  position: relative;
  outline: none;
  max-width: 680px;
  margin-inline: auto;
}
.deck:focus-visible { outline: 2px solid var(--clr-a1); outline-offset: 10px; border-radius: var(--r-2xl); }

.deck__stage {
  display: grid;
  user-select: none;
  -webkit-user-select: none;
  perspective: 1400px;
  touch-action: pan-y;
  /* Room for the two cards peeking out behind the front one. */
  padding-inline-end: calc(var(--deck-shift) * 2);
  padding-block-end: calc(var(--deck-drop) * 2);
}
[dir="rtl"] .deck__stage {
  padding-inline-end: 0;
  padding-inline-start: calc(var(--deck-shift) * 2);
}

.deck__card {
  grid-area: 1 / 1;
  transform-style: preserve-3d;
  transform-origin: 50% 120%;
  transform:
    translate3d(calc(var(--drag-x, 0px) + var(--pos) * var(--deck-shift)),
                calc(var(--pos) * var(--deck-drop)), 0)
    rotate(calc(var(--drag-rot, 0deg) + var(--pos) * 1.4deg))
    scale(calc(1 - var(--pos) * 0.055));
  opacity: calc(1 - var(--pos) * 0.22);
  /* No blur on the cards behind: each blurred card was an offscreen
     surface redrawn every frame, for a softening nobody could see. */
  z-index: calc(10 - var(--pos));
  transition:
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 380ms ease,
    box-shadow 380ms ease;
  will-change: transform, opacity;
}
/* RTL: the pile leans the other way. */
[dir="rtl"] .deck__card {
  transform:
    translate3d(calc(var(--drag-x, 0px) - var(--pos) * var(--deck-shift)),
                calc(var(--pos) * var(--deck-drop)), 0)
    rotate(calc(var(--drag-rot, 0deg) - var(--pos) * 1.4deg))
    scale(calc(1 - var(--pos) * 0.055));
}

/* Cards in a pile must be opaque or the ones underneath read through the
   one in front. The translucent card tint is painted over a solid base. */
.deck__card > .member-card {
  background-color: var(--clr-bg-2);
  background-image: linear-gradient(var(--clr-bg-card), var(--clr-bg-card));
  box-shadow: var(--sh-card);
}
/* Only the front card shows its contents — the rest are just edges of a pile. */
.deck__card:not(.is-front) > .member-card > * {
  opacity: 0;
  transition: opacity 260ms ease;
}
.deck__card.is-front > .member-card > * {
  opacity: 1;
  transition: opacity 380ms ease 120ms;
}
.deck__card.is-front { cursor: grab; }
.deck__card.is-front > .member-card {
  box-shadow: var(--sh-lg), 0 0 0 1px var(--clr-border-h);
  border-color: var(--clr-border-h);
}
.deck__card.is-dragging { transition: none; cursor: grabbing; }
.deck__card.is-hidden { opacity: 0; pointer-events: none; }
.deck__card:not(.is-front) { pointer-events: none; }

/* The card that just left the pile flies off before looping back. */
.deck--flung .deck__card:not(.is-front) { transition-duration: 620ms; }

.deck__controls {
  display: flex; align-items: center; justify-content: center;
  gap: var(--s4);
  margin-block-start: var(--s6);
}
.deck__nav {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--clr-border);
  background: var(--clr-bg-card);
  color: var(--clr-text-2);
  box-shadow: var(--sh-sm);
  transition: transform var(--t-spring), color var(--t-fast),
              border-color var(--t-fast), background var(--t-fast);
}
.deck__nav:hover {
  color: var(--clr-a1);
  border-color: var(--clr-a1-border);
  background: var(--clr-a1-dim);
  transform: scale(1.12);
}
.deck__nav:active { transform: scale(0.94); }
/* The chevrons point outward from the deck in either writing direction. */
[dir="rtl"] .deck__nav svg { transform: scaleX(-1); }

.deck__dots { display: flex; align-items: center; gap: var(--s2); }
.deck__dot {
  width: 9px; height: 9px;
  border-radius: var(--r-full);
  background: var(--clr-border);
  border: 1px solid transparent;
  transition: width var(--t-spring), background var(--t-base);
}
.deck__dot:hover { background: var(--clr-text-muted); }
.deck__dot.active { width: 30px; background: var(--grad-accent); }

.deck__hint {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: var(--s2) var(--s3);
  margin-block-start: var(--s4);
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  text-align: center;
}
.deck__hint-icon {
  display: inline-flex;
  color: var(--clr-a1);
  animation: swipeNudge 2.6s cubic-bezier(0.4,0,0.2,1) infinite;
}
@keyframes swipeNudge {
  0%, 60%, 100% { transform: translateX(0); }
  70% { transform: translateX(-5px); }
  85% { transform: translateX(5px); }
}
.deck__counter {
  padding: 2px var(--s3);
  border-radius: var(--r-full);
  border: 1px solid var(--clr-border);
  background: var(--clr-bg-card);
  color: var(--clr-text-2);
  direction: ltr;
}
.deck__counter b { color: var(--clr-a1); }

/* ── 21. TECHNOLOGIES ─────────────────────────────────────── */
.stack__tabs {
  display: flex; flex-wrap: wrap; gap: var(--s2);
  margin-block-end: var(--s8);
}
.tab-btn {
  padding: var(--s3) var(--s5);
  border-radius: var(--r-full);
  border: 1px solid var(--clr-border);
  background: transparent;
  color: var(--clr-text-2);
  font-size: var(--text-sm); font-weight: var(--w-medium);
}
.tab-btn:hover { color: var(--clr-a1); border-color: var(--clr-a1-border); }
.tab-btn.active {
  background: var(--grad-accent);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 16px rgba(0,245,212,0.2);
}

.stack__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: var(--s4);
}
.skill-item { padding: var(--s5); }
.skill-item__header {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); margin-block-end: var(--s3);
}
.skill-item__name { font-weight: var(--w-medium); font-size: var(--text-sm); }
.skill-item__percent {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--clr-a1);
  direction: ltr;
  unicode-bidi: isolate;
}
.project-card__meta, .team__members-count { direction: ltr; unicode-bidi: isolate; }

.progress-bar {
  position: relative;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--clr-border);
  overflow: hidden;
}
.progress-bar__fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: var(--r-full);
  background: var(--grad-accent);
  transform: scaleX(0);
  /* "inline-start" is not a valid transform-origin — it silently fell back
     to center and the bars grew outwards from the middle. */
  transform-origin: left center;
  transition: transform 1.1s cubic-bezier(0.16,1,0.3,1);
}
[dir="rtl"] .progress-bar__fill { transform-origin: right center; }
.progress-bar__fill.animated { transform: scaleX(var(--target, 1)); }

/* ── 22. PROJECTS ─────────────────────────────────────────── */
.projects__controls {
  display: flex; flex-wrap: wrap; gap: var(--s4);
  align-items: center; justify-content: space-between;
  margin-block-end: var(--s8);
}
.search-wrap { position: relative; flex: 1 1 260px; min-width: 0; }
.search-wrap > svg {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: var(--s4);
  transform: translateY(-50%);
  color: var(--clr-text-muted);
  pointer-events: none;
}
.search-input { padding-inline-start: var(--s10) !important; }

.filter-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.filter-chip {
  padding: var(--s2) var(--s4);
  border-radius: var(--r-full);
  border: 1px solid var(--clr-border);
  background: transparent;
  color: var(--clr-text-2);
  font-size: var(--text-sm);
}
.filter-chip:hover { color: var(--clr-a1); border-color: var(--clr-a1-border); }
.filter-chip.active {
  background: var(--clr-a1-dim);
  color: var(--clr-a1);
  border-color: var(--clr-a1-border);
  font-weight: var(--w-semi);
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: var(--s6);
}
.projects__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--s16);
  color: var(--clr-text-2);
}

.project-card {
  display: flex; flex-direction: column;
  overflow: hidden;
  height: 100%;
}
.project-card:hover { transform: translateY(-6px); }
.project-card--featured .flip-card__face {
  border-color: var(--clr-a1-border);
  box-shadow: var(--sh-glow-a1), var(--sh-card);
}
/* Actions sit at the bottom of whichever face is showing. */
.flip-card__face .project-card__actions { margin-block-start: auto; align-items: center; }

.project-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--clr-a1-dim), var(--clr-a2-dim));
  overflow: hidden;
}
/* Blurred copy of the artwork fills the frame, the real image sits on top
   fully visible — so portrait logos are not cropped in half. */
.project-card__media::before {
  content: "";
  position: absolute; inset: -8%;
  background-image: var(--cover);
  background-size: cover;
  background-position: center;
  filter: blur(24px) saturate(140%) brightness(0.5);
}
.project-card__media img {
  position: relative;
  width: 100%; height: 100%;
  object-fit: contain;
  transition: transform var(--t-slow);
}
.project-card:hover .project-card__media img { transform: scale(1.05); }
.project-card__media--fallback::after {
  content: "◆";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 3rem;
  color: var(--clr-a1);
  opacity: 0.5;
}
.project-card__badges {
  position: absolute;
  inset-block-start: var(--s3);
  inset-inline-end: var(--s3);
  display: flex; flex-wrap: wrap; gap: var(--s2);
  justify-content: flex-end;
  max-width: calc(100% - var(--s6));
}

.project-card__body {
  display: flex; flex-direction: column; gap: var(--s3);
  padding: var(--s5);
  flex: 1;
}
.project-card__meta { font-size: var(--text-xs); color: var(--clr-text-muted); }
.project-card__title { font-size: var(--text-xl); line-height: var(--lh-snug); }
.project-card__desc { font-size: var(--text-sm); color: var(--clr-text-2); flex: 1; }
.project-card__tags { display: flex; flex-wrap: wrap; gap: var(--s2); }
.project-card__actions {
  display: flex; flex-wrap: wrap; gap: var(--s2);
  padding: var(--s5);
  padding-block-start: 0;
}

/* ── 23. MODAL ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  z-index: var(--z-modal);
  background: rgba(2,5,16,0.85);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s4);
  opacity: 0; visibility: hidden;
  transition: opacity var(--t-base), visibility var(--t-base);
}
[data-theme="light"] .modal-overlay { background: rgba(10,20,60,0.5); }
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  width: 100%; max-width: 680px;
  max-height: min(88vh, 900px);
  overflow-y: auto;
  padding: clamp(var(--s5), 4vw, var(--s8));
  border-radius: var(--r-3xl);
  background: var(--clr-bg-elevated);
  border: 1px solid var(--clr-a1-border);
  box-shadow: var(--sh-glow-a1), var(--sh-lg);
  /* No backdrop-filter of its own: the overlay under it is already blurred. */
  transform: scale(0.94) translateY(20px);
  transition: transform var(--t-spring);
  overscroll-behavior: contain;
}
.modal-overlay.open .modal { transform: none; }

.modal__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s4);
  margin-block-end: var(--s5);
}
.modal__badges { display: flex; flex-wrap: wrap; gap: var(--s2); margin-block-end: var(--s3); }
.modal__title { font-size: clamp(var(--text-xl), 4vw, var(--text-3xl)); }
.modal__media {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-block-end: var(--s5);
  border: 1px solid var(--clr-border);
  background: var(--clr-bg-card);
}
.modal__media::before {
  content: "";
  position: absolute; inset: -8%;
  background-image: var(--cover);
  background-size: cover;
  background-position: center;
  filter: blur(28px) saturate(140%) brightness(0.45);
}
.modal__media img {
  position: relative;
  width: 100%;
  height: 260px;
  object-fit: contain;
}
.modal__desc { color: var(--clr-text-2); margin-block-end: var(--s6); }
.modal__block { margin-block-end: var(--s6); }
.modal__block-title { font-size: var(--text-base); margin-block-end: var(--s3); }
.modal__tags { display: flex; flex-wrap: wrap; gap: var(--s2); }
.modal__actions {
  display: flex; flex-wrap: wrap; gap: var(--s3);
  padding-block-start: var(--s5);
  border-block-start: 1px solid var(--clr-border);
}

/* ── 24. FORMS ────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--s2); }
.form-label {
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  color: var(--clr-text-2);
}
.form-input, .form-textarea {
  width: 100%;
  padding: var(--s3) var(--s4);
  min-height: 46px;
  border-radius: var(--r-lg);
  background: var(--clr-bg-elevated);
  border: 1px solid var(--clr-border);
  color: var(--clr-text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-textarea { resize: vertical; min-height: 120px; line-height: var(--lh-relaxed); }
/* Each line takes its direction from its own first letter, so English
   typed on a Kurdish or Arabic page reads left to right (and the other
   way round) while an empty field still follows the page. */
.form-input:not(.ltr-force), .form-textarea, .palette__input { unicode-bidi: plaintext; }
.form-input::placeholder, .form-textarea::placeholder { color: var(--clr-text-muted); }
.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--clr-a1);
  box-shadow: 0 0 0 3px var(--clr-a1-dim);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: var(--s4);
}

.form-success {
  display: flex; flex-direction: column; align-items: center; gap: var(--s4);
  text-align: center;
  padding: var(--s10) var(--s4);
}
.form-success__icon {
  display: grid; place-items: center;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(16,185,129,0.12);
  border: 2px solid rgba(16,185,129,0.35);
  color: var(--clr-success);
}
.form-success__icon svg { width: 30px; height: 30px; }
.form-success p { color: var(--clr-text-2); max-width: 380px; }

/* ── 25. CONTACT ──────────────────────────────────────────── */
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(var(--s6), 4vw, var(--s12));
  align-items: start;
}
.contact__info { display: flex; flex-direction: column; }

.contact-info__item {
  display: flex; align-items: flex-start; gap: var(--s4);
  padding-block: var(--s5);
  border-block-end: 1px solid var(--clr-border);
}
.contact-info__item--last { border-block-end: none; }
.contact-info__icon {
  display: grid; place-items: center;
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: var(--r-lg);
  background: var(--clr-a1-dim);
  border: 1px solid var(--clr-a1-border);
  color: var(--clr-a1);
}
.contact-info__icon--ok {
  background: rgba(16,185,129,0.12);
  border-color: rgba(16,185,129,0.3);
  color: var(--clr-success);
}
.contact-info__body { min-width: 0; display: flex; flex-direction: column; gap: var(--s1); align-items: start; }
.contact-info__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-text-muted);
}
.contact-info__value { font-size: var(--text-base); font-weight: var(--w-medium); overflow-wrap: anywhere; }
.contact-info__link { color: var(--clr-a1); }
.contact-info__link:hover { text-decoration: underline; }
.contact-info__value--ok { color: var(--clr-success); }

.copy-btn {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  padding: var(--s1) var(--s2);
  border-radius: var(--r-sm);
  border: 1px solid var(--clr-border);
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.copy-btn:hover { color: var(--clr-a1); border-color: var(--clr-a1-border); background: var(--clr-a1-dim); }

.contact__socials { padding-block-start: var(--s6); }
.contact__socials-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-text-muted);
  margin-block-end: var(--s3);
}
.socials { display: flex; flex-wrap: wrap; gap: var(--s3); }
.social-link {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: var(--s3) var(--s5);
  border-radius: var(--r-lg);
  border: 1px solid var(--clr-border);
  background: var(--clr-bg-card);
  color: var(--clr-text-2);
  font-size: var(--text-sm); font-weight: var(--w-medium);
}
.social-link:hover {
  color: var(--clr-a1);
  border-color: var(--clr-a1-border);
  background: var(--clr-a1-dim);
  transform: translateY(-2px);
}

.contact__form {
  display: flex; flex-direction: column; gap: var(--s4);
  padding: clamp(var(--s5), 3vw, var(--s8));
}
.contact__note {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  text-align: center;
}

/* ── 26. FOOTER ───────────────────────────────────────────── */
footer {
  position: relative;
  z-index: var(--z-content);
  background: var(--clr-bg-2);
  border-block-start: 1px solid var(--clr-border);
  padding-block: var(--s10) var(--s6);
  margin-block-start: var(--s16);
}
/* Daylight footer: the deepest tint on the page, with the brand rule on
   top, so the page ends on a grounded band instead of fading out. */
[data-theme="light"] footer {
  background: linear-gradient(180deg, rgba(210, 220, 238, 0.94), rgba(200, 212, 234, 0.97));
  border-block-start-color: var(--clr-a1-border);
}

.footer__inner { display: flex; flex-direction: column; gap: var(--s6); }
.footer__brand { display: flex; align-items: center; gap: var(--s4); }
.footer__name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  letter-spacing: 0.1em;
}
.footer__tagline { font-size: var(--text-sm); color: var(--clr-text-2); max-width: 620px; }

.footer__links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.footer__links a { font-size: var(--text-sm); color: var(--clr-text-2); }
.footer__links a:hover { color: var(--clr-a1); }

.footer__bottom {
  display: flex; flex-wrap: wrap; gap: var(--s3);
  align-items: center; justify-content: space-between;
  padding-block-start: var(--s5);
  border-block-start: 1px solid var(--clr-border);
}
.footer__copy { font-size: var(--text-sm); color: var(--clr-text-muted); }

/* ── 27. SCROLL-TOP & TOAST ───────────────────────────────── */
/* These two used to share the same corner and covered each other.
   Scroll-top owns the end corner; the toast owns the start corner. */
.scroll-top {
  position: fixed;
  inset-block-end: var(--s6);
  inset-inline-end: var(--s6);
  z-index: var(--z-scrolltop);
  display: grid; place-items: center;
  width: 50px; height: 50px;
  border-radius: var(--r-xl);
  background: var(--grad-accent);
  color: #fff;
  box-shadow: var(--sh-glow-a1), var(--sh-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity var(--t-base), transform var(--t-base), visibility var(--t-base);
}
.scroll-top.visible { opacity: 1; visibility: visible; transform: none; }
.scroll-top:hover { transform: translateY(-3px); }

.toast {
  position: fixed;
  inset-block-end: var(--s6);
  inset-inline-start: var(--s6);
  z-index: var(--z-toast);
  display: flex; align-items: center; gap: var(--s3);
  max-width: min(360px, calc(100vw - var(--s12)));
  padding: var(--s4) var(--s5);
  border-radius: var(--r-xl);
  background: var(--clr-bg-elevated);
  border: 1px solid var(--clr-border);
  box-shadow: var(--sh-lg);
  backdrop-filter: blur(20px);
  font-size: var(--text-sm); font-weight: var(--w-medium);
  opacity: 0;
  visibility: hidden;
  transform: translateY(70px) scale(0.96);
  transition: opacity var(--t-spring), transform var(--t-spring), visibility var(--t-spring);
}
.toast.show { opacity: 1; visibility: visible; transform: none; }
.toast svg { flex-shrink: 0; }
.toast--success { border-color: rgba(16,185,129,0.35); color: var(--clr-success); }
.toast--error { border-color: rgba(239,68,68,0.35); color: var(--clr-error); }
[data-theme="light"] .toast { background: rgba(255,255,255,0.98); }

/* ── 28. GLITCH ───────────────────────────────────────────── */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}
.glitch::before { color: var(--clr-a1); animation: glitchTop 3.2s infinite steps(2, end); }
.glitch::after  { color: var(--clr-a2); animation: glitchBot 2.8s infinite steps(2, end); }
@keyframes glitchTop {
  0%, 92%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  93% { clip-path: inset(0 0 62% 0); transform: translateX(-3px); }
  96% { clip-path: inset(0 0 72% 0); transform: translateX(3px); }
}
@keyframes glitchBot {
  0%, 90%, 100% { clip-path: inset(100% 0 0 0); transform: none; }
  91% { clip-path: inset(68% 0 0 0); transform: translateX(3px); }
  95% { clip-path: inset(78% 0 0 0); transform: translateX(-3px); }
}

/* ── 28b. MOTION POLISH ───────────────────────────────────── */

/* Nav links grow an underline from the centre instead of snapping —
   with scaleX, so the growth never re-lays-out the link. */
.nav-link { position: relative; }
.nav-link::after {
  content: "";
  position: absolute;
  inset-block-end: 4px;
  inset-inline: 22%;
  height: 2px;
  border-radius: var(--r-full);
  background: var(--grad-accent);
  transform: scaleX(0);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

/* Section eyebrow rule draws itself in. */
.section-eyebrow::before { transition: width 520ms cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.visible .section-eyebrow::before { width: 34px; }

/* Filter chips and tabs morph rather than jump. */
.filter-chip, .tab-btn {
  transition: color var(--t-fast), border-color var(--t-fast),
              background var(--t-base), transform var(--t-spring);
}
.filter-chip:hover, .tab-btn:hover { transform: translateY(-2px); }
.filter-chip.active, .tab-btn.active { transform: none; }

/* Tech tags lift under the pointer. */
.tech-tag {
  transition: transform var(--t-spring), border-color var(--t-fast),
              color var(--t-fast), background var(--t-fast);
}
.tech-tag:hover {
  transform: translateY(-2px);
  border-color: var(--clr-a1-border);
  color: var(--clr-a1);
}

/* Stat numbers get a soft glow as they finish counting. */
.stat-card { transition: transform var(--t-spring), border-color var(--t-base), box-shadow var(--t-base); }
.stat-card:hover .stat-card__value { transform: translateZ(var(--z, 0px)) scale(1.06); }
.stat-card__value { display: inline-block; transition: transform var(--t-spring); }

/* Contact rows slide in from the reading edge on hover. */
.contact-info__item { transition: transform var(--t-spring); }
.contact-info__item:hover { transform: translateX(4px); }
[dir="rtl"] .contact-info__item:hover { transform: translateX(-4px); }
.contact-info__icon { transition: transform var(--t-spring), background var(--t-base); }
.contact-info__item:hover .contact-info__icon { transform: scale(1.1) rotate(-6deg); }

/* Social pills and the hero logo card breathe. */
.social-link { transition: transform var(--t-spring), border-color var(--t-fast), color var(--t-fast), background var(--t-fast); }
.social-link:hover { transform: translateY(-3px); }

.hero__logo-card { animation: heroFloat 7s ease-in-out infinite; }
@keyframes heroFloat {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -12px; }
}
/* The tilt handler writes to transform, so the float uses translate and the
   two never fight over the same property. */
.hero__logo-card.tilt-card { transition: transform var(--t-spring); }
/* While the pointer is on a tilt card it tracks closely; the spring only
   plays as the card settles back. */
.tilt-card.is-tilting { transition: transform 120ms ease-out; }

/* Looping decorations stop while their section is scrolled out of view
   (see initOffscreenPause) or covered by the modal / mobile menu. */
.is-offscreen *, .is-offscreen *::before, .is-offscreen *::after,
.is-locked main *, .is-locked main *::before, .is-locked main *::after {
  animation-play-state: paused !important;
}

/* Theme switches fade the whole surface set rather than snapping. */
.panel, .glass-card, .service-card, .member-card, .stat-card,
.flip-card__face, .contact__form, .skill-item, .navbar__inner {
  transition-property: transform, border-color, box-shadow, background, color;
}

/* Modal opens with a small spring. */
.modal { transition: transform 480ms cubic-bezier(0.34, 1.4, 0.64, 1), opacity var(--t-base); }

/* Scroll-to-top rolls in. */
.scroll-top { transition: opacity var(--t-base), visibility var(--t-base), transform var(--t-spring); }
.scroll-top:hover { transform: translateY(-3px) rotate(-8deg); }

/* ── 28c. CHIPS (planner + contact topics) ────────────────── */
.chip-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  position: relative;
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 42px;
  padding: var(--s2) var(--s4);
  border-radius: var(--r-full);
  border: 1px solid var(--clr-border);
  background: var(--clr-bg-card);
  color: var(--clr-text-2);
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  line-height: 1.3;
  text-align: start;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-base),
              transform var(--t-spring), box-shadow var(--t-base);
}
.chip:hover { color: var(--clr-a1); border-color: var(--clr-a1-border); transform: translateY(-2px); }
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"] {
  color: var(--clr-a1);
  background: var(--clr-a1-dim);
  border-color: var(--clr-a1);
  box-shadow: 0 0 0 3px var(--clr-a1-dim);
}
.chip__icon { display: inline-flex; color: var(--clr-a1); }
.chip__icon svg { width: 18px; height: 18px; }
/* A tick pops onto the corner of a chosen chip: scaled, not resized,
   so choosing never shifts the chips around it. */
.chip__tick {
  position: absolute;
  inset-block-start: -6px;
  inset-inline-end: -6px;
  display: grid; place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--grad-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transform: scale(0);
  transition: transform var(--t-spring);
}
.chip__tick svg { width: 11px; height: 11px; }
.chip[aria-pressed="true"] .chip__tick { transform: scale(1); }
.chip--sm { min-height: 36px; padding: var(--s1) var(--s3); font-size: var(--text-xs); }

/* ── 28d. PLANNER ─────────────────────────────────────────── */
.planner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(var(--s6), 4vw, var(--s12));
  align-items: start;
}
.planner__steps { display: flex; flex-direction: column; gap: var(--s8); min-width: 0; }
.planner__step { border: none; min-width: 0; }
.planner__legend {
  display: flex; align-items: center; gap: var(--s3);
  font-size: var(--text-lg);
  font-weight: var(--w-semi);
  margin-block-end: var(--s4);
}
.planner__num {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  background: var(--clr-a1-dim);
  border: 1px solid var(--clr-a1-border);
  color: var(--clr-a1);
  font-size: var(--text-xs);
  font-weight: var(--w-bold);
  direction: ltr;
  flex-shrink: 0;
}

.planner__summary {
  display: flex; flex-direction: column; gap: var(--s5);
  padding: clamp(var(--s5), 3vw, var(--s8));
  border-radius: var(--r-2xl);
  background: linear-gradient(160deg, var(--clr-a2-dim), transparent 55%), var(--clr-bg-card);
  border: 1px solid var(--clr-a1-border);
  box-shadow: var(--sh-card);
  position: relative;
  isolation: isolate;
}
.planner__summary::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), var(--clr-a1-dim), transparent 70%);
  opacity: 0;
  transition: opacity var(--t-base);
  pointer-events: none;
  z-index: -1;
}
.planner__summary:hover::after { opacity: 1; }
.planner__title { display: flex; align-items: center; gap: var(--s2); font-size: var(--text-xl); }
.planner__title svg { color: var(--clr-a1); }
.planner__block { display: flex; flex-direction: column; gap: var(--s3); }
.planner__label {
  display: flex; align-items: center; gap: var(--s2);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-text-muted);
}
.planner__label svg { color: var(--clr-a1); }
.planner__size {
  margin-inline-start: auto;
  font-size: var(--text-sm);
  letter-spacing: 0;
  text-transform: none;
  color: var(--clr-a1);
}
.planner__note { font-size: var(--text-sm); color: var(--clr-text-2); }
.planner__summary.is-empty .planner__note { color: var(--clr-text-muted); }
.planner__brief {
  display: flex; flex-direction: column; gap: var(--s3);
  padding-block-start: var(--s4);
  border-block-start: 1px dashed var(--clr-border);
}
.planner__brief:empty { display: none; }
.planner__row { display: grid; gap: 2px; }
.planner__row dt { font-size: var(--text-xs); color: var(--clr-text-muted); }
.planner__row dd { font-size: var(--text-sm); font-weight: var(--w-medium); color: var(--clr-text); }
.planner__actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.planner__actions .btn { flex: 1 1 auto; }

/* The four engineers as 3D tokens: each lies flat on the card, hinged at
   its bottom edge, and stands up when the plan needs that person. */
.planner__tokens {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s3);
  perspective: 700px;
}
.token {
  display: flex; flex-direction: column; align-items: center; gap: var(--s2);
  text-align: center;
  transform-style: preserve-3d;
}
.token__tile {
  display: grid; place-items: center;
  width: 100%; max-width: 64px; aspect-ratio: 1;
  border-radius: var(--r-lg);
  background: var(--clr-bg-elevated);
  border: 1px solid var(--clr-border);
  color: var(--clr-text-muted);
  transform-origin: 50% 100%;
  transform: rotateX(62deg) translateZ(-4px);
  opacity: 0.45;
  transition:
    transform 700ms cubic-bezier(0.34, 1.45, 0.64, 1),
    opacity var(--t-base), color var(--t-base), background var(--t-base),
    border-color var(--t-base), box-shadow var(--t-base);
}
.token__icon { display: inline-flex; }
.token__icon svg { width: 24px; height: 24px; }
.token.is-on .token__tile {
  transform: rotateX(0deg) translateZ(20px);
  opacity: 1;
  color: var(--member-accent);
  background: color-mix(in srgb, var(--member-accent) 14%, var(--clr-bg-elevated));
  border-color: color-mix(in srgb, var(--member-accent) 45%, transparent);
  box-shadow: 0 16px 22px -12px color-mix(in srgb, var(--member-accent) 75%, transparent);
}
.token__name {
  font-size: var(--text-xs);
  line-height: 1.3;
  color: var(--clr-text-muted);
  transition: color var(--t-base);
}
.token.is-on .token__name { color: var(--clr-text); font-weight: var(--w-semi); }

.meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.meter span {
  height: 8px;
  border-radius: var(--r-full);
  background: var(--clr-border);
  transition: background var(--t-base);
}
.meter[data-level="1"] span:nth-child(-n+1),
.meter[data-level="2"] span:nth-child(-n+2),
.meter[data-level="3"] span:nth-child(-n+3) { background: var(--grad-accent); }

/* ── 28e. TECH SPHERE ─────────────────────────────────────── */
.stack__sphere {
  margin-block-start: var(--s12);
  padding-block-start: var(--s10);
  border-block-start: 1px solid var(--clr-border);
  text-align: center;
}
.stack__sphere-title { font-size: var(--text-xl); margin-block-end: var(--s2); }
.sphere {
  position: relative;
  height: clamp(320px, 52vw, 460px);
  max-width: 640px;
  margin-inline: auto;
  perspective: 900px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.sphere.is-dragging { cursor: grabbing; }
.sphere__stage { position: absolute; inset: 0; transform-style: preserve-3d; }
/* Physical left/top on purpose: sphere.js places every name with real
   x/y/z offsets from the centre, which must not mirror in RTL. */
.sphere .sphere__item {
  position: absolute;
  left: 50%; top: 50%;
  will-change: transform, opacity;
  transition: scale var(--t-spring), color var(--t-fast), border-color var(--t-fast),
              background var(--t-fast), box-shadow var(--t-fast);
}
/* Names with no project behind them stay quiet, so the clickable ones lead. */
.sphere .sphere__item:not(.tech-tag--link) {
  color: var(--clr-text-muted);
  background: transparent;
  border-color: var(--clr-border);
}
.sphere .sphere__item.tech-tag--link {
  color: var(--clr-text);
  background: var(--clr-bg-elevated);
  border-color: var(--clr-a1-border);
}
.sphere .sphere__item.tech-tag--link:hover,
.sphere .sphere__item.tech-tag--link:focus-visible {
  scale: 1.18;
  color: var(--clr-a1);
  box-shadow: var(--sh-glow-a1);
}
.sphere__hint {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: var(--s2);
  margin-block-start: var(--s4);
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
}

/* ── 28f. TECH FILTER BANNER ──────────────────────────────── */
.tech-filter {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4);
  margin-block-end: var(--s6);
  border-radius: var(--r-xl);
  background: var(--clr-a1-dim);
  border: 1px solid var(--clr-a1-border);
  animation: bannerIn 420ms cubic-bezier(0.16, 1, 0.3, 1);
}
.tech-filter:focus { outline: none; }
.tech-filter:focus-visible { outline: 2px solid var(--clr-a1); outline-offset: 3px; }
.tech-filter__icon { display: inline-flex; color: var(--clr-a1); }
.tech-filter__text { flex: 1 1 auto; font-size: var(--text-sm); color: var(--clr-text); }
.tech-filter__name {
  font-family: var(--font-mono);
  color: var(--clr-a1);
  direction: ltr;
  unicode-bidi: isolate;
}
.tech-filter__count {
  display: grid; place-items: center;
  min-width: 28px; height: 28px;
  border-radius: var(--r-full);
  background: var(--grad-accent);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: var(--w-bold);
}
.tech-filter__clear {
  display: inline-flex; align-items: center; gap: var(--s1);
  padding: var(--s1) var(--s3);
  border-radius: var(--r-full);
  border: 1px solid var(--clr-a1-border);
  color: var(--clr-a1);
  font-size: var(--text-xs);
  font-weight: var(--w-semi);
  transition: background var(--t-fast);
}
.tech-filter__clear:hover { background: var(--clr-a1-dim); }
.tech-filter__clear svg { width: 14px; height: 14px; }
@keyframes bannerIn {
  from { opacity: 0; transform: perspective(600px) rotateX(-24deg) translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ── 28g. MODAL PAGER ─────────────────────────────────────── */
.modal__pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3);
  margin-block-start: var(--s5);
  padding-block-start: var(--s5);
  border-block-start: 1px solid var(--clr-border);
}
.modal__page {
  display: flex; align-items: center; gap: var(--s3);
  min-width: 0;
  padding: var(--s3) var(--s4);
  border-radius: var(--r-lg);
  border: 1px solid var(--clr-border);
  background: var(--clr-bg-card);
  text-align: start;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-spring);
}
.modal__page:hover { border-color: var(--clr-a1-border); background: var(--clr-a1-dim); transform: translateY(-2px); }
.modal__page--next { justify-content: flex-end; text-align: end; }
.modal__page-text {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
  font-size: var(--text-sm);
  font-weight: var(--w-semi);
  color: var(--clr-text);
}
.modal__page-text small { font-size: var(--text-xs); font-weight: var(--w-regular); color: var(--clr-text-muted); }
.modal__page-arrow { display: inline-flex; flex-shrink: 0; color: var(--clr-a1); }
[dir="rtl"] .modal__page-arrow svg { transform: scaleX(-1); }
/* Paging turns the dialog over like a page, in the reading direction. */
.modal--paged-next { animation: pageNext 460ms cubic-bezier(0.22, 1, 0.36, 1); }
.modal--paged-prev { animation: pagePrev 460ms cubic-bezier(0.22, 1, 0.36, 1); }
[dir="rtl"] .modal--paged-next { animation-name: pagePrev; }
[dir="rtl"] .modal--paged-prev { animation-name: pageNext; }
@keyframes pageNext {
  from { opacity: 0.2; transform: perspective(1200px) rotateY(-14deg) translateX(40px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pagePrev {
  from { opacity: 0.2; transform: perspective(1200px) rotateY(14deg) translateX(-40px); }
  to   { opacity: 1; transform: none; }
}

/* ── 28h. CONTACT FORM DETAILS ────────────────────────────── */
.form-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.form-counter {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  direction: ltr;
  unicode-bidi: isolate;
}
.form-counter.is-near { color: var(--clr-warning); }
.form-error { font-size: var(--text-xs); color: var(--clr-error); }
.form-error[hidden] { display: none; }
.form-input[aria-invalid="true"], .form-textarea[aria-invalid="true"] { border-color: var(--clr-error); }
.form-input[aria-invalid="true"]:focus,
.form-textarea[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.16); }
/* The honeypot stays in the DOM for bots and out of sight for people. */
.form-trap {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.form-alert {
  display: flex; gap: var(--s3);
  padding: var(--s4);
  border-radius: var(--r-lg);
  border: 1px solid rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.08);
  animation: bannerIn 380ms cubic-bezier(0.16, 1, 0.3, 1);
}
.form-alert[hidden] { display: none; }
.form-alert__icon { display: inline-flex; flex-shrink: 0; color: var(--clr-error); }
.form-alert__body {
  display: flex; flex-direction: column; gap: var(--s2);
  min-width: 0;
  font-size: var(--text-sm);
  color: var(--clr-text-2);
}
.form-alert__title { font-weight: var(--w-semi); color: var(--clr-text); }
.form-alert__actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-block-start: var(--s2); }
.contact__privacy {
  font-size: var(--text-xs);
  line-height: var(--lh-normal);
  color: var(--clr-text-muted);
  text-align: center;
}
.contact-info__time { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--s2); }
.contact-info__time-icon { display: inline-flex; color: var(--clr-a3); }
.contact-info__time-value {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: var(--w-semi);
  color: var(--clr-text);
  direction: ltr;
  unicode-bidi: isolate;
}
.contact-info__time-note { font-size: var(--text-xs); font-weight: var(--w-regular); color: var(--clr-text-muted); }
/* The success tick turns in like a coin. */
.form-success__icon { animation: coinIn 800ms cubic-bezier(0.34, 1.4, 0.64, 1) both; }
@keyframes coinIn {
  from { opacity: 0; transform: perspective(500px) rotateY(-180deg) scale(0.5); }
  to   { opacity: 1; transform: none; }
}

/* ── 28i. QUICK-ACTIONS PALETTE ───────────────────────────── */
.palette-overlay {
  position: fixed; inset: 0;
  z-index: var(--z-palette);
  display: flex; align-items: flex-start; justify-content: center;
  padding: max(10vh, var(--s16)) var(--s4) var(--s4);
  background: rgba(2,5,16,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  perspective: 1200px;
  opacity: 0; visibility: hidden;
  transition: opacity var(--t-base), visibility var(--t-base);
}
[data-theme="light"] .palette-overlay { background: rgba(10,20,60,0.35); }
.palette-overlay.open { opacity: 1; visibility: visible; }
.palette {
  display: flex; flex-direction: column;
  width: min(600px, 100%);
  max-height: min(70vh, 560px);
  overflow: hidden;
  border-radius: var(--r-2xl);
  background: var(--clr-bg-elevated);
  border: 1px solid var(--clr-a1-border);
  box-shadow: var(--sh-glow-a1), var(--sh-lg);
  /* Swings down into place from a slight backward tilt. */
  transform-origin: 50% 0%;
  transform: rotateX(16deg) translateY(-18px) scale(0.97);
  transition: transform 440ms cubic-bezier(0.34, 1.3, 0.64, 1);
}
.palette-overlay.open .palette { transform: none; }
[data-theme="light"] .palette { background: #fff; }
.palette__search {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s4) var(--s5);
  border-block-end: 1px solid var(--clr-border);
  color: var(--clr-text-muted);
}
.palette__input {
  flex: 1; min-width: 0;
  border: none;
  background: transparent;
  color: var(--clr-text);
  font-size: var(--text-lg);
  outline: none;
}
.palette__input::placeholder { color: var(--clr-text-muted); }
.palette__kbd {
  padding: 2px var(--s2);
  border-radius: var(--r-sm);
  border: 1px solid var(--clr-border);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
}
.palette__list { overflow-y: auto; padding: var(--s2); overscroll-behavior: contain; }
.palette__group + .palette__group { margin-block-start: var(--s2); }
.palette__group-title {
  padding: var(--s2) var(--s3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
}
.palette__item {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3);
  border-radius: var(--r-lg);
  color: var(--clr-text-2);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.palette__item.is-active { background: var(--clr-a1-dim); color: var(--clr-text); }
.palette__icon {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: var(--r-md);
  background: var(--clr-border);
  color: var(--clr-a1);
}
.palette__icon svg { width: 16px; height: 16px; }
.palette__icon .lang-badge { min-width: 32px; height: 32px; }
.palette__label {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
}
.palette__meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  direction: ltr;
  unicode-bidi: isolate;
}
.palette__enter { display: inline-flex; color: var(--clr-a1); opacity: 0; transition: opacity var(--t-fast); }
.palette__item.is-active .palette__enter { opacity: 1; }
[dir="rtl"] .palette__enter svg { transform: scaleX(-1); }
.palette__empty { padding: var(--s8) var(--s4); text-align: center; font-size: var(--text-sm); color: var(--clr-text-muted); }
.palette__hint {
  padding: var(--s3) var(--s5);
  border-block-start: 1px solid var(--clr-border);
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
}

/* ── 28j. THEME SWITCH ────────────────────────────────────── */
/* theme.js reveals the new theme as a circle growing from the button.
   The default cross-fade is replaced, and the page's own colour
   transitions are off while the switch runs so the edge stays crisp. */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after { transition: none !important; }

/* ── 28k. PROJECT ART ON A LIGHT BACKDROP ─────────────────── */
/* Dark artwork on a transparent background (Saday Zankoline's navy logo)
   would vanish into the dark theme, so it sits on a pale plate instead
   of the blurred cover. */
.media--light { background: linear-gradient(160deg, #f5f8fd 0%, #e2e9f5 100%); }
.media--light::before { display: none; }
.media--light img { padding: 4%; }

/* ── 28l. SADAYCHESS ──────────────────────────────────────── */
/* Our first app. Warm gold from its logo joins the site's own accents
   here, and nowhere else. */
:root {
  --chess-gold: #e9b44c;
  --chess-gold-dim: rgba(233, 180, 76, 0.14);
  --chess-gold-border: rgba(233, 180, 76, 0.36);
}
[data-theme="light"] {
  --chess-gold: #9a6500;
  --chess-gold-dim: rgba(176, 116, 0, 0.1);
  --chess-gold-border: rgba(176, 116, 0, 0.32);
}

.chess-panel::after {
  background: radial-gradient(circle, var(--chess-gold-dim) 0%, transparent 70%);
}

.chess {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(var(--s8), 5vw, var(--s16));
  align-items: center;
}

.chess__art { position: relative; display: grid; place-items: center; }
/* Warm light behind the icon, like the sun on its flag. */
.chess__art::before {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 180, 76, 0.3) 0%, rgba(220, 38, 38, 0.1) 45%, transparent 70%);
  filter: blur(28px);
  pointer-events: none;
}

.chess-logo {
  position: relative;
  display: block;
  width: min(100%, 360px);
  aspect-ratio: 1;
  border-radius: 20%;
  filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.45));
  transition: transform var(--t-spring);
}
[data-theme="light"] .chess-logo { filter: drop-shadow(0 22px 34px rgba(30, 50, 110, 0.28)); }
.chess-logo__img { width: 100%; height: 100%; object-fit: contain; }
.chess-logo--fallback {
  display: grid; place-items: center;
  background: linear-gradient(160deg, #b91c1c, #0b0b0b 55%, #166534);
}
.chess-logo--fallback::after {
  content: "SadayChess";
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--chess-gold);
}

.chess__body { min-width: 0; }
.chess__title { margin-block-end: var(--s4); }
.chess__status { margin-block-end: var(--s5); }

.chess-status {
  gap: var(--s2);
  padding: var(--s2) var(--s4);
  font-size: var(--text-sm);
  white-space: normal;
}
.chess-status__dot {
  width: 8px; height: 8px; flex-shrink: 0;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent);
}

.chess__lead {
  font-size: var(--text-lg);
  line-height: var(--lh-relaxed);
  color: var(--clr-text-2);
  margin-block-end: var(--s6);
}

.chess__features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr));
  gap: var(--s2) var(--s4);
  margin-block-end: var(--s6);
}
.chess__feature {
  display: flex; align-items: center; gap: var(--s3);
  font-weight: var(--w-medium);
}
.chess__feature-icon {
  display: grid; place-items: center;
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: var(--r-lg);
  background: var(--chess-gold-dim);
  border: 1px solid var(--chess-gold-border);
  color: var(--chess-gold);
}
.chess__feature-icon svg { width: 18px; height: 18px; }

/* "Runs on" / "Speaks" with their chips. */
.chess-facts { display: grid; gap: var(--s3); margin-block-end: var(--s6); }
.chess-facts__row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: var(--s3);
  align-items: start;
}
.chess-facts dt {
  padding-block-start: var(--s2);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-text-muted);
}
[dir="rtl"] .chess-facts dt { text-transform: none; letter-spacing: 0; }
.chess-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chess-chip {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: var(--s1) var(--s3);
  min-height: 34px;
  border-radius: var(--r-full);
  border: 1px solid var(--clr-border);
  background: var(--clr-bg-card);
  color: var(--clr-text);
  font-size: var(--text-sm);
}
[data-theme="light"] .chess-chip { background: var(--clr-bg-inset); }
.chess-chip svg { width: 16px; height: 16px; color: var(--clr-a1); }

.chess__actions {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--s3);
}
.chess__stores { margin-block-start: var(--s3); }
/* Store names are isolated Latin runs in RTL copy; never split them. */
:is(.chess__note, .chess-status-body) bdi { white-space: nowrap; }
.chess__go svg { transition: translate var(--t-base); }
.chess__go:hover svg { translate: 3px 0; }
[dir="rtl"] .chess__go svg,
[dir="rtl"] .chess-help__arrow svg { transform: scaleX(-1); }
[dir="rtl"] .chess__go:hover svg { translate: -3px 0; }

/* Store links. Until a listing is live it is a quiet dashed label, so
   nobody mistakes it for a real store badge. */
.store-btn {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 46px;
  padding: var(--s2) var(--s4);
  border-radius: var(--r-lg);
  border: 1px solid var(--clr-border);
  background: var(--clr-bg-card);
  color: var(--clr-text);
  font-size: var(--text-sm); font-weight: var(--w-semi);
}
a.store-btn:hover { border-color: var(--clr-a1-border); color: var(--clr-a1); }
.store-btn--soon {
  border-style: dashed;
  background: transparent;
  color: var(--clr-text-2);
  cursor: default;
}
.store-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.store-btn__text { display: flex; flex-direction: column; line-height: 1.2; }
.store-btn__name { font-weight: var(--w-semi); color: var(--clr-text); }
.store-btn__soon {
  font-size: var(--text-xs);
  font-weight: var(--w-medium);
  color: var(--chess-gold);
}

.chess__note {
  margin-block-start: var(--s4);
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
}

.chess__links {
  display: flex; flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  margin-block-start: var(--s5);
  padding-block-start: var(--s5);
  border-block-start: 1px solid var(--clr-border);
}
.chess__links a {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-size: var(--text-sm);
  color: var(--clr-text-2);
}
.chess__links a:hover { color: var(--clr-a1); }
.chess__links svg { width: 15px; height: 15px; }

/* ── The /sadaychess page ── */
.chess-hero {
  position: relative;
  padding-block: calc(var(--nav-h) + var(--s8)) var(--s12);
  overflow: hidden;
}
.chess-back {
  display: inline-flex; align-items: center; gap: var(--s1);
  margin-block-end: var(--s8);
  font-size: var(--text-sm);
  color: var(--clr-text-2);
}
.chess-back:hover { color: var(--clr-a1); }
.chess-back svg { width: 16px; height: 16px; }
[dir="rtl"] .chess-back svg { transform: scaleX(-1); }

.chess-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(var(--s8), 5vw, var(--s16));
  align-items: center;
}
.chess-hero__content { min-width: 0; }
.chess-hero__content .hero__eyebrow { margin-block-end: var(--s5); }
.chess-hero__title {
  font-family: var(--font-display);
  font-size: var(--text-6xl);
  line-height: 1.02;
  letter-spacing: 0.01em;
  margin-block-end: var(--s3);
}
.chess-hero__tagline {
  font-size: var(--text-2xl);
  font-weight: var(--w-medium);
  color: var(--chess-gold);
  margin-block-end: var(--s5);
}
.chess-hero__lead {
  font-size: var(--text-lg);
  line-height: var(--lh-relaxed);
  color: var(--clr-text-2);
  max-width: 60ch;
  margin-block-end: var(--s8);
}
.chess-hero__visual { position: relative; display: grid; place-items: center; }
.chess-hero__visual::before {
  content: "";
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 180, 76, 0.32) 0%, rgba(220, 38, 38, 0.1) 45%, transparent 70%);
  filter: blur(34px);
  pointer-events: none;
}
.chess-hero__logo { width: min(100%, 420px); }

/* The page hero is followed by sections, like the home hero. */
.chess-hero + .section { padding-block-start: 0; }

.chess-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--s5);
}
.chess-feature {
  display: flex; flex-direction: column; gap: var(--s3);
  padding: var(--s6);
}
.chess-feature__icon {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  border-radius: var(--r-lg);
  background: var(--chess-gold-dim);
  border: 1px solid var(--chess-gold-border);
  color: var(--chess-gold);
}
.chess-feature__title { font-size: var(--text-xl); }
.chess-feature__desc { color: var(--clr-text-2); font-size: var(--text-base); }

.chess-split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(var(--s6), 4vw, var(--s12));
  align-items: start;
}
.chess-split__title { margin-block-end: var(--s4); }
.chess-facts--large { margin-block-end: 0; gap: var(--s5); }
.chess-facts--large .chess-chip { min-height: 40px; padding-inline: var(--s4); font-size: var(--text-base); }
.chess-status-body {
  font-size: var(--text-lg);
  line-height: var(--lh-relaxed);
  color: var(--clr-text-2);
  margin-block-end: var(--s6);
}

.chess-screens {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 260px);
  gap: var(--s5);
  overflow-x: auto;
  padding-block: var(--s2) var(--s4);
  scroll-snap-type: x mandatory;
}
.chess-screens__item { scroll-snap-align: start; }
.chess-screens__item img {
  width: 100%;
  border-radius: var(--r-2xl);
  border: 1px solid var(--clr-border);
  box-shadow: var(--sh-card);
}

.chess-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--s5);
}
.chess-help {
  display: flex; align-items: flex-start; gap: var(--s4);
  padding: var(--s6);
  color: var(--clr-text);
}
.chess-help:hover { transform: translateY(-4px); border-color: var(--clr-a1-border); }
.chess-help__icon {
  display: grid; place-items: center;
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: var(--r-lg);
  background: var(--clr-a1-dim);
  border: 1px solid var(--clr-a1-border);
  color: var(--clr-a1);
}
.chess-help__body { display: flex; flex-direction: column; gap: var(--s1); min-width: 0; flex: 1; }
.chess-help__title { font-weight: var(--w-semi); font-size: var(--text-lg); }
.chess-help__desc { color: var(--clr-text-2); font-size: var(--text-sm); }
.chess-help__meta {
  margin-block-start: var(--s2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--clr-a1);
  overflow-wrap: anywhere;
}
.chess-help__arrow { color: var(--clr-text-muted); padding-block-start: var(--s3); }
.chess-help:hover .chess-help__arrow { color: var(--clr-a1); }

/* SadayChess links in the footer. */
.footer__product {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--s2) var(--s5);
}
.footer__product a { font-size: var(--text-sm); color: var(--clr-text-2); }
.footer__product a:hover { color: var(--clr-a1); }
.footer__product .footer__product-name {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-weight: var(--w-semi);
  color: var(--clr-text);
}
.footer__product-name img { width: 28px; height: 28px; }

@media (max-width: 960px) {
  .chess, .chess-hero__grid, .chess-split { grid-template-columns: 1fr; }
  .chess__art { max-width: 280px; margin-inline: auto; }
  .chess-hero__visual { order: -1; }
  .chess-hero__logo { width: min(70vw, 300px); }
}

@media (max-width: 640px) {
  .chess-facts__row { grid-template-columns: 1fr; gap: var(--s2); }
  .chess-facts dt { padding-block-start: 0; }
  .chess__actions > * { flex: 1 1 auto; }
  .chess__actions .btn { flex-basis: 100%; }
  .chess__art { max-width: 220px; }
  .chess-hero__title { font-size: var(--text-5xl); }
}

/* ── 29. RESPONSIVE ───────────────────────────────────────── */
/* Eight links need about 1230px in Sorani (the widest language) beside the
   logo and buttons; below that the menu moves into the hamburger. */
@media (max-width: 1239px) {
  .navbar__links { display: none; }
  .hamburger { display: flex; }
  .navbar__logo-name { font-size: 1.3rem; }
}

@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--s12); }
  .hero__visual { order: -1; min-height: 260px; }
  .logo-flip__face { padding: var(--s6); }
  .hero__logo-card .logo-mark { --logo-size: 150px; }
  .planner { grid-template-columns: 1fr; }
  .hero__description { max-width: none; }
  .hero__scroll { display: none; }

  .about__grid,
  .contact__grid { grid-template-columns: 1fr; }
  .leader { grid-template-columns: 1fr; text-align: center; }
  .leader__photo { max-width: 240px; margin-inline: auto; }
  .leader__body { align-items: center; }
}

@media (max-width: 640px) {
  :root { --nav-h: 64px; }

  .deck { --deck-shift: 12px; --deck-drop: 10px; }
  .deck__controls { gap: var(--s3); }
  .deck__nav { width: 42px; height: 42px; }
  .member-card__icon { width: 48px; height: 48px; font-size: 1.35rem; }

  .panel { border-radius: var(--r-2xl); }
  .section-head { margin-block-end: var(--s8); }
  .hero__actions .btn { flex: 1 1 100%; }
  .about__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
  .projects__controls { flex-direction: column; align-items: stretch; }
  .filter-chips { justify-content: flex-start; }
  .project-card__actions .btn { flex: 1 1 auto; }
  .modal__actions .btn { flex: 1 1 100%; }
  .modal__pager { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }

  /* Long phrases wrap on a phone: reserve two lines so nothing jumps. */
  .hero__typed { min-height: 3.2em; }
  .planner__tokens { gap: var(--s2); }
  .stack__sphere { margin-block-start: var(--s8); padding-block-start: var(--s8); }
  .sphere { height: clamp(300px, 92vw, 380px); }
  .sphere .sphere__item { font-size: 0.68rem; padding: 2px var(--s2); }

  .scroll-top { inset-block-end: var(--s4); inset-inline-end: var(--s4); width: 44px; height: 44px; }
  .toast {
    inset-inline: var(--s4);
    inset-block-end: var(--s4);
    max-width: none;
  }
}

/* Keyboard shortcuts mean little on a phone, and the navbar needs the room. */
@media (max-width: 480px) {
  .palette-btn { display: none; }
}

@media (max-width: 380px) {
  .about__stats { grid-template-columns: 1fr; }
  .team__members-title { font-size: var(--text-lg); }
}

/* ── 30. MOTION PREFERENCES ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal--left, .reveal--right,
  [data-stagger] > * { opacity: 1 !important; transform: none !important; }
  .deck__hint-icon, .hero__logo-card, .hero__typed-caret,
  .hero__orbit, .hero__orbit-dot { animation: none !important; }
  .hero__orbit--1 { transform: perspective(1100px) var(--tilt); }
  .hero__orbit--2 { transform: perspective(1100px) var(--tilt); }
  .hero__orbit-dot { transform: var(--untilt); }
  .flip-card__inner, .logo-flip__inner { transition: none !important; }
  .progress-bar__fill { transform: scaleX(var(--target, 1)) !important; }
  .cursor-follower { display: none; }
  /* The loader's 3D mark rests, already assembled, at a three-quarter angle. */
  .sada3d, .sada3d__body, .sada3d__part, .sada3d__part > svg, .sada3d__plate,
  .sd-trace, .sd-dot, .loader__model::before, .loader__model::after { animation: none !important; }
  .sada3d__echo { display: none; }
}

/* ── 31. PRINT ────────────────────────────────────────────── */
@media print {
  #bg-canvas, .cursor-follower, .navbar, .mobile-menu, .palette-overlay,
  .scroll-top, .toast, #scroll-progress, .loader, .hero__scroll { display: none !important; }
  body { background: #fff; color: #000; }
  .panel { break-inside: avoid; box-shadow: none; border-color: #ccc; }
}
