/* Bakura DNA page + single gene pages. */

/* ---------- hero ---------- */
.dna-hero {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--cream);
}

.dna-hero::before {
  content: "";
  position: absolute;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgb(209 149 74 / 0.25),
    transparent 65%
  );
  inset-inline-start: -200px;
  top: -260px;
}

.dna-hero__inner {
  position: relative;
  padding-block: 96px 40px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.dna-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dna-hero__eyebrow img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.dna-hero__eyebrow .eyebrow {
  color: var(--gold);
  letter-spacing: 0.2em;
  white-space: nowrap;
}

.dna-hero h1 {
  margin: 0;
  font-size: clamp(56px, 10vw, 160px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--cream);
}

.dna-hero h1 b {
  font-family: Manrope, var(--font);
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #d1954a, #f0cf8a);
  background-clip: text;
  color: transparent;
}

.dna-hero__lead,
.dna-hero__lead p {
  max-width: 40ch;
  margin: 0;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.75;
  font-weight: 500;
  color: var(--cream);
  text-wrap: pretty;
}

.dna-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
}

.dna-hero__stat {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
  color: rgb(254 247 224 / 0.7);
}

.dna-hero__stat b {
  font: 800 34px/1 var(--font-display);
  color: var(--sunlight);
}

.dna-hero__cue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid rgb(254 247 224 / 0.3);
  border-radius: 999px;
  color: var(--cream);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.dna-hero__cue:hover {
  border-color: var(--sunlight);
  background: rgb(240 207 138 / 0.1);
  color: var(--cream);
}

.dna-page .dna-hero__cue .icon {
  width: 18px;
  height: 18px;
  transform: rotate(-90deg);
}

.dna-band {
  position: relative;
  height: 220px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  direction: ltr;
}

.dna-band i {
  position: relative;
  width: 2px;
  height: 170px;
  background: linear-gradient(#c88537, #39312a, #f0cf8a);
}

.dna-band i::before,
.dna-band i::after {
  content: "";
  position: absolute;
  left: -6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.dna-band i::before {
  top: -6px;
  background: var(--sunlight);
}

.dna-band i::after {
  bottom: -6px;
  background: var(--gold);
}

@media (prefers-reduced-motion: no-preference) {
  .dna-helix__rung i {
    animation: dna-twist-x 7s ease-in-out infinite;
    animation-delay: calc(var(--i) * -0.52s);
  }

  @keyframes dna-twist-y {
    50% {
      transform: scaleY(-1);
    }
  }

  @keyframes dna-twist-x {
    50% {
      transform: scaleX(-1);
    }
  }
}

/* ---------- helix list ---------- */
.dna-helix {
  padding-block: 110px;
}

.dna-helix__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-bottom: 64px;
}

.dna-helix__head h2 {
  margin: 0;
  font-size: clamp(30px, 3.8vw, 56px);
}

.dna-helix__head p {
  margin: 0;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.dna-helix__mascot {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.dna-helix__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dna-helix__list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 260px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(12px, 3vw, 40px);
  min-height: 120px;
  text-decoration: none;
  border-radius: 20px;
  transition: background 0.25s;
}

.dna-helix__list a:hover,
.dna-helix__list a:focus-visible {
  background: rgb(245 223 174 / 0.4);
  color: inherit;
}

.dna-helix__list a:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 2px;
}

.dna-helix__list a:hover .dna-helix__rung i::before,
.dna-helix__list a:hover .dna-helix__rung i::after {
  scale: 1.25;
}

.dna-helix__list a:hover strong {
  color: var(--rust);
}

.dna-helix__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  grid-column: 1;
  text-align: start;
}

.dna-helix__list li:nth-child(even) .dna-helix__text {
  grid-column: 3;
  grid-row: 1;
  text-align: end;
  align-items: flex-end;
}

.dna-helix__text b {
  font: 700 14px var(--font);
  color: var(--rust);
}

.dna-helix__text strong {
  font: 700 clamp(18px, 2vw, 26px)/1.45 var(--font-display);
  text-wrap: balance;
  transition: color 0.25s;
}

.dna-helix__alt {
  font-size: 13px;
  color: var(--muted);
}

.dna-helix__alt:lang(ar) {
  font-family: var(--font-display);
  font-size: 15px;
}

.dna-helix__rung {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  height: 120px;
  display: flex;
  align-items: center;
  direction: ltr;
}

.dna-helix__rung::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.dna-helix__rung i {
  position: relative;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #c88537, #d5c9ad, #100e11);
}

.dna-helix__rung i::before,
.dna-helix__rung i::after {
  content: "";
  position: absolute;
  top: -13px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: scale 0.3s ease;
}

.dna-helix__rung i::before {
  left: -14px;
  background: var(--sun);
}

.dna-helix__rung i::after {
  right: -14px;
  background: var(--ink);
}

@media (max-width: 719px) {
  .dna-helix {
    padding-block: 80px;
  }

  .dna-helix__list a {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 16px;
    min-height: 96px;
    padding-inline-end: 8px;
  }

  .dna-helix__text,
  .dna-helix__list li:nth-child(even) .dna-helix__text {
    grid-column: 2;
    grid-row: 1;
    text-align: start;
    align-items: flex-start;
  }

  .dna-helix__rung {
    grid-column: 1;
    height: 96px;
    padding-inline: 12px;
  }

  .dna-helix__rung i::before,
  .dna-helix__rung i::after {
    top: -8px;
    width: 18px;
    height: 18px;
  }

  .dna-helix__rung i::before {
    left: -9px;
  }

  .dna-helix__rung i::after {
    right: -9px;
  }
}

/* ---------- gene cards ---------- */
.dna-grid {
  background: var(--honey);
  padding-block: 110px;
}

.dna-grid__head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 48px;
}

.dna-grid__head h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 48px);
}

.dna-grid__inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}

@media (min-width: 960px) {
  .dna-grid__inner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.gene-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 380px;
  padding: 28px;
  border-radius: var(--radius-card);
  text-decoration: none;
  transition:
    transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.35s ease;
}

.gene-card:hover,
.gene-card:focus-visible {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 0 24px 48px -24px rgb(57 49 42 / 0.45);
}

.gene-card:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
}

.gene-card .gene-art i {
  transition: translate 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.gene-card:hover .gene-art i:nth-child(1) {
  translate: -6px -4px;
}

.gene-card:hover .gene-art i:nth-child(2) {
  translate: 6px -6px;
}

.gene-card:hover .gene-art i:nth-child(3) {
  translate: 4px 6px;
}

.gene-card__more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.gene-card__more .icon {
  width: 18px;
  height: 18px;
  transition: translate 0.3s ease;
}

.gene-card:hover .gene-card__more .icon {
  translate: -4px 0;
}

html:not([dir="rtl"]) .gene-card:hover .gene-card__more .icon {
  translate: 4px 0;
}

.dna-closing .button {
  gap: 10px;
}

.dna-closing .button .icon {
  width: 18px;
  height: 18px;
}

.gene-card--0 {
  background: var(--ink);
  color: var(--cream);
  --c0: var(--sun);
  --c1: var(--honey);
  --c2: var(--rust);
}

.gene-card--1 {
  background: var(--cream);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  --c0: var(--ink);
  --c1: var(--sun);
  --c2: var(--rust);
}

.gene-card--2 {
  background: var(--gold);
  color: var(--ink);
  --c0: var(--ink);
  --c1: var(--cream);
  --c2: var(--honey);
}

.gene-card:hover,
.gene-card:hover * {
  color: inherit;
}

.gene-card__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gene-card__text b {
  font: 800 13px var(--font);
  opacity: 0.6;
}

.gene-card__text strong {
  font: 700 22px/1.45 var(--font-display);
}

.gene-card__alt {
  font-size: 12px;
  opacity: 0.75;
}

.gene-card__alt:lang(ar) {
  font-size: 14px;
}

.gene-card__summary {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.75;
  opacity: 0.85;
  text-wrap: pretty;
}

/* shared gene art (cards + stage). Uses --c0/--c1/--c2. */
.gene-art {
  position: relative;
  display: block;
  width: 150px;
  height: 150px;
  direction: ltr;
}

.gene-art i {
  position: absolute;
  display: block;
  aspect-ratio: 1;
  border-radius: 50%;
}

.gene-art--0 i:nth-child(1) {
  width: 62%;
  left: 4%;
  top: 10%;
  background: var(--c0);
}

.gene-art--0 i:nth-child(2) {
  width: 34%;
  right: 6%;
  bottom: 4%;
  background: var(--c1);
}

.gene-art--0 i:nth-child(3) {
  width: 62%;
  height: 3px;
  aspect-ratio: auto;
  border-radius: 0;
  left: 20%;
  top: 50%;
  background: var(--c2);
}

.gene-art--1 i:nth-child(1) {
  width: 70%;
  aspect-ratio: 2/1;
  border-radius: 999px 999px 0 0;
  left: 15%;
  bottom: 10%;
  background: var(--c1);
}

.gene-art--1 i:nth-child(2) {
  width: 28%;
  left: 36%;
  top: 6%;
  background: var(--c0);
}

.gene-art--1 i:nth-child(3) {
  width: 20%;
  right: 4%;
  top: 20%;
  background: var(--c2);
}

.gene-art--2 i:nth-child(1) {
  width: 44%;
  height: 70%;
  aspect-ratio: auto;
  border-radius: 0 100%;
  left: 8%;
  bottom: 12%;
  background: var(--c0);
}

.gene-art--2 i:nth-child(2) {
  width: 44%;
  height: 70%;
  aspect-ratio: auto;
  border-radius: 100% 0;
  left: 40%;
  bottom: 12%;
  background: var(--c1);
}

.gene-art--2 i:nth-child(3) {
  width: 18%;
  right: 4%;
  top: 2%;
  background: var(--c2);
}

.gene-art--3 i:nth-child(1) {
  width: 76%;
  left: 12%;
  top: 6%;
  border: 3px solid currentcolor;
  opacity: 0.35;
}

.gene-art--3 i:nth-child(2) {
  width: 50%;
  left: 25%;
  top: 19%;
  background: var(--c0);
}

.gene-art--3 i:nth-child(3) {
  width: 16%;
  left: 42%;
  top: 36%;
  background: var(--c1);
}

.gene-art--4 i {
  width: 18%;
  aspect-ratio: auto;
  border-radius: 999px;
}

.gene-art--4 i:nth-child(1) {
  height: 84%;
  left: 22%;
  top: 8%;
  background: var(--c0);
}

.gene-art--4 i:nth-child(2) {
  height: 64%;
  left: 44%;
  top: 28%;
  background: var(--c1);
}

.gene-art--4 i:nth-child(3) {
  height: 44%;
  left: 66%;
  top: 48%;
  background: var(--c2);
}

.gene-art--5 i:nth-child(1) {
  width: 24%;
  left: 8%;
  bottom: 8%;
  background: var(--c1);
}

.gene-art--5 i:nth-child(2) {
  width: 38%;
  left: 28%;
  bottom: 8%;
  background: var(--c2);
}

.gene-art--5 i:nth-child(3) {
  width: 56%;
  right: 2%;
  bottom: 8%;
  background: var(--c0);
}

.gene-art--6 i:nth-child(1) {
  width: 60%;
  border-radius: 50% 50% 50% 0;
  left: 10%;
  top: 10%;
  background: var(--c0);
}

.gene-art--6 i:nth-child(2) {
  width: 30%;
  right: 8%;
  bottom: 8%;
  background: var(--c1);
}

.gene-art--6 i:nth-child(3) {
  width: 12%;
  left: 30%;
  top: 30%;
  background: var(--c2);
}

.gene-art--7 i {
  width: 44%;
}

.gene-art--7 i:nth-child(1) {
  left: 10%;
  top: 38%;
  background: var(--c0);
}

.gene-art--7 i:nth-child(2) {
  left: 28%;
  top: 8%;
  background: var(--c1);
  mix-blend-mode: multiply;
}

.gene-art--7 i:nth-child(3) {
  left: 46%;
  top: 38%;
  background: var(--c2);
  opacity: 0.9;
}

.gene-art--8 i:nth-child(1) {
  width: 84%;
  aspect-ratio: 2/1;
  border-radius: 999px 999px 0 0;
  left: 8%;
  bottom: 12%;
  background: var(--c2);
}

.gene-art--8 i:nth-child(2) {
  width: 60%;
  aspect-ratio: 2/1;
  border-radius: 999px 999px 0 0;
  left: 20%;
  bottom: 12%;
  background: var(--c1);
}

.gene-art--8 i:nth-child(3) {
  width: 36%;
  aspect-ratio: 2/1;
  border-radius: 999px 999px 0 0;
  left: 32%;
  bottom: 12%;
  background: var(--c0);
}

/* ---------- closing ---------- */
.dna-closing {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--cream);
  padding-block: 120px;
}

.dna-closing__ring {
  left: 50%;
  top: 50%;
  border: 1px solid var(--bark);
  translate: -50% -50%;
}

.dna-closing__ring--1 {
  width: 560px;
  height: 560px;
}

.dna-closing__ring--2 {
  width: 380px;
  height: 380px;
}

.dna-closing__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
}

.dna-closing__mascot {
  width: 180px;
  height: 180px;
  object-fit: contain;
  margin-bottom: -12px;
}

.dna-closing h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 76px);
  line-height: 1.3;
  max-width: 16ch;
  color: var(--cream);
}

.dna-closing h2 span {
  color: var(--sunlight);
}

/* ---------- single gene ---------- */
.gene-page--0 .gene-hero {
  background: var(--ink);
  color: var(--cream);
  --c0: var(--sun);
  --c1: var(--honey);
  --c2: var(--rust);
  --stage: #1c181b;
  --line-c: rgb(254 247 224 / 0.18);
  --acc: var(--sunlight);
}

.gene-page--1 .gene-hero {
  background: var(--cream);
  color: var(--ink);
  --c0: var(--ink);
  --c1: var(--sun);
  --c2: var(--rust);
  --stage: var(--honey);
  --line-c: rgb(16 14 17 / 0.15);
  --acc: var(--rust);
}

.gene-page--2 .gene-hero {
  background: var(--gold);
  color: var(--ink);
  --c0: var(--ink);
  --c1: var(--cream);
  --c2: var(--honey);
  --stage: var(--amber);
  --line-c: rgb(16 14 17 / 0.2);
  --acc: var(--ink);
}

.gene-hero {
  position: relative;
  overflow: hidden;
}

.gene-hero h1 {
  margin: 0;
  color: inherit;
  font-size: clamp(40px, 5.4vw, 80px);
  line-height: 1.25;
  text-wrap: balance;
}

.gene-hero__bar {
  padding-top: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.gene-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid currentcolor;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

html[dir="rtl"] .gene-back .icon {
  transform: rotate(180deg);
}

/* Back points left in English; site.css turns every English arrow forward. */
html:lang(en) .gene-back .icon {
  transform: none;
}

.gene-dots {
  display: grid;
  grid-template-columns: repeat(9, 44px);
}

.gene-dots a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}

.gene-dots a::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--line-c);
}

.gene-dots a[aria-current]::before {
  width: 36px;
  background: var(--acc);
}

.gene-dots a:focus-visible {
  outline: 2px solid currentcolor;
  outline-offset: -2px;
  border-radius: 8px;
}

@media (max-width: 600px) {
  .gene-dots {
    grid-template-columns: repeat(5, 44px);
  }
}

.gene-hero__grid {
  padding-block: 40px 96px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 56px;
  align-items: center;
}

.gene-hero__copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gene-hero__num {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  font: 900 clamp(110px, 14vw, 210px)/0.8 var(--font-display);
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 2px var(--acc);
}

.gene-hero__num small {
  font: 600 13px var(--font);
  letter-spacing: 0.14em;
  color: currentcolor;
  -webkit-text-stroke: 0;
  opacity: 0.7;
  padding-bottom: 18px;
}

.gene-hero .eyebrow {
  color: inherit;
  opacity: 0.8;
}

.gene-hero__alt {
  font-size: 15px;
  opacity: 0.75;
  margin-top: -6px;
}

.gene-hero__alt:lang(ar) {
  font-family: var(--font-display);
  font-size: 22px;
}

.gene-hero__lead {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.8;
  text-wrap: pretty;
}

.gene-hero__rule {
  width: 84px;
  height: 4px;
  border-radius: 999px;
  background: var(--acc);
}

.gene-page--0 .gene-hero__rule {
  background: var(--sun);
}

.gene-stage {
  position: relative;
  aspect-ratio: 1;
  max-width: 540px;
  width: 100%;
  justify-self: center;
  container-type: inline-size;
}

.gene-stage__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--line-c);
}

.gene-stage__dash {
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  border: 1.5px dashed var(--line-c);
}

.gene-stage__dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid currentcolor;
  opacity: 0.55;
  transform: rotate(var(--a)) translateX(50cqw) rotate(calc(-1 * var(--a)));
  margin: -5px;
}

.gene-stage__dot.is-on {
  width: 22px;
  height: 22px;
  margin: -11px;
  opacity: 1;
  border: 0;
  background: var(--acc);
}

.gene-page--0 .gene-stage__dot.is-on {
  background: var(--sun);
}

.gene-stage__core {
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  background: var(--stage);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.gene-stage__core .gene-art {
  width: 72%;
  height: 72%;
}

@media (prefers-reduced-motion: no-preference) {
  .gene-stage__dash {
    animation: gene-spin 60s linear infinite;
  }

  .gene-stage__core .gene-art {
    animation: edu-float 3.8s ease-in-out infinite alternate;
  }

  @keyframes gene-spin {
    to {
      transform: rotate(360deg);
    }
  }
}

.gene-story {
  padding-block: 100px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px 48px;
  align-items: start;
  max-width: 1080px;
}

@media (min-width: 900px) {
  .gene-story {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
}

.gene-story__side {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gene-story__side h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.45;
}

.gene-story__alt {
  font-size: 13px;
  color: var(--muted);
}

.gene-story__alt:lang(ar) {
  font-family: var(--font-display);
  font-size: 17px;
}

.gene-story__body {
  padding: clamp(24px, 4vw, 44px);
  border-radius: 28px;
  background: rgb(245 223 174 / 0.4);
  font-family: var(--font-reading);
  font-size: 19px;
  line-height: 2;
}

.gene-story__body > :is(p, h2, h3, ul):first-of-type {
  margin-top: 0;
}

.gene-story__body p {
  margin: 0 0 1.1em;
}

.gene-story__body > p:first-of-type {
  font-size: 1.12em;
}

.gene-story__body > :last-child {
  margin-bottom: 0;
}

.gene-story__quote {
  display: block;
  height: 40px;
  font: 400 72px/1 var(--font-reading);
  color: var(--gold);
}

@media (max-width: 599px) {
  .gene-story {
    padding-block: 64px;
  }

  .gene-story__side {
    position: static;
  }

  .gene-story__body {
    font-size: 17px;
  }
}

.gene-story__empty {
  color: var(--muted);
  font-family: var(--font);
  font-size: 15px;
}

.gene-nav {
  padding-bottom: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 20px;
}

.gene-nav a {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px;
  border-radius: 28px;
  text-decoration: none;
}

.gene-nav__prev {
  border: 1.5px solid var(--line);
}

.gene-nav__prev:hover {
  border-color: var(--ink);
  color: inherit;
}

.gene-nav__next {
  justify-content: space-between;
  background: var(--ink);
  color: var(--cream);
}

.gene-nav__next:hover {
  background: var(--bark);
  color: var(--cream);
}

.gene-nav small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--rust);
}

.gene-nav__next small {
  color: var(--sunlight);
}

.gene-nav strong {
  font: 700 20px/1.45 var(--font-display);
}

.gene-nav__chip {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 900 22px var(--font-display);
  background: var(--honey);
  color: var(--ink);
}

.gene-nav__chip--sun {
  background: var(--sun);
}

.gene-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 100px;
}

.gene-actions .button {
  min-width: 0;
  white-space: normal;
  text-align: center;
}

@media (max-width: 599px) {
  .gene-actions {
    flex-direction: column;
  }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .dna-band i {
    animation:
      dna-twist-y 6s ease-in-out infinite calc(var(--i) * -0.26s),
      dna-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--i) * 25ms) both;
  }

  .dna-hero__inner > * {
    animation: dna-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .dna-hero__inner > :nth-child(2) {
    animation-delay: 0.08s;
  }

  .dna-hero__inner > :nth-child(3) {
    animation-delay: 0.16s;
  }

  .dna-hero__inner > :nth-child(4) {
    animation-delay: 0.24s;
  }

  .gene-hero__copy > *,
  .gene-stage {
    animation: dna-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .gene-hero__copy > :nth-child(2) {
    animation-delay: 0.06s;
  }

  .gene-hero__copy > :nth-child(3) {
    animation-delay: 0.12s;
  }

  .gene-hero__copy > :nth-child(n + 4) {
    animation-delay: 0.18s;
  }

  .gene-stage__dot.is-on {
    animation: gene-pulse 2.4s ease-in-out infinite;
  }

  @keyframes dna-in {
    from {
      opacity: 0;
      translate: 0 24px;
    }

    to {
      opacity: 1;
      translate: 0 0;
    }
  }

  @keyframes gene-pulse {
    50% {
      box-shadow: 0 0 0 10px rgb(240 207 138 / 0.18);
    }
  }

  /* Scroll-driven reveals; browsers without view timelines show everything at once. */
  @supports (animation-timeline: view()) {
    .dna-helix__list li,
    .dna-grid__head,
    .gene-card,
    .gene-story__body,
    .gene-nav a {
      animation: dna-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }

    .dna-helix__rung {
      animation: dna-draw linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 40%;
    }

    @keyframes dna-draw {
      from {
        scale: 0 1;
        opacity: 0;
      }

      to {
        scale: 1 1;
        opacity: 1;
      }
    }
  }
}

/* The other-language line hugs the start edge of its own column. */
:is(.dna-helix__alt, .gene-card__alt, .gene-hero__alt, .gene-story__alt) {
  align-self: flex-start;
  max-width: 100%;
}

.dna-helix__list li:nth-child(even) .dna-helix__alt {
  align-self: flex-end;
}

@media (max-width: 719px) {
  .dna-helix__list li:nth-child(even) .dna-helix__alt {
    align-self: flex-start;
  }
}

@media (max-width: 599px) {
  .gene-card {
    min-height: 0;
  }

  .gene-card .gene-art {
    width: 112px;
    height: 112px;
  }
}
