:root {
  color-scheme: light;

  --brand-ink: #071324;
  --brand-slate: #16233a;
  --brand-well: #101b2e;
  --brand-mustard: #c9a100;
  --brand-bronze: #7f6600;
  --brand-steel: #8b99ab;
  --brand-paper: #fbfbfc;
  --brand-mist: #f1f2f5;

  --ground: var(--brand-mist);
  --surface: var(--brand-paper);
  --surface-raised: #ffffff;
  --surface-sunken: #e9ebf0;
  --chrome: var(--brand-ink);
  --on-chrome: var(--brand-paper);
  --text: var(--brand-ink);
  --text-secondary: #5a6472;
  --border: #d5d7dd;
  --rule: #e6e8ec;
  --accent: var(--brand-mustard);
  --accent-text: var(--brand-bronze);
  --accent-on: var(--brand-ink);
  --shadow: 6px 6px 0 rgba(7, 19, 36, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --ground: var(--brand-well);
  --surface: var(--brand-slate);
  --surface-raised: #1d2c45;
  --surface-sunken: #0b1524;
  --chrome: var(--brand-slate);
  --text: var(--brand-paper);
  --text-secondary: var(--brand-steel);
  --border: rgba(251, 251, 252, 0.1);
  --rule: rgba(251, 251, 252, 0.07);
  --accent-text: var(--brand-mustard);
  --shadow: 6px 6px 0 rgba(0, 0, 0, 0.34);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;

    --ground: var(--brand-well);
    --surface: var(--brand-slate);
    --surface-raised: #1d2c45;
    --surface-sunken: #0b1524;
    --chrome: var(--brand-slate);
    --text: var(--brand-paper);
    --text-secondary: var(--brand-steel);
    --border: rgba(251, 251, 252, 0.1);
    --rule: rgba(251, 251, 252, 0.07);
    --accent-text: var(--brand-mustard);
    --shadow: 6px 6px 0 rgba(0, 0, 0, 0.34);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--ground);
  font-family:
    "Source Sans 3", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Arial, "Noto Sans Arabic", "IBM Plex Sans Arabic", sans-serif;
  line-height: 1.6;
}

[dir="rtl"] body,
body:lang(ar) {
  font-family:
    "IBM Plex Sans Arabic", "Noto Sans Arabic", Inter, ui-sans-serif, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  border-radius: 6px;
  background: var(--chrome);
  color: var(--on-chrome);
  padding: 0.75rem 1rem;
}

[dir="rtl"] .skip-link {
  left: auto;
  right: 1rem;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* The lockup derives every dimension from its own font-size, the way the logo
   sheet's spec table does — mark 33 x 28, stroke W/16, seal 0.34W, radius W/20,
   gap 0.5W, rule stroke/2. Resizing the lockup is therefore one number, and the
   breakpoint below only changes that number. */
.tq-lockup {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-content: start;
  font-size: 1.35rem;
  column-gap: 0.611em; /* 0.5W, where W = 1.222em */
  color: var(--text);
}

/* Height rule: the mark stands the full height of the type beside it — Latin
   cap to Arabic descender — not the cap height alone. 28/27 of the Latin size,
   at the mark's own 33:28 aspect. */
.tq-mark {
  display: block;
  height: 1.037em;
  width: auto;
}

.tq-lockup-en {
  font-family: "Libre Caslon Text", "Times New Roman", serif;
  font-size: 1em;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* One gold across the lockup — the Arabic matches the seal and the rule. The
   logotype is exempt from the contrast floors that push accent text elsewhere
   down to --accent-text. */
.tq-lockup-ar {
  font-family: "IBM Plex Sans Arabic", "Noto Sans Arabic", sans-serif;
  font-size: 0.94em; /* spec: Arabic 0.94 x Latin */
  font-weight: 600;
  line-height: 1;
  letter-spacing: normal;
  color: var(--accent);
}

/* Rule weight is stroke / 2 = W / 32. Floored at 1px so it never rounds away
   at the small end; the logo sheet ships the same relationship. */
.tq-lockup-rule {
  grid-column: 1 / -1;
  height: max(1px, 0.038em);
  margin-top: 0.3em;
  background: var(--accent);
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
  font-size: 0.86rem;
  font-weight: 800;
}

.lang-switch a {
  padding: 0.45rem 0.8rem;
  color: var(--text-secondary);
}

.lang-switch a[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-on);
}

.tq-theme-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.tq-theme-toggle button {
  appearance: none;
  border: 0;
  background: none;
  padding: 0.45rem 0.8rem;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.tq-theme-toggle button[aria-pressed="true"] {
  background: var(--surface-sunken);
  color: var(--text);
}

.header-link {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  background: var(--surface);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr);
  gap: 2rem;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 5.5rem 1.5rem 4rem;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

[dir="rtl"] .eyebrow {
  letter-spacing: 0.04em;
}

/* Body copy carries tokens with no wrap opportunity in them — app.taqareer.ai,
   تقارير.ai — inside narrow panels. Breaking those mid-token is conventional and
   is the only thing standing between them and an overflow. */
p {
  overflow-wrap: anywhere;
}

/* Display type does not get `anywhere`. On a headline that rule does not prevent
   a bug, it swaps one for another: instead of overflowing it hard-breaks the word
   ("workspac / e"), which is worse and much easier to ship without noticing.
   `break-word` breaks only when a word cannot fit a line of its own, so it stays
   a genuine last resort — and the h1 clamps below are sized so it never fires. */
h1,
h2,
h3 {
  overflow-wrap: break-word;
}

h1 {
  max-width: 800px;
  margin: 0;
  font-family: "Libre Caslon Text", "IBM Plex Sans Arabic", "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 6.9rem);
  line-height: 0.93;
  letter-spacing: -0.02em;
}

.hero-lede {
  max-width: 690px;
  margin: 1.5rem 0 0;
  color: var(--text-secondary);
  font-size: 1.15rem;
}

.layer-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.layer-summary span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 0.45rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 800;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 3px;
  padding: 0.72rem 1rem;
  font-weight: 800;
}

.button.primary {
  background: var(--accent);
  color: var(--accent-on);
  box-shadow: var(--shadow);
}

.button.secondary {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  padding: 2rem;
  min-height: 420px;
}

.panel-orbit {
  position: absolute;
  inset: 1rem;
  opacity: 0.58;
  pointer-events: none;
}

.panel-orbit span {
  position: absolute;
  border: 1px solid var(--border);
  border-radius: 50%;
}

.panel-orbit span:nth-child(1) {
  inset: 0.25rem;
}

.panel-orbit span:nth-child(2) {
  inset: 3rem 2rem 2rem 4rem;
}

.panel-orbit span:nth-child(3) {
  right: 2rem;
  bottom: 3rem;
  width: 9rem;
  height: 9rem;
}

.panel-label {
  position: relative;
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  margin: 0;
  padding: 0.42rem 0.7rem;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 800;
  background: var(--surface-sunken);
}

.arabic-name {
  position: relative;
  margin: 4.25rem 0 1.2rem;
  color: var(--text);
  font-size: clamp(3rem, 8vw, 5.8rem);
  font-weight: 700;
  line-height: 1;
}

.panel-copy {
  position: relative;
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.18rem;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  max-width: 1180px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  background: var(--border);
}

.trust-strip span {
  min-height: 72px;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  text-align: center;
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.section-heading {
  max-width: 740px;
}

h2 {
  margin: 0;
  font-family: "Libre Caslon Text", "IBM Plex Sans Arabic", "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.03;
}

.section-heading p:not(.eyebrow),
.split-section > p {
  margin: 1rem 0 0;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.service-card {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  padding: 1.35rem;
}

.service-number {
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 900;
}

.service-card h3 {
  margin: 1.25rem 0 0.75rem;
  font-size: 1.2rem;
  line-height: 1.2;
}

.service-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.96rem;
}

.layer-section {
  border-top: 1px solid var(--rule);
}

.layer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.layer-card {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface-raised);
  padding: 1.5rem;
}

.layer-card span {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

[dir="rtl"] .layer-card span {
  letter-spacing: 0.02em;
}

.layer-card h3 {
  margin: 0.9rem 0 0.75rem;
  font-size: 1.35rem;
  line-height: 1.2;
}

.layer-card p {
  margin: 0;
  color: var(--text-secondary);
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  border-top: 1px solid var(--rule);
}

.invite-note {
  margin-top: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
  border-top: 1px solid var(--rule);
  padding: 1.5rem;
  color: var(--text-secondary);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 920px) {
  .hero,
  .split-section {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 3.25rem;
  }

  .service-grid,
  .trust-strip,
  .layer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-panel {
    min-height: 360px;
  }
}

@media (max-width: 620px) {
  .site-header,
  .site-footer,
  .header-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-link,
  .lang-switch,
  .tq-theme-toggle {
    width: 100%;
    justify-content: center;
  }

  /* One number resizes the whole lockup — mark, both wordmarks, gap and rule
     all derive from it. */
  .tq-lockup {
    font-size: 1.15rem;
  }

  /* Libre Caslon Text sets ~12% wider than the Fraunces it replaced: the longest
     English word, "workspace", measures 5.491px per px of font-size, against
     4.914 for Fraunces at the same size. So the 16vw carried over from the
     pre-rebrand sheet no longer fits — it put that word at 100.2% of the line
     box at 390px and 103.4% at 320px, hard-breaking it as "workspac / e" on
     every phone narrower than ~398px.

     Size against the content box — 100vw less the two 1.5rem hero gutters —
     rather than against the viewport. The constraint is linear in the content
     box, so this holds the longest word at a constant 90% of the line at every
     width instead of letting the margin collapse as the screen narrows. The
     2.4rem floor keeps that true down to ~258px; the 4.3rem cap takes over at
     ~468px, where it is already the more conservative of the two. */
  h1 {
    font-size: clamp(2.4rem, calc((100vw - 3rem) * 0.164), 4.3rem);
  }

  .service-grid,
  .trust-strip,
  .layer-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions .button {
    width: 100%;
  }
}
