/* ==========================================================================
   ABI Holding — single-page site
   Direction: RTL only (lang="fa"). Logical properties throughout; the few
   physical values (transform-origin, translateX) are noted where they assume RTL.
   Token names follow the VibeFarsi theme schema; values are ABI's own theme.
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face { font-family: "Pelak"; src: url("fonts/Pelak-Light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Pelak"; src: url("fonts/Pelak-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pelak"; src: url("fonts/Pelak-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

/* ---------- Theme tokens ---------- */
:root {
  color-scheme: light;

  /* لاجورد، کاغذ، مرکب، زر */
  --lajvard: #14227a;
  --lajvard-deep: #0b1450;
  --night: #070c34;
  --kaghaz: #f4f5f9;
  --kaghaz-tint: #e8eaf3;
  --ink: #0c1136;
  --zar: #cda650;
  --zar-ink: #7e5e10;

  --background: var(--kaghaz);
  --foreground: var(--ink);
  --card: #fcfcfe;
  --muted: var(--kaghaz-tint);
  --muted-foreground: #474d72;
  --border: rgb(12 17 54 / 0.14);
  --brand: var(--zar-ink);
  --brand-line: #b08a2e;
  --primary: var(--lajvard);
  --primary-foreground: #f4f5f9;
  --ring: var(--lajvard);

  --radius: 0.125rem;
  --shape-control: 0.125rem;
  --shape-surface: 0.125rem;
  --line: 1px;
  --motion: 200ms;
  --motion-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --type-body: "Pelak", Tahoma, sans-serif;
  --type-display: "Pelak", Tahoma, sans-serif;

  /* Type scale */
  --fs-meta: 0.875rem;
  --fs-body: 1.0625rem;
  --fs-lead: 1.25rem;
  --fs-h3: clamp(1.1875rem, 1.05rem + 0.5vw, 1.4375rem);
  --fs-statement: clamp(1.4375rem, 1.05rem + 1.5vw, 2.125rem);
  --fs-h2: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  --fs-display: min(5rem, 9.7cqi); /* widest hero line is ~9.9em in Pelak Light, so it always fits its column */

  --bar-h: 64px;
  --gutter: clamp(20px, 5vw, 64px);
  --split-gap: clamp(32px, 5vw, 80px);
}

[data-tone="dark"] {
  color-scheme: dark;
  --background: var(--lajvard);
  --foreground: #eef0fa;
  --card: rgb(255 255 255 / 0.04);
  --muted: rgb(255 255 255 / 0.06);
  --muted-foreground: #b5bce6;
  --border: rgb(238 240 250 / 0.16);
  --brand: var(--zar);
  --brand-line: var(--zar);
  --primary: var(--zar);
  --primary-foreground: var(--ink);
  --ring: var(--zar);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--bar-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--foreground);
  font-family: var(--type-body);
  font-size: var(--fs-body);
  line-height: 1.9;
  letter-spacing: 0;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, figure, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }

::selection { background: var(--zar); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: var(--radius);
}

.container {
  width: min(100%, 1240px + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip {
  position: fixed;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--zar);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- Header ---------- */
.bar {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 50;
  height: var(--bar-h);
  background: rgb(7 12 52 / 0.94);
  color: var(--foreground);
  border-block-end: 1px solid var(--border);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
}

.bar__row {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-family: var(--type-display);
  font-size: 1.1875rem;
  font-weight: 300;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
}
.mark b, .sld__source-name b, .foot__name b { font-weight: 700; }

/* the motif: one line, one node */
.mark__glyph {
  position: relative;
  width: 28px;
  height: 12px;
  flex: none;
}
.mark__glyph::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: 5px;
  height: 2px;
  background: var(--zar);
}
.mark__glyph::after {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 8px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--zar);
  border-radius: 50%;
  background: var(--night);
}

.nav ul { display: flex; align-items: center; gap: 2px; }

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 11px;
  font-size: var(--fs-meta);
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted-foreground);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--motion) var(--motion-ease);
}
.nav a:hover { color: var(--foreground); }
.nav a[aria-current="true"] { color: var(--foreground); }
.nav a::after {
  content: "";
  position: absolute;
  inset-inline: 11px;
  inset-block-end: 6px;
  height: 2px;
  background: var(--zar);
  transform: scaleX(0);
  transition: transform var(--motion) var(--motion-ease);
}
.nav a[aria-current="true"]::after { transform: scaleX(1); }

.bar__toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--shape-control);
  color: inherit;
  font-size: 1.25rem;
  cursor: pointer;
}
.bar__toggle .icon--close { display: none; }
.bar[data-open="true"] .bar__toggle .icon--open { display: none; }
.bar[data-open="true"] .bar__toggle .icon--close { display: block; }

/* reading progress: the line fills from the start edge (right, in RTL) */
.bar__progress {
  position: absolute;
  inset-inline: 0;
  inset-block-end: -1px;
  height: 2px;
  background: var(--zar);
  transform: scaleX(var(--progress, 0));
  transform-origin: 100% 50%;
}

@media (max-width: 1099px) {
  .bar__toggle { display: inline-flex; }

  .nav {
    position: absolute;
    inset-block-start: var(--bar-h);
    inset-inline: 0;
    max-height: calc(100dvh - var(--bar-h));
    overflow-y: auto;
    background: var(--night);
    border-block-end: 1px solid var(--border);
    padding-block: 8px 16px;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity var(--motion) var(--motion-ease), transform var(--motion) var(--motion-ease), visibility 0s linear var(--motion);
  }
  .bar[data-open="true"] .nav {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition-delay: 0s;
  }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; padding-inline: var(--gutter); }
  .nav a {
    display: flex;
    min-height: 48px;
    padding-inline: 0;
    font-size: var(--fs-body);
    border-block-end: 1px solid var(--border);
  }
  .nav li:last-child a { border-block-end: 0; }
  .nav a::after { display: none; }
  .nav a[aria-current="true"] { color: var(--zar); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding-inline: 22px;
  border: 1px solid transparent;
  border-radius: var(--shape-control);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
  transition: background-color var(--motion) var(--motion-ease), border-color var(--motion) var(--motion-ease), transform var(--motion) var(--motion-ease);
}
.btn:active { transform: translateY(1px); }
.btn--solid { background: var(--primary); color: var(--primary-foreground); }
.btn--solid:hover { background: #ddb964; }
.btn--line { border-color: var(--border); color: var(--foreground); }
.btn--line:hover { border-color: var(--brand-line); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: min(100svh, 940px);
  display: grid;
  align-items: center;
  padding-block: calc(var(--bar-h) + clamp(40px, 6vw, 88px)) clamp(56px, 7vw, 104px);
  color: var(--foreground);
  background:
    radial-gradient(90% 70% at 88% 0%, #1d2f9c 0%, transparent 60%),
    linear-gradient(180deg, var(--lajvard) 0%, var(--lajvard-deep) 100%);
}

/* drafting grid, fading out toward the bottom */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgb(238 240 250 / 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgb(238 240 250 / 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: 100% var(--bar-h);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: clamp(32px, 4vw, 64px);
  align-items: center;
}
.hero__copy { container-type: inline-size; }

.hero__name { display: grid; gap: 2px; font: inherit; }
.hero__name-fa { font-size: var(--fs-lead); font-weight: 700; line-height: 1.6; }
.hero__name-en {
  justify-self: start;
  font-size: var(--fs-meta);
  line-height: 1.6;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.hero__thesis {
  margin-block: clamp(20px, 3vw, 36px) clamp(28px, 4vw, 48px);
  font-family: var(--type-display);
  font-size: var(--fs-display);
  font-weight: 400;
  line-height: 1.4;
}
.hero__thesis span { display: block; white-space: nowrap; }
.hero__thesis span:last-child { color: var(--zar); }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Single-line diagram (hero) ---------- */
.sld {
  --feeder: 64px;
  --row: 64px;
  display: grid;
  grid-template-columns: auto 36px auto;
  align-items: center;
}

.sld__source {
  display: grid;
  gap: 4px;
  max-width: 216px;
  padding: 16px 18px 18px;
  background: rgb(7 12 52 / 0.55);
  border: 1px solid var(--brand-line);
  outline: 1px solid var(--border);
  outline-offset: 5px;
}
.sld__source-name {
  justify-self: start;
  font-family: var(--type-display);
  font-size: var(--fs-h3);
  font-weight: 300;
  line-height: 1.5;
  white-space: nowrap;
}
.sld__source-role { font-size: var(--fs-meta); line-height: 1.75; color: var(--muted-foreground); }

.sld__trunk { position: relative; overflow: hidden; height: 2px; background: var(--brand-line); }

.sld__feeders { position: relative; }
.sld__feeders li { position: relative; }

/* bus segments: each row draws its own piece so the bus ends at the first and last feeder */
.sld__feeders li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 0;
  width: 2px;
  background: var(--brand-line);
}
.sld__feeders li:first-child::before { inset-block-start: 50%; }
.sld__feeders li:last-child::before { inset-block-end: 50%; }

.sld__feeders a {
  display: grid;
  grid-template-columns: var(--feeder) auto minmax(0, 1fr);
  align-items: center;
  min-height: var(--row);
  text-decoration: none;
}

.sld__line { position: relative; overflow: hidden; height: 2px; background: rgb(205 166 80 / 0.55); }

.sld__node {
  width: 14px;
  height: 14px;
  margin-inline-end: 16px;
  border: 2px solid var(--brand-line);
  border-radius: 50%;
  background: var(--lajvard-deep);
  transition: background-color var(--motion) var(--motion-ease), box-shadow var(--motion) var(--motion-ease);
}

.sld__label {
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  white-space: nowrap;
  transition: color var(--motion) var(--motion-ease);
}

.sld__feeders a:hover .sld__node,
.sld__feeders a:focus-visible .sld__node { background: var(--zar); box-shadow: 0 0 0 6px rgb(205 166 80 / 0.2); }
.sld__feeders a:hover .sld__label { color: var(--zar); }

/* light travelling along the conductors (leftward: assumes RTL) */
.sld__trunk::after,
.sld__line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, #fff3cf 50%, transparent 100%);
  transform: translateX(101%);
}

@media (max-width: 1099px) {
  .hero { min-height: 0; }
  .hero__grid { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .sld { justify-self: start; }
}

@media (max-width: 599px) {
  .sld { --row: 56px; --feeder: 40px; grid-template-columns: minmax(0, 1fr); justify-items: start; justify-self: stretch; }
  .sld__source { max-width: none; }
  .sld__trunk { width: 2px; height: 28px; margin-block-start: 6px; }
  .sld__trunk::after { display: none; }
  .sld__feeders { justify-self: stretch; }
  .sld__feeders li:first-child::before { inset-block-start: 0; }
  .sld__label { white-space: normal; }
}

/* ---------- Sections ---------- */
.sec {
  background: var(--background);
  color: var(--foreground);
  padding-block: clamp(64px, 8.5vw, 120px);
}
.sec--tint { --background: var(--kaghaz-tint); }
.sec--night { --background: var(--night); }

.sec__head { margin-block-end: clamp(24px, 3vw, 40px); }

/* a station on the line: opens every section */
.station {
  position: relative;
  display: block;
  width: 64px;
  height: 12px;
  margin-block-end: 18px;
}
.station::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: 5px;
  height: 2px;
  background: var(--brand-line);
}
.station::after {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 12px;
  height: 12px;
  border: 2px solid var(--brand-line);
  border-radius: 50%;
  background: var(--background);
}

h2 {
  font-family: var(--type-display);
  font-size: var(--fs-h2);
  font-weight: 300;
  line-height: 1.45;
  text-wrap: balance;
}

h3 {
  font-family: var(--type-display);
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.6;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 24px var(--split-gap);
  align-items: start;
}
.split > .sec__head { margin-block-end: 0; }

.prose p { max-width: 46rem; }
.prose p + p, .prose p + .prose__cols { margin-block-start: 1.15em; }
.lead { font-size: var(--fs-lead); font-weight: 400; line-height: 1.9; }

.prose__cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 40px;
  max-width: 46rem;
  padding-block-start: 28px;
  border-block-start: 1px solid var(--border);
}
.prose .prose__cols p { margin-block-start: 0; }

.statement {
  font-family: var(--type-display);
  font-size: var(--fs-statement);
  font-weight: 300;
  line-height: 1.8;
  text-wrap: pretty;
}

/* Vision / mission */
.duo {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 40px var(--split-gap);
  align-items: start;
}
.duo h2 { font-size: var(--fs-h3); font-weight: 700; color: var(--brand); }
.duo .sec__head { margin-block-end: 20px; }
.mission { padding-inline-start: var(--split-gap); border-inline-start: 1px solid var(--border); }
.duo .mission { margin-inline-start: calc(var(--split-gap) * -0.5); padding-inline-start: calc(var(--split-gap) * 0.5); }

/* Focus areas: five feeders off one bus */
.feeder {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 5fr) minmax(0, 7fr);
  gap: 8px clamp(20px, 3.5vw, 56px);
  align-items: baseline;
  padding-block: 28px 30px;
  padding-inline-start: 44px;
  border-block-start: 1px solid var(--border);
  scroll-margin-top: calc(var(--bar-h) + 16px);
  transition: background-color var(--motion) var(--motion-ease);
}
.feeder:last-child { border-block-end: 1px solid var(--border); }
.feeder::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: -1px 0;
  width: 2px;
  background: var(--brand-line);
}
.feeder::after {
  content: "";
  position: absolute;
  inset-inline-start: -6px;
  inset-block-start: 50%;
  width: 14px;
  height: 14px;
  margin-block-start: -7px;
  border: 2px solid var(--brand-line);
  border-radius: 50%;
  background: var(--background);
  transition: background-color var(--motion) var(--motion-ease), box-shadow var(--motion) var(--motion-ease);
}
.feeder:hover::after, .feeder:target::after { background: var(--zar); box-shadow: 0 0 0 6px rgb(205 166 80 / 0.2); }
.feeder:target { background: var(--muted); }

.feeder__num {
  font-family: var(--type-display);
  font-size: var(--fs-h2);
  font-weight: 300;
  line-height: 1.2;
  color: var(--brand);
}

/* Approach: criteria table ruled like a manuscript jadval */
.jadval {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-block-start: clamp(36px, 4.5vw, 64px);
  background: var(--border);
  border: 1px solid var(--brand-line);
  outline: 1px solid var(--border);
  outline-offset: 5px;
}
.jadval li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 96px;
  padding: 24px;
  background: var(--card);
  font-weight: 400;
  line-height: 1.8;
}
.jadval li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-block-start: 0.7em;
  border-radius: 50%;
  background: var(--brand-line);
}

/* Value-creation chain: seven stations on one line */
.chain {
  --idx-h: 40px;
  --node: 20px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-block: clamp(48px, 6vw, 88px) clamp(40px, 5vw, 72px);
}
.chain::before,
.chain::after {
  content: "";
  position: absolute;
  inset-inline: calc(100% / 14);
  inset-block-start: calc(var(--idx-h) + var(--node) / 2 - 1px);
  height: 2px;
}
.chain::before { background: rgb(205 166 80 / 0.28); }
.chain::after { background: var(--zar); transform-origin: 100% 50%; } /* draws from the right: RTL */

.chain__step {
  position: relative;
  display: grid;
  grid-template-rows: var(--idx-h) var(--node) auto;
  justify-items: center;
  text-align: center;
}
.chain__idx { font-size: var(--fs-meta); line-height: var(--idx-h); color: var(--muted-foreground); }
.chain__node {
  position: relative;
  z-index: 1;
  width: var(--node);
  height: var(--node);
  border: 2px solid var(--zar);
  border-radius: 50%;
  background: var(--background);
}
.chain__node::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--zar);
}
.chain__label {
  margin-block-start: 18px;
  padding-inline: 6px;
  font-family: var(--type-display);
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.55;
  text-wrap: balance;
}

/* direction marks between stations, pointing left: RTL */
.chain__step:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-inline-end: -5px;
  inset-block-start: calc(var(--idx-h) + var(--node) / 2 - 5px);
  width: 10px;
  height: 10px;
  border-inline-end: 2px solid var(--zar);
  border-block-end: 2px solid var(--zar);
  transform: rotate(45deg);
}

.chain__step--goal .chain__node { background: var(--zar); box-shadow: 0 0 0 7px rgb(205 166 80 / 0.22); }
.chain__step--goal .chain__node::after { display: none; }
.chain__step--goal .chain__label { color: var(--zar); }

.chain__note {
  max-width: 46rem;
  margin-inline-start: calc((100% - var(--split-gap)) / 3 + var(--split-gap));
}

/* Competitive edge: five taps hanging from a busbar */
.busbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tap {
  position: relative;
  padding-block-start: 44px;
  padding-inline-end: 28px;
  border-block-start: 2px solid var(--brand-line);
}
.tap::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 6px;
  width: 2px;
  height: 28px;
  background: var(--brand-line);
}
.tap::after {
  content: "";
  position: absolute;
  inset-block-start: -8px;
  inset-inline-start: 0;
  width: 14px;
  height: 14px;
  border: 2px solid var(--brand-line);
  border-radius: 50%;
  background: var(--background);
}
.tap h3 { margin-block-end: 10px; }

/* Governance: separated layers */
.gov {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px var(--split-gap);
  align-items: center;
}
.layers ol { display: grid; gap: 20px; }
.layers li {
  position: relative;
  padding: 14px 24px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-inline-start: 2px solid var(--brand-line);
  font-family: var(--type-display);
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.6;
}
.layers li:nth-child(2) { margin-inline-start: 32px; }
.layers li:nth-child(3) { margin-inline-start: 64px; }
.layers li:nth-child(4) { margin-inline-start: 96px; }
.layers li + li::before {
  content: "";
  position: absolute;
  inset-block-start: -21px;
  inset-inline-start: -2px;
  width: 2px;
  height: 20px;
  background: var(--brand-line);
}
.layers figcaption { margin-block-start: 18px; font-size: var(--fs-meta); color: var(--muted-foreground); }

/* Horizon */
.horizon {
  position: relative;
  overflow: hidden;
  padding-block-end: clamp(104px, 13vw, 184px);
  background: linear-gradient(180deg, var(--lajvard) 0%, var(--lajvard-deep) 100%);
}
.horizon::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  height: 65%;
  background: radial-gradient(58% 100% at 50% 100%, rgb(205 166 80 / 0.3) 0%, transparent 72%);
  pointer-events: none;
}
.horizon::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--zar) 22%, #fff3cf 50%, var(--zar) 78%, transparent 100%);
}
.horizon .container { position: relative; }
.horizon__lead { max-width: 46rem; font-size: var(--fs-lead); line-height: 1.9; }
.statement--wide {
  max-width: 25em;
  margin-block-start: clamp(32px, 4vw, 56px);
  font-size: var(--fs-h2);
  font-weight: 300;
  line-height: 1.7;
}

/* ---------- Footer ---------- */
.foot {
  background: var(--night);
  color: var(--foreground);
  padding-block: clamp(48px, 6vw, 80px) 40px;
}
.foot__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px var(--split-gap);
  align-items: end;
}
.foot__id { display: grid; justify-items: start; }
.foot__name {
  font-family: var(--type-display);
  font-size: clamp(2.5rem, 1.4rem + 4.6vw, 4.375rem);
  font-weight: 300;
  line-height: 1.3;
}
.foot__full {
  font-size: var(--fs-meta);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.foot__thesis {
  grid-column: 1 / -1;
  padding-block-start: 28px;
  border-block-start: 1px solid var(--border);
  font-family: var(--type-display);
  font-size: var(--fs-statement);
  font-weight: 300;
  line-height: 1.7;
  color: var(--zar);
}
.foot__meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  font-size: var(--fs-meta);
}
.foot__site { color: var(--muted-foreground); }
.foot__site a {
  display: inline-block;
  padding-block: 10px;
  color: var(--foreground);
  font-weight: 700;
  text-decoration-color: var(--zar);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.foot__top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color var(--motion) var(--motion-ease);
}
.foot__top:hover { color: var(--foreground); }

/* ---------- Responsive ---------- */
@media (max-width: 1099px) {
  .busbar { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
}

@media (max-width: 899px) {
  .split, .duo, .gov { grid-template-columns: minmax(0, 1fr); }
  .duo .mission {
    margin-inline-start: 0;
    padding-inline-start: 0;
    padding-block-start: 36px;
    border-inline-start: 0;
    border-block-start: 1px solid var(--border);
  }

  .feeder { grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; row-gap: 8px; padding-inline-start: 28px; }
  .feeder p { grid-column: 1 / -1; }
  .feeder::after { inset-block-start: 54px; }

  .jadval { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jadval li:last-child { grid-column: 1 / -1; }

  /* the chain turns vertical */
  .chain {
    --idx-w: 28px;
    --gap: 16px;
    grid-template-columns: minmax(0, 1fr);
  }
  .chain::before,
  .chain::after {
    inset-inline: auto;
    inset-inline-start: calc(var(--idx-w) + var(--gap) + var(--node) / 2 - 1px);
    inset-block: 30px;
    width: 2px;
    height: auto;
    transform-origin: 50% 0;
  }
  .chain__step {
    grid-template-rows: auto;
    grid-template-columns: var(--idx-w) var(--node) minmax(0, 1fr);
    column-gap: var(--gap);
    align-items: center;
    justify-items: start;
    min-height: 60px;
    text-align: start;
  }
  .chain__idx { line-height: 1.5; }
  .chain__label { margin-block-start: 0; padding-inline: 0; font-size: var(--fs-h3); }
  .chain__step:not(:last-child)::after { display: none; }
  .chain__note { margin-inline-start: 0; }

  .layers li:nth-child(2) { margin-inline-start: 20px; }
  .layers li:nth-child(3) { margin-inline-start: 40px; }
  .layers li:nth-child(4) { margin-inline-start: 60px; }
}

@media (max-width: 599px) {
  .hero__actions .btn { flex: 1 1 100%; }
  .prose__cols { grid-template-columns: minmax(0, 1fr); }
  .jadval { grid-template-columns: minmax(0, 1fr); }
  .jadval li { min-height: 0; padding: 18px 20px; }
  .busbar { grid-template-columns: minmax(0, 1fr); }
  .tap { padding-inline-end: 0; }
  .foot__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* scroll reveal, once */
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }

  /* hero: the diagram energises from the source outward */
  .hero__copy > * { animation: rise 800ms var(--ease-out) both; }
  .hero__copy > :nth-child(2) { animation-delay: 80ms; }
  .hero__copy > :nth-child(3) { animation-delay: 180ms; }

  .sld__source { animation: fade 600ms var(--ease-out) 150ms both; }
  .sld__trunk { transform-origin: 100% 50%; animation: draw-x 400ms var(--ease-out) 450ms both; }
  .sld__feeders li::before { animation: fade 400ms var(--ease-out) 750ms both; }
  .sld__line { transform-origin: 100% 50%; animation: draw-x 500ms var(--ease-out) calc(850ms + var(--i) * 70ms) both; }
  .sld__node,
  .sld__label { animation: fade 500ms var(--ease-out) calc(1150ms + var(--i) * 70ms) both; }

  .sld__feeders li:nth-child(1) { --i: 0; }
  .sld__feeders li:nth-child(2) { --i: 1; }
  .sld__feeders li:nth-child(3) { --i: 2; }
  .sld__feeders li:nth-child(4) { --i: 3; }
  .sld__feeders li:nth-child(5) { --i: 4; }

  .sld__trunk::after { animation: pulse 6s linear 2s infinite; }
  .sld__line::after { animation: pulse 6s linear calc(2.35s + var(--i) * 0.28s) infinite; }

  /* value chain: the line fills, stations light in order */
  .js .chain::after { transform: scaleX(0); transition: transform 1500ms cubic-bezier(0.45, 0, 0.3, 1) 150ms; }
  .js .chain.is-in::after { transform: scaleX(1); }
  .js .chain__step { opacity: 0.35; transition: opacity 400ms var(--motion-ease); transition-delay: calc(150ms + var(--i) * 240ms); }
  .js .chain.is-in .chain__step { opacity: 1; }
  .chain__step:nth-child(1) { --i: 0; }
  .chain__step:nth-child(2) { --i: 1; }
  .chain__step:nth-child(3) { --i: 2; }
  .chain__step:nth-child(4) { --i: 3; }
  .chain__step:nth-child(5) { --i: 4; }
  .chain__step:nth-child(6) { --i: 5; }
  .chain__step:nth-child(7) { --i: 6; }
  .chain.is-in .chain__step--goal .chain__node { animation: halo 3.2s ease-in-out 2s infinite; }

  @media (max-width: 899px) {
    .js .chain::after { transform: scaleY(0); }
    .js .chain.is-in::after { transform: scaleY(1); }
  }
}

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

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes draw-x { from { transform: scaleX(0); } }
@keyframes pulse {
  0% { transform: translateX(101%); }
  22%, 100% { transform: translateX(-101%); }
}
@keyframes halo {
  0%, 100% { box-shadow: 0 0 0 7px rgb(205 166 80 / 0.22); }
  50% { box-shadow: 0 0 0 13px rgb(205 166 80 / 0.08); }
}

@media print {
  .bar, .skip, .hero__actions, .foot__top { display: none; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
