:root {
  --ink: #0A0A0A;
  --paper: #F5F2EA;
  --grey: #666662;
  --fog: #E7E4DD;
  --evidence: #285EA8;
  --conflict: #B63A32;
  --rule: rgba(10, 10, 10, 0.22);
  --max: 1280px;
}

* { box-sizing: border-box; }
html { font-synthesis: none; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Yekan Bakh", "Inter", system-ui, sans-serif;
  font-size: 18px;
  line-height: 32px;
  font-weight: 400;
  direction: rtl;
  text-align: right;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -40px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  z-index: 20;
}
.skip-link:focus { top: 8px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.wrap {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.site-header .wordmark { grid-column: 1; }
.site-header .main-nav { grid-column: 2; justify-self: start; }
.site-header .header-cta { grid-column: 3; justify-self: end; }

.wordmark {
  font-weight: 900;
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.wm-dot {
  width: 0.18em;
  height: 0.18em;
  background: var(--ink);
  border-radius: 50%;
  display: inline-block;
  margin-inline-start: 0.08em;
  transform: translateY(0.06em);
}

.main-nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.main-nav a {
  text-decoration: none;
  font-size: 15px;
  line-height: 26px;
  font-weight: 400;
}
.main-nav a:hover { color: var(--evidence); }

.header-cta,
.btn,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  padding: 12px 20px;
  border: 1px solid var(--ink);
  border-radius: 0;
  font-size: 15px;
  line-height: 24px;
  font-weight: 500;
}
.header-cta:hover,
.btn-primary:hover { opacity: 0.92; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  width: 40px;
  height: 40px;
}

.sub-header {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}
.back-home {
  color: var(--evidence);
  text-decoration: none;
  font-size: 15px;
  line-height: 26px;
}
.sub-header a:not(.back-home) {
  text-decoration: none;
  font-size: 15px;
}

.hero { padding: 64px 0 40px; }
.recon-tag {
  display: inline-block;
  border: 1px solid var(--ink);
  padding: 6px 10px;
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.eyebrow {
  color: var(--evidence);
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  margin: 0 0 16px;
}
.display,
h1.display {
  font-size: 64px;
  line-height: 76px;
  font-weight: 900;
  margin: 0 0 24px;
  max-width: 18ch;
}
h1 {
  font-size: 48px;
  line-height: 62px;
  font-weight: 800;
  margin: 0 0 16px;
}
h2 {
  font-size: 32px;
  line-height: 44px;
  font-weight: 700;
  margin: 0 0 16px;
}
h3 {
  font-size: 18px;
  line-height: 28px;
  font-weight: 700;
  margin: 0 0 8px;
}
.lede {
  max-width: 52ch;
  margin: 0 0 32px;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.text-link {
  color: var(--evidence);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.text-link:hover { color: var(--ink); }

.section { padding: 64px 0; }
.hairline { border: 0; border-top: 1px solid var(--rule); margin: 0; }

.recon-figure { margin: 0; }
.recon-figure img { width: 100%; height: auto; }
.recon-figure figcaption {
  font-size: 13px;
  line-height: 20px;
  color: var(--grey);
  margin-top: 12px;
}

.story-head {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: end;
  margin-bottom: 32px;
}
.story-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
  align-items: start;
}
.story-time {
  color: var(--evidence);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.story-label { font-weight: 700; }

.fog-panel {
  background: var(--fog);
  padding: 32px;
  position: relative;
  margin: 24px 0;
}
.blue-rail {
  box-shadow: inset -4px 0 0 var(--evidence);
}
.fog-panel p { margin: 12px 0 0; max-width: 60ch; }

.diag-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 32px;
}
.diag-num {
  color: var(--grey);
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  display: block;
  margin-bottom: 8px;
}

.sheet-teaser {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 48px;
  align-items: start;
}
.sheet-preview {
  border: 1px solid var(--ink);
  padding: 32px;
  background: var(--paper);
}
.sheet-meta {
  display: inline-block;
  border: 1px solid var(--ink);
  padding: 4px 8px;
  font-size: 12px;
  margin-bottom: 16px;
}
.gap-box {
  border: 1px dashed var(--ink);
  padding: 16px;
  font-weight: 700;
  margin: 16px 0;
}
.indep-block {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}

.close-cta { padding: 64px 0; }
.close-cta .eyebrow { color: var(--ink); }
.pilot-badge { display: inline-block; border: 1px solid var(--evidence); color: var(--evidence); font-size: 13px; padding: 4px 10px; margin-bottom: 16px; }

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 48px 0 64px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 32px;
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--evidence); }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col strong { font-weight: 700; margin-bottom: 8px; }
.footer-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.icon {
  stroke: var(--evidence);
  fill: none;
  stroke-width: 1.6;
  width: 18px;
  height: 18px;
}
.bale-icon { width: 18px; height: 18px; }

.page-hero { padding: 48px 0 24px; }
.presence-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}
.presence-item { padding-top: 16px; border-top: 1px solid var(--rule); }
.latin { font-family: "Inter", "Yekan Bakh", sans-serif; }

.method-steps { margin-top: 24px; }
.method-step {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}
.step-label {
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  color: var(--evidence);
}

.atlas-list { margin-top: 24px; }
.atlas-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 24px;
  padding: 32px 0;
  border-top: 1px solid var(--rule);
}
.atlas-code {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: var(--evidence);
  font-weight: 500;
}
.atlas-meta { color: var(--grey); font-size: 15px; line-height: 26px; }

.founder-block { padding: 48px 0; }
.future-panel { margin-top: 32px; }

.contact-page { padding: 48px 0 80px; text-align: center; }
.contact-page .wordmark { font-size: 48px; line-height: 62px; }
.contact-title {
  font-size: 18px;
  line-height: 32px;
  font-weight: 400;
  margin: 16px 0 48px;
}
.contact-list {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: right;
}
.contact-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  text-decoration: none;
  background: transparent;
  color: var(--ink);
  width: 100%;
  cursor: pointer;
  appearance: none;
}
.contact-item:hover .contact-name { color: var(--evidence); }
.contact-item--primary {
  background: var(--paper, #F5F2EA);
  border: 1px solid var(--ink, #0A0A0A);
  border-bottom: 1px solid var(--ink, #0A0A0A);
  padding: 20px 14px;
  margin-bottom: 8px;
}
.contact-item--primary .contact-name {
  color: var(--ink, #0A0A0A);
  font-weight: 700;
}
.contact-name { font-weight: 500; }
.contact-value { color: var(--grey); font-size: 15px; }
.intl-link .contact-name { color: var(--evidence); }

.phone-groups {
  display: inline-flex;
  flex-direction: row;
  direction: ltr;
  unicode-bidi: isolate;
  gap: 0.4em;
}
.phone-group {
  direction: ltr;
  unicode-bidi: isolate;
}

.sheet-page { padding: 48px 0 80px; }
.sheet-frame {
  border: 1px solid var(--ink);
  padding: 40px;
  max-width: 720px;
  margin: 32px auto 0;
  background: var(--paper);
}
.sheet-brand {
  font-weight: 900;
  margin-bottom: 24px;
}
.sheet-gap { margin: 24px 0; }
.sheet-why, .sheet-next { margin: 24px 0; }
.blue-rule {
  height: 4px;
  background: var(--evidence);
  border: 0;
  margin: 32px 0 16px;
}
.sheet-bound { font-size: 15px; line-height: 26px; color: var(--grey); }
.share-row { margin-top: 24px; text-align: center; }

/* Harmonized with primitives: mid desktop 2-col chrome, phone ≤800 1-col */
@media (max-width: 1100px) {
  .display, h1.display { font-size: 48px; line-height: 62px; }
  .diag-grid, .footer-grid, .presence-grid { grid-template-columns: 1fr 1fr; }
  .sheet-teaser, .story-head { grid-template-columns: 1fr; }
}

.legal-page { padding: 48px 0 80px; max-width: 760px; }
.legal-foot { margin-top: 32px; }

@media (max-width: 800px) {
  .wrap, .site-header, .sub-header { width: calc(100% - 32px); }
  .display, h1.display { font-size: 42px; line-height: 54px; max-width: none; }
  h1 { font-size: 34px; line-height: 44px; }
  h2 { font-size: 28px; line-height: 38px; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; grid-column: 2; justify-self: start; }
  .site-header { grid-template-columns: auto auto 1fr; }
  .site-header .header-cta { grid-column: 3; }
  .main-nav {
    display: none;
    position: absolute;
    top: 72px;
    inset-inline: 16px;
    background: var(--paper);
    border: 1px solid var(--ink);
    flex-direction: column;
    padding: 16px;
    z-index: 10;
  }
  .main-nav.open { display: flex; }
  .diag-grid, .footer-grid, .presence-grid { grid-template-columns: 1fr; }
  .story-row, .method-step, .atlas-item { grid-template-columns: 1fr; gap: 8px; }
  .contact-item {
    grid-template-columns: 28px 1fr;
    grid-template-areas: "icon name" "icon extra";
  }
  .contact-item > :first-child { grid-area: icon; }
  .contact-item > :nth-child(2) { grid-area: name; }
  .contact-item > :nth-child(3) {
    grid-area: extra;
    justify-self: start;
    max-width: 100%;
  }
}

/* Desktop polish — after base rules so cascade wins */
@media (min-width: 801px) {
  .wrap,
  .site-header,
  .sub-header {
    width: min(var(--max), calc(100% - 64px));
  }
  .display,
  h1.display {
    max-width: 28ch;
  }
}

@media (min-width: 1100px) {
  .wrap,
  .site-header,
  .sub-header {
    width: min(var(--max), calc(100% - 80px));
  }
  .display,
  h1.display {
    max-width: 34ch;
  }
}
