/* ============================================================================
   KINSCROLL — landing page
   Layered on tokens.css. Adds no colour of its own: every value below is a
   token or a composition of tokens. The chrome stays hueless; the only
   chromatic pixels on this page are in the constellation, where they mean
   something.
   ========================================================================== */

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-size: var(--fs-lg);            /* marketing body, not the app's 13px */
  line-height: var(--lh-normal);
  overflow-x: hidden;
  font-feature-settings: var(--num-prose);
}

h1, h2, h3 { margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
img, svg { max-width: 100%; }

kbd {
  font-family: var(--font-mono);
  font-size: .82em;
  font-weight: var(--fw-medium);
  line-height: 1;
  padding: var(--sp-1) var(--sp-15);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
  background: var(--surface);
  color: var(--text-dim);
  white-space: nowrap;
}

.vh {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip {
  position: absolute; left: var(--sp-4); top: var(--sp-4);
  transform: translateY(-200%);
  z-index: var(--z-modal);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-4);
  text-decoration: none;
  transition: transform var(--dur-2) var(--ease-out);
}
.skip:focus { transform: translateY(0); }

/* ---------------------------------------------------------------- shell -- */

.band,
.hero,
.site-in,
.foot-in { width: min(1180px, 100% - clamp(32px, 7vw, 96px)); margin-inline: auto; }

.band { padding-block: clamp(56px, 8.5vw, 112px); }
.band-tight { padding-block: clamp(40px, 5vw, 64px); }

.band-head { max-width: 62ch; }
.band-head h2 { margin-top: var(--sp-3); }
.band-lede { margin-top: var(--sp-4); color: var(--text-dim); font-size: var(--fs-lg); }

h1 {
  font-family: var(--font-display);
  font-variation-settings: "wdth" var(--wd-narrow);
  font-weight: var(--fw-semibold);
  font-size: clamp(34px, 5.6vw, var(--fs-5xl));
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
}

h2 {
  font-family: var(--font-display);
  font-variation-settings: "wdth" var(--wd-display);
  font-weight: var(--fw-semibold);
  font-size: clamp(24px, 3.2vw, var(--fs-3xl));
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-snug);
  text-wrap: balance;
}

h3 {
  font-family: var(--font-display);
  font-variation-settings: "wdth" var(--wd-display);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-xl);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
}

/* ------------------------------------------------------------- controls -- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  line-height: 1;
  padding: var(--sp-25) var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out),
              color var(--dur-2) var(--ease-out);
}
.btn:hover { background: var(--surface-alt); border-color: var(--line-strong); color: var(--text); }

.btn-primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--ink);
  font-weight: var(--fw-semibold);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }

.btn-quiet { background: transparent; }
.btn-quiet:hover { background: var(--tint-1); }

.btn-lg { font-size: var(--fs-lg); padding: var(--sp-35) var(--sp-6); }
.btn-sm { font-size: var(--fs-sm); padding: var(--sp-15) var(--sp-3); }

/* --------------------------------------------------------------- header -- */

.site {
  position: sticky; top: 0; z-index: var(--z-header);
  background: var(--glass-heavy);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-in {
  display: flex; align-items: center; gap: var(--sp-5);
  min-height: 60px;
  padding-block: var(--sp-2);
}

.brand {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  color: var(--text); text-decoration: none;
  margin-inline-end: auto;
}
.brand-mark { width: 22px; height: 22px; color: var(--accent); fill: currentColor; flex: none; }
.brand-word {
  font-family: var(--font-display);
  font-variation-settings: "wdth" var(--wd-narrow);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-xl);
  letter-spacing: var(--ls-snug);
  line-height: 1;
}

.site-nav { display: flex; gap: var(--sp-5); }
.site-nav a {
  color: var(--text-dim); text-decoration: none;
  font-size: var(--fs-md); font-weight: var(--fw-medium);
  padding-block: var(--sp-1);
}
.site-nav a:hover { color: var(--text); }

.site-act { display: flex; align-items: center; gap: var(--sp-3); }

.themebtn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-ui); font-size: var(--fs-sm);
  color: var(--text-dim);
  background: none; border: 1px solid transparent; border-radius: var(--r-sm);
  padding: var(--sp-15) var(--sp-2);
  cursor: pointer;
  transition: color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
.themebtn:hover { color: var(--text); border-color: var(--line); }
.themebtn-face {
  width: 13px; height: 13px; border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: linear-gradient(90deg, var(--bg) 50%, var(--text) 50%);
  flex: none;
}
.themebtn-label { white-space: nowrap; }

@media (max-width: 860px) {
  .site-nav { display: none; }
  .themebtn-label { display: none; }
  .themebtn { padding: var(--sp-2); }
}

/* ----------------------------------------------------------------- hero -- */

.hero { padding-block: clamp(40px, 6vw, 80px) clamp(48px, 7vw, 96px); }
.hero-copy { max-width: 60ch; }
.hero-eyebrow { font-size: var(--fs-xs); color: var(--accent-dim); }
.hero-eyebrow [lang="ar"] { font-size: 1.25em; letter-spacing: 0; }

.hero h1 { margin-top: var(--sp-4); }
.lede {
  margin-top: var(--sp-5);
  font-size: clamp(var(--fs-lg), 1.6vw, var(--fs-xl));
  line-height: var(--lh-normal);
  color: var(--text-dim);
  max-width: 56ch;
}
.hero-act { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-8); }
.hero-note { margin-top: var(--sp-4); font-size: var(--fs-md); color: var(--text-muted); }

/* ------------------------------------------------------- constellation -- */

.sky { margin: clamp(40px, 5vw, 64px) 0 0; }

.sky-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  padding: var(--sp-2);
  overflow: hidden;
}
.sky-svg { display: block; width: 100%; height: auto; }

/* the reveal — one generation at a time, exactly as the app does it */
.sky-svg .dot,
.sky-svg .wire { animation: skyIn var(--dur-5) var(--ease-out) backwards; animation-delay: var(--d, 0ms); }
.sky-svg.no-anim .dot,
.sky-svg.no-anim .wire { animation: none; }
@keyframes skyIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.sky-svg .house-box { fill: var(--surface-alt); stroke: var(--line); }
.sky-svg .house-name {
  font-family: var(--font-display);
  font-variation-settings: "wdth" var(--wd-wide);
  font-size: 9px; font-weight: var(--fw-medium);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  fill: var(--text-muted);
}
.sky-svg .gen-num {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--text-muted);
  opacity: .8;
}
.sky-svg .gen-rule { stroke: var(--line-soft); stroke-width: 1; }

.sky-svg .wire { fill: none; stroke: var(--wire); stroke-width: 1; }
.sky-svg .wire.arc { stroke: var(--wire-strong); stroke-width: .9; stroke-dasharray: 3 3; }
.sky-svg .wire.bar { stroke: var(--accent); stroke-width: 1.6; opacity: .55; }

.sky-svg .dot { fill: var(--neutral); }
.sky-svg .dot.m { fill: var(--male); }
.sky-svg .dot.f { fill: var(--female); }
.sky-svg .dot.ring { fill: var(--bg-sunk); stroke-width: 1.8; stroke: var(--neutral); }
.sky-svg .dot.ring.m { stroke: var(--male); }
.sky-svg .dot.ring.f { stroke: var(--female); }
.sky-svg .dot.you { stroke: var(--accent-strong); stroke-width: 2.4; }
.sky-svg .you-halo { fill: none; stroke: var(--accent-strong); stroke-width: 1; opacity: .45; }
.sky-svg .you-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  fill: var(--accent-dim);
  letter-spacing: .04em;
}

.sky-svg .hit { fill: transparent; cursor: pointer; }

/* the lit kinship road */
.sky-svg.is-lit .dot,
.sky-svg.is-lit .wire,
.sky-svg.is-lit .house-name,
.sky-svg.is-lit .you-label { opacity: .16; transition: opacity var(--dur-3) var(--ease-out); }
.sky-svg.is-lit .dot.lit { opacity: 1; }
.sky-svg.is-lit .wire.lit { opacity: 1; stroke: var(--wire-hi); stroke-width: 2; stroke-dasharray: none; }
.sky-svg .dot.lit.target { stroke: var(--accent-strong); stroke-width: 2.6; }

.sky-foot {
  display: flex; flex-wrap: wrap; gap: var(--sp-5) var(--sp-8);
  align-items: flex-start; justify-content: space-between;
  margin-top: var(--sp-5);
}
.sky-read { max-width: 48ch; }
.sky-line {
  font-size: var(--fs-md);
  color: var(--text);
  min-height: calc(var(--fs-md) * var(--lh-normal) * 2);
}
.sky-line .path {
  font-weight: var(--fw-semibold);
  color: var(--accent-dim);
}
.sky-line .meta { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-muted); }
.sky-hint { margin-top: var(--sp-1); font-size: var(--fs-sm); color: var(--text-muted); }
.sky-read .btn { margin-top: var(--sp-3); }

.legend {
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4);
  font-size: var(--fs-sm); color: var(--text-dim);
  max-width: 40ch;
}
.legend li { display: inline-flex; align-items: center; gap: var(--sp-15); }
.lg { flex: none; width: 9px; height: 9px; border-radius: var(--r-full); background: var(--neutral); }
.lg-m { background: var(--male); }
.lg-f { background: var(--female); }
.lg-n { background: var(--neutral); }
.lg-ring { background: var(--bg-sunk); box-shadow: inset 0 0 0 2px var(--neutral); }
.lg-big { width: 13px; height: 13px; background: var(--neutral); }
.lg-bar { width: 15px; height: 2px; border-radius: 1px; background: var(--accent); opacity: .7; }
.lg-wire { width: 15px; height: 1px; border-radius: 0; background: var(--line-strong); }
.lg-arc {
  width: 15px; height: 6px; border-radius: 0; background: none;
  border-top: 1px dashed var(--line-strong); border-radius: 40% 40% 0 0 / 100% 100% 0 0;
}

/* ---------------------------------------------------------------- facts -- */

.facts {
  display: grid; gap: var(--sp-6);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  border-block: 1px solid var(--line);
  padding-block: clamp(28px, 4vw, 44px);
}
.facts li { display: flex; flex-direction: column; gap: var(--sp-2); }
.facts-h {
  font-family: var(--font-display);
  font-variation-settings: "wdth" var(--wd-display);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-lg);
  letter-spacing: var(--ls-snug);
  line-height: var(--lh-snug);
}
.facts p { font-size: var(--fs-md); color: var(--text-dim); }

/* ---------------------------------------------------------------- views -- */

.views { margin-top: clamp(32px, 4vw, 52px); border-top: 1px solid var(--line); }

.view {
  display: grid;
  grid-template-columns: 64px minmax(140px, 1fr) minmax(0, 2.1fr) auto;
  gap: var(--sp-4) var(--sp-5);
  align-items: baseline;
  padding-block: var(--sp-6);
  border-bottom: 1px solid var(--line-soft);
  transition: background var(--dur-2) var(--ease-out);
}
.view:hover { background: var(--wash-1); }

.view-glyph {
  grid-row: span 1;
  align-self: center;
  display: block; width: 52px; height: 40px;
  color: var(--text-muted);
}
.view-glyph svg { width: 100%; height: 100%; overflow: visible; }
.view-glyph svg :where(path, rect, circle) {
  fill: none; stroke: currentColor; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.view-glyph svg .fill { fill: currentColor; stroke: none; }
.view-glyph svg .soft { opacity: .4; }
.view:hover .view-glyph { color: var(--accent-dim); }

.view-name { align-self: center; }
.view-say { color: var(--text-dim); font-size: var(--fs-md); align-self: center; }
.view-key {
  align-self: center;
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-sm); color: var(--text-muted);
  white-space: nowrap;
}

.views-foot {
  margin-top: var(--sp-6);
  font-size: var(--fs-md); color: var(--text-muted);
}
.views-foot kbd { margin-inline: 2px; }

@media (max-width: 860px) {
  .view {
    grid-template-columns: 44px 1fr auto;
    gap: var(--sp-2) var(--sp-4);
    align-items: center;
  }
  .view-glyph { width: 40px; height: 32px; }
  .view-say { grid-column: 2 / -1; }
}

/* ---------------------------------------------------------------- rahim -- */

.band-rahim {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.rahim-grid {
  display: grid; gap: clamp(32px, 5vw, 72px);
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 900px) { .rahim-grid { grid-template-columns: 1fr; } }

.rahim-copy > p { margin-top: var(--sp-4); color: var(--text-dim); font-size: var(--fs-md); max-width: 62ch; }
.rahim-copy h2 { margin-top: var(--sp-3); }
.pathish {
  font-weight: var(--fw-medium);
  color: var(--accent-dim);
  white-space: nowrap;
}
.rahim-care {
  border-left: 2px solid var(--line);
  padding-left: var(--sp-4);
}

.hadith {
  margin: var(--sp-7) 0 0;
  padding: var(--sp-5) var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  max-width: 60ch;
}
.hadith p {
  font-family: var(--font-display);
  font-variation-settings: "wdth" var(--wd-normal);
  font-weight: var(--fw-regular);
  font-size: var(--fs-xl);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
  color: var(--text);
}
.hadith p::before { content: "\201C"; }
.hadith p::after { content: "\201D"; }
.hadith footer {
  margin-top: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.rahim-open { font-size: var(--fs-md); }

.rahim-fig {
  position: sticky; top: 84px;
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
@media (max-width: 900px) { .rahim-fig { position: static; } }

.rings { display: block; width: 100%; height: auto; }
.rings .ring { fill: none; stroke: var(--line); stroke-width: 1; }
.rings .ring-lbl text {
  font-family: var(--font-display);
  font-variation-settings: "wdth" var(--wd-wide);
  font-size: 7.5px; letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; text-anchor: middle;
  fill: var(--text-muted);
}
.rings .rd circle { stroke: none; }
.rings .rd .m { fill: var(--male); }
.rings .rd .f { fill: var(--female); }
.rings .rd .n { fill: var(--neutral); }
.rings .rd .mah { stroke: var(--text); stroke-width: 1.4; }
.rings .rd .you { fill: var(--accent-strong); }
.rings .road { stroke: var(--accent-strong); stroke-width: 2; stroke-linecap: round; }
.rings-cap {
  margin-top: var(--sp-4);
  font-size: var(--fs-sm); color: var(--text-muted);
}

/* --------------------------------------------------------------- ledger -- */

.ledger {
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: clamp(32px, 4vw, 52px);
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.led { background: var(--surface); padding: var(--sp-6); }
.led-h {
  font-family: var(--font-display);
  font-variation-settings: "wdth" var(--wd-wide);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
}
.led-stay .led-h { color: var(--accent-dim); }
.led-never .led-h { color: var(--danger); }
.led ul { margin-top: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-4); }
.led li { font-size: var(--fs-md); color: var(--text-dim); }
.led li b { color: var(--text); font-weight: var(--fw-semibold); }

/* --------------------------------------------------------------- naming -- */

.naming {
  display: grid; gap: clamp(28px, 4vw, 56px);
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: start;
  margin-top: clamp(32px, 4vw, 52px);
}
@media (max-width: 900px) { .naming { grid-template-columns: 1fr; } }

.ntab { width: 100%; border-collapse: collapse; }
.ntab th {
  text-align: start;
  font-family: var(--font-display);
  font-variation-settings: "wdth" var(--wd-wide);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line-strong);
}
.ntab td {
  padding-block: var(--sp-4);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: baseline;
  font-size: var(--fs-md);
  color: var(--text-dim);
}
.nname {
  font-family: var(--font-display);
  font-variation-settings: "wdth" var(--wd-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-medium);
  color: var(--text);
  white-space: nowrap;
  padding-inline-end: var(--sp-5);
}
.nname[lang="ar"] { font-family: "IBM Plex Sans Arabic", var(--font-ui); font-size: var(--fs-2xl); }
.nname[lang="hi"] { font-family: "IBM Plex Sans Devanagari", var(--font-ui); }
.nconv {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  padding-inline-end: var(--sp-5);
  white-space: nowrap;
}

.nnotes { display: flex; flex-direction: column; gap: var(--sp-5); }
.nnotes li { font-size: var(--fs-md); color: var(--text-dim); }
.nnotes b { color: var(--text); font-weight: var(--fw-semibold); }

@media (max-width: 620px) {
  .ntab thead { display: none; }
  .ntab tr { display: grid; gap: var(--sp-1); padding-block: var(--sp-4); border-bottom: 1px solid var(--line-soft); }
  .ntab td { border: 0; padding: 0; }
  .nname { white-space: normal; }
}

/* ------------------------------------------------------------------ faq -- */

.faq { margin-top: clamp(28px, 3.5vw, 44px); max-width: 78ch; border-top: 1px solid var(--line); }

.q { border-bottom: 1px solid var(--line-soft); }
.q summary {
  display: flex; align-items: baseline; gap: var(--sp-3);
  list-style: none;
  cursor: pointer;
  padding-block: var(--sp-5);
  font-family: var(--font-display);
  font-variation-settings: "wdth" var(--wd-display);
  font-weight: var(--fw-medium);
  font-size: var(--fs-lg);
  letter-spacing: var(--ls-snug);
  color: var(--text);
}
.q summary::-webkit-details-marker { display: none; }
.q summary::after {
  content: "+";
  margin-inline-start: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  color: var(--text-muted);
  transition: transform var(--dur-2) var(--ease-out);
}
.q[open] summary::after { content: "\2212"; }
.q summary:hover { color: var(--accent-strong); }
.q .a { padding-bottom: var(--sp-5); max-width: 66ch; }
.q .a p { font-size: var(--fs-md); color: var(--text-dim); }

/* -------------------------------------------------------------- closing -- */

.closing { text-align: center; }
.closing p { margin: var(--sp-4) auto 0; max-width: 52ch; color: var(--text-dim); font-size: var(--fs-lg); }
.closing-act { justify-content: center; }

/* --------------------------------------------------------------- footer -- */

.site-foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-in { padding-block: clamp(36px, 5vw, 56px); }
.foot-word {
  font-family: var(--font-display);
  font-variation-settings: "wdth" var(--wd-narrow);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-xl);
  letter-spacing: var(--ls-snug);
}
.foot-say { margin-top: var(--sp-2); color: var(--text-dim); font-size: var(--fs-md); max-width: 50ch; }
.foot-nav { display: flex; flex-wrap: wrap; gap: var(--sp-5); margin-top: var(--sp-5); }
.foot-nav a { font-size: var(--fs-md); text-decoration: none; }
.foot-nav a:hover { text-decoration: underline; }
.foot-fine { margin-top: var(--sp-5); font-size: var(--fs-sm); color: var(--text-muted); }

/* ------------------------------------------------------- scroll reveal -- */

.reveal { opacity: 0; transform: translateY(10px); }
.reveal.seen {
  opacity: 1; transform: none;
  transition: opacity var(--dur-4) var(--ease-out), transform var(--dur-4) var(--ease-out);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------- narrow bits -- */

@media (max-width: 520px) {
  .hero-act .btn { width: 100%; }
  .sky-frame { padding: var(--sp-1); border-radius: var(--r-md); }
  .legend { max-width: none; }
  .led { padding: var(--sp-5); }
}
