:root {
  --bg: #f8fcfc;
  --soft: #eaf7f6;
  --soft-2: #f3faf9;
  --primary: #3d8c8d;
  --primary-dark: #2b6d6e;
  --secondary: #75c3bf;
  --dark: #173f43;
  --text: #243438;
  --muted: #4d6468;
  --border: #dcebea;
  --white: #ffffff;
  --focus: #1d5f73;
  --shadow: 0 10px 30px rgba(23, 63, 67, 0.06);
  --radius: 18px;
  --header: 72px;
  --max: 1080px;
  --font: "Segoe UI", Tahoma, "Noto Sans Arabic", "Arial", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.75;
  overflow-x: hidden;
}

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

a {
  color: var(--primary-dark);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--dark);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: 8px;
  z-index: 20;
  transform: translateY(-140%);
  background: var(--dark);
  color: #fff;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
}

.skip:focus {
  transform: none;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(248, 252, 252, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.header-inner {
  min-height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--dark);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--dark);
  border-radius: 12px;
  min-width: 44px;
  min-height: 44px;
  padding: 0.4rem 0.7rem;
  font: inherit;
  cursor: pointer;
}

.nav-panel {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.96rem;
  padding: 0.35rem 0.15rem;
}

.nav-links a[aria-current="page"] {
  color: var(--primary-dark);
  box-shadow: inset 0 -2px 0 var(--secondary);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.lang-switch a {
  color: var(--dark);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.lang-switch a[aria-current="true"] {
  color: var(--primary-dark);
}

.hero {
  padding: 3.2rem 0 2.4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 2rem;
  align-items: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.8rem;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.92rem;
}

h1,
h2,
h3 {
  color: var(--dark);
  line-height: 1.3;
  margin: 0 0 0.7rem;
}

h1 {
  font-size: clamp(1.85rem, 4vw, 3.1rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.45rem, 2.4vw, 2rem);
}

h3 {
  font-size: 1.15rem;
}

.lede {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 42rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary-dark);
  color: #fff;
}

.btn-primary:hover {
  background: var(--dark);
  color: #fff;
}

.btn-ghost {
  background: var(--white);
  color: var(--dark);
  border-color: var(--border);
}

.hero-art,
.section-art {
  justify-self: center;
}

.section {
  padding: 1.2rem 0 3rem;
}

.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}

.soft {
  background: linear-gradient(180deg, var(--soft) 0%, var(--bg) 100%);
  border-block: 1px solid var(--border);
}

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

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
}

.card p:last-child,
.prose p:last-child {
  margin-bottom: 0;
}

.icon-row {
  width: 42px;
  height: 42px;
  margin-bottom: 0.7rem;
  color: var(--primary-dark);
}

.cta-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.prose {
  display: grid;
  gap: 1rem;
}

.prose section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
}

.gene-ribbon {
  background-color: #f4fbfa;
  background-image:
    linear-gradient(180deg, rgba(248, 252, 252, 0.9), rgba(244, 251, 250, 0.82)),
    url("/img/gene-ribbon.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.locus-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0.7rem 0 0.8rem;
}

.locus-list div {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #dcebea;
  border-radius: 14px;
  padding: 0.65rem 0.7rem;
}

.locus-list dt {
  color: #4d6468;
  font-size: 0.86rem;
}

.locus-list dd {
  margin: 0.15rem 0 0;
  color: #173f43;
  font-weight: 700;
}

.locus-source {
  color: #4d6468;
  font-size: 0.95rem;
}

.prose ul,
.plain-list {
  margin: 0.4rem 0 0;
  padding-inline-start: 1.2rem;
}

.note {
  background: var(--soft-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  color: var(--dark);
}

.faq details {
  border-top: 1px solid var(--border);
  padding: 0.75rem 0;
}

.faq details:first-of-type {
  border-top: 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--dark);
}

.inherit {
  margin: 1rem 0 0;
  padding: 0;
  border: 0;
}

.pedigree {
  background: #f4fbfa;
  border: 1px solid #dcebea;
  border-radius: 20px;
  padding: 1rem 0.8rem 0.9rem;
}

.pedigree-parents {
  display: grid;
  grid-template-columns: 1fr 72px 1fr;
  align-items: center;
  gap: 0.4rem;
}

.person {
  background: #fff;
  border: 1px solid #dcebea;
  border-radius: 18px;
  padding: 0.7rem 0.6rem 0.85rem;
  text-align: center;
}

.person strong,
.child-node b,
.mix b {
  color: #173f43;
}

.person span,
.child-node p,
.child-node em {
  display: block;
  color: #4d6468;
  font-size: 0.92rem;
}

.person-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.2rem;
}

.gene-pair {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.bead {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
}

.bead.typical {
  background: #fff;
  border: 3px solid #2b6d6e;
}

.bead.changed {
  background: #173f43;
  border: 3px solid #173f43;
}

.union {
  height: 2px;
  background: #4e9fa0;
  position: relative;
}

.union span {
  position: absolute;
  inset-inline-start: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4e9fa0;
  transform: translate(-50%, -50%);
}

.drop {
  width: 2px;
  height: 22px;
  margin: 0 auto;
  background: #4e9fa0;
}

.child-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}

.child-node {
  background: #fff;
  border: 1px solid #dcebea;
  border-radius: 16px;
  padding: 0.7rem 0.4rem 0.8rem;
  text-align: center;
}

.child-node b {
  font-size: 1.35rem;
  line-height: 1;
}

.child-node em {
  margin-top: 0.35rem;
  font-style: normal;
  font-weight: 700;
  color: #173f43;
}

.child-node.affected {
  background: #eaf7f6;
  border-color: #2b6d6e;
}

.mix,
.key {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 0.9rem;
  margin-top: 0.8rem;
  color: #173f43;
  font-size: 0.95rem;
}

.key .bead {
  margin-inline-end: 0.3rem;
  vertical-align: -3px;
}

.sa-page h2,
.sa-page h3 {
  color: #173f43;
}

.sa-kicker {
  color: #0f6b3c;
}

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

.stat-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(31, 138, 76, 0.1), transparent 42%),
    #fff;
  border: 1px solid #d7ebe4;
  border-radius: 22px;
  padding: 1.15rem 1.15rem 1.05rem;
  box-shadow: 0 10px 28px rgba(23, 63, 67, 0.05);
}

.stat-card::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: #1f8a4c;
}

.stat-year {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.1rem 0.65rem;
  border-radius: 999px;
  background: #e8f6ef;
  color: #0f6b3c;
  font-size: 0.82rem;
  font-weight: 700;
}

.stat-num {
  display: block;
  margin-top: 0.7rem;
  color: #0f6b3c;
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-card strong {
  display: block;
  margin-top: 0.35rem;
  color: #173f43;
  font-size: 1.05rem;
  line-height: 1.4;
}

.stat-card p {
  margin: 0.45rem 0 0;
  color: #4d6468;
}

.place-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #dcebea;
  border-radius: 16px;
  padding: 0.9rem 1rem;
}

.timeline {
  position: relative;
  display: grid;
  gap: 0;
  margin-top: 1rem;
}

.timeline::before {
  content: "";
  position: absolute;
  inset-inline-start: 30px;
  top: 18px;
  bottom: 24px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d7efe3 0%, #7dcaa0 38%, #1f8a4c 72%, #0f6b3c 100%);
}

.time-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  background: transparent;
  border: 0;
  padding: 0 0 1.05rem;
}

.time-mark {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1rem;
}

.time-mark::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #1f8a4c;
  box-shadow: 0 0 0 5px #e8f6ef;
}

.time-item:nth-child(n + 5) .time-mark::before {
  border-color: #17864b;
}

.time-item:nth-child(n + 9) .time-mark::before {
  border-color: #0f6b3c;
  box-shadow: 0 0 0 5px #d9f0e4;
}

.time-item:last-child {
  padding-bottom: 0;
}

.time-mark span {
  margin-top: 0.45rem;
  color: #0f6b3c;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  background: #e8f6ef;
  border-radius: 999px;
  padding: 0.12rem 0.4rem;
}

.time-card {
  min-width: 0;
  background: #fff;
  border: 1px solid #d7ebe4;
  border-radius: 18px;
  padding: 0.95rem 1rem 0.85rem;
  box-shadow: 0 8px 22px rgba(23, 63, 67, 0.045);
}

.time-card h3 {
  margin-bottom: 0.25rem;
}

.study-title {
  margin: 0 0 0.35rem;
  color: #2b6d6e;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.time-card .meta {
  overflow-wrap: anywhere;
}

.place-list {
  display: grid;
  gap: 0.7rem;
}

.inherit-caption {
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.85rem;
}

.parents {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.7rem;
  align-items: stretch;
}

.parent,
.outcome,
.summary-item {
  background: var(--soft-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.85rem;
}

.parent-role,
.outcome-rate {
  display: block;
  font-weight: 700;
  color: var(--dark);
}

.parent-state,
.outcome-state {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 0.55rem;
}

.alleles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.allele {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid var(--border);
}

.allele.typical {
  background: #fff;
  color: var(--dark);
  border-color: var(--secondary);
}

.allele.changed {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}

.join {
  align-self: center;
  color: var(--primary-dark);
  font-weight: 700;
}

.outcomes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 0.85rem;
}

.outcome.affected {
  background: #fff;
  border-color: var(--primary);
}

.outcome-from {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin-top: 0.85rem;
}

.summary-item strong {
  display: block;
  font-size: 1.35rem;
  color: var(--dark);
  line-height: 1.2;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.refs {
  font-size: 0.95rem;
}

.refs li + li {
  margin-top: 0.45rem;
}

.source-grid {
  display: grid;
  gap: 0.85rem;
}

.source {
  display: grid;
  gap: 0.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.05rem;
}

.source strong {
  color: var(--dark);
}

.meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.empty-slot {
  border: 1px dashed var(--border);
  border-radius: 16px;
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 1rem;
  background: var(--soft-2);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.6rem 0 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.2rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
}

.footer-links a {
  color: var(--dark);
  text-decoration: none;
  font-weight: 600;
}

.handle {
  font-weight: 700;
  color: var(--dark);
}

@media (max-width: 720px) {
  .parents,
  .outcomes,
  .summary,
  .pedigree-parents,
  .child-row,
  .locus-list,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .time-item {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 0.55rem;
  }

  .timeline::before {
    inset-inline-start: 27px;
  }

  .join {
    justify-self: center;
  }

  .union {
    width: 2px;
    height: 22px;
    margin: 0 auto;
  }
}

@media (max-width: 860px) {
  .hero-grid,
  .cards,
  .footer-grid,
  .cta-band {
    grid-template-columns: 1fr;
    display: grid;
  }

  .cta-band {
    align-items: start;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-panel {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: var(--header);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0.4rem 1rem 1rem;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-panel.is-open {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-links a,
  .lang-switch a {
    min-height: 44px;
  }
}

@media (max-width: 430px) {
  .wrap {
    width: min(var(--max), calc(100% - 1.4rem));
  }

  .actions,
  .btn {
    width: 100%;
  }

  h1 {
    font-size: 1.7rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
