/* ============================================================
   22/x — LATTICE LIGHT v3
   Generational by Design. Disruptive by Intent.
   www.22x.ae

   Tokens are split into a light (default) and dark (data-theme="dark")
   set. The dark theme inherits all geometry from light — only colors
   move — so layout regressions are impossible.
   ============================================================ */

:root {
  /* — palette: light (Lattice Light) — */
  --bone:        #F1EBDF;
  --bone-deep:   #E8E0D0;
  --card:        #EDE4D1;
  --ink:         #141413;
  --ink-soft:    #3A3732;
  --ash:         #6B665D;
  --ash-faint:   #A9A298;
  --copper:      #B06A3B;
  --copper-dim:  #8C5128;
  --teal:        #2F5D5B;
  --rule:        #C9BFA9;
  --rule-faint:  #DDD2BA;
  --focus:       #B06A3B;

  --nav-bg:      rgba(241, 235, 223, 0.82);
  --nav-bg-mob:  rgba(241, 235, 223, 0.92);
  --shadow-soft: 0 1px 0 var(--rule-faint);

  /* — typography stack — */
  --serif: 'Cormorant Garamond', 'Cormorant', 'Playfair Display', 'Georgia', serif;
  --sans:  'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono:  'IBM Plex Mono', 'SF Mono', 'Menlo', 'Consolas', monospace;

  /* — geometry — */
  --maxw: 1240px;
  --pad:  clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* — palette: dark (Lattice Night) — */
[data-theme="dark"] {
  --bone:        #14120F;
  --bone-deep:   #1C1916;
  --card:        #211D17;
  --ink:         #EDE4D1;
  --ink-soft:    #C2B89E;
  --ash:         #8C857B;
  --ash-faint:   #5A5550;
  --copper:      #D08856;
  --copper-dim:  #B06A3B;
  --teal:        #6FA29F;
  --rule:        #2A2620;
  --rule-faint:  #1F1B16;
  --focus:       #D08856;

  --nav-bg:      rgba(20, 18, 15, 0.85);
  --nav-bg-mob:  rgba(20, 18, 15, 0.94);
  --shadow-soft: 0 1px 0 var(--rule);
}

/* respect OS preference if user has not picked a theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bone:        #14120F;
    --bone-deep:   #1C1916;
    --card:        #211D17;
    --ink:         #EDE4D1;
    --ink-soft:    #C2B89E;
    --ash:         #8C857B;
    --ash-faint:   #5A5550;
    --copper:      #D08856;
    --copper-dim:  #B06A3B;
    --rule:        #2A2620;
    --rule-faint:  #1F1B16;
    --focus:       #D08856;
    --nav-bg:      rgba(20, 18, 15, 0.85);
    --nav-bg-mob:  rgba(20, 18, 15, 0.94);
    --shadow-soft: 0 1px 0 var(--rule);
  }
}

/* ============== reset ============== */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--bone);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  width: 100%;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
img, svg { max-width: 100%; }
::selection { background: var(--copper); color: var(--bone); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }

/* ============== typography helpers ============== */
.serif      { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.italic     { font-style: italic; }
.mono       { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ash); }
.rule       { height: 1px; background: var(--rule); border: 0; }
.rule-faint { height: 1px; background: var(--rule-faint); border: 0; }

/* ============== layout ============== */
.wrap   { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
section { position: relative; }
.col-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
@media (max-width: 780px) { .col-2 { grid-template-columns: 1fr; gap: 32px; } }

/* ============== nav ============== */
nav.top {
  position: fixed; inset: 0 0 auto 0;
  z-index: 100;
  backdrop-filter: blur(0);
  transition: backdrop-filter 0.45s var(--ease), background 0.45s var(--ease), box-shadow 0.45s var(--ease);
  background: transparent;
}
nav.top.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}
nav.top .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.mark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 3.4vw, 38px);
  letter-spacing: 0;
  display: flex; align-items: baseline; gap: 2px;
  color: var(--ink);
}
.mark .slash { color: var(--copper); font-weight: 400; padding: 0 2px; font-style: italic; }
.mark .x     { font-style: italic; }

nav.top ul {
  list-style: none; display: flex; gap: 36px;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
}
nav.top ul a {
  color: var(--ink-soft);
  transition: color 0.25s;
  position: relative; padding-bottom: 4px;
}
nav.top ul a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 0; height: 1px; background: var(--copper);
  transition: width 0.35s var(--ease);
}
nav.top ul a:hover { color: var(--ink); }
nav.top ul a:hover::after { width: 100%; }

/* nav right cluster */
.nav-right {
  display: flex; align-items: center; gap: 12px;
}
@media (max-width: 420px) {
  .nav-right { gap: 6px; }
  .lang-toggle { gap: 6px; font-size: 10px; }
  .lang-toggle button { padding: 8px 1px; }
}

/* theme toggle */
.theme-toggle {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--ink-soft);
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.theme-toggle:hover { color: var(--copper); border-color: var(--copper); background: transparent; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .icon-sun  { display: block; }
  :root:not([data-theme]) .theme-toggle .icon-moon { display: none; }
}

/* mobile nav toggle */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  margin-left: 4px;
  color: var(--ink);
}
.nav-toggle .bars { position: relative; width: 22px; height: 14px; }
.nav-toggle .bars span {
  position: absolute; left: 0; right: 0;
  height: 1.4px; background: currentColor;
  transition: transform 0.35s var(--ease), opacity 0.25s var(--ease), top 0.35s var(--ease);
}
.nav-toggle .bars span:nth-child(1) { top: 0; }
.nav-toggle .bars span:nth-child(2) { top: 6px; }
.nav-toggle .bars span:nth-child(3) { top: 12px; }
body.menu-open .nav-toggle .bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
body.menu-open .nav-toggle .bars span:nth-child(2) { opacity: 0; }
body.menu-open .nav-toggle .bars span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

@media (max-width: 860px) {
  nav.top ul { display: none; }
  .nav-toggle { display: inline-flex; }
  nav.top.scrolled { background: var(--nav-bg-mob); }

  .mobile-menu {
    position: fixed;
    top: 64px; left: 0; right: 0; bottom: 0;
    background: var(--bone);
    transform: translateY(-110%);
    transition: transform 0.45s var(--ease);
    z-index: 95;
    padding: 32px var(--pad) 48px;
    display: flex; flex-direction: column;
    overflow-y: auto;
  }
  body.menu-open .mobile-menu { transform: translateY(0); }
  .mobile-menu ul {
    list-style: none; display: flex; flex-direction: column; gap: 4px;
    padding-top: 8px;
  }
  .mobile-menu ul a {
    display: block; padding: 18px 0;
    font-family: var(--serif); font-size: 32px; font-weight: 400;
    letter-spacing: -0.01em; color: var(--ink);
    border-bottom: 1px solid var(--rule-faint);
  }
  .mobile-menu ul li:first-child a { border-top: 1px solid var(--rule-faint); }
  .mobile-menu .mm-foot {
    margin-top: auto; padding-top: 32px;
    font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--ash);
    display: flex; flex-direction: column; gap: 8px;
  }
}
.mobile-menu { display: none; }
@media (max-width: 860px) { .mobile-menu { display: flex; } }

.lang-toggle {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ash);
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
}
.lang-toggle button { color: var(--ash); transition: color 0.25s; padding: 8px 2px; min-height: 40px; }
.lang-toggle button.active { color: var(--ink); }
.lang-toggle .sep { color: var(--ash-faint); }

/* ============== hero ============== */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  padding-top: 96px;
  padding-bottom: 120px;
  display: flex; align-items: center;
  position: relative;
  overflow: hidden;
}
@media (max-width: 780px) {
  .hero { padding-top: 88px; padding-bottom: 96px; min-height: auto; }
}
.hero .wrap { width: 100%; position: relative; z-index: 2; }
.hero-kicker {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 48px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ash);
}
.hero-kicker .dot { width: 6px; height: 6px; background: var(--copper); border-radius: 50%; display: inline-block; flex: 0 0 6px; }
.hero-kicker .sep { flex: 0 0 40px; height: 1px; background: var(--rule); }
@media (max-width: 540px) {
  .hero-kicker { gap: 10px; font-size: 10px; margin-bottom: 36px; }
  .hero-kicker .sep { display: none; }
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 7.6vw, 116px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 18ch;
}
.hero h1 em      { font-style: italic; color: var(--ink); font-weight: 400; }
.hero h1 .copper { color: var(--copper); font-style: italic; }
.hero-sub {
  margin-top: 36px;
  max-width: 52ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  font-weight: 300;
}
@media (max-width: 540px) { .hero-sub { font-size: 16px; margin-top: 28px; } }
.hero-actions {
  margin-top: 44px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
@media (max-width: 540px) {
  .hero-actions { margin-top: 36px; gap: 12px; }
  .hero-actions .btn { width: 100%; justify-content: space-between; }
}
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 24px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  transition: all 0.35s var(--ease);
  min-height: 48px;
}
.btn:hover { background: var(--ink); color: var(--bone); }
.btn.ghost { border-color: var(--ash-faint); color: var(--ink-soft); }
.btn.ghost:hover { background: var(--ink-soft); color: var(--bone); border-color: var(--ink-soft); }
.btn svg { width: 14px; height: 14px; }

.hero-foot {
  position: absolute; bottom: 32px; left: 0; right: 0;
  padding: 0 var(--pad);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ash);
  z-index: 2;
}
@media (max-width: 780px) {
  .hero-foot { font-size: 9px; bottom: 24px; gap: 12px; }
  .hero-foot > span:nth-child(1) { display: none; }
}
.hero-foot .scroll { display: flex; align-items: center; gap: 12px; }
.hero-foot .scroll .bar {
  width: 1px; height: 40px; background: var(--ink);
  animation: scroll-bar 2.2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes scroll-bar {
  0%   { transform: scaleY(0); }
  50%  { transform: scaleY(1); }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* lattice background */
.lattice-bg {
  position: absolute; inset: 0;
  z-index: 1;
  opacity: 0.45;
  pointer-events: none;
  color: var(--rule);
  mask-image:         radial-gradient(circle at 82% 40%, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 30%, rgba(0,0,0,0) 70%);
  -webkit-mask-image: radial-gradient(circle at 82% 40%, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 30%, rgba(0,0,0,0) 70%);
}
/* in dark mode the rule token is near-black; brighten the lattice so it reads */
[data-theme="dark"] .lattice-bg { opacity: 0.32; color: var(--copper-dim); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .lattice-bg { opacity: 0.32; color: var(--copper-dim); }
}
.lattice-bg svg { width: 100%; height: 100%; display: block; }

/* reticle accent */
.reticle {
  position: absolute; right: var(--pad); bottom: 90px;
  width: 140px; height: 140px;
  z-index: 2;
  color: var(--copper);
  opacity: 0.85;
  animation: reticle-breathe 7s ease-in-out infinite;
}
@keyframes reticle-breathe {
  0%, 100% { opacity: 0.65; transform: rotate(0deg); }
  50%      { opacity: 0.95; transform: rotate(90deg); }
}
@media (max-width: 780px) { .reticle { display: none; } }

/* ============== sections ============== */
.section {
  padding: clamp(72px, 10vh, 160px) 0;
  position: relative;
}
@media (max-width: 540px) { .section { padding: 64px 0; } }
.section-head {
  display: grid; grid-template-columns: 160px 1fr; gap: 32px;
  align-items: baseline;
  margin-bottom: 72px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 780px) { .section-head { grid-template-columns: 1fr; gap: 12px; margin-bottom: 40px; padding-bottom: 20px; } }
.section-num {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ash);
}
.section-title {
  font-family: var(--serif); font-size: clamp(36px, 5vw, 64px); font-weight: 400;
  line-height: 1.04; letter-spacing: -0.01em;
  color: var(--ink);
}
.section-title em      { font-style: italic; }
.section-title .copper { color: var(--copper); font-style: italic; }

/* ============== thesis ============== */
.thesis-quote {
  font-family: var(--serif);
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.22;
  color: var(--ink);
  font-weight: 400;
  letter-spacing: -0.005em;
}
.thesis-quote em { font-style: italic; color: var(--copper); }
.thesis-body p {
  font-size: 16px; line-height: 1.65; color: var(--ink-soft);
  margin-bottom: 20px; font-weight: 400;
}
.thesis-body p:last-child { margin-bottom: 0; }
.thesis-meta {
  margin-top: 32px; padding-top: 20px;
  border-top: 1px solid var(--rule-faint);
  display: flex; gap: 28px; flex-wrap: wrap;
}
.thesis-meta .mono { color: var(--ash); }

/* ============== platform ============== */
.platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
@media (max-width: 780px) { .platform-grid { grid-template-columns: 1fr; } }
.vcard {
  background: var(--bone);
  padding: 40px 36px 36px;
  position: relative;
  cursor: pointer;
  transition: background 0.45s var(--ease), padding 0.5s var(--ease);
}
@media (max-width: 540px) { .vcard { padding: 32px 24px 28px; } }
.vcard:hover         { background: var(--bone-deep); }
.vcard.active        { background: var(--bone-deep); padding-bottom: 56px; }
.vcard-num {
  position: absolute; top: 24px; right: 28px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; color: var(--ash);
}
.vcard-icon {
  width: 48px; height: 48px;
  color: var(--copper);
  margin-bottom: 32px;
  transition: transform 0.5s var(--ease);
}
.vcard:hover .vcard-icon { transform: rotate(15deg); }
.vcard-title {
  font-family: var(--serif); font-size: clamp(26px, 3.4vw, 34px); font-weight: 400;
  letter-spacing: -0.01em; color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.05;
}
.vcard-title em { font-style: italic; }
.vcard-sub {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--copper); margin-bottom: 22px;
}
.vcard-desc {
  font-size: 15px; color: var(--ink-soft); line-height: 1.6; max-width: 48ch;
}
.vcard-detail {
  max-height: 0; overflow: hidden;
  transition: max-height 0.6s var(--ease), margin 0.6s var(--ease), opacity 0.4s var(--ease);
  opacity: 0;
}
.vcard.active .vcard-detail {
  max-height: 600px;
  margin-top: 20px;
  opacity: 1;
}
.vcard-detail ul {
  list-style: none; padding-top: 20px; border-top: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 10px;
}
.vcard-detail li {
  display: grid; grid-template-columns: 24px 1fr; gap: 12px;
  font-size: 14px; color: var(--ink-soft); line-height: 1.5;
}
.vcard-detail li::before {
  content: ''; display: block; width: 14px; height: 1px; background: var(--copper);
  margin-top: 10px;
}
.vcard-more {
  margin-top: 24px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ash);
  display: inline-flex; align-items: center; gap: 10px;
}
.vcard.active .vcard-more { color: var(--copper); }
.vcard-more .plus { display: inline-block; width: 10px; height: 10px; position: relative; }
.vcard-more .plus::before, .vcard-more .plus::after { content: ''; position: absolute; background: currentColor; }
.vcard-more .plus::before { left: 0; top: 4.5px; width: 10px; height: 1px; }
.vcard-more .plus::after  { left: 4.5px; top: 0; width: 1px; height: 10px; transition: transform 0.4s var(--ease); }
.vcard.active .vcard-more .plus::after { transform: rotate(90deg); }

/* ============== numbers ============== */
.numbers-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}
@media (max-width: 980px) { .numbers-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; } }
.stat {
  padding: 28px 0 0;
  border-top: 1px solid var(--ink);
}
.stat .stat-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ash); margin-bottom: 24px;
}
.stat .stat-value {
  font-family: var(--serif);
  font-size: clamp(56px, 7vw, 92px);
  font-weight: 400; line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
  display: flex; align-items: baseline; gap: 4px;
}
.stat .stat-value .suffix { font-size: 0.55em; color: var(--copper); margin-left: 2px; font-style: italic; }
.stat .stat-foot {
  margin-top: 18px;
  font-size: 13px; color: var(--ink-soft); line-height: 1.5;
}

/* ============== vision ============== */
.vision-block {
  display: grid; grid-template-columns: 160px 1fr; gap: 32px;
  padding: 48px 0;
  border-bottom: 1px solid var(--rule-faint);
  align-items: baseline;
}
.vision-block:first-of-type { border-top: 1px solid var(--rule-faint); }
@media (max-width: 780px) { .vision-block { grid-template-columns: 1fr; gap: 16px; } }
.vision-block .vision-label { font-family: var(--mono); font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ash); }
.vision-block .vision-text {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.32;
  color: var(--ink);
  font-weight: 400;
  letter-spacing: -0.005em;
}
.vision-block .vision-text em { font-style: italic; color: var(--copper); }

/* ============== values ============== */
.values-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 980px) { .values-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .values-grid { grid-template-columns: 1fr; } }
.value {
  padding: 44px 28px 36px;
  border-right: 1px solid var(--rule-faint);
  position: relative;
  transition: background 0.4s var(--ease);
}
@media (max-width: 540px) { .value { padding: 32px 24px 28px; } }
.value:last-child { border-right: 0; }
@media (max-width: 980px) {
  .value:nth-child(2n) { border-right: 0; }
  .value { border-bottom: 1px solid var(--rule-faint); }
  .value:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 520px) {
  .value { border-right: 0; border-bottom: 1px solid var(--rule-faint); }
  .value:last-child { border-bottom: 0; }
}
.value:hover { background: var(--bone-deep); }
.value-num {
  font-family: var(--serif); font-style: italic;
  font-size: 18px; color: var(--copper);
  margin-bottom: 40px;
  letter-spacing: 0.05em;
}
.value-title {
  font-family: var(--serif); font-size: 26px; font-weight: 400;
  color: var(--ink); margin-bottom: 14px;
  letter-spacing: -0.005em;
}
.value-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.55; }

/* ============== people ============== */
.people-block {
  display: grid; grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
  padding: 56px 0;
  border-top: 1px solid var(--rule-faint);
}
.people-block:first-of-type { border-top: 1px solid var(--rule); }
.people-block:last-of-type { border-bottom: 1px solid var(--rule); }
@media (max-width: 780px) {
  .people-block { grid-template-columns: 1fr; gap: 24px; padding: 40px 0; }
}
.people-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash);
  position: sticky;
  top: 96px;
}
/* in single-column mobile, stop the label from sticking — it floats over cards otherwise */
@media (max-width: 780px) {
  .people-label { position: static; top: auto; }
}
.people-label em {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  letter-spacing: -0.005em;
  color: var(--copper);
  text-transform: none;
  margin-top: 12px;
}
.people-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  /* anchor each cell to the top of its row — when one card opens its bio,
     the sibling's portrait stays put instead of being stretched/shifted */
  align-items: start;
}
@media (max-width: 540px) { .people-grid { grid-template-columns: 1fr; } }

.person {
  /* now a clickable button-card */
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--rule-faint);
  border-bottom: 1px solid var(--rule-faint);
  padding: 36px 32px 32px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  position: relative;
  display: block;
  width: 100%;
  transition: background 0.4s var(--ease);
}
.person:hover { background: var(--bone-deep); }
.person:nth-child(2n) { border-right: 0; }
.person:focus-visible {
  outline: 1px solid var(--copper);
  outline-offset: -3px;
}
@media (max-width: 540px) {
  .person { border-right: 0; padding: 32px 0; }
}

/* portrait surface — square plate */
.person-portrait {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  background: var(--bone-deep);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  overflow: hidden;
  background-image:
    linear-gradient(var(--rule-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule-faint) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px;
  background-position: center center;
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease), filter 0.5s var(--ease);
}
.person:hover .person-portrait { border-color: var(--copper-dim); }
.person.is-open .person-portrait { border-color: var(--copper); }

/* photo portraits — when an <img.person-photo> sits inside the plate */
.person-portrait.has-photo {
  background-image: none;
  background-color: var(--rule-faint);
}
.person-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  z-index: 1;
  transition: transform 0.6s var(--ease), filter 0.5s var(--ease);
  filter: contrast(1.02) saturate(0.92);
}
.person:hover .person-photo { transform: scale(1.015); filter: contrast(1.06) saturate(0.96); }
.person.is-open .person-photo { transform: scale(1.02); }
[data-theme="dark"] .person-photo {
  /* in dark mode invert tonal range slightly so the cream backdrop reads against ink */
  filter: contrast(1.04) saturate(0.88) brightness(0.92);
}

.person-mono {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(56px, 9vw, 96px);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink);
  position: relative;
  z-index: 2;
  /* paper-block behind the monogram so it sits clean over the grid */
  padding: 6px 18px;
  background: var(--bone);
  box-shadow: 0 0 0 1px var(--rule-faint);
}
.person.is-open .person-mono { color: var(--copper); }

.person-plate {
  position: absolute;
  top: 12px;
  left: 14px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ash);
  z-index: 2;
}

/* corner registration marks */
.person-corner {
  position: absolute;
  width: 14px; height: 14px;
  z-index: 2;
}
.person-corner.tl { top: 8px;    left: 8px;    border-top: 1px solid var(--rule);    border-left: 1px solid var(--rule); }
.person-corner.tr { top: 8px;    right: 8px;   border-top: 1px solid var(--rule);    border-right: 1px solid var(--rule); }
.person-corner.bl { bottom: 8px; left: 8px;    border-bottom: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.person-corner.br { bottom: 8px; right: 8px;   border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); }

.person-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.person-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin-bottom: 4px;
}
.person-role {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--copper);
  letter-spacing: 0.01em;
}
.person-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash);
  padding-bottom: 2px;
  transition: color 0.3s var(--ease);
}
.person:hover .person-toggle { color: var(--copper); }
.person.is-open .person-toggle { color: var(--copper); }
.person-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  font-family: var(--serif);
  transition: transform 0.4s var(--ease);
}
.person.is-open .person-toggle-icon { transform: rotate(45deg); }

/* bio — collapsed by default, expands on .is-open
   Note: we use grid-template-rows: 0fr → 1fr trick on a single-row grid,
   so the bio MUST contain exactly one child (.person-bio-inner) which holds
   all <p>s. Multi-row grids would expose auto-sized rows. */
.person-bio {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: 0;
  transition: grid-template-rows 0.55s var(--ease), margin-top 0.4s var(--ease), padding-top 0.4s var(--ease);
  overflow: hidden;
}
.person-bio-inner {
  min-height: 0;
  overflow: hidden;
}
.person-bio p {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.65;
  margin: 0;
}
.person-bio p + p { margin-top: 12px; }
.person.is-open .person-bio {
  grid-template-rows: 1fr;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--rule-faint);
}
.person.is-open .person-toggle-label::after {
  content: '';
}
/* swap label text without JS */
.person.is-open .person-toggle-label { font-size: 0; }
.person.is-open .person-toggle-label::before {
  content: 'Close';
  font-size: 10px;
  letter-spacing: 0.18em;
}
html[lang="ar"] .person.is-open .person-toggle-label::before { content: 'إغلاق'; }

/* ============== footer ============== */
footer {
  padding: clamp(64px, 10vh, 100px) 0 32px;
  border-top: 1px solid var(--rule);
  background: var(--bone);
  position: relative;
  overflow: hidden;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 96px;
}
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 64px; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; gap: 36px; } }
.footer-lockup .mark { font-size: clamp(36px, 6vw, 44px); margin-bottom: 20px; }
.footer-col a { display: inline-block; padding: 4px 0; min-height: 32px; font-size: 14px; color: var(--ink-soft); transition: color 0.25s; }
.footer-bottom > span { font-size: 9px; }
.footer-lockup p {
  font-family: var(--serif); font-size: 20px; line-height: 1.35; color: var(--ink);
  max-width: 24ch; font-style: italic;
}
.footer-lockup p .copper { color: var(--copper); }
.footer-col h5 {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ash); margin-bottom: 18px; font-weight: 500;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a:hover { color: var(--copper); }
.footer-address {
  margin-top: 18px;
  font-family: var(--serif);
  font-style: normal;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  letter-spacing: 0.005em;
  max-width: 28ch;
}
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  padding-top: 24px; border-top: 1px solid var(--rule-faint);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ash);
}

/* contact form (added — backend-wired) */
.contact-form {
  margin-top: 56px; padding-top: 48px;
  border-top: 1px solid var(--rule-faint);
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
@media (max-width: 720px) { .contact-form { grid-template-columns: 1fr; gap: 18px; } }
.contact-form label {
  display: flex; flex-direction: column; gap: 8px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ash);
}
.contact-form input, .contact-form textarea {
  font-family: var(--sans); font-size: 15px;
  background: transparent; color: var(--ink);
  border: 0; border-bottom: 1px solid var(--rule);
  padding: 10px 0;
  outline: none;
  transition: border-color 0.25s;
}
.contact-form textarea { min-height: 90px; resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--copper); }
.contact-form .full { grid-column: 1 / -1; }
.contact-form .submit-row {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
}
.contact-form .form-status {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ash);
}
.contact-form .form-status.ok    { color: var(--teal); }
.contact-form .form-status.error { color: var(--copper-dim); }

/* honeypot — visually & geometrically hidden but still focusable for bots */
.contact-form .hp {
  position: absolute !important;
  left: -10000px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}

/* ============== reveal + accessibility ============== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reticle { animation: none; }
  .hero-foot .scroll .bar { animation: none; opacity: 0.5; }
  body, .vcard, .value, .btn, .theme-toggle { transition: none !important; }
}

a:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

/* sidebar fiducials */
.fiducial-left {
  position: fixed; left: 16px; top: 50%;
  transform: translateY(-50%) rotate(-90deg); transform-origin: left center;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ash-faint);
  z-index: 50; pointer-events: none;
  white-space: nowrap;
}
@media (max-width: 1180px) { .fiducial-left { display: none; } }

/* ====================================================================
   RTL / Arabic typography
   ==================================================================== */

/* In RTL, body & headlines switch to a paired Arabic typeface but keep
   the same Lattice cadence. Cormorant has no good Arabic; Amiri's serifs
   echo the same restrained, classical voice. */
html[lang="ar"] body,
html[lang="ar"] input,
html[lang="ar"] textarea,
html[lang="ar"] button {
  font-family: "IBM Plex Sans Arabic", "Inter", system-ui, sans-serif;
}
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] .hero h1,
html[lang="ar"] .section-title,
html[lang="ar"] .vcard-title,
html[lang="ar"] .vision-text,
html[lang="ar"] .thesis-quote,
html[lang="ar"] .person-name,
html[lang="ar"] .footer-lockup p {
  font-family: "Amiri", "IBM Plex Sans Arabic", serif;
  font-style: normal; /* italics don't render in Arabic */
}
html[lang="ar"] em { font-style: normal; }
html[lang="ar"] .mono,
html[lang="ar"] .mark,
html[lang="ar"] .vcard-num,
html[lang="ar"] .stat-value,
html[lang="ar"] .person-plate,
html[lang="ar"] .section-num,
html[lang="ar"] .vision-label,
html[lang="ar"] .value-num,
html[lang="ar"] .fiducial-left,
html[lang="ar"] .footer-bottom,
html[lang="ar"] .hero-kicker {
  font-family: var(--mono);
}

/* RTL — flip directional bits */
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .nav-right { direction: ltr; } /* keep toggles natural */
html[dir="rtl"] .top .wrap > ul { direction: rtl; }

/* hero kicker dot/separators read right-to-left naturally */
html[dir="rtl"] .hero-kicker .sep { margin: 0 0.5em; }

/* arrow icons in CTAs should mirror */
html[dir="rtl"] .btn svg { transform: scaleX(-1); }

/* fiducial: flip the left rail to a right rail in RTL */
html[dir="rtl"] .fiducial-left {
  left: auto; right: 16px;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: right center;
}

/* vcard-num pinned top-right normally; in RTL pin top-left */
html[dir="rtl"] .vcard-num,
html[dir="rtl"] .stat-label,
html[dir="rtl"] .person-plate,
html[dir="rtl"] .person-toggle {
  /* override only the directional padding; positions handled below */
}

/* thesis meta + numbers grid read RTL automatically since we use flex/grid;
   ensure list bullets flip to right side */
html[dir="rtl"] .vcard-detail ul { padding-left: 0; padding-right: 1.1em; }
html[dir="rtl"] .vcard-detail ul li { text-align: right; }

/* footer grid still reads left to right visually for column order;
   we let the natural document flow flip it. Address text is right-aligned. */
html[dir="rtl"] .footer-address { text-align: right; }
html[dir="rtl"] .footer-col ul { padding-right: 0; }

/* form: align labels right, keep fields LTR for email */
html[dir="rtl"] .contact-form label { text-align: right; }
html[dir="rtl"] .contact-form input[type="email"] { direction: ltr; text-align: left; }

/* mobile menu items right-aligned in RTL */
html[dir="rtl"] .mobile-menu ul { text-align: right; }
html[dir="rtl"] .mobile-menu .mm-foot { direction: rtl; }

/* hero scroll arrow: don't flip the bar */
html[dir="rtl"] .hero-foot .scroll .bar { transform: none; }

/* slash in 22/x logo stays the same — wordmark is bilingual */
html[dir="rtl"] .mark { direction: ltr; }

/* the people-toggle "Read +" — keep + on the trailing edge */
html[dir="rtl"] .person-toggle { flex-direction: row-reverse; }

/* hero headline: Arabic version is shorter; keep wide letterform pitch */
html[lang="ar"] .hero h1 {
  letter-spacing: 0;
  line-height: 1.18;
}
html[lang="ar"] .section-title {
  letter-spacing: 0;
/* In RTL the person-meta should still flex right→left so name leads */
html[dir="rtl"] .person-meta { direction: rtl; text-align: right; }
html[dir="rtl"] .person-bio-inner p { text-align: right; }
html[dir="rtl"] .person-bio-inner { direction: rtl; }

/* Arabic hero — make every beat sit on its own block-level line so
   nothing collides with diacritics or descenders. */
html[lang="ar"] .hero h1 {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.35em !important;
  line-height: 1.35 !important;
  letter-spacing: 0;
  font-size: clamp(34px, 5.4vw, 76px) !important;
  max-width: 100%;
}
html[lang="ar"] .hero h1 br { display: none !important; }
html[lang="ar"] .hero h1 em,
html[lang="ar"] .hero h1 .copper,
html[lang="ar"] .hero h1 > * { display: inline; }

html[lang="ar"] .section-title {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.3em !important;
  line-height: 1.32 !important;
}
html[lang="ar"] .section-title br { display: none !important; }
html[lang="ar"] .hero-sub { line-height: 1.85; }

/* In RTL the reticle and lattice mask move to the LEFT side */
html[dir="rtl"] .reticle {
  right: auto !important;
  left: var(--pad) !important;
  bottom: 90px;
}
html[dir="rtl"] .lattice-bg {
  /* Mirror the radial mask focus from 82% (right) to 18% (left) */
  mask-image:         radial-gradient(circle at 18% 40%, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 30%, rgba(0,0,0,0) 70%) !important;
  -webkit-mask-image: radial-gradient(circle at 18% 40%, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 30%, rgba(0,0,0,0) 70%) !important;
}

/* ====================================================================
   v3 — bulletproof Arabic / RTL fixes
   ==================================================================== */
/* AR hero — beats stack as block elements with explicit margin. Cannot overlap. */
html[lang="ar"] .hero h1 .ar-beat {
  display: block !important;
  line-height: 1.3 !important;
  margin: 0 0 0.4em 0 !important;
}
html[lang="ar"] .hero h1 .ar-beat-2 {
  color: var(--copper) !important;
  font-style: italic !important;
  margin-bottom: 0 !important;
}
html[lang="ar"] .hero h1 {
  font-size: clamp(34px, 5.4vw, 76px) !important;
  line-height: 1.3 !important;
  max-width: 100%;
}

/* RTL reticle and lattice mirror — bulletproof */
html[dir="rtl"] .reticle {
  right: auto !important;
  left: var(--pad) !important;
}
html[dir="rtl"] .lattice-bg {
  mask-image:         radial-gradient(circle at 18% 40%, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 30%, rgba(0,0,0,0) 70%) !important;
  -webkit-mask-image: radial-gradient(circle at 18% 40%, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 30%, rgba(0,0,0,0) 70%) !important;
}
