/* GHAUS — depth
   The page is a descent. The background runs from the lit water at the top
   to the abyss at the bottom of the document, and a gauge on the right reads
   the scroll position in metres. One warm accent (pearl) for anything that
   claims exclusivity; one cold accent (aqua) for instruments and readouts.
   Nothing glows, nothing is pure black or pure white. Prose in a humanist
   sans at 17px; the serif carries the voice; mono carries numbers. */

:root {
  color-scheme: dark;

  --surface: #14304a;
  --shallow: #0f2238;
  --mid: #0b1728;
  --deep: #070f1b;
  --abyss: #04070c;

  --bone: #ebe6dc;
  --bone-2: #aeaba3;
  --bone-3: #7f8188;

  --pearl: #c9a96e;
  --pearl-2: #e2cfa6;
  --pearl-hair: rgba(201, 169, 110, 0.28);
  --pearl-wash: rgba(201, 169, 110, 0.08);

  --aqua: #7fb3c8;
  --aqua-2: #a9d1e2;
  --aqua-hair: rgba(127, 179, 200, 0.26);

  --hair: rgba(235, 230, 220, 0.08);
  --hair-2: rgba(235, 230, 220, 0.14);
  --hair-3: rgba(235, 230, 220, 0.26);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --arabic: "Naskh Subset", "Noto Naskh Arabic", "Geeza Pro", "Arabic Typesetting", serif;

  --gut: clamp(1.25rem, 5vw, 5rem);
  --wide: 82rem;
  --measure: 38rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --rail-h: 4.25rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--rail-h) + 1rem);
  /* The descent. Set on <html> so the gradient spans the whole document,
     not the viewport: scrolling down is going down. */
  background: linear-gradient(180deg, var(--surface) 0%, var(--shallow) 18%, var(--mid) 45%, var(--deep) 75%, var(--abyss) 100%) no-repeat;
  background-color: var(--abyss);
}

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

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  letter-spacing: -0.004em;
  color: var(--bone-2);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: rgba(201, 169, 110, 0.32);
  color: var(--bone);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

strong,
b {
  font-weight: 600;
  color: var(--bone);
}

em {
  font-style: italic;
}

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

/* ————— light: the surface shafts, fading with depth (opacity set by JS) ————— */

.light {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 30% -10%, rgba(127, 179, 200, 0.22), transparent 70%),
    radial-gradient(40% 35% at 78% -5%, rgba(169, 209, 226, 0.14), transparent 70%);
  opacity: 1;
  transition: opacity 0.2s linear;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ————— rail (header) ————— */

.rail {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--rail-h);
  padding: 0 var(--gut);
  background: linear-gradient(180deg, rgba(4, 7, 12, 0.55), rgba(4, 7, 12, 0));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.rail.is-deep {
  background: linear-gradient(180deg, rgba(4, 7, 12, 0.86), rgba(4, 7, 12, 0.55));
  border-bottom: 1px solid var(--hair);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--bone);
  min-height: 44px;
}

.mark__glyph {
  width: 22px;
  height: 30px;
  flex: none;
}

.mark__name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.mark__arabic {
  font-family: var(--arabic);
  font-size: 1.05rem;
  color: var(--pearl);
  line-height: 1;
  margin-top: 0.15rem;
}

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

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.85rem;
  font-size: 0.875rem;
  color: var(--bone-2);
  border-radius: 2px;
  transition: color 0.25s;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--bone);
}

.nav .readout {
  margin: 0 0.5rem 0 0.25rem;
}

.readout {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--aqua);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 46px;
  padding: 0 1.4rem;
  border: 1px solid var(--hair-3);
  border-radius: 2px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--bone);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, color 0.25s;
}

.btn:hover {
  border-color: var(--bone-2);
}

.btn--pearl {
  border-color: var(--pearl);
  color: var(--pearl-2);
}

.btn--pearl:hover {
  background: var(--pearl-wash);
  border-color: var(--pearl-2);
}

.btn--small {
  min-height: 40px;
  padding: 0 1rem;
  font-size: 0.85rem;
}

.rail .btn {
  min-height: 40px;
  padding: 0 1.1rem;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .nav a:not(.btn) {
    display: none;
  }
  .nav .readout {
    display: inline-block;
  }
}

@media (max-width: 420px) {
  .mark__name {
    letter-spacing: 0.18em;
  }
  .rail .btn {
    padding: 0 0.85rem;
  }
}

/* ————— depth gauge ————— */

.gauge {
  position: fixed;
  right: calc(var(--gut) / 2.4);
  top: 50%;
  translate: 0 -50%;
  z-index: 15;
  height: min(58vh, 34rem);
  width: 3.2rem;
  display: none;
  pointer-events: none;
}

@media (min-width: 1100px) {
  .gauge {
    display: block;
  }
}

.gauge__line {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0.9rem;
  width: 1px;
  background: var(--hair-3);
}

.gauge__tick {
  position: absolute;
  right: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  translate: 0 -50%;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--bone-3);
}

.gauge__tick::after {
  content: "";
  width: 0.55rem;
  height: 1px;
  background: var(--hair-3);
}

.gauge__marker {
  position: absolute;
  right: 0.2rem;
  top: 0;
  translate: 0 -50%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--aqua-2);
  font-variant-numeric: tabular-nums;
  transition: top 0.12s linear;
}

.gauge__marker::after {
  content: "";
  width: 1.4rem;
  height: 1px;
  background: var(--aqua-2);
}

/* ————— layout primitives ————— */

main {
  position: relative;
  z-index: 2;
  flex: 1;
}

.wrap {
  width: min(100% - 2 * var(--gut), var(--wide));
  margin-inline: auto;
}

.section {
  padding-block: clamp(4.5rem, 10vw, 9rem);
}

.section--tight {
  padding-block: clamp(3rem, 7vw, 6rem);
}

.section + .section {
  border-top: 1px solid var(--hair);
}

.kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-3);
  margin-bottom: 1.6rem;
}

.kicker b {
  font-weight: 500;
  color: var(--pearl);
}

.kicker .readout {
  text-transform: none;
  letter-spacing: 0.04em;
}

.title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: -0.012em;
  color: var(--bone);
  text-wrap: balance;
}

.title em {
  color: var(--pearl-2);
}

.lede {
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
  line-height: 1.5;
  color: var(--bone);
  max-width: 34em;
  text-wrap: pretty;
}

.prose {
  max-width: var(--measure);
}

.prose p + p,
.prose p + ul,
.prose ul + p {
  margin-top: 1.1em;
}

.prose ul {
  padding-left: 1.1em;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--bone);
  margin: 2.2em 0 0.6em;
}

.prose a {
  color: var(--bone);
  border-bottom: 1px solid var(--hair-3);
}

.prose a:hover {
  border-color: var(--bone);
}

.micro {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-3);
}

.arabic {
  font-family: var(--arabic);
  font-size: 1.5em;
  line-height: 1;
  color: var(--pearl);
  direction: rtl;
  unicode-bidi: isolate;
}

.split {
  display: grid;
  gap: 2.5rem var(--gut);
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
  }
  .split--even {
    grid-template-columns: 1fr 1fr;
  }
  .split__head {
    position: sticky;
    top: calc(var(--rail-h) + 2rem);
  }
}

/* ————— hero ————— */

.hero {
  position: relative;
  min-height: calc(100svh - var(--rail-h));
  display: grid;
  align-items: end;
  padding-block: clamp(3rem, 8vw, 6rem);
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  filter: saturate(0.72) brightness(0.78);
}

.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 48, 74, 0.2) 0%, rgba(11, 23, 40, 0.55) 55%, rgba(7, 15, 27, 0.96) 100%),
    linear-gradient(90deg, rgba(7, 15, 27, 0.55) 0%, rgba(7, 15, 27, 0) 60%);
}

.hero__inner {
  display: grid;
  gap: 2rem;
}

.hero h1 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.75rem, 8.4vw, 7.2rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--bone);
  max-width: 11em;
  text-wrap: balance;
}

.hero h1 span {
  color: var(--pearl-2);
}

.hero__lede {
  max-width: 30em;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.5;
  color: var(--bone);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

.hero__cta .micro {
  margin-left: 0.5rem;
}

.hero__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem 2rem;
  margin-top: clamp(2.5rem, 6vw, 5rem);
  padding-top: 1.2rem;
  border-top: 1px solid var(--hair-2);
}

.hero__foot .micro {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.hero__foot .micro b {
  color: var(--bone-2);
  font-weight: 500;
}

/* ————— manifesto ————— */

.manifesto .prose p {
  font-size: clamp(1.05rem, 1.35vw, 1.2rem);
  line-height: 1.55;
}

.manifesto .prose p:first-child {
  color: var(--bone);
}

.pull {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.15;
  color: var(--bone);
  border-left: 1px solid var(--pearl);
  padding-left: 1.4rem;
  margin: 2.6rem 0 0;
  max-width: 20em;
}

.pull small {
  display: block;
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-3);
}

/* ————— three lines ————— */

.lines {
  display: grid;
  gap: 1px;
  background: var(--hair);
  border: 1px solid var(--hair);
  margin-top: 3rem;
}

@media (min-width: 900px) {
  .lines {
    grid-template-columns: repeat(3, 1fr);
  }
}

.line {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 1.1rem;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  background: rgba(4, 7, 12, 0.38);
  transition: background 0.3s;
}

.line:hover {
  background: rgba(4, 7, 12, 0.6);
}

.line__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.line__idx {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--bone-3);
}

.line__arabic {
  font-family: var(--arabic);
  font-size: 1.7rem;
  line-height: 1;
  color: var(--pearl);
  direction: rtl;
}

.line__name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 2.6vw, 2.5rem);
  line-height: 1;
  color: var(--bone);
}

.line__name small {
  display: block;
  margin-top: 0.55rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--bone-3);
}

.line__text {
  color: var(--bone-2);
}

.line__text + .line__text {
  margin-top: 0.8rem;
}

.line__meta {
  display: grid;
  gap: 0.45rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--bone-3);
}

.line__meta span b {
  font-weight: 500;
  color: var(--aqua);
}

.seeb {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem 2rem;
  padding: 1.4rem clamp(1.4rem, 3vw, 2.4rem);
  border: 1px solid var(--pearl-hair);
  background: var(--pearl-wash);
}

@media (min-width: 900px) {
  .seeb {
    grid-template-columns: auto 1fr;
    align-items: center;
  }
}

.seeb__word {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-family: var(--serif);
  font-size: 1.9rem;
  color: var(--bone);
}

.seeb p {
  color: var(--bone-2);
  max-width: 50em;
}

/* ————— the place ————— */

.place__grid {
  display: grid;
  gap: 1px;
  background: var(--hair);
  border: 1px solid var(--hair);
  margin-top: 3rem;
}

@media (min-width: 900px) {
  .place__grid {
    grid-template-columns: 1.2fr 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .place__grid > figure {
    grid-column: 1;
    grid-row: 1 / 3;
  }
}

.place__grid > figure {
  position: relative;
  margin: 0;
  min-height: 18rem;
  background: var(--abyss);
}

.place__grid > figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.6) brightness(0.8);
}

.place__grid figcaption {
  position: absolute;
  left: 1.2rem;
  bottom: 1rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.spot {
  padding: clamp(1.4rem, 3vw, 2.2rem);
  background: rgba(4, 7, 12, 0.38);
  display: grid;
  gap: 0.8rem;
  align-content: start;
}

.spot__depth {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--aqua);
}

.spot h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.1;
  color: var(--bone);
}

.spot p {
  color: var(--bone-2);
  font-size: 0.98rem;
}

.bathy {
  margin-top: 3rem;
  border: 1px solid var(--hair);
  padding: clamp(1.2rem, 3vw, 2rem);
  background: rgba(4, 7, 12, 0.3);
}

.bathy svg {
  width: 100%;
  height: auto;
  display: block;
}

.bathy .micro {
  margin-bottom: 1rem;
}

/* ————— season ————— */

.season__facts {
  display: grid;
  gap: 1px;
  background: var(--hair);
  border: 1px solid var(--hair);
  margin-top: 3rem;
}

@media (min-width: 700px) {
  .season__facts {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .season__facts {
    grid-template-columns: repeat(4, 1fr);
  }
}

.fact {
  padding: 1.5rem;
  background: rgba(4, 7, 12, 0.38);
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.fact__num {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 3.6vw, 3.4rem);
  line-height: 1;
  color: var(--bone);
  font-variant-numeric: tabular-nums;
}

.fact__num small {
  font-size: 0.5em;
  color: var(--pearl);
  margin-left: 0.2em;
}

.fact__label {
  font-size: 0.92rem;
  color: var(--bone-2);
}

.day {
  margin-top: 3rem;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--hair-2);
}

.day__row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--hair);
}

.day__row time {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--aqua);
  padding-top: 0.2rem;
}

.day__row p {
  color: var(--bone-2);
}

.day__row p b {
  display: block;
  font-weight: 500;
  color: var(--bone);
}

/* ————— who ————— */

.who {
  display: grid;
  gap: 2rem;
  margin-top: 3rem;
}

@media (min-width: 800px) {
  .who {
    grid-template-columns: 1fr 1fr;
  }
}

.who__col {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.who__col h3 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pearl);
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--pearl-hair);
}

.who__col--not h3 {
  color: var(--bone-3);
  border-color: var(--hair-2);
}

.who__col ul {
  list-style: none;
  display: grid;
  gap: 0.8rem;
}

.who__col li {
  padding-left: 1.4rem;
  position: relative;
  color: var(--bone-2);
}

.who__col li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.6rem;
  height: 1px;
  background: var(--pearl);
}

.who__col--not li::before {
  background: var(--bone-3);
}

/* ————— safety ————— */

.rules {
  margin-top: 3rem;
  display: grid;
  gap: 1px;
  background: var(--hair);
  border: 1px solid var(--hair);
}

@media (min-width: 800px) {
  .rules {
    grid-template-columns: repeat(2, 1fr);
  }
}

.rule {
  padding: 1.6rem;
  background: rgba(4, 7, 12, 0.38);
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.6rem 1rem;
}

.rule__n {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--aqua);
  padding-top: 0.3rem;
}

.rule h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.15;
  color: var(--bone);
}

.rule p {
  grid-column: 2;
  color: var(--bone-2);
  font-size: 0.98rem;
}

/* ————— heritage ————— */

.heritage {
  position: relative;
}

.heritage__grid {
  display: grid;
  gap: 1rem;
  margin-top: 3rem;
}

@media (min-width: 800px) {
  .heritage__grid {
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(10rem, auto);
  }
  .heritage__grid figure:nth-child(1) {
    grid-column: 1 / 8;
    grid-row: 1 / 3;
  }
  .heritage__grid figure:nth-child(2) {
    grid-column: 8 / 13;
  }
  .heritage__grid figure:nth-child(3) {
    grid-column: 8 / 13;
  }
  .heritage__grid figure:nth-child(4) {
    grid-column: 1 / 5;
  }
  .heritage__grid .heritage__facts {
    grid-column: 5 / 13;
  }
}

.heritage__grid figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--abyss);
  border: 1px solid var(--hair);
}

.heritage__grid figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.05) sepia(0.18) brightness(0.92);
  transition: transform 1.2s var(--ease);
}

.heritage__grid figure:hover img {
  transform: scale(1.02);
}

.heritage__grid figcaption {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.9rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bone-2);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.heritage__facts {
  display: grid;
  gap: 1rem;
  align-content: start;
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--hair);
  background: rgba(4, 7, 12, 0.38);
}

.heritage__facts dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem 1.4rem;
  align-items: baseline;
}

.heritage__facts dt {
  font-family: var(--arabic);
  font-size: 1.45rem;
  line-height: 1;
  color: var(--pearl);
  direction: rtl;
  text-align: right;
}

.heritage__facts dd {
  color: var(--bone-2);
  font-size: 0.98rem;
}

.heritage__facts dd b {
  font-weight: 500;
  color: var(--bone);
  letter-spacing: 0.04em;
}

/* ————— apply ————— */

.apply {
  position: relative;
}

.apply__note {
  margin-top: 1.4rem;
  color: var(--bone-2);
  max-width: 34em;
}

.form {
  display: grid;
  gap: 1.3rem;
  margin-top: 0.5rem;
}

@media (min-width: 700px) {
  .form {
    grid-template-columns: 1fr 1fr;
  }
  .form .field--wide,
  .form .form__foot {
    grid-column: 1 / -1;
  }
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-3);
}

.field label small {
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--bone-3);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  background: rgba(4, 7, 12, 0.5);
  border: 1px solid var(--hair-2);
  border-radius: 2px;
  color: var(--bone);
  transition: border-color 0.2s;
}

.field textarea {
  min-height: 8.5rem;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--aqua);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--bone-3);
}

.form__foot {
  display: grid;
  gap: 1.2rem;
}

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: start;
  font-size: 0.9rem;
  color: var(--bone-2);
}

.consent input {
  width: 18px;
  height: 18px;
  margin-top: 0.2rem;
  accent-color: var(--pearl);
}

.form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.form__status {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--aqua);
  min-height: 1.2em;
}

.form__status.is-error {
  color: #d9a08a;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.received {
  display: none;
  padding: 2rem;
  border: 1px solid var(--pearl-hair);
  background: var(--pearl-wash);
}

.received.is-shown {
  display: block;
}

.received h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.9rem;
  color: var(--bone);
  margin-bottom: 0.6rem;
}

.form.is-hidden {
  display: none;
}

/* ————— footer ————— */

.foot {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--hair);
  padding: 3rem 0 2.5rem;
  color: var(--bone-3);
  font-size: 0.85rem;
}

.foot__grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 800px) {
  .foot__grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.foot h4 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-3);
  margin-bottom: 0.9rem;
}

.foot ul {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.foot a {
  color: var(--bone-2);
  display: inline-flex;
  min-height: 32px;
  align-items: center;
}

.foot a:hover {
  color: var(--bone);
}

.foot p + p {
  margin-top: 0.7rem;
}

.foot__legal {
  margin-top: 2.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--hair);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 2rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}

.foot__legal .arabic {
  font-size: 1rem;
}

.credits {
  font-size: 0.78rem;
  line-height: 1.5;
}

/* ————— document pages (theory, records) ————— */

.doc {
  padding-block: clamp(3rem, 7vw, 6rem) clamp(4rem, 9vw, 8rem);
}

.doc__head {
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
  display: grid;
  gap: 1.4rem;
}

.doc__body {
  display: grid;
  gap: 3rem var(--gut);
}

@media (min-width: 1000px) {
  .doc__body {
    grid-template-columns: 14rem minmax(0, 1fr);
    align-items: start;
  }
  .toc {
    position: sticky;
    top: calc(var(--rail-h) + 1.5rem);
  }
}

.toc {
  display: grid;
  gap: 0.1rem;
  align-content: start;
  border-left: 1px solid var(--hair-2);
}

.toc a {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.45rem 0 0.45rem 1rem;
  font-size: 0.86rem;
  color: var(--bone-3);
  border-left: 1px solid transparent;
  margin-left: -1px;
  transition: color 0.2s, border-color 0.2s;
  min-height: 36px;
}

.toc a span:first-child {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--bone-3);
}

.toc a:hover,
.toc a.is-active {
  color: var(--bone);
  border-left-color: var(--pearl);
}

.doc__sections {
  display: grid;
  gap: clamp(3rem, 6vw, 5rem);
  max-width: 46rem;
}

.doc__section {
  scroll-margin-top: calc(var(--rail-h) + 1.5rem);
}

.doc__section > .micro {
  margin-bottom: 0.9rem;
  color: var(--aqua);
}

.doc__section h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  line-height: 1.1;
  color: var(--bone);
  margin-bottom: 1.2rem;
  text-wrap: balance;
}

.doc__section .prose {
  max-width: none;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6rem 0;
  font-size: 0.92rem;
}

.table th,
.table td {
  padding: 0.75rem 0.8rem 0.75rem 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--hair);
}

.table th {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-3);
}

.table td.num,
.table th.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--aqua-2);
}

.table td b {
  font-weight: 500;
  color: var(--bone);
}

.table .pend {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--pearl);
  margin-left: 0.4rem;
  vertical-align: middle;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.callout {
  margin: 1.8rem 0;
  padding: 1.3rem 1.5rem;
  border-left: 1px solid var(--pearl);
  background: var(--pearl-wash);
  color: var(--bone-2);
}

.callout b {
  color: var(--bone);
}

.callout--cold {
  border-left-color: var(--aqua);
  background: rgba(127, 179, 200, 0.07);
}

.gloss {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem 1.5rem;
  align-items: baseline;
  margin-top: 1.5rem;
}

.gloss dt {
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
  white-space: nowrap;
}

.gloss dt .arabic {
  font-size: 1.4rem;
}

.gloss dt b {
  font-weight: 500;
  letter-spacing: 0.04em;
}

.gloss dd {
  color: var(--bone-2);
}

/* ————— reveal ————— */

.reveal {
  opacity: 0;
  translate: 0 14px;
  transition: opacity 0.9s var(--ease), translate 0.9s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  translate: 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    translate: 0 0;
    transition: none;
  }
  .heritage__grid figure img {
    transition: none;
  }
}

/* ————— 404 ————— */

.lost {
  min-height: calc(100svh - var(--rail-h));
  display: grid;
  align-content: center;
  gap: 1.4rem;
  padding-block: 4rem;
}

.lost h1 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  line-height: 1;
  color: var(--bone);
}

/* gauge tick positions (no inline styles: CSP forbids them) */
.gauge__tick[data-m="0"] { top: 0; }
.gauge__tick[data-m="10"] { top: 16.66%; }
.gauge__tick[data-m="20"] { top: 33.33%; }
.gauge__tick[data-m="30"] { top: 50%; }
.gauge__tick[data-m="40"] { top: 66.66%; }
.gauge__tick[data-m="50"] { top: 83.33%; }
.gauge__tick[data-m="60"] { top: 100%; }

.lede--gap {
  margin-top: 1.2rem;
}

/* ————— audit fixes, 2026-11-02 ————— */

/* grid items default to min-width:auto, so a nowrap glossary term or a wide
   table pushed the whole document column past the viewport on phones */
.doc__body > * {
  min-width: 0;
}

.toc a {
  min-height: 44px;
}

.foot a {
  min-height: 44px;
}

.credits {
  font-size: 0.84rem;
}

@media (max-width: 700px) {
  .gloss {
    grid-template-columns: 1fr;
    gap: 0.3rem 0;
  }
  .gloss dt {
    white-space: normal;
    flex-wrap: wrap;
  }
  .gloss dd {
    margin-bottom: 0.9rem;
  }
}

/* rail button: full label on wide screens, one word on phones */
.btn__short {
  display: none;
}

@media (max-width: 560px) {
  .btn__long {
    display: none;
  }
  .btn__short {
    display: inline;
  }
}

/* gauge: the readout wrapped onto two lines and sat on the first tick */
.gauge {
  width: 6rem;
}

.gauge__marker {
  right: 0.2rem;
  white-space: nowrap;
  justify-content: flex-end;
  width: 5.6rem;
  text-shadow: 0 1px 2px rgba(4, 7, 12, 0.9);
}

.gauge__marker span {
  padding: 0.1rem 0.3rem;
  background: rgba(4, 7, 12, 0.72);
  border-radius: 2px;
}

.gauge__tick {
  z-index: -1;
}

/* the same min-width trap one level down: each section is a grid item too */
.doc__sections > * {
  min-width: 0;
}

.table-wrap {
  max-width: 100%;
}
