/* ==========================================================================
   Moudud — brand system v8
   Light editorial identity. No webfonts, no frameworks, no dependencies.
   Logical properties throughout, so /ar/ mirrors without extra rules.
   ========================================================================== */

:root {
  color-scheme: light;

  /* surfaces */
  --paper: #ffffff;
  --paper-2: #f6f7f9;
  --paper-3: #eceff3;
  --ink: #0d1216;
  --ink-2: #2a333c;
  --body: #46515d;
  --muted: #6b7683;
  --faint: #98a1ab;
  --line: #e5e8ec;
  --line-2: #d3d8de;

  /* brand */
  --accent: #1b4a7e;
  --accent-2: #12365e;
  --accent-wash: #f1f5fa;
  --on-accent: #ffffff;

  /* status */
  --ok: #0f6b46;
  --ok-wash: #edf7f1;
  --warn: #8a5a00;
  --warn-wash: #fdf6e7;
  --danger: #b42318;
  --danger-wash: #fdf1f0;

  /* type */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* legacy aliases — /admin and old markup keep working */
  --bg: var(--paper);
  --surface: var(--paper);
  --deep: var(--paper-2);
  --line-3: var(--line-2);
  --text: var(--ink);
  --text-2: var(--ink-2);
  --dim: var(--faint);
  --cond: var(--sans);

  /* metrics */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(13, 18, 22, 0.04), 0 12px 32px -20px rgba(13, 18, 22, 0.22);
  --ring: 0 0 0 3px rgba(27, 74, 126, 0.16);
}

html[lang="ar"] {
  --sans: "Segoe UI", "Noto Naskh Arabic", "Geeza Pro", Tahoma, system-ui, sans-serif;
  --mono: "Segoe UI", "Noto Naskh Arabic", Tahoma, system-ui, sans-serif;
}
html[lang="bn"] {
  --sans: "Noto Sans Bengali", "Nirmala UI", "Bangla Sangam MN", "Kohinoor Bangla", "Hind Siliguri", system-ui, sans-serif;
  --mono: "Noto Sans Bengali", "Nirmala UI", "Bangla Sangam MN", ui-monospace, monospace;
}

/* --------------------------------------------------------------- reset -- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
html:is([lang="ar"], [lang="bn"]) body { font-size: 17px; line-height: 1.85; overflow-wrap: break-word; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }
[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 64px);
}
/* on very wide screens let the measure grow a little rather than leaving
   two empty gutters framing a narrow column */
@media (min-width: 1500px) {
  .wrap { max-width: 1320px; }
}
.mono { font-family: var(--mono); font-size: 0.9em; letter-spacing: -0.01em; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.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 {
  position: absolute; inset-inline-start: 16px; top: -80px; z-index: 100;
  padding: 12px 18px; background: var(--ink); color: #fff; font-weight: 600;
  border-radius: var(--radius-sm); transition: top 0.15s ease;
}
.skip:focus { top: 12px; color: #fff; }

/* ------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink);
  font-size: 0.95rem; font-weight: 600; line-height: 1; letter-spacing: -0.01em;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.btn:hover { border-color: var(--ink-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: transparent; padding-inline: 10px; color: var(--body); }
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); border-color: transparent; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 0.9rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
.btn svg { flex: none; }

/* -------------------------------------------------------------- header -- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { color: var(--ink); }
/* the monogram is a <use> of one <symbol>, so the gradient ids exist once */
.brand-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.brand-mark { width: 30px; height: 30px; flex: none; border-radius: 7px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.02em; }
.brand-role { font-family: var(--mono); font-size: 10px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
html:is([lang="ar"], [lang="bn"]) .brand-role { font-size: 11px; letter-spacing: 0; text-transform: none; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--body); font-size: 0.9rem; font-weight: 500;
}
.nav-links a:hover { color: var(--ink); background: var(--paper-2); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.lang-switch {
  display: inline-flex; align-items: stretch; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper);
}
.lang-switch a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 38px; padding: 0 7px;
  font-family: var(--mono); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.02em; line-height: 1; color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-switch a + a { border-inline-start: 1px solid var(--line); }
.lang-switch a:hover { background: var(--paper-2); color: var(--ink); }
.lang-switch a[aria-current="page"] { background: var(--ink); color: #fff; }
html:is([lang="ar"], [lang="bn"]) .lang-switch a { font-family: var(--sans); font-size: 0.76rem; letter-spacing: 0; }
.nav-toggle {
  display: none; width: 40px; height: 40px; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink);
}
.nav-toggle:hover { background: var(--paper-2); }

/* ---------------------------------------------------------------- hero -- */
.hero { padding-block: clamp(44px, 6vw, 84px) clamp(40px, 5vw, 72px); }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 4vw, 56px); align-items: start;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent);
}
html:is([lang="ar"], [lang="bn"]) .eyebrow { font-size: 13px; letter-spacing: 0; text-transform: none; }
.eyebrow::before {
  content: ""; width: 18px; height: 1px; background: var(--accent); flex: none;
}
html[dir="rtl"] .eyebrow::before { order: 2; }

.display {
  margin-top: 18px;
  font-size: clamp(2.45rem, 5.4vw, 4.05rem);
  line-height: 1.02; letter-spacing: -0.038em; font-weight: 700; color: var(--ink);
  text-wrap: balance;
}
html:is([lang="ar"], [lang="bn"]) .display { line-height: 1.24; letter-spacing: 0; font-size: clamp(2.3rem, 5vw, 3.7rem); }
.display .thin { color: var(--muted); font-weight: 400; }

.lead {
  margin-top: 20px; max-width: 54ch;
  font-size: clamp(1.02rem, 1.4vw, 1.15rem); line-height: 1.62; color: var(--body);
}
html:is([lang="ar"], [lang="bn"]) .lead { line-height: 1.8; }

.hero-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  margin-top: 22px; font-size: 0.88rem; color: var(--muted);
}
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 500; }
.status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none;
  box-shadow: 0 0 0 3px var(--ok-wash);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* ask the agent — a chat composer, not a search bar */
.ask {
  margin-top: 32px; max-width: 620px;
  display: flex; flex-direction: column;
}
.ask-form {
  display: flex; flex-direction: column; gap: 4px;
  padding-block: 14px 10px; padding-inline: 16px 12px;
  border: 1px solid var(--line-2); border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(13, 18, 22, 0.04), 0 20px 44px -34px rgba(13, 18, 22, 0.45);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.ask-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27, 74, 126, 0.12), 0 20px 44px -34px rgba(13, 18, 22, 0.45);
}
html:not(.js) .ask { display: none; }

/* the field: two lines at rest, grows with the question */
.ask-form textarea {
  display: block; width: 100%;
  min-height: 46px; max-height: 132px;
  padding: 2px 2px 0;
  border: 0; background: transparent; outline: none; resize: none;
  font-family: inherit; font-size: 0.97rem; line-height: 1.5; color: var(--ink);
  overflow-y: auto;
}
html:is([lang="ar"], [lang="bn"]) .ask-form textarea { font-size: 1.02rem; line-height: 1.7; }
.ask-form textarea::placeholder { color: var(--faint); }

/* toolbar: agent avatar on the left, send on the right */
.ask-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ask-icon { color: var(--accent); }

/* the agent reads as live: a quiet ping on its avatar, one pulse on arrival */
.ask-ping {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-wash);
}
.ask-ping::after {
  content: ""; position: absolute; inset-block-start: 0; inset-inline-end: 0;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: ask-ping 2.8s ease-out infinite;
}
@keyframes ask-ping {
  0%        { box-shadow: 0 0 0 2px var(--paper), 0 0 0 2px rgba(27, 74, 126, 0.40); }
  70%, 100% { box-shadow: 0 0 0 2px var(--paper), 0 0 0 9px rgba(27, 74, 126, 0); }
}

/* circular send — the way a chat composer sends */
.ask-submit {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px;
  border: 0; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.12s ease;
}
.ask-submit:hover { background: var(--accent-2); }
.ask-submit:active { transform: scale(0.94); }
.ask-submit:disabled { background: var(--paper-3); color: var(--faint); cursor: default; transform: none; }
.ask-submit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ask-submit svg { display: block; }

/* suggestions sit under the composer, like a prompt list */
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-block: 12px 0; padding-inline: 2px; }
.chip {
  display: inline-flex; align-items: center; min-height: 32px; padding: 4px 11px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); color: var(--body);
  font-size: 0.8rem; line-height: 1.3; text-align: start;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }

/* the transcript sits above the composer, where a conversation belongs */
.ask-thread {
  order: -1;
  display: flex; flex-direction: column; gap: 14px;
  max-height: 320px; overflow-y: auto;
  margin-block-end: 10px; padding: 16px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--paper-2);
}
.ask-msg { display: flex; flex-direction: column; gap: 4px; }
.ask-who {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
}
html:is([lang="ar"], [lang="bn"]) .ask-who { font-size: 12px; letter-spacing: 0; text-transform: none; }
.ask-msg p { font-size: 0.94rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); }
html:is([lang="ar"], [lang="bn"]) .ask-msg p { font-size: 1rem; line-height: 1.8; }
.ask-q p { color: var(--ink); font-weight: 600; }
.ask-err p { color: var(--danger); }
.ask-wait p { color: var(--muted); font-style: italic; }

.ask-note {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  padding-block: 10px 0; padding-inline: 4px;
  font-size: 0.78rem; color: var(--faint);
}
.ask-send {
  font-size: 0.78rem; font-weight: 600; color: var(--accent);
  text-decoration: underline; text-underline-offset: 3px;
}

.ask.is-nudge .ask-form { animation: ask-nudge 1.2s ease-out 2; }
@keyframes ask-nudge {
  0%, 100% { box-shadow: 0 1px 2px rgba(13, 18, 22, 0.04), 0 20px 44px -34px rgba(13, 18, 22, 0.45), 0 0 0 0 rgba(27, 74, 126, 0); }
  45%      { box-shadow: 0 1px 2px rgba(13, 18, 22, 0.04), 0 20px 44px -34px rgba(13, 18, 22, 0.45), 0 0 0 8px rgba(27, 74, 126, 0.10); }
}

/* identity plane: one rail, three layers, a fill that follows the selection */
.plane {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-2); padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.plane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plane-title {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
html:is([lang="ar"], [lang="bn"]) .plane-title { font-size: 12px; letter-spacing: 0; text-transform: none; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--ok-wash); color: var(--ok);
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
}
html:is([lang="ar"], [lang="bn"]) .pill { font-size: 11px; letter-spacing: 0; text-transform: none; }

.plane-map { position: relative; padding-inline-start: 36px; }
.plane-spine {
  position: absolute; inset-inline-start: 11px; top: 0; bottom: 0;
  width: 1px; background: var(--line-2); pointer-events: none;
}
.plane-spine::after {
  content: ""; position: absolute; inset-inline: 0; top: 0;
  height: var(--fill, 0%); background: var(--accent);
  transition: height 0.42s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.layer {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  width: 100%; padding: 12px 14px; text-align: start;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink); font-family: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.24s ease, opacity 0.24s ease;
}
.layer::before {
  content: ""; position: absolute; inset-inline-start: -25px; top: 50%;
  width: 25px; height: 1px; background: var(--line-2);
  transition: background 0.18s ease, opacity 0.18s ease;
}
.layer-dot {
  position: absolute; inset-inline-start: -29px; top: 50%;
  width: 7px; height: 7px; margin-block-start: -3.5px;
  border: 1px solid var(--line-2); border-radius: 50%; background: var(--paper);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.24s ease;
}
.layer b { font-size: 0.9rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.layer small {
  font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted);
}
.layer:hover { border-color: var(--line-2); }
.layer:hover::before { background: var(--accent); opacity: 0.4; }
.layer:hover .layer-dot { border-color: var(--accent); }
.layer[aria-pressed="true"] {
  border-color: #c9d9ea;
  box-shadow: 0 1px 2px rgba(13, 18, 22, 0.04), 0 14px 26px -22px rgba(27, 74, 126, 0.65);
}
.layer[aria-pressed="true"]::before { background: var(--accent); opacity: 1; }
.layer[aria-pressed="true"] .layer-dot {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.layer[aria-pressed="false"] { opacity: 0.62; }
.layer[aria-pressed="false"]:hover { opacity: 1; }
html:is([lang="ar"], [lang="bn"]) .layer b { font-size: 0.96rem; }
html:is([lang="ar"], [lang="bn"]) .layer small { font-size: 10.5px; letter-spacing: 0; text-transform: none; }

.plane-hop { position: relative; padding: 14px 0; }
.plane-hop::before {
  content: ""; position: absolute; inset-inline-start: -25px; top: 50%;
  width: 17px; height: 1px; background: var(--line-2);
}
.plane-hop::after {
  content: ""; position: absolute; inset-inline-start: -29px; top: 50%;
  width: 6px; height: 6px; margin-block-start: -3px; border-radius: 50%;
  background: var(--paper-2); border: 1px solid var(--line-2);
}
.plane-hop span {
  font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint);
}
html:is([lang="ar"], [lang="bn"]) .plane-hop span { font-family: var(--sans); font-size: 11px; letter-spacing: 0; text-transform: none; }

.plane-detail {
  border-top: 1px solid var(--line); padding-top: 14px;
  transition: height 0.34s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.plane-detail.is-swapping { overflow: hidden; }
.plane-detail h3 {
  font-size: 0.86rem; font-weight: 700; color: var(--ink); letter-spacing: -0.01em;
}
.plane-detail ul { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.plane-detail li {
  position: relative; padding-inline-start: 16px;
  font-size: 0.82rem; line-height: 1.5; color: var(--body);
  animation: row-in 0.3s ease-out both;
}
.plane-detail li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 0.62em;
  width: 5px; height: 1px; background: var(--accent);
}
.plane-detail li:nth-child(2) { animation-delay: 0.03s; }
.plane-detail li:nth-child(3) { animation-delay: 0.06s; }
.plane-detail li:nth-child(4) { animation-delay: 0.09s; }
.plane-detail li:nth-child(5) { animation-delay: 0.12s; }
.plane-detail li:nth-child(6) { animation-delay: 0.15s; }
html:is([lang="ar"], [lang="bn"]) .plane-detail li { font-size: 0.92rem; line-height: 1.7; }
@keyframes row-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------- certifications -- */
.creds { border-bottom: 1px solid var(--line); background: var(--paper); }
.creds-grid {
  display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px;
  align-items: baseline; padding-block: 26px;
}
.creds-title {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
html:is([lang="ar"], [lang="bn"]) .creds-title { font-family: var(--sans); font-size: 13px; letter-spacing: 0; text-transform: none; }
.creds-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px 28px;
}
.creds-list li { display: flex; flex-direction: column; gap: 2px; }
.creds-list b { font-size: 0.9rem; font-weight: 600; line-height: 1.35; color: var(--ink); }
.creds-list span {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
@media (max-width: 720px) {
  .creds-grid { grid-template-columns: 1fr; gap: 12px; }
}

/* --------------------------------------------------------------- stats -- */
.stats { border-block: 1px solid var(--line); background: var(--paper); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 28px 24px; border-inline-start: 1px solid var(--line); }
.stat:first-child { border-inline-start: 0; padding-inline-start: 0; }
.stat b {
  display: block; font-size: clamp(1.9rem, 3.2vw, 2.6rem); line-height: 1;
  font-weight: 700; letter-spacing: -0.04em; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat span { display: block; margin-top: 8px; font-size: 0.85rem; color: var(--muted); line-height: 1.45; }
.stat .accent { color: var(--accent); }

/* ------------------------------------------------------------- section -- */
.section { padding-block: clamp(56px, 8vw, 96px); scroll-margin-top: 80px; }
.section + .section { border-top: 1px solid var(--line); }
.section-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
  gap: 16px 48px; align-items: end; margin-bottom: clamp(28px, 4vw, 44px);
}
.h2 {
  margin-top: 12px;
  font-size: clamp(1.6rem, 3.1vw, 2.35rem); line-height: 1.12;
  letter-spacing: -0.03em; font-weight: 700; color: var(--ink); text-wrap: balance;
}
html:is([lang="ar"], [lang="bn"]) .h2 { line-height: 1.35; letter-spacing: 0; }
.section-lead { font-size: 0.98rem; line-height: 1.65; color: var(--muted); max-width: 46ch; }
html:is([lang="ar"], [lang="bn"]) .section-lead { line-height: 1.85; }

/* capability cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.card:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-num {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.1em; color: var(--faint);
}
.card-icon { color: var(--accent); }
.card h3 { font-size: 1.06rem; font-weight: 700; line-height: 1.35; letter-spacing: -0.015em; color: var(--ink); }
.card p { font-size: 0.9rem; line-height: 1.6; color: var(--body); }
html:is([lang="ar"], [lang="bn"]) .card p { font-size: 0.96rem; line-height: 1.8; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 2px; }
.tags span {
  padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--mono); font-size: 10.5px; color: var(--muted); direction: ltr;
}
html:is([lang="ar"], [lang="bn"]) .tags span { font-family: var(--sans); font-size: 11.5px; }

/* experience: the capability card with a short list instead of a paragraph */
.card .job-org { margin-top: -6px; font-size: 0.86rem; font-weight: 600; color: var(--accent); }
.job-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.job-list li { position: relative; padding-inline-start: 14px; font-size: 0.88rem; line-height: 1.55; color: var(--body); }
.job-list li::before {
  content: ""; position: absolute; inset-inline-start: 2px; top: 0.62em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
html:is([lang="ar"], [lang="bn"]) .job-list li { font-size: 0.95rem; line-height: 1.8; }
.job-card .tags { margin-top: auto; }

/* proof line: one verifiable fact per capability, pinned to the card foot */
.proof {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 0.8rem; line-height: 1.55; color: var(--ink-2);
}
.proof b {
  display: block; margin-bottom: 3px;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent);
}
html:is([lang="ar"], [lang="bn"]) .proof { font-size: 0.9rem; line-height: 1.7; }
html:is([lang="ar"], [lang="bn"]) .proof b { font-family: var(--sans); font-size: 12px; letter-spacing: 0; text-transform: none; }

/* editorial rows */
.rows { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: 48px minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px 32px; align-items: baseline;
  padding-block: 26px; border-top: 1px solid var(--line);
}
.row:last-child { border-bottom: 1px solid var(--line); }
.row-k { font-family: var(--mono); font-size: 0.78rem; font-weight: 600; color: var(--accent); }
.row h3 { font-size: 1.12rem; font-weight: 700; line-height: 1.35; letter-spacing: -0.015em; color: var(--ink); }
.row p { font-size: 0.94rem; line-height: 1.65; color: var(--body); }

/* process */
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.flow li { padding: 20px; border-inline-start: 1px solid var(--line); background: var(--paper); }
.flow li:first-child { border-inline-start: 0; }
.flow-n {
  display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.1em; color: var(--accent); margin-bottom: 10px;
}
.flow h3 { font-size: 0.92rem; font-weight: 700; color: var(--ink); line-height: 1.35; }
.flow p { margin-top: 6px; font-size: 0.8rem; line-height: 1.55; color: var(--muted); }
html:is([lang="ar"], [lang="bn"]) .flow p { font-size: 0.88rem; line-height: 1.7; }

/* work / engagement cards */
.work { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.work-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper);
}
.work-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted);
}
html:is([lang="ar"], [lang="bn"]) .work-top { font-size: 11.5px; letter-spacing: 0; text-transform: none; }
.live { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); }
.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.live.private { color: var(--muted); }
.live.private::before { background: var(--faint); }
.work-card h3 { font-size: 1.02rem; font-weight: 700; line-height: 1.4; letter-spacing: -0.015em; color: var(--ink); }
.work-card > p { font-size: 0.88rem; line-height: 1.6; color: var(--body); }
html:is([lang="ar"], [lang="bn"]) .work-card > p { font-size: 0.95rem; line-height: 1.8; }
.phases { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.phases li {
  position: relative; padding-inline-start: 16px;
  font-size: 0.82rem; color: var(--ink-2);
}
.phases li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 0.66em;
  width: 5px; height: 5px; border-radius: 50%; border: 1px solid var(--accent);
}
.deliver {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 0.8rem; line-height: 1.55; color: var(--muted);
}
.deliver b {
  display: block; margin-bottom: 3px;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-2);
}
html:is([lang="ar"], [lang="bn"]) .deliver b { font-family: var(--sans); font-size: 11.5px; letter-spacing: 0; text-transform: none; }
.work-card .btn { align-self: flex-start; }

/* -------------------------------------------------------------- posture -- */
.posture {
  display: grid; grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.posture-summary {
  display: flex; flex-direction: column; gap: 8px;
  padding: 28px; border-inline-end: 1px solid var(--line); background: var(--paper-2);
}
.score {
  display: flex; align-items: baseline; gap: 4px;
  font-size: clamp(2.8rem, 5vw, 3.6rem); font-weight: 700;
  line-height: 1; letter-spacing: -0.05em; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.score b { font-weight: 700; }
.score span { font-size: 1.1rem; color: var(--faint); font-weight: 500; }
.score-label { font-size: 0.88rem; color: var(--body); }
.score-time { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); }
.posture-summary .btn { align-self: flex-start; margin-top: 10px; }
.checks {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 0; padding: 0;
}
.check {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto;
  gap: 2px 10px; padding: 13px 20px; border-bottom: 1px solid var(--line);
}
.check:nth-child(odd) { border-inline-end: 1px solid var(--line); }
.c-name { font-size: 0.86rem; font-weight: 600; color: var(--ink); }
.c-detail {
  grid-column: 1; font-family: var(--mono); font-size: 0.68rem; line-height: 1.45;
  color: var(--faint); overflow-wrap: anywhere; direction: ltr; text-align: start;
}
html[dir="rtl"] .c-detail { text-align: right; }
.badge {
  grid-column: 2; grid-row: 1 / span 2; align-self: center;
  min-width: 46px; padding: 2px 7px; border-radius: 999px; text-align: center;
  font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: 0.06em;
  background: var(--paper-3); color: var(--muted); border: 1px solid transparent;
}
.badge[data-state="pass"] { background: var(--ok-wash); color: var(--ok); border-color: rgba(15, 107, 70, 0.16); }
.badge[data-state="warn"] { background: var(--warn-wash); color: var(--warn); border-color: rgba(138, 90, 0, 0.16); }
.badge[data-state="fail"] { background: var(--danger-wash); color: var(--danger); border-color: rgba(180, 35, 24, 0.16); }
.posture-note { margin-top: 12px; font-size: 0.78rem; color: var(--faint); }

/* ---------------------------------------------------------------- stack -- */
.stack { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.stack h3 {
  padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
html:is([lang="ar"], [lang="bn"]) .stack h3 { font-family: var(--sans); font-size: 12px; letter-spacing: 0; text-transform: none; }
.stack ul { display: flex; flex-direction: column; gap: 7px; }
.stack li { font-size: 0.87rem; color: var(--body); }

/* -------------------------------------------------------------- contact -- */
.contact-grid {
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 5vw, 64px); align-items: start;
}
.contact-copy > p { margin-top: 14px; font-size: 0.98rem; line-height: 1.65; color: var(--body); max-width: 42ch; }
.details { margin-top: 28px; border-top: 1px solid var(--line); }
.details > div {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px;
  padding-block: 14px; border-bottom: 1px solid var(--line);
}
.details dt { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
html:is([lang="ar"], [lang="bn"]) .details dt { font-family: var(--sans); font-size: 0.82rem; letter-spacing: 0; text-transform: none; }
.details dd { font-size: 0.92rem; font-weight: 600; color: var(--ink); }
.details dd a { color: var(--ink); }
.details dd a:hover { color: var(--accent); }

/* Bengali sits lower than Latin at the same size: give display type more room
   so matras and conjuncts are never clipped. */
html[lang="bn"] .display { line-height: 1.34; }
html[lang="bn"] .h2 { line-height: 1.46; }
html[lang="bn"] .card h3,
html[lang="bn"] .work-card h3,
html[lang="bn"] .flow h3 { line-height: 1.5; }
html[lang="bn"] .stat b { line-height: 1.25; }

.form {
  display: flex; flex-direction: column; gap: 16px;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-2);
}
.form h3 { font-size: 1.05rem; font-weight: 700; color: var(--ink); letter-spacing: -0.015em; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--accent); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink); font-size: 0.94rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { resize: vertical; min-height: 132px; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--danger); }
.field.hp, .field .hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-status { min-height: 20px; font-size: 0.84rem; line-height: 1.5; color: var(--muted); }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--danger); }
.form-status a { color: inherit; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.form .btn { align-self: flex-start; }

/* ------------------------------------------------------------- 404 page -- */
.notfound-main {
  display: flex; flex-direction: column; gap: 18px;
  min-height: 56vh; justify-content: center;
  padding-block: clamp(56px, 10vw, 120px);
}
.notfound-main .h2 { max-width: 18ch; }
.notfound-main .lead { max-width: 54ch; }
.notfound-note { margin: 0; font-size: 0.88rem; color: var(--muted); }
.notfound-note a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------- footer -- */
.site-footer { border-top: 1px solid var(--line); background: var(--paper-2); }
.footer-grid {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px 32px; padding-block: 28px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.footer-brand .brand-mark { width: 24px; height: 24px; }
.footer-meta { font-size: 0.8rem; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.82rem; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

/* ------------------------------------------------------------- notfound -- */
.notfound { min-height: 100vh; display: flex; align-items: center; }
.notfound .section { padding-block: 80px; }
.notfound p { margin-top: 16px; color: var(--muted); }
.notfound .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* ---------------------------------------------------------------- motion -- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation-delay: 0s !important;
  }
}

/* ------------------------------------------------------------ responsive -- */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; }
  .plane { max-width: 560px; }
  .cards, .work { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow li { border-top: 1px solid var(--line); }
  .flow li:nth-child(-n+2) { border-top: 0; }
  .flow li:nth-child(odd) { border-inline-start: 0; }
  .stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .posture { grid-template-columns: 1fr; }
  .posture-summary { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .contact-grid { grid-template-columns: 1fr; }
  .section-head { grid-template-columns: 1fr; align-items: start; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  html.js .nav-links {
    position: absolute; inset-inline: 0; top: 100%;
    display: none; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 10px clamp(20px, 4vw, 40px) 18px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 28px -24px rgba(13, 18, 22, 0.4);
  }
  html.js .site-header[data-open="true"] .nav-links { display: flex; }
  .nav-links a { min-height: 44px; padding-inline: 8px; border-radius: var(--radius-sm); }
  .nav-links a:hover { background: var(--paper-2); }
  .nav-actions .btn { display: none; }
}

@media (max-width: 720px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 20px 18px; }
  .stat:nth-child(odd) { border-inline-start: 0; padding-inline-start: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .cards, .work, .stack { grid-template-columns: 1fr; }
  .row { grid-template-columns: 32px minmax(0, 1fr); gap: 6px 16px; }
  .row p { grid-column: 2; }
  .checks { grid-template-columns: 1fr; }
  .check:nth-child(odd) { border-inline-end: 0; }
  .form-row { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow li { border-inline-start: 0; }
  .flow li:nth-child(2) { border-top: 1px solid var(--line); }
  .footer-grid { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .hero-actions .btn { width: 100%; }
  .ask-form { flex-wrap: wrap; }
  .ask-form input { flex-basis: 100%; }
  .ask-form .btn { width: 100%; }
  .brand-role { display: none; }
  .lang-switch a { min-width: 31px; height: 34px; padding: 0 5px; font-size: 0.64rem; }
}

@media print {
  .site-header, .ask, .form, .site-footer .footer-links, .posture-summary .btn { display: none !important; }
  body { color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
  .section { padding-block: 24px; break-inside: avoid; }
}

/* ==========================================================================
   Interaction layer — v9
   Every state below reflects something real: scroll position, the selected
   layer, the active filter, a copied value, the clock. No decorative motion.
   ========================================================================== */

/* reading progress, pinned to the bottom edge of the sticky header */
.progress {
  position: absolute; inset-inline: 0; inset-block-end: -1px;
  height: 2px; overflow: hidden; pointer-events: none;
}
.progress i {
  display: block; width: 100%; height: 100%;
  background: linear-gradient(90deg, var(--accent), #2c6aa6);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.09s linear;
}
html[dir="rtl"] .progress i { transform-origin: right center; }

/* header search */
.nav-search {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--muted);
  font-size: 0.82rem; font-weight: 500; line-height: 1;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.nav-search:hover { border-color: var(--line-2); background: var(--paper-2); color: var(--ink); }
.nav-search svg { flex: none; }
.nav-search kbd {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--paper-2); color: var(--faint); white-space: nowrap;
}
html:is([lang="ar"], [lang="bn"]) .nav-search { font-size: 0.86rem; }

/* live Riyadh clock */
.clock { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.clock b { font-family: var(--mono); font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }

/* active section in the nav */
.nav-links a[aria-current="true"] { color: var(--ink); background: var(--paper-2); }
.nav-links a[aria-current="true"]::after {
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); margin-inline-start: 7px;
}

/* identity plane: panel swap */
.plane-detail > div { animation: panel-in 0.16s ease-out; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

/* stack filter — filters the four real groups */
.stack-filter { display: none; flex-wrap: wrap; gap: 6px; margin-bottom: 26px; }
html.js .stack-filter { display: flex; }
.stack-filter .chip[aria-pressed="true"] {
  background: var(--ink); border-color: var(--ink); color: #fff;
}
.stack-filter .chip[aria-pressed="true"]:hover { background: var(--ink); color: #fff; }

/* when one group is selected it becomes a compact row of tools */
.stack.is-filtered { display: block; }
.stack.is-filtered ul { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.stack.is-filtered li {
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); font-size: 0.84rem; line-height: 1.4;
}

/* case-study disclosure */
.more {
  margin-top: 0; padding-top: 12px; border-top: 1px solid var(--line);
}
.more summary {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 600; color: var(--accent);
  cursor: pointer; list-style: none;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: "+"; font-family: var(--mono); font-size: 0.95rem; line-height: 1; }
.more[open] summary::after { content: "\2013"; }
.more summary:hover { color: var(--accent-2); }
.more ul { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.more li {
  position: relative; padding-inline-start: 14px;
  font-size: 0.82rem; line-height: 1.55; color: var(--body);
}
.more li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 0.62em;
  width: 5px; height: 1px; background: var(--accent);
}
html:is([lang="ar"], [lang="bn"]) .more summary { font-size: 0.88rem; }
html:is([lang="ar"], [lang="bn"]) .more li { font-size: 0.9rem; line-height: 1.7; }

/* the work card's button follows the disclosure */
.work-card .more + .btn { margin-top: 2px; }

/* copy button beside an address */
.copy {
  margin-inline-start: 8px; padding: 2px 8px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); color: var(--muted);
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  vertical-align: 1px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.copy:hover { border-color: var(--accent); color: var(--accent); }
.copy.is-done { border-color: var(--ok); background: var(--ok-wash); color: var(--ok); }
html:is([lang="ar"], [lang="bn"]) .copy { font-family: var(--sans); font-size: 11px; letter-spacing: 0; text-transform: none; }

.posture-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.posture-actions .btn { margin-top: 0; }

/* search dialog */
body.palette-open { overflow: hidden; }
.palette {
  width: min(640px, calc(100vw - 28px));
  max-height: min(74vh, 640px);
  margin: auto; padding: 0; overflow: hidden;
  border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 32px 90px -28px rgba(13, 18, 22, 0.55);
}
.palette::backdrop { background: rgba(13, 18, 22, 0.34); }
.palette-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; border-bottom: 1px solid var(--line);
}
.palette-icon { color: var(--muted); flex: none; }
#palette-input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font-size: 1rem; color: var(--ink);
}
#palette-input::placeholder { color: var(--faint); }
#palette-input::-webkit-search-cancel-button { display: none; }
.palette-close {
  flex: none; padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--paper-2); color: var(--muted);
}
.palette-close:hover { border-color: var(--line-2); color: var(--ink); }
.palette-close kbd, .palette-foot kbd {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
}
.palette-list { max-height: min(50vh, 420px); overflow-y: auto; padding: 6px; }
.palette-item { border-radius: 9px; }
.palette-hit {
  display: flex; flex-direction: column; gap: 1px; width: 100%;
  padding: 9px 12px; border-radius: 9px; text-align: start;
}
.palette-item[aria-selected="true"] .palette-hit { background: var(--accent-wash); }
.palette-title { font-size: 0.92rem; font-weight: 600; line-height: 1.4; color: var(--ink); }
.palette-sub {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted);
}
html:is([lang="ar"], [lang="bn"]) .palette-sub { font-family: var(--sans); font-size: 11px; letter-spacing: 0; text-transform: none; }
.palette-empty { padding: 22px 18px; font-size: 0.88rem; line-height: 1.6; color: var(--muted); }
.palette-foot {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  padding: 9px 14px; border-top: 1px solid var(--line);
  background: var(--paper-2); font-size: 0.72rem; color: var(--muted);
}
.palette-foot kbd {
  padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--paper); color: var(--ink-2);
}

/* the brief highlight after a search jump */
.is-flash { animation: flash 1.5s ease-out 1; }
@keyframes flash {
  0%, 35% { background-color: var(--accent-wash); }
  100% { background-color: transparent; }
}

/* back to top */
.to-top {
  position: fixed; inset-block-end: 22px; inset-inline-end: 22px; z-index: 35;
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 50%;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow);
}
.to-top:hover { border-color: var(--ink-2); background: var(--paper-2); }

/* capability cards: the accent line appears on hover, tied to focus too */
.card { position: relative; overflow: hidden; }
.card::before {
  content: ""; position: absolute; inset-inline: 0; inset-block-start: 0; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left center;
  transition: transform 0.24s ease;
}
.card:hover::before, .card:focus-within::before { transform: scaleX(1); }
html[dir="rtl"] .card::before { transform-origin: right center; }

#creds { scroll-margin-top: 88px; }

/* typography: avoid a lonely last word where the engine supports it */
p, li { text-wrap: pretty; }

@media (max-width: 1180px) {
  .nav-search-label { display: none; }
  .nav-search { padding: 0 9px; }
}
@media (max-width: 900px) {
  .nav-search kbd { display: none; }
  .palette { max-height: 82vh; }
}
@media (max-width: 520px) {
  .nav-search { width: 38px; padding: 0; justify-content: center; }
  .nav-search-label, .nav-search kbd { display: none; }
  .palette-foot { display: none; }
  .to-top { inset-block-end: 16px; inset-inline-end: 16px; width: 40px; height: 40px; }
}
/* Nothing that needs JavaScript is shown before it can work: with the script
   off, the page is the plain document — no dead buttons, no placeholder clock. */
html:not(.js) .nav-search,
html:not(.js) .copy,
html:not(.js) .progress,
html:not(.js) .clock,
html:not(.js) #clock-2,
html:not(.js) .posture-actions { display: none !important; }

/* without JavaScript the layer switcher cannot switch, so every layer is shown
   instead of three inert buttons over one visible panel */
html:not(.js) .plane-map { display: none !important; }
html:not(.js) .plane-detail > div { display: block !important; }

@media print {
  .progress, .nav-search, .to-top, .palette, .stack-filter, .copy { display: none !important; }
}
