/* ==========================================================================
   KHWARAZM - base layer
   Reset, document defaults, typography, layout primitives.
   Direction is handled with logical properties only; there is no separate
   RTL stylesheet and no [dir="rtl"] override anywhere in this project.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-wrap: pretty;
}

h1 { font-size: var(--fs-h1); letter-spacing: -.02em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 650; }

p { margin: 0; text-wrap: pretty; }

a {
  color: var(--blue);
  text-decoration: none;
}
a:hover { color: var(--blue-hover); }

img, svg, video { max-width: 100%; }
img { height: auto; display: block; }

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
button { cursor: pointer; }

ul, ol { margin: 0; padding: 0; }
li { list-style: none; }

table { border-collapse: collapse; width: 100%; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0;
}

::selection { background: var(--blue); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: var(--radius-lg); }
::-webkit-scrollbar-track { background: transparent; }

/* Every interactive element shows the same 3px ring. Status is never
   communicated by colour alone anywhere in this design system. */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
  border-radius: var(--radius-xs);
}

/* Skip link, visible on focus only. */
.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  z-index: 100;
  background: var(--navy);
  color: #fff;
  padding: 12px 18px;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus {
  inset-inline-start: 0;
  color: #fff;
}

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--page-pad);
  width: 100%;
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: clamp(56px, 7vw, 96px); }
.section--tight { padding-block: clamp(48px, 6vw, 80px); }
.section--flush { padding-block: clamp(32px, 4vw, 48px); }

/* Sections are separated by a change of surface and a hairline, not by gaps. */
.band { background: var(--surface); border-block: 1px solid var(--border); }
.band--top { border-block: 0; border-top: 1px solid var(--border); }
.band--bottom { border-block: 0; border-bottom: 1px solid var(--border); }
.band--alt { background: var(--bg-alt); border-block: 0; border-bottom: 1px solid var(--border); }
.band--navy { background: var(--navy); color: #fff; border-block: 0; }
.band--navy a { color: #fff; }

/* Card grids reflow with auto-fit and need no media queries. */
.grid { display: grid; gap: clamp(20px, 2.4vw, 24px); }
.grid--280 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--300 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--320 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--340 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid--wide { gap: clamp(32px, 5vw, 64px); }

/* minmax(0,1fr) and not 1fr: the default minimum is auto, so one wide table
   blows the track out and pushes the next column below the fold. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
@media (min-width: 900px) {
  .split--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .split--aside { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); }
  .split--main { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
}

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack--sm { gap: var(--space-2); }
.stack--lg { gap: var(--space-6); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.cluster--sm { gap: var(--space-2); }
.cluster--between { justify-content: space-between; }
.cluster--end { justify-content: flex-end; }

/* --------------------------------------------------------------------------
   Typography helpers
   -------------------------------------------------------------------------- */

.display { font-size: var(--fs-display); line-height: 1.08; letter-spacing: -.02em; font-weight: 700; }
.lead { font-size: clamp(16px, 1.25vw, 18px); line-height: 1.65; color: var(--ink-2); max-width: 60ch; }
.prose { max-width: 70ch; color: var(--ink-2); }
.prose p + p { margin-top: 1em; }
.prose h2 { margin-top: 1.6em; margin-bottom: .5em; color: var(--ink); }
.prose h3 { margin-top: 1.4em; margin-bottom: .4em; color: var(--ink); }
.prose ul { margin: .8em 0; }
.prose li { position: relative; padding-inline-start: 18px; margin-bottom: .4em; }
.prose li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .65em;
  width: 6px;
  height: 6px;
  background: var(--teal);
}

/* The mono face carries labels, counts, identifiers and technical strings. */
.mono { font-family: var(--mono); }

.eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-mono-label);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
}
.eyebrow--light { color: var(--navy-mute); }

.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.text-center { text-align: center; }
.text-start { text-align: start; }

/* Data flow diagrams, charts, the CAPTCHA and numeric columns never mirror. */
.ltr { direction: ltr; }
.rtl { direction: rtl; }
.nowrap { white-space: nowrap; }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.hidden { display: none !important; }
.full { width: 100%; }
.flex-1 { flex: 1; min-width: 0; }
.mt-auto { margin-top: auto; }
.self-start { align-self: flex-start; }
.min-w-0 { min-width: 0; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: square;
}
.icon--sm { width: 16px; height: 16px; }
.icon--md { width: 18px; height: 18px; }
.icon--lg { width: 24px; height: 24px; }
.icon--xl { width: 34px; height: 34px; }

/* Utilities added for templates. Inline style attributes are not usable in
   this project: the CSP is style-src 'self', which blocks them, so every
   one-off value gets a named class here instead. */
.mx-auto { margin-inline: auto; }
.measure-sm { max-width: 560px; }
.measure-md { max-width: 720px; }
.icon--56 { width: 56px; height: 56px; }
.gap-0 { gap: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
