/* ==========================================================================
   Mohammed Refat â€” personal site
   Design tokens, layout, components. No build step, no dependencies.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --paper: #f7f7f5;
  --surface: #ffffff;
  --tint: #efeff1;
  --field: #fbfbfa;
  --ink: #0c0c0c;
  --ink-soft: #35353a;
  --muted: #5f5f66;
  --line: rgba(12, 12, 12, 0.12);
  --line-strong: rgba(12, 12, 12, 0.24);
  --blue: #1625b0;
  --blue-solid: #1625b0;
  --blue-soft: #2a3fd4;
  --lav: #dbddf5;
  --on-lav: #12143a;
  --green: #2f7d5f;
  --danger: #b3261e;
  --shadow-sm: 0 1px 2px rgba(12, 12, 12, 0.05);
  --shadow-lg: 0 18px 46px -22px rgba(12, 12, 12, 0.4);
  --radius: 22px;
  --radius-lg: 30px;
  --wrap: 1180px;
  --font-display: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.72, 0.3, 1);
}

[data-theme="dark"] {
  --paper: #0b0b0d;
  --surface: #131317;
  --tint: #0f0f13;
  --field: #17171c;
  --ink: #f4f3f0;
  --ink-soft: #d4d3ce;
  --muted: #9c9ca6;
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.26);
  --blue: #9aa8ff;
  --blue-solid: #2f3fd4;
  --blue-soft: #7f90ff;
  --lav: #242a68;
  --on-lav: #e9ebff;
  --green: #7fcaa8;
  --danger: #ff9d93;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px -26px rgba(0, 0, 0, 0.9);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}

[dir="rtl"] {
  --font-sans: "IBM Plex Sans Arabic", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Cairo", "IBM Plex Sans Arabic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[dir="rtl"] body {
  font-family: var(--font-sans);
  line-height: 1.7;
  letter-spacing: 0;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
::selection { background: var(--lav); color: var(--on-lav); }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

.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;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
[dir="rtl"] .skip-link { left: auto; right: 12px; }
.skip-link:focus { transform: translateY(0); }

/* ---------- Typography helpers ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.2rem, 8.4vw, 6.6rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
}

.h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4.4vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 20ch;
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.eyebrow-light { color: rgba(255, 255, 255, 0.7); }

.lede {
  margin-top: 20px;
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  color: var(--muted);
  max-width: 56ch;
  line-height: 1.7;
}

.prose p {
  color: var(--ink-soft);
  margin-bottom: 1.1em;
  max-width: 62ch;
  font-size: 1.02rem;
}
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), background-color 0.25s ease,
    color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-arrow { transition: transform 0.25s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(3px); }

.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--blue-solid); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.btn-lav { background: var(--lav); color: var(--on-lav); }
.btn-lav:hover { background: #fff; color: #1625b0; }

.btn-sm { padding: 11px 18px; font-size: 13.5px; }
.btn-block { width: 100%; }

/* ---------- Reveal animation ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  will-change: opacity, transform;
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 72px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 11px;
  background: var(--blue-solid);
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.02em;
  transition: transform 0.3s var(--ease), background-color 0.3s ease;
}
.brand:hover .brand-mark { transform: rotate(-6deg); }
.brand-text {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav { display: flex; align-items: center; gap: 26px; }
.nav a {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 0;
  transition: color 0.2s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
[dir="rtl"] .nav a::after {
  transform-origin: right;
}
.nav a:hover, .nav a.active { color: var(--ink); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 10px; }

/* Language switcher */
.lang-switch {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  background: var(--tint);
  color: var(--ink);
}

.lang-btn.active {
  background: var(--ink);
  color: var(--paper);
}

[dir="rtl"] .lang-btn {
  font-family: var(--font-sans);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.25s var(--ease);
}
.icon-btn:hover { background: var(--surface); border-color: var(--line-strong); transform: translateY(-1px); }
.icon-btn svg, .chat-fab svg, .chat-close svg, .chat-form button svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.menu-btn { display: none; }
.icon-close { display: none; }
.menu-btn[aria-expanded="true"] .icon-menu { display: none; }
.menu-btn[aria-expanded="true"] .icon-close { display: block; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: clamp(36px, 6vw, 72px); }

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  padding-bottom: clamp(44px, 6vw, 76px);
}

.hero-copy .display { margin: 0 0 26px; }
.hero-lede {
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  color: var(--ink-soft);
  max-width: 44ch;
  line-height: 1.65;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-meta {
  margin-top: 26px;
  font-size: 13.5px;
  color: var(--muted);
}
.hero-meta strong { color: var(--ink); font-weight: 600; }

.hero-visual { position: relative; }
.hero-visual::before {
  content: "";
  position: absolute;
  inset: -14% -8% -10% -8%;
  background: radial-gradient(58% 58% at 62% 38%, rgba(219, 221, 245, 0.9), transparent 70%);
  filter: blur(6px);
  z-index: 0;
  pointer-events: none;
}
[data-theme="dark"] .hero-visual::before {
  background: radial-gradient(58% 58% at 62% 38%, rgba(42, 63, 212, 0.32), transparent 70%);
}

.portrait-card {
  position: relative;
  z-index: 1;
  aspect-ratio: 4 / 4.6;
  border-radius: var(--radius-lg);
  padding: clamp(20px, 2.4vw, 28px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
  background:
    radial-gradient(120% 80% at 85% 10%, rgba(219, 221, 245, 0.32), transparent 55%),
    linear-gradient(158deg, #1a2bd4 0%, #1625b0 38%, #0a0f3d 100%);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.portrait-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 70px -20px rgba(22, 37, 176, 0.5);
}
.portrait-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(80% 60% at 50% 40%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(80% 60% at 50% 40%, #000 20%, transparent 78%);
  z-index: -1;
}

.portrait-top {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #6ee7a8;
  box-shadow: 0 0 0 0 rgba(110, 231, 168, 0.7);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(110, 231, 168, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(110, 231, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(110, 231, 168, 0); }
}
.portrait-loc {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.55);
}

.portrait-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: inherit;
  z-index: 2;
}
.portrait-face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  z-index: 2;
  filter: saturate(0.98);
  transition: transform 0.5s var(--ease);
}
.portrait-face::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 15, 61, 0.2) 0%, rgba(10, 15, 61, 0.02) 42%, rgba(10, 15, 61, 0.72) 80%, rgba(10, 15, 61, 0.94) 100%);
  z-index: 3;
  pointer-events: none;
}
.portrait-card:hover .portrait-face img {
  transform: scale(1.03);
}

/* AskCatGPT style hover curious pill */
.portrait-hover-badge {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.portrait-card:hover .portrait-hover-badge {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.portrait-curious-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--blue-solid);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  box-shadow: 0 16px 36px -4px rgba(12, 12, 12, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  transition: transform 0.2s ease, background 0.2s ease;
}
.portrait-curious-pill:hover {
  transform: scale(1.05);
  background: #ffffff;
}

.portrait-initials {
  font-family: var(--font-display);
  font-size: clamp(5rem, 12vw, 9.5rem);
  font-weight: 300;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}
.portrait-ring {
  position: absolute;
  width: 56%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
}
.portrait-ring::before, .portrait-ring::after {
  content: "";
  position: absolute;
  inset: -16%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}
.portrait-ring::after { inset: -34%; border-style: dashed; }

.portrait-bottom { position: relative; z-index: 4; }
.portrait-name {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.2vw, 1.9rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.portrait-role {
  margin-top: 5px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.01em;
}
.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.mini-stats li { display: flex; flex-direction: column; gap: 2px; }
.mini-stats strong {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  direction: ltr;
  unicode-bidi: isolate;
}
.mini-stats span {
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- Marquee ---------- */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 42s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; gap: 12px; padding-right: 12px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.pill span { font-size: 11px; opacity: 0.5; transition: transform 0.25s var(--ease); }
.pill:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill:hover span { opacity: 0.8; transform: translate(2px, -2px); }

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 8.5vw, 116px) 0; }
.section-tint {
  background: var(--tint);
  border-block: 1px solid var(--line);
}
.section-head { margin-bottom: clamp(36px, 4.5vw, 56px); }

/* ---------- Link rows ---------- */
.link-list {
  display: grid;
  gap: 10px;
}
.link-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  transition: transform 0.3s var(--ease), border-color 0.3s ease, box-shadow 0.3s ease;
}
.link-row:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.link-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--lav);
  color: var(--on-lav);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.link-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.link-body strong { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.link-body small { color: var(--muted); font-size: 13.2px; }
.link-arrow {
  margin-left: auto;
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.3s var(--ease), color 0.3s ease;
}
.link-row:hover .link-arrow { transform: translate(3px, -3px); color: var(--ink); }

/* ---------- Stat band ---------- */
.stat-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.stat-band div { display: flex; flex-direction: column; gap: 6px; }
.stat-band strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  direction: ltr;
  unicode-bidi: isolate;
}
.stat-band span { font-size: 13px; color: var(--muted); line-height: 1.5; max-width: 22ch; }

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: stretch;
}
.card {
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 2.6vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.35s var(--ease), box-shadow 0.35s ease, border-color 0.3s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.card-featured {
  background: var(--lav);
  border-color: color-mix(in srgb, var(--on-lav) 12%, transparent);
  color: var(--on-lav);
}
.card-tag {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.card-featured .card-tag { color: color-mix(in srgb, var(--on-lav) 62%, transparent); }
.card-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.1vw, 1.75rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.card-body { font-size: 14.4px; line-height: 1.66; color: var(--muted); }
.card-featured .card-body { color: color-mix(in srgb, var(--on-lav) 78%, transparent); }
.card-list {
  margin: 22px 0 26px;
  display: grid;
  gap: 9px;
  font-size: 13.6px;
}
.card-list li { position: relative; padding-left: 20px; color: var(--ink-soft); }
.card-featured .card-list li { color: var(--on-lav); }
.card-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.62em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--blue);
}
.card-featured .card-list li::before { background: var(--on-lav); }
.card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.card-featured .card-foot { border-top-color: color-mix(in srgb, var(--on-lav) 18%, transparent); }
.price {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1;
}
.price small {
  display: block;
  margin-top: 5px;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.card-featured .price small { color: color-mix(in srgb, var(--on-lav) 65%, transparent); }

.work-note { margin-top: 28px; font-size: 14px; color: var(--muted); }
.work-note a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.work-note a:hover { color: var(--blue); }

/* ---------- About ---------- */
/* ================= 5-CARD FANNED SHOWCASE (AskCatGPT Style) ================= */
.about-fan-wrap {
  position: relative;
  max-width: 1060px;
  margin: 0 auto clamp(40px, 6vw, 72px);
  padding: 30px 10px 20px;
}

.about-fan-stickers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.fan-sticker {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 26px -6px rgba(22, 37, 176, 0.45);
  pointer-events: auto;
  cursor: default;
  transition: transform 0.25s var(--ease), box-shadow 0.25s ease;
  will-change: transform;
}
.fan-sticker:hover {
  transform: scale(1.1) rotate(0deg) !important;
  box-shadow: 0 14px 30px -4px rgba(22, 37, 176, 0.6);
}
.fan-sticker.sticker-1 { top: 10px; left: clamp(10px, 7vw, 100px); transform: rotate(-7deg); }
.fan-sticker.sticker-2 { top: 6px; right: clamp(10px, 8vw, 110px); transform: rotate(6deg); background: #10b981; box-shadow: 0 10px 26px -6px rgba(16, 185, 129, 0.45); }
.fan-sticker.sticker-3 { bottom: 6px; left: clamp(10px, 12vw, 150px); transform: rotate(5deg); background: #8b5cf6; box-shadow: 0 10px 26px -6px rgba(139, 92, 246, 0.45); }
.fan-sticker.sticker-4 { bottom: 10px; right: clamp(10px, 13vw, 160px); transform: rotate(-5deg); background: #00add8; box-shadow: 0 10px 26px -6px rgba(0, 173, 216, 0.45); }

.about-cards-fan {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  perspective: 1200px;
  padding: 30px 0 20px;
  position: relative;
  z-index: 2;
}

.fan-card {
  position: relative;
  flex: 0 0 clamp(160px, 18vw, 215px);
  height: clamp(235px, 26vw, 305px);
  margin: 0 -22px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 18px 42px -12px rgba(0, 0, 0, 0.16);
  padding: 10px;
  display: flex;
  flex-direction: column;
  transform-origin: bottom center;
  transition: transform 0.42s cubic-bezier(0.2, 0, 0.15, 1), box-shadow 0.42s ease, border-color 0.3s ease;
  cursor: pointer;
  outline: none;
  overflow: hidden;
}
[data-theme="dark"] .fan-card {
  background: #17181c;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 22px 50px -12px rgba(0, 0, 0, 0.75);
}

/* Fan Angles for LTR */
.fan-card.fan-card-1 { transform: rotate(-9deg) translateY(12px); z-index: 1; }
.fan-card.fan-card-2 { transform: rotate(-4.5deg) translateY(4px); z-index: 2; }
.fan-card.fan-card-3 { transform: rotate(0deg) translateY(-8px); z-index: 3; }
.fan-card.fan-card-4 { transform: rotate(4.5deg) translateY(4px); z-index: 2; }
.fan-card.fan-card-5 { transform: rotate(9deg) translateY(12px); z-index: 1; }

/* Fan Angles for RTL */
[dir="rtl"] .fan-card.fan-card-1 { transform: rotate(9deg) translateY(12px); }
[dir="rtl"] .fan-card.fan-card-2 { transform: rotate(4.5deg) translateY(4px); }
[dir="rtl"] .fan-card.fan-card-3 { transform: rotate(0deg) translateY(-8px); }
[dir="rtl"] .fan-card.fan-card-4 { transform: rotate(-4.5deg) translateY(4px); }
[dir="rtl"] .fan-card.fan-card-5 { transform: rotate(-9deg) translateY(12px); }

/* Hover Lift & Straighten */
.fan-card:hover,
.fan-card:focus-visible,
.fan-card.active {
  transform: rotate(0deg) translateY(-26px) scale(1.1) !important;
  z-index: 15 !important;
  box-shadow: 0 32px 75px -16px rgba(22, 37, 176, 0.38);
  border-color: var(--blue);
  transition-timing-function: cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
[data-theme="dark"] .fan-card:hover,
[data-theme="dark"] .fan-card:focus-visible,
[data-theme="dark"] .fan-card.active {
  box-shadow: 0 32px 75px -16px rgba(0, 0, 0, 0.95);
  border-color: var(--blue);
}

.fan-card-media {
  flex: 1 1 auto;
  border-radius: 14px;
  overflow: hidden;
  background: var(--tint);
  position: relative;
  margin-bottom: 0;
  height: 100%;
}
.fan-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.fan-card:hover .fan-card-media img {
  transform: scale(1.05);
}

.fan-card-caption {
  flex: 0 0 auto;
  padding: 4px 6px 2px;
  display: flex;
  flex-direction: column;
}
.fan-card-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 2px;
}
.fan-card-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile responsive fan cards */
@media (max-width: 768px) {
  .about-cards-fan {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0 26px;
    overflow: visible;
  }
  .fan-card.fan-card-3 {
    flex: 0 0 clamp(200px, 60vw, 240px);
    height: clamp(280px, 80vw, 325px);
    margin: 0;
    z-index: 3;
    transform: none !important;
    box-shadow: 0 22px 50px -12px rgba(0, 0, 0, 0.45);
    border-color: rgba(59, 91, 253, 0.45);
  }
  .fan-card.fan-card-2,
  .fan-card.fan-card-4 {
    flex: 0 0 clamp(64px, 16vw, 84px);
    height: clamp(235px, 66vw, 275px);
    margin: 0 -12px;
    opacity: 0.55;
    z-index: 1;
    pointer-events: none;
    transform: none !important;
  }
  .fan-card.fan-card-1,
  .fan-card.fan-card-5 {
    display: none;
  }
  .about-fan-stickers {
    display: none;
  }
}

.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(36px, 5vw, 72px);
  align-items: start;
}
.about-copy .h2 { margin-bottom: 26px; }
.pullquote {
  margin-top: 34px;
  padding: 22px 26px;
  border-left: 2px solid var(--blue);
  background: var(--tint);
  border-radius: 0 14px 14px 0;
}
.pullquote p {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.7vw, 1.38rem);
  line-height: 1.42;
  letter-spacing: -0.015em;
}

.timeline {
  padding: 26px 26px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.timeline-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}
.timeline-list { position: relative; }
.timeline-list li {
  position: relative;
  padding: 0 0 22px 22px;
  border-left: 1px solid var(--line);
}
.timeline-list li:last-child { border-left-color: transparent; padding-bottom: 6px; }
.timeline-list li::before {
  content: "";
  position: absolute;
  left: -4.5px; top: 5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--blue);
}
.timeline-years {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.timeline-list strong {
  display: block;
  font-size: 14.4px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.timeline-org { display: block; font-size: 12.8px; color: var(--blue); margin-top: 2px; }
.timeline-list p { font-size: 12.8px; color: var(--muted); line-height: 1.55; margin-top: 6px; }

/* ---------- Writing ---------- */
.post-card { position: relative; }
.post-card .card-title { font-size: clamp(1.28rem, 1.85vw, 1.52rem); }
.post-card .card-body { margin-bottom: 24px; }
.post-meta {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.2px;
  color: var(--muted);
}
.post-arrow { margin-left: auto; font-size: 16px; transition: transform 0.3s var(--ease); }
.post-card:hover .post-arrow { transform: translate(3px, -3px); color: var(--ink); }

/* ---------- Apple-Style Brand Cards Grid ---------- */
.brand-apple-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 48px;
}
.brand-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(24px, 3vw, 32px) 20px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.35s ease, 
              border-color 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.brand-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(59, 91, 253, 0.08), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.brand-card:hover {
  transform: translateY(-5px);
  border-color: rgba(59, 91, 253, 0.35);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.12), 0 0 24px rgba(59, 91, 253, 0.1);
}
[data-theme="dark"] .brand-card {
  background: rgba(23, 24, 28, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .brand-card:hover {
  border-color: rgba(90, 125, 255, 0.5);
  box-shadow: 0 22px 50px -12px rgba(0, 0, 0, 0.7), 0 0 28px rgba(59, 91, 253, 0.2);
}
.brand-card:hover::before {
  opacity: 1;
}

.brand-logo-frame {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 14px;
}
.brand-logo-img {
  max-height: 40px;
  max-width: 130px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.35s ease;
}
.brand-card:hover .brand-logo-img {
  transform: scale(1.06);
}

/* Theme-adaptive logos */
.logo-dark-only { display: none; }
.logo-light-only { display: block; }
[data-theme="dark"] .logo-dark-only { display: block; }
[data-theme="dark"] .logo-light-only { display: none; }

.brand-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.brand-arrow {
  font-size: 0.85rem;
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: all 0.25s ease;
  color: var(--blue);
}
.brand-card:hover .brand-arrow {
  opacity: 1;
  transform: translate(0, 0);
}
.brand-role {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

@media (max-width: 900px) {
  .brand-apple-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}
@media (max-width: 480px) {
  .brand-apple-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 32px;
  }
  .brand-card {
    padding: 16px 10px 14px;
    border-radius: 16px;
  }
  .brand-logo-frame {
    height: 36px;
    margin-bottom: 8px;
  }
  .brand-logo-img {
    max-height: 28px;
    max-width: 85px;
  }
  .brand-name {
    font-size: 0.94rem;
  }
  .brand-role {
    font-size: 0.68rem;
  }
}

.stack { margin-top: 44px; }
.stack .eyebrow { margin-bottom: 16px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-list li {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.8px;
  color: var(--ink-soft);
  background: var(--surface);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s var(--ease);
}
.chip-list li:hover { border-color: var(--blue); color: var(--ink); transform: translateY(-1px); }

/* ---------- Quotes ---------- */
.quotes {
  margin-top: clamp(44px, 6vw, 72px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(24px, 4vw, 56px);
}
.quote { padding-top: 26px; border-top: 1px solid var(--line); }
.quote blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.12rem, 1.65vw, 1.38rem);
  line-height: 1.48;
  letter-spacing: -0.012em;
  margin-bottom: 22px;
}
.quote figcaption { display: flex; align-items: center; gap: 12px; }
.avatar {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lav);
  color: var(--on-lav);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.quote figcaption span:last-child { display: flex; flex-direction: column; }
.quote figcaption strong { font-size: 13.5px; font-weight: 600; }
.quote figcaption small { font-size: 12px; color: var(--muted); }

/* ---------- Newsletter ---------- */
.newsletter {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  padding: clamp(30px, 5vw, 60px);
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(219, 221, 245, 0.24), transparent 60%),
    linear-gradient(140deg, #1625b0, #0c1350 85%);
  box-shadow: var(--shadow-lg);
}
.newsletter::after {
  content: "MR";
  position: absolute;
  right: -18px; bottom: -58px;
  font-family: var(--font-display);
  font-size: 15rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}
.newsletter .h2 { color: #fff; margin-bottom: 16px; }
.newsletter-copy p { color: rgba(255, 255, 255, 0.78); font-size: 14.8px; max-width: 46ch; }
.newsletter-fine { margin-top: 16px; font-size: 12.2px !important; color: rgba(255, 255, 255, 0.55) !important; }
.newsletter-form-wrap { position: relative; z-index: 1; }
.newsletter-form label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 10px;
}
.field-row { display: flex; gap: 8px; flex-wrap: wrap; }
.field-row input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 14px;
}
.field-row input::placeholder { color: rgba(255, 255, 255, 0.45); }
.field-row input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.14);
}
.field-row input.invalid { border-color: #ffb4a8; }
.newsletter-count { margin-top: 18px; font-size: 12.4px; color: rgba(255, 255, 255, 0.6); }
.newsletter-count strong { color: #fff; }
.form-status { margin-top: 12px; font-size: 13px; min-height: 18px; }
.form-status.ok { color: var(--green); }
.form-status.err { color: var(--danger); }
.newsletter .form-status.ok { color: #a7f3c8; }
.newsletter .form-status.err { color: #ffc0b6; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
.contact-copy .h2 { margin-bottom: 8px; }
.contact-details {
  margin-top: 32px;
  display: grid;
  gap: 16px;
}
.contact-details li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.contact-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}
.contact-details a:hover { color: var(--blue); }
.contact-fine { margin-top: 26px; font-size: 13px; color: var(--muted); max-width: 40ch; }

.contact-form {
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  font-size: 14.5px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: 0.75; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 16%, transparent);
}
.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent);
}
.error { display: none; margin-top: 6px; font-size: 12.2px; color: var(--danger); }
.error.show { display: block; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-fine { margin-top: 14px; font-size: 11.8px; color: var(--muted); line-height: 1.55; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: clamp(44px, 6vw, 68px) 0 26px;
  background: var(--paper);
}
.footer-top {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 40px;
}
.footer-brand p {
  margin-top: 16px;
  font-size: 13.4px;
  color: var(--muted);
  max-width: 30ch;
}
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h3 {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.footer-col a { font-size: 13.6px; color: var(--ink-soft); width: fit-content; }
.footer-col a:hover { color: var(--blue); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 12.2px;
  color: var(--muted);
}

/* ---------- Chat widget ---------- */
.chat {
  position: fixed;
  right: clamp(14px, 2.4vw, 28px);
  bottom: clamp(14px, 2.4vw, 28px);
  z-index: 90;
  font-family: var(--font-sans);
}
.chat-fab {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  background: var(--blue-solid);
  color: #fff;
  box-shadow: 0 14px 34px -12px rgba(22, 37, 176, 0.8), 0 2px 6px rgba(0, 0, 0, 0.14);
  transition: transform 0.3s var(--ease), background-color 0.3s ease;
}
.chat-fab:hover { transform: translateY(-3px) scale(1.03); }
.chat-fab svg { width: 24px; height: 24px; }
.chat-icon-close { display: none; }
.chat.is-open .chat-icon-open { display: none; }
.chat.is-open .chat-icon-close { display: block; }
.chat-badge {
  position: absolute;
  top: 3px; right: 3px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #6ee7a8;
  border: 2px solid var(--paper);
}
.chat.is-open .chat-badge { display: none; }

.chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  width: min(376px, calc(100vw - 28px));
  height: min(556px, calc(100vh - 128px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 30px 80px -24px rgba(12, 12, 12, 0.5);
  transform-origin: bottom right;
  animation: chatIn 0.28s var(--ease);
}
.chat-panel[hidden] { display: none; }
@keyframes chatIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.chat-avatar {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--blue-solid);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
}
.chat-who { display: flex; flex-direction: column; line-height: 1.25; }
.chat-who strong { font-size: 13.5px; font-weight: 600; }
.chat-who small {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.chat-who .dot { width: 5px; height: 5px; animation: none; background: var(--green); box-shadow: none; }
.chat-close {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}
.chat-close:hover { color: var(--ink); border-color: var(--line-strong); }
.chat-close svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.msg {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 13.3px;
  line-height: 1.55;
  animation: msgIn 0.3s var(--ease);
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.msg p + p { margin-top: 8px; }
.msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.msg.bot {
  align-self: flex-start;
  background: var(--tint);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
  color: var(--ink-soft);
}
.msg.user {
  align-self: flex-end;
  background: var(--ink);
  color: var(--paper);
  border-bottom-right-radius: 6px;
}
.msg.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.msg.typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1.2s infinite;
}
.msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.chat-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
}
.chat-prompts button {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 11.4px;
  color: var(--muted);
  text-align: left;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.chat-prompts button:hover { color: var(--ink); border-color: var(--line-strong); background: var(--tint); }
.chat-prompts[hidden] { display: none; }

.chat-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.chat-form input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-size: 13.2px;
}
.chat-form input:focus { outline: none; border-color: var(--line); background: var(--surface); }
.chat-form button {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  background: var(--blue-solid);
  color: #fff;
}
.chat-form button:hover { background: var(--blue-soft); }
.chat-form button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.chat-note {
  padding: 0 16px 10px;
  font-size: 10.4px;
  color: var(--muted);
  background: var(--paper);
}
.chat-note a { text-decoration: underline; text-underline-offset: 2px; }
.chat-note a:hover { color: var(--ink); }

/* ---------- Simple pages (legal / 404) ---------- */
.page-main { padding: clamp(48px, 7vw, 84px) 0 clamp(56px, 8vw, 96px); }
.page-head { max-width: 720px; margin-bottom: 36px; }
.page-head .h2 { max-width: none; margin-bottom: 14px; }
.page-head p { color: var(--muted); font-size: 14px; }
.legal-body { max-width: 720px; }
.legal-body h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin: 36px 0 12px;
}
.legal-body h3 { font-size: 1rem; margin: 24px 0 8px; }
.legal-body p, .legal-body li { color: var(--ink-soft); font-size: 14.6px; line-height: 1.75; }
.legal-body p { margin-bottom: 12px; }
.legal-body ul { list-style: disc; padding-left: 22px; margin-bottom: 14px; }
.legal-body li { margin-bottom: 6px; }
.legal-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.legal-card {
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.page-nav { display: flex; gap: 14px; margin-bottom: 28px; font-size: 13.5px; }
.page-nav a { color: var(--muted); }
.page-nav a:hover { color: var(--ink); }

.not-found { text-align: center; padding: clamp(56px, 10vw, 120px) 0; }
.not-found .display { font-size: clamp(4.5rem, 16vw, 11rem); line-height: 0.9; }
.not-found p { color: var(--muted); max-width: 38ch; margin: 18px auto 30px; }

/* ---------- Pixelation canvas effect (AskCatGPT style) ---------- */
.pixelate-container {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.pixelate-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
  z-index: 3;
}

/* ---------- Pill buttons & Sparkles ---------- */
.btn-pill-blue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 32px;
  border-radius: 999px;
  background: var(--blue-solid);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: 0 10px 26px -6px rgba(22, 37, 176, 0.42);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s ease;
}
.btn-pill-blue:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -6px rgba(22, 37, 176, 0.58);
  background: var(--blue-soft);
  color: #fff;
}
.icon-sparkle {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ---------- Refat Labs / Studio Section (AskCatGPT Cat Labs layout) ---------- */
.labs-section {
  position: relative;
  padding: clamp(72px, 9vw, 130px) 0 clamp(64px, 8vw, 110px);
  overflow: hidden;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

/* Signature Dashed Track Guides (Lines 1 & 4 from AskCatGPT) */
.labs-track {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  pointer-events: none;
  z-index: 1;
}
.labs-track-left {
  left: clamp(16px, 4.5vw, 64px);
  border-left: 2px dashed var(--line);
}
.labs-track-right {
  right: clamp(16px, 4.5vw, 64px);
  border-right: 2px dashed var(--line);
}
.labs-track-pin {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
  left: -4.5px;
  box-shadow: 0 0 0 3px var(--paper);
}
.labs-track-pin.top { top: 90px; }
.labs-track-pin.mid { top: 52%; }
.labs-track-pin.btm { bottom: 90px; }

.labs-inner {
  position: relative;
  z-index: 2;
}

/* Floating Parallax Engineering Badges (AskCatGPT Style on scroll) */
.labs-floating-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 380px;
  pointer-events: none;
  z-index: 4;
  overflow: visible;
}

.labs-float-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px -8px rgba(0, 0, 0, 0.12);
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: auto;
  cursor: default;
  transition: transform 0.12s linear, box-shadow 0.3s ease, border-color 0.3s ease;
  will-change: transform;
}
[data-theme="dark"] .labs-float-badge {
  background: rgba(22, 24, 30, 0.88);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.6);
}
.labs-float-badge:hover {
  border-color: var(--blue);
  box-shadow: 0 20px 45px -10px rgba(22, 37, 176, 0.3);
}

.labs-float-badge.float-tr {
  top: 30px;
  right: clamp(10px, 4vw, 50px);
}
.labs-float-badge.float-tl {
  top: 60px;
  left: clamp(10px, 4vw, 50px);
}
.labs-float-badge.float-bl {
  top: 230px;
  left: clamp(5px, 2vw, 35px);
}
.labs-float-badge.float-br {
  top: 240px;
  right: clamp(5px, 3vw, 45px);
}

.float-icon {
  width: 15px;
  height: 15px;
  color: var(--blue);
  flex-shrink: 0;
}
.float-prompt {
  color: var(--green);
  font-weight: 700;
}
.float-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.float-dot.green { background: #10b981; box-shadow: 0 0 8px #10b981; }
.float-dot.cyan { background: #00add8; box-shadow: 0 0 8px #00add8; }
.float-dot.purple { background: #8b5cf6; box-shadow: 0 0 8px #8b5cf6; }

@media (max-width: 980px) {
  .labs-floating-layer {
    display: none;
  }
}

.labs-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.labs-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(22, 37, 176, 0.08);
  color: var(--blue);
  border: 1px solid rgba(22, 37, 176, 0.2);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 22px;
  backdrop-filter: blur(8px);
}
[data-theme="dark"] .labs-pill-badge {
  background: rgba(154, 168, 255, 0.12);
  color: var(--blue);
  border-color: rgba(154, 168, 255, 0.25);
}

.labs-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--ink);
}

.labs-lede {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--muted);
  max-width: 58ch;
  margin: 0 auto 30px;
  line-height: 1.6;
}

.labs-actions {
  display: flex;
  justify-content: center;
  margin-bottom: clamp(40px, 6vw, 64px);
}

/* 3 Tilted Rotating Cards Deck */
.labs-deck {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 3.8vw, 48px);
  perspective: 1200px;
  align-items: stretch;
  margin-bottom: 48px;
  padding: 30px 14px;
}

.labs-card {
  position: relative;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
  transform-origin: center center;
  cursor: pointer;
  z-index: 1;
}

/* Subtle, elegant card tilts that prevent overlapping or text clipping */
.labs-card.card-left {
  transform: rotate(-3deg);
  z-index: 1;
}
.labs-card.card-center {
  transform: rotate(3deg) translateY(-10px);
  z-index: 1;
}
.labs-card.card-right {
  transform: rotate(-2.5deg);
  z-index: 1;
}

/* Hover straightening & elevation */
.labs-card:hover {
  transform: rotate(0deg) translateY(-18px) scale(1.03) !important;
  z-index: 10;
}

.labs-card-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}
.labs-card:hover .labs-card-inner {
  border-color: var(--line-strong);
  box-shadow: 0 28px 70px -18px rgba(22, 37, 176, 0.28);
}
[data-theme="dark"] .labs-card:hover .labs-card-inner {
  box-shadow: 0 28px 70px -18px rgba(0, 0, 0, 0.85);
}

.labs-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.labs-card-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.labs-card-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(47, 125, 95, 0.12);
  color: var(--green);
}

.labs-card-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  background: var(--tint);
  margin-bottom: 18px;
}
.labs-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pixelate-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 4;
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.72);
  color: #fff;
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.labs-card:hover .pixelate-badge {
  opacity: 1;
  transform: translateY(0);
}

.labs-card-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.labs-card-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--ink);
}
.labs-card-desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* Floating Sticker Badge (Rotated -6deg like AskCatGPT) */
.labs-sticker-wrap {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}
.labs-sticker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  transform: rotate(-6deg);
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: transform 0.3s var(--ease), border-color 0.3s ease;
}
.labs-sticker:hover {
  transform: rotate(0deg) scale(1.05);
  border-color: var(--blue);
}
.labs-sticker svg {
  width: 22px;
  height: 22px;
  color: var(--blue);
  flex-shrink: 0;
}

/* ---------- Dedicated Mo Labs Page Styling ---------- */
.labs-hero-page {
  padding: clamp(60px, 8vw, 110px) 0 clamp(40px, 6vw, 80px);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.labs-hero-page .display {
  font-size: clamp(3.2rem, 9vw, 6.8rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}
.labs-hero-page .lede {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--muted);
  max-width: 64ch;
  margin: 0 auto 36px;
  line-height: 1.6;
}
.labs-hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

/* Experiments Deep-Dive Grid */
.exp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  margin-top: 40px;
}
.exp-card {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: clamp(24px, 4vw, 44px);
  box-shadow: var(--shadow-sm);
  align-items: center;
  transition: transform 0.3s var(--ease), border-color 0.3s ease, box-shadow 0.3s ease;
}
.exp-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
}
.exp-card.reversed {
  grid-template-columns: 1fr 1.05fr;
}
.exp-card.reversed .exp-visual {
  order: 2;
}
.exp-card.reversed .exp-info {
  order: 1;
}

.exp-visual {
  position: relative;
  aspect-ratio: 4 / 3.4;
  border-radius: 20px;
  overflow: hidden;
  background: var(--tint);
}
.exp-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.exp-info {
  display: flex;
  flex-direction: column;
}
.exp-top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.exp-num {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--blue);
  font-weight: 600;
}
.exp-status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(47, 125, 95, 0.12);
  color: var(--green);
}
.exp-status-pill.blue {
  background: rgba(22, 37, 176, 0.1);
  color: var(--blue);
}
.exp-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin-bottom: 14px;
}
.exp-lede {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 22px;
}
.exp-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
  padding: 18px;
  background: var(--field);
  border-radius: 16px;
  border: 1px solid var(--line);
}
.exp-spec-item strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
  font-weight: 600;
}
.exp-spec-item small {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.exp-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.exp-stack span {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--tint);
  color: var(--ink-soft);
}

/* Audience Decides Lab - Voting Section */
.vote-section {
  position: relative;
  padding: clamp(64px, 8vw, 110px) 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.vote-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 44px;
}
.vote-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s var(--ease), border-color 0.3s ease;
}
.vote-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue);
}
.vote-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.vote-card-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.vote-card-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
}
.vote-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}
.vote-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 20px;
}
.vote-progress-track {
  width: 100%;
  height: 6px;
  background: var(--tint);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}
.vote-progress-bar {
  height: 100%;
  background: var(--blue);
  border-radius: 999px;
  transition: width 0.5s var(--ease);
}
.vote-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.btn-vote {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--field);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-vote:hover, .btn-vote.voted {
  background: var(--blue-solid);
  border-color: var(--blue-solid);
  color: #fff;
}

/* Manifesto Section */
.manifesto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.manifesto-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
}
.manifesto-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--blue);
  margin-bottom: 12px;
  line-height: 1;
}
.manifesto-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.manifesto-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .hero-grid { grid-template-columns: 1fr 0.85fr; gap: 32px; }
  .about-grid { grid-template-columns: 1fr; }
  .timeline { max-width: 640px; }
  .contact-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .cards > :last-child { grid-column: 1 / -1; }
  .footer-top { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  html { scroll-padding-top: 80px; }

  .nav {
    position: fixed;
    inset: 72px 0 auto 0;
    z-index: 99;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px clamp(20px, 4vw, 40px) 24px;
    background: color-mix(in srgb, var(--paper) 95%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.2);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s var(--ease);
  }
  .nav.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav a { width: 100%; padding: 14px 0; font-size: 16px; border-bottom: 1px solid var(--line); font-weight: 500; }
  .nav a:last-child { border-bottom: 0; }
  .nav a::after { display: none; }
  .menu-btn { display: grid; }
  .header-cta { display: none; }

  .hero { padding-top: 24px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 430px; width: 100%; margin-inline: auto; }
  .portrait-card { aspect-ratio: 4 / 4.2; }
  .hero-visual::before { inset: -6% 0; }
  .marquee { margin-top: 12px; }

  .labs-deck {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin-inline: auto;
    gap: 36px;
  }
  .labs-card.card-left,
  .labs-card.card-center,
  .labs-card.card-right {
    transform: rotate(0deg) translateY(0);
  }
  .labs-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
  }
  .labs-track-left { left: 12px; }
  .labs-track-right { right: 12px; }

  .exp-card,
  .exp-card.reversed {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .exp-card.reversed .exp-visual { order: 1; }
  .exp-card.reversed .exp-info { order: 2; }
  .vote-grid { grid-template-columns: 1fr; }
  .manifesto-grid { grid-template-columns: 1fr; }

  .stat-band { grid-template-columns: 1fr 1fr; gap: 26px 20px; }
  .newsletter { grid-template-columns: 1fr; }
  .newsletter::after { font-size: 11rem; bottom: -40px; }
  .quotes { grid-template-columns: 1fr; }
  .logo-wall { grid-template-columns: 1fr 1fr; }
  .logo-item:nth-child(3n) { border-right: 1px solid var(--line); }
  .logo-item:nth-child(2n) { border-right: 0; }
  .logo-item:nth-child(n + 4) { border-bottom: 1px solid var(--line); }
  .logo-item:nth-child(n + 5) { border-bottom: 0; }
}

@media (max-width: 720px) {
  .section { padding: clamp(48px, 8vw, 68px) 0; }
  .section-head { margin-bottom: 30px; }
  .h2 { font-size: clamp(1.65rem, 5.8vw, 2.15rem) !important; line-height: 1.22 !important; max-width: 100% !important; }
  .lede { font-size: 0.96rem; line-height: 1.62; margin-top: 14px; max-width: 100% !important; }
  
  .cards { grid-template-columns: 1fr; gap: 14px; }
  .cards > :last-child { grid-column: auto; }
  .card { padding: 22px 18px; }
  .card-title { font-size: 1.25rem; margin-bottom: 10px; }
  .card-body { font-size: 13.8px; line-height: 1.62; }
  .card-foot { flex-wrap: wrap; gap: 12px; align-items: center; }
  .card-foot .btn { width: 100%; justify-content: center; min-height: 44px; }
  
  .footer-top { grid-template-columns: 1fr 1fr; gap: 26px; }
  .footer-bottom { flex-direction: column; gap: 14px; }
  .contact-details li { grid-template-columns: 1fr; gap: 3px; }
  .contact-label { padding-top: 0; }
  
  .field-row { flex-direction: column; gap: 10px; }
  .field-row input, .field-row .btn { width: 100%; }
  .newsletter-form .btn { padding: 14px 24px; min-height: 48px; justify-content: center; }
  
  .labs-track { display: none !important; }
  
  /* Prevent iOS Safari auto-zoom on form inputs */
  input, select, textarea { font-size: 16px !important; }
  .field input, .field select, .field textarea { font-size: 16px !important; padding: 12px 14px; }
}

@media (max-width: 520px) {
  .display { font-size: clamp(2.15rem, 8.8vw, 2.75rem) !important; line-height: 1.12 !important; }
  .hero { padding-top: 16px; }
  .hero-grid { gap: 26px; padding-bottom: 28px; }
  .hero-lede { font-size: 0.98rem; line-height: 1.6; }
  .hero-actions { gap: 10px; margin-top: 20px; }
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; min-height: 46px; }
  .hero-meta { margin-top: 20px; font-size: 12.8px; }
  
  .portrait-card { padding: 18px 15px; border-radius: 20px; }
  .status-pill { padding: 5px 10px; font-size: 11px; }
  .portrait-loc { font-size: 9px; }
  .portrait-name { font-size: 1.18rem; }
  .portrait-role { font-size: 11.5px; }
  .mini-stats { gap: 6px; margin-top: 16px; padding-top: 12px; }
  .mini-stats strong { font-size: 1.12rem; }
  .mini-stats span { font-size: 9px; }
  
  .brand-text { display: none; }
  .header-actions { gap: 6px; }
  .lang-btn { min-width: 28px; height: 26px; padding: 0 6px; font-size: 11px; }
  .brand-mark { width: 34px; height: 34px; font-size: 14px; }
  
  .link-row { padding: 14px 16px; gap: 12px; border-radius: 16px; }
  .link-body strong { font-size: 14.5px; }
  .link-body small { font-size: 12px; }
  .link-icon { width: 36px; height: 36px; }
  
  .stat-band { grid-template-columns: 1fr; gap: 18px; }
  .chat-panel { width: calc(100vw - 20px); right: -6px; height: min(480px, calc(100vh - 100px)); }
  .footer-top { grid-template-columns: 1fr; gap: 24px; }
}

/* ==========================================================================
   RTL Layout & Arabic Typography Enhancements (Modern Apple / FinTech UI)
   ========================================================================== */

/* 1. Never break Arabic cursive connections with letter-spacing */
[dir="rtl"],
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4,
[dir="rtl"] p, [dir="rtl"] span, [dir="rtl"] a, [dir="rtl"] li,
[dir="rtl"] label, [dir="rtl"] button, [dir="rtl"] input, [dir="rtl"] textarea,
[dir="rtl"] .eyebrow, [dir="rtl"] .card-tag, [dir="rtl"] .status-pill,
[dir="rtl"] .mini-stats span, [dir="rtl"] .timeline-title, [dir="rtl"] .timeline-years,
[dir="rtl"] .brand-role, [dir="rtl"] .labs-card-tag, [dir="rtl"] .pill,
[dir="rtl"] .display, [dir="rtl"] .h1, [dir="rtl"] .h2, [dir="rtl"] .h3,
[dir="rtl"] .card-title, [dir="rtl"] .portrait-name, [dir="rtl"] .labs-title {
  letter-spacing: 0 !important;
}

/* 2. Arabic Headings & Typography */
[dir="rtl"] .display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.28 !important;
  font-size: clamp(2.1rem, 7.5vw, 4.2rem);
}
[dir="rtl"] .h1,
[dir="rtl"] .h2 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.36 !important;
  max-width: 100% !important;
}
[dir="rtl"] .h3,
[dir="rtl"] .card-title {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.4 !important;
}
[dir="rtl"] .eyebrow {
  letter-spacing: 0 !important;
  font-weight: 600;
  text-transform: none;
  font-size: 11.5px;
}
[dir="rtl"] .eyebrow::before {
  margin-left: 0;
  margin-right: 0;
}
[dir="rtl"] .hero-lede,
[dir="rtl"] .lede {
  line-height: 1.8 !important;
  max-width: 100% !important;
  font-size: clamp(0.98rem, 1.3vw, 1.12rem);
}
[dir="rtl"] p,
[dir="rtl"] .card-body,
[dir="rtl"] .prose p {
  line-height: 1.76 !important;
}
[dir="rtl"] .card-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}
[dir="rtl"] .quote blockquote {
  font-family: var(--font-display);
  line-height: 1.7 !important;
  text-align: right;
  font-weight: 600;
}

/* 3. Card List Bullet Dots in RTL */
[dir="rtl"] .card-list li {
  padding-left: 0;
  padding-right: 22px;
  text-align: right;
}
[dir="rtl"] .card-list li::before {
  left: auto;
  right: 0;
  top: 0.65em;
}

/* 4. Arrow flipping & alignment in RTL */
[dir="rtl"] .btn-arrow,
[dir="rtl"] .link-arrow {
  display: inline-block;
  transform: scaleX(-1);
  margin-left: 0;
  margin-right: 4px;
}
[dir="rtl"] .post-meta {
  flex-direction: row;
}
[dir="rtl"] .post-arrow {
  margin-left: 0;
  margin-right: auto;
  transform: scaleX(-1);
}
[dir="rtl"] .post-card:hover .post-arrow {
  transform: scaleX(-1) translate(-3px, -3px);
}
[dir="rtl"] .brand-arrow {
  transform: scaleX(-1);
  margin-left: 0;
  margin-right: 3px;
}

/* 5. Mobile Nav in RTL */
[dir="rtl"] .nav a {
  text-align: right;
}

/* 6. Timeline in RTL */
[dir="rtl"] .timeline-list li {
  border-left: none;
  border-right: 1px solid var(--line);
  padding: 0 22px 22px 0;
  text-align: right;
}
[dir="rtl"] .timeline-list li:last-child {
  border-right-color: transparent;
  padding-bottom: 6px;
}
[dir="rtl"] .timeline-list li::before {
  left: auto;
  right: -4.5px;
}
[dir="rtl"] .timeline-years,
[dir="rtl"] .mini-stats strong,
[dir="rtl"] .portrait-loc {
  unicode-bidi: isolate;
  direction: ltr;
  display: inline-block;
}
[dir="rtl"] .timeline-years {
  direction: rtl;
  unicode-bidi: isolate;
}

/* 7. Pullquote in RTL */
[dir="rtl"] .pullquote {
  border-left: none;
  border-right: 2px solid var(--blue);
  border-radius: 14px 0 0 14px;
  text-align: right;
}

/* 8. Newsletter in RTL */
[dir="rtl"] .newsletter::after {
  right: auto;
  left: -18px;
}
[dir="rtl"] .newsletter-copy {
  text-align: right;
}
[dir="rtl"] .newsletter-copy p {
  max-width: 100%;
}

/* 9. Form controls in RTL */
[dir="rtl"] input,
[dir="rtl"] select,
[dir="rtl"] textarea {
  text-align: right;
  font-family: var(--font-sans);
}
[dir="rtl"] input[type="email"] {
  direction: ltr;
  text-align: right;
}
[dir="rtl"] .field label {
  text-align: right;
}

/* 10. Chat Widget in RTL */
[dir="rtl"] .chat {
  right: auto;
  left: clamp(14px, 2.4vw, 28px);
}
[dir="rtl"] .chat-fab {
  margin-left: 0;
  margin-right: auto;
}
[dir="rtl"] .chat-panel {
  right: auto;
  left: 0;
}
@media (max-width: 520px) {
  [dir="rtl"] .chat-panel {
    right: auto;
    left: -6px;
  }
}
[dir="rtl"] .chat-close {
  margin-left: 0;
  margin-right: auto;
}
[dir="rtl"] .chat-prompts button {
  text-align: right;
}
[dir="rtl"] .chat-form button svg {
  transform: scaleX(-1);
}
[dir="rtl"] .msg.bot {
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 6px;
  text-align: right;
}
[dir="rtl"] .msg.user {
  border-bottom-right-radius: 16px;
  border-bottom-left-radius: 6px;
  text-align: right;
}

/* 11. Footer alignment */
[dir="rtl"] .footer-brand p,
[dir="rtl"] .footer-col {
  text-align: right;
}

/* Print */
@media print {
  .site-header, .chat, .marquee, .newsletter, .contact-form, .site-footer { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding: 24px 0; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}
