/* Qarain design system — dark evidence-room. Inherited brand DNA:
   near-black surfaces, light as evidence, warm paper contrast, weight = certainty. */

:root {
  --black: #050505;
  --surface: #0C0C0D;
  --marble: #111113;
  --paper: #F5F2ED;
  --white: #FFFFFF;
  --grey: #A8A49C;      /* body-secondary: >=7:1 on --black */
  --dim: #6E6A63;       /* decorative only, never body text */
  --light-warm: #FBF6E9;
  --gold: #E8B987;      /* the one pre-attentive accent */
  --verify: #E8B987;
  --investigate: #9AA0A6;
  --hold: #7FA0B8;
  --line: rgba(255,255,255,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: 'Yekan Bakh', -apple-system, system-ui, sans-serif;
  background: var(--black);
  color: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.75;
}
body[data-lang="en"] { font-family: 'Inter', 'Yekan Bakh', system-ui, sans-serif; word-spacing: 0.04em; }

/* Latin runs inside RTL text stay readable */
[dir="rtl"] a[href^="mailto:"], [dir="rtl"] .ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

a { color: var(--light-warm); text-underline-offset: 3px; }
a:hover { color: var(--white); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.visually-hidden, .skip-link {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; top: 0.5rem; inset-inline-start: 0.5rem; width: auto; height: auto;
  clip: auto; z-index: 2000; background: var(--paper); color: var(--black);
  padding: 0.6rem 1rem; border-radius: 4px;
}

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; gap: 1.4rem;
  padding: 0.9rem 1.5rem;
  background: rgba(5,5,5,0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { text-decoration: none; line-height: 1.15; margin-inline-end: auto; }
.brand-name { display: block; font-size: 1.1rem; font-weight: 800; letter-spacing: 0.02em; color: var(--white); }
.brand-parent { display: block; font-size: 0.62rem; font-weight: 400; color: var(--grey); letter-spacing: 0.05em; }
.site-nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--grey); text-decoration: none; font-size: 0.85rem; padding: 0.35rem 0.1rem;
  min-height: 24px; display: inline-flex; align-items: center;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--white); }
.head-right { display: flex; align-items: center; gap: 0.8rem; }
.lang-switch {
  display: flex; gap: 0.15rem; background: rgba(255,255,255,0.05);
  border: 1px solid var(--line); border-radius: 100px; padding: 0.2rem;
}
.lang-btn {
  color: var(--grey); text-decoration: none; font-size: 0.74rem;
  padding: 0.3rem 0.7rem; border-radius: 100px; min-width: 24px; min-height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
}
.lang-btn.active { background: rgba(255,255,255,0.12); color: var(--white); }
.head-cta {
  color: var(--black); background: var(--gold); text-decoration: none;
  font-size: 0.85rem; font-weight: 700; padding: 0.45rem 1rem; border-radius: 100px;
  min-height: 24px; display: inline-flex; align-items: center; white-space: nowrap;
}
.head-cta:hover { color: var(--black); background: var(--light-warm); }

@media (max-width: 760px) {
  .site-nav { display: none; } /* footer nav carries the full map on mobile */
}

/* ---------- hero / evidence field ---------- */
.hero {
  position: relative; min-height: 92vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: var(--black);
}
#field { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.field-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: transparent; }
.hero-inner { position: relative; z-index: 2; max-width: 780px; padding: 2rem; text-align: center; }
.hero-eyebrow { color: var(--grey); font-size: 0.9rem; letter-spacing: 0.04em; margin-bottom: 1.4rem; }
.hero-title {
  font-size: clamp(1.9rem, 5vw, 3.4rem); font-weight: 900; line-height: 1.25;
  letter-spacing: -0.02em; color: var(--white);
  filter: blur(var(--clarity-blur, 0px));
  opacity: var(--clarity-opacity, 1);
  transition: filter 0.6s ease, opacity 0.6s ease;
  text-shadow: 0 0 44px rgba(251,246,233,0.12);
}
.hero-sub { margin-top: 1.4rem; font-size: clamp(1rem, 1.9vw, 1.2rem); font-weight: 300; color: var(--grey); max-width: 620px; margin-inline: auto; }
.hero-actions { margin-top: 2.4rem; display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }
.hero-legend {
  position: absolute; bottom: 1.4rem; inset-inline: 0; text-align: center;
  color: var(--grey); font-size: 0.8rem; z-index: 2; padding: 0 2rem;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.85rem 1.7rem; border-radius: 100px; text-decoration: none;
  font-size: 0.95rem; font-weight: 700; min-height: 44px; border: 1px solid transparent;
}
.btn-primary { background: var(--gold); color: var(--black); }
.btn-primary:hover { background: var(--light-warm); color: var(--black); }
.btn-quiet { background: transparent; color: var(--paper); border-color: var(--line); font-weight: 400; }
.btn-quiet:hover { border-color: var(--grey); color: var(--white); }

/* ---------- blocks ---------- */
section.block, article.block { padding: 7rem 2rem; max-width: 820px; margin: 0 auto; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 900; line-height: 1.3; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.15rem, 2.2vw, 1.45rem); font-weight: 700; margin-bottom: 0.9rem; }
h3 { font-size: 1.05rem; font-weight: 700; }
p + p { margin-top: 0.7rem; }
section.block section, article.block section { margin-top: 3.2rem; }
.lede { margin-top: 1.1rem; font-size: clamp(1.02rem, 1.9vw, 1.2rem); font-weight: 300; color: var(--grey); }
.dim { color: var(--grey); font-size: 0.92rem; }
.eyebrow { color: var(--gold); font-size: 0.82rem; letter-spacing: 0.06em; margin-bottom: 0.8rem; }

.tri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.4rem; }
.tri p { color: var(--grey); font-size: 0.95rem; }
.tri h2 { color: var(--white); }
@media (max-width: 760px) { .tri { grid-template-columns: 1fr; } }

/* missingness strip — the doctrine made visible */
.missingness {
  margin-top: 2.2rem; padding: 0.9rem 1.1rem;
  border: 1px dashed var(--line); border-radius: 6px;
  color: var(--grey); font-size: 0.92rem; display: flex; gap: 0.7rem; align-items: baseline;
}
.miss-dot {
  flex: none; width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid var(--grey); background: transparent; transform: translateY(1px);
}

/* second-opinion frame */
.second-opinion { text-align: center; }
.second-line { font-size: clamp(1.15rem, 2.4vw, 1.6rem); font-weight: 300; color: var(--grey); }
.second-line:last-of-type { color: var(--white); font-weight: 700; }
.bumpers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 3.4rem; text-align: start; }
.bumper { border: 1px solid var(--line); border-radius: 8px; padding: 1.3rem; background: var(--surface); }
.bumper h3 { color: var(--white); margin-bottom: 0.4rem; }
.bumper p { color: var(--grey); font-size: 0.9rem; }
.bumper-note { margin-top: 1.6rem; color: var(--grey); font-size: 0.92rem; }
@media (max-width: 760px) { .bumpers { grid-template-columns: 1fr; } }

/* products */
.monetize-lede { color: var(--grey); margin-bottom: 2rem; }
.feature-card {
  display: block; text-decoration: none; background: var(--marble);
  border: 1px solid rgba(232,185,135,0.35); border-radius: 10px; padding: 1.8rem;
}
.feature-card:hover { border-color: var(--gold); }
.feature-flag { color: var(--gold); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; margin-bottom: 0.6rem; }
.feature-flag.soon { color: var(--grey); }
.feature-card h3 { color: var(--white); font-size: 1.3rem; }
.feature-card p { color: var(--grey); margin-top: 0.5rem; }
.prod-meta { color: var(--paper); font-size: 0.9rem; }
.prod-reverse { color: var(--grey); font-size: 0.88rem; }
.prod-list { list-style: none; margin-top: 1.4rem; }
.prod-list li + li { margin-top: 0.6rem; }
.prod-list a {
  display: grid; gap: 0.15rem; text-decoration: none;
  padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 8px;
}
.prod-list a:hover { border-color: var(--grey); }
.prod-list strong { color: var(--white); }
.prod-short { color: var(--grey); font-size: 0.9rem; }
.soon { color: var(--grey); font-size: 0.78rem; border: 1px solid var(--line); border-radius: 100px; padding: 0.1rem 0.6rem; margin-inline-start: 0.5rem; }
.anchor-note { margin-top: 2rem; color: var(--grey); font-size: 0.9rem; }

.prod-grid { display: grid; gap: 1.2rem; margin-top: 2.4rem; }
.prod-card { display: block; text-decoration: none; border: 1px solid var(--line); border-radius: 10px; padding: 1.6rem; background: var(--surface); }
.prod-card.first { border-color: rgba(232,185,135,0.35); background: var(--marble); }
.prod-card:hover { border-color: var(--grey); }
.prod-card.first:hover { border-color: var(--gold); }
.prod-card h2 { color: var(--white); margin-bottom: 0.3rem; }
.prod-card p { color: var(--grey); font-size: 0.93rem; }
.prod-card .missingness { margin-top: 1.1rem; }

/* single product */
.prod-head .pacing-line { font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 300; color: var(--grey); }
.prod-head h1 { margin-bottom: 1rem; }
.offer-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem;
  margin-top: 2.6rem; padding: 1.4rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.offer-label { font-size: 0.78rem; color: var(--grey); letter-spacing: 0.06em; margin-bottom: 0.3rem; }
.offer-strip p { color: var(--paper); font-size: 0.98rem; }
@media (max-width: 640px) { .offer-strip { grid-template-columns: 1fr; } }
.posture-example .artifact-mini { border: 1px solid var(--line); border-radius: 8px; padding: 1.2rem; background: var(--surface); display: grid; gap: 0.6rem; }
.cta-row { margin-top: 3rem; display: flex; gap: 0.9rem; flex-wrap: wrap; align-items: center; }
.cross-links { margin-top: 3rem; color: var(--grey); }
.soon-note { color: var(--grey); }

/* posture chips — calm, never alarm */
.posture { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.86rem; font-weight: 700; }
.p-dot { width: 9px; height: 9px; border-radius: 50%; }
.posture-verify { color: var(--verify); } .posture-verify .p-dot { background: var(--verify); }
.posture-investigate { color: var(--investigate); } .posture-investigate .p-dot { background: var(--investigate); }
.posture-hold { color: var(--hold); } .posture-hold .p-dot { background: var(--hold); }

/* sample artifacts */
.fictional { color: var(--grey); font-size: 0.78rem; letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.artifact { margin-top: 3.6rem; border: 1px solid var(--line); border-radius: 10px; padding: 1.8rem; background: var(--surface); }
.artifact header h2 { margin-bottom: 0.6rem; }
.artifact .missingness { margin-top: 1.2rem; }
.evidence { width: 100%; border-collapse: collapse; margin-top: 1.6rem; font-size: 0.9rem; }
.evidence th { text-align: start; color: var(--grey); font-weight: 400; font-size: 0.78rem; letter-spacing: 0.05em; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); }
.evidence td { padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--line); color: var(--paper); vertical-align: top; }
.evidence tr:last-child td { border-bottom: none; }
.row-missing td { color: var(--grey); }
.row-missing td:first-child { border-inline-start: 2px dashed var(--grey); }
.artifact-next { margin-top: 1.6rem; display: grid; gap: 0.4rem; }
.artifact-next h3 { color: var(--grey); font-size: 0.8rem; letter-spacing: 0.06em; margin-top: 0.8rem; }
.artifact-next p { color: var(--paper); font-size: 0.94rem; }
@media (max-width: 640px) {
  .evidence thead { display: none; }
  .evidence tr { display: block; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
  .evidence td { display: block; border: none; padding: 0.15rem 0; }
  .row-missing td:first-child { border: none; }
}

/* method */
.pillars { margin-top: 1.6rem; padding-inline-start: 1.2rem; display: grid; gap: 0.7rem; color: var(--grey); }
.pillars strong { color: var(--white); }
.pillar { margin-top: 3rem; }
.pillar-n { color: var(--gold); font-weight: 400; margin-inline-end: 0.3rem; }
.pillar p { color: var(--grey); }
.classes { margin-top: 1rem; padding-inline-start: 1.2rem; display: grid; gap: 0.8rem; color: var(--grey); }
.classes strong { color: var(--white); display: block; }
.deeper ul, .cannot ul { margin-top: 1rem; padding-inline-start: 1.2rem; display: grid; gap: 0.8rem; color: var(--grey); }

/* independence / boundaries */
.independence section ul { margin-top: 0.8rem; padding-inline-start: 1.2rem; display: grid; gap: 0.5rem; color: var(--paper); }
.pledge { border: 1px solid rgba(232,185,135,0.35); border-radius: 10px; padding: 1.8rem; background: var(--marble); }
.pledge-sign { margin-top: 1.4rem; color: var(--gold); font-weight: 700; }
.nevers { margin-top: 2.2rem; padding-inline-start: 1.4rem; display: grid; gap: 1rem; font-size: 1.02rem; color: var(--paper); }
.nevers li::marker { color: var(--gold); }

/* privacy */
.privacy-links { margin-top: 1.6rem; padding-inline-start: 1.2rem; display: grid; gap: 0.6rem; }
.privacy section p { color: var(--grey); }

/* decision lens */
.lens-privacy { margin-top: 0.6rem; color: var(--grey); font-size: 0.88rem; }
.lens-frames { margin-top: 3rem; }
.lens-frame h2 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); }
.lens-progress { display: flex; gap: 0.4rem; margin-bottom: 1.4rem; }
.lens-progress span { width: 22px; height: 3px; border-radius: 2px; background: var(--line); }
.lens-progress .on { background: var(--gold); }
.lens-progress .done { background: var(--grey); }
.lens-opts { margin-top: 1.4rem; display: grid; gap: 0.7rem; }
.lens-opt {
  text-align: start; background: var(--surface); color: var(--paper);
  border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.2rem;
  font: inherit; font-size: 0.97rem; cursor: pointer; min-height: 44px;
}
.lens-opt:hover { border-color: var(--gold); color: var(--white); }
.lens-back {
  margin-top: 1.6rem; background: none; border: none; color: var(--grey);
  font: inherit; font-size: 0.9rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
  min-height: 24px;
}
.lens-back:hover { color: var(--white); }
.lens-result .result-card { border: 1px solid rgba(232,185,135,0.35); border-radius: 10px; padding: 1.6rem; background: var(--marble); margin-top: 1rem; display: grid; gap: 0.6rem; }
.lens-result .result-card h3 { color: var(--white); font-size: 1.25rem; }
.lens-result .result-card p { color: var(--grey); }
.lens-result .result-note { color: var(--grey); font-size: 0.92rem; margin-top: 0.8rem; }
.lens-no { margin-top: 2rem; color: var(--grey); font-size: 0.95rem; }

/* exhale + footer */
.exhale { text-align: center; }
.exhale-line { font-size: clamp(1.2rem, 2.6vw, 1.7rem); font-weight: 300; color: var(--grey); }
.site-foot { border-top: 1px solid var(--line); padding: 3.5rem 2rem 2.5rem; text-align: center; }
.foot-line { color: var(--paper); font-size: 0.95rem; }
.foot-line.dim { color: var(--grey); font-size: 0.88rem; margin-top: 0.4rem; }
.foot-nav { margin-top: 1.8rem; display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; }
.foot-nav a { color: var(--grey); text-decoration: none; font-size: 0.86rem; min-height: 24px; display: inline-flex; align-items: center; }
.foot-nav a:hover { color: var(--white); }
.foot-dot { margin-top: 2.6rem; }
.foot-dot img { width: 58px; height: auto; opacity: 0.85; }
.foot-copy { margin-top: 1rem; color: var(--grey); font-size: 0.8rem; }

@media (prefers-reduced-motion: reduce) {
  .hero-title { transition: none; filter: none !important; opacity: 1 !important; }
  * { animation: none !important; }
}
