/* ==========================================================================
   Holding Lebanon S.A.L. — site styles
   One stylesheet for the English, French and Arabic (RTL) pages.
   Layout uses logical properties (inline-start/end) so RTL works as-is.
   ========================================================================== */

:root {
  /* Palette — security-paper greens, engraving ink, one flag red */
  --paper: #F1F3EC;
  --paper-2: #E5EBE1;
  --paper-3: #D9E2D4;
  --sheet: #FAFBF6;
  --ink: #14231C;
  --ink-2: #2F4037;
  --muted: #56685E;
  --line: #C6D1C5;
  --cedar: #1E5A43;
  --cedar-deep: #0E2F23;
  --engrave: #9CBBA8;
  --red: #C8322B;
  --red-soft: #EE7064;
  --on-dark: #EEF3EC;
  --on-dark-muted: #A9C2B3;

  /* Type */
  --font-display: "Libre Caslon Display", "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --font-body: "Libre Franklin", "Franklin Gothic Book", "Segoe UI", system-ui, sans-serif;
  --font-letter: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --font-latin-display: "Libre Caslon Display", Georgia, serif;
  --font-latin-body: "Libre Franklin", "Segoe UI", system-ui, sans-serif;

  --step--1: clamp(0.84rem, 0.81rem + 0.12vw, 0.9rem);
  --step-0: clamp(1rem, 0.97rem + 0.16vw, 1.1rem);
  --step-1: clamp(1.18rem, 1.1rem + 0.4vw, 1.42rem);
  --step-2: clamp(1.42rem, 1.26rem + 0.8vw, 1.95rem);
  --step-3: clamp(1.75rem, 1.46rem + 1.45vw, 2.75rem);
  --step-4: clamp(2.2rem, 1.7rem + 2.5vw, 3.9rem);
  --step-5: clamp(2.7rem, 1.85rem + 4.1vw, 5.6rem);

  /* Layout */
  --gutter: clamp(1rem, 0.55rem + 2.2vw, 2.5rem);
  --maxw: 1200px;
  --header-h: 76px;
}

/* Arabic page: Naskh display + Arabic sans body, set a touch larger (Arabic reads small at Latin sizes) */
html[lang="ar"] {
  font-size: 106.25%;
  --font-display: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
  --font-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-letter: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
}

/* Tracking and uppercase break Arabic joining — never apply them to Arabic text */
*:lang(ar) {
  letter-spacing: 0 !important;
  text-transform: none !important;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body {
  line-height: 1.85;
}

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

a {
  color: var(--cedar);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.012em;
  color: inherit;
  text-wrap: balance;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3 {
  font-weight: 700;
  line-height: 1.3;
}

p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

p {
  text-wrap: pretty;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100px;
  z-index: 100;
  background: var(--cedar-deep);
  color: var(--on-dark);
  padding: 0.6rem 1rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
  color: var(--on-dark);
}

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

/* Lebanese flag proportions: red 1 / white 2 / red 1 */
.flag-rule {
  height: 8px;
  background: linear-gradient(to bottom, var(--red) 0 25%, #fff 25% 75%, var(--red) 75% 100%);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.9rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--cedar-deep);
  color: var(--on-dark);
}

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

.btn-ghost {
  background: transparent;
  border-color: color-mix(in srgb, var(--ink) 38%, transparent);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--paper-2);
  border-color: var(--ink);
  color: var(--ink);
}

.btn .arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.btn:hover .arrow {
  transform: translateX(4px);
}

html[dir="rtl"] .btn .arrow {
  transform: scaleX(-1);
}

html[dir="rtl"] .btn:hover .arrow {
  transform: scaleX(-1) translateX(4px);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px -24px rgb(14 47 35 / 0.6);
}

.header-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-inline-end: auto;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
  color: var(--cedar);
}

.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-name b {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 400;
  white-space: nowrap;
}

html[lang="ar"] .brand-name b {
  font-weight: 700;
  font-size: 1.4rem;
}

.brand-name small {
  margin-top: 0.32rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

html[lang="ar"] .brand-name small {
  margin-top: 0.15rem;
  font-size: 0.78rem;
}

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

.nav-links {
  display: flex;
  gap: 1.5rem;
  padding: 0;
  list-style: none;
}

.nav-links a {
  position: relative;
  display: inline-block;
  padding-block: 0.4rem;
  color: var(--ink-2);
  font-size: 0.93rem;
  font-weight: 500;
  text-decoration: none;
}

.nav-links a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0.1rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

html[dir="rtl"] .nav-links a::after {
  transform-origin: right;
}

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

.nav-links a:hover::after,
.nav-links a[aria-current="true"]::after {
  transform: scaleX(1);
}

.lang-switch {
  display: flex;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.lang-switch a {
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-latin-body);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
  text-decoration: none;
}

.lang-switch a:lang(ar) {
  font-family: "IBM Plex Sans Arabic", Tahoma, sans-serif;
  font-size: 0.82rem;
}

.lang-switch a:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.lang-switch a[aria-current="page"] {
  background: var(--cedar);
  color: var(--on-dark);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle-bars {
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
}

.nav-toggle-bars::before {
  top: -6px;
}

.nav-toggle-bars::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Section scaffolding ---------- */
.section {
  padding-block: clamp(4rem, 8vw, 7.5rem);
}

.eyebrow,
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--cedar);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

html[lang="ar"] .eyebrow,
html[lang="ar"] .section-label {
  font-size: 0.95rem;
}

.eyebrow::before,
.section-label::before {
  content: "";
  width: 28px;
  height: 1px;
  flex: none;
  background: var(--red);
}

.section-head {
  display: grid;
  gap: 1.1rem;
  max-width: 50rem;
  margin-bottom: clamp(2.5rem, 5vw, 4.25rem);
}

.section-head h2,
.section h2 {
  font-size: var(--step-4);
}

.section-intro {
  max-width: 60ch;
  color: var(--ink-2);
  font-size: var(--step-1);
  line-height: 1.55;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(2.75rem, 6vw, 5.5rem) clamp(3.5rem, 7vw, 6.5rem);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(2.5rem, 5vw, 5rem);
}

.hero-copy {
  display: grid;
  justify-items: start;
}

.hero h1 {
  margin-block: 1.2rem 1.5rem;
  font-size: var(--step-5);
  line-height: 1.02;
}

html[lang="ar"] .hero h1 {
  line-height: 1.25;
}

.hero h1 .accent {
  color: var(--cedar);
}

.hero-lead {
  max-width: 38ch;
  color: var(--ink-2);
  font-size: var(--step-1);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2.2rem;
}

/* ---------- Share certificate ---------- */
.certificate {
  --guilloche: var(--engrave);
  --guilloche-strong: var(--cedar);
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 34rem;
  justify-self: end;
  background: var(--sheet);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow:
    0 1px 0 #fff inset,
    0 40px 70px -48px rgb(14 47 35 / 0.6),
    0 10px 22px -16px rgb(14 47 35 / 0.3);
  transform: rotate(-1.4deg);
}

html[dir="rtl"] .certificate {
  justify-self: start;
  transform: rotate(1.4deg);
}

.certificate canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cert-body {
  display: grid;
  gap: 1.15rem;
  padding: clamp(2.6rem, 5vw, 3.6rem) clamp(2.2rem, 4.5vw, 3.4rem);
}

.cert-head {
  display: grid;
  gap: 0.35rem;
  text-align: center;
}

.cert-company {
  font-family: var(--font-latin-display);
  font-size: var(--step-2);
  letter-spacing: 0.1em;
  line-height: 1.1;
  text-transform: uppercase;
}

.cert-company:lang(ar) {
  font-family: var(--font-display);
  font-weight: 700;
}

.cert-kind {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-wrap: balance;
}

html[lang="ar"] .cert-kind {
  font-size: 0.85rem;
}

.cert-figure {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.9rem;
  margin-block: 0.4rem 0;
}

.cert-numeral {
  color: var(--red);
  font-family: var(--font-latin-display);
  font-size: clamp(6.5rem, 13vw, 10.5rem);
  line-height: 0.78;
}

.cert-unit {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1;
}

html[lang="ar"] .cert-unit {
  font-weight: 700;
}

.cert-statement {
  max-width: 26ch;
  margin-inline: auto;
  color: var(--ink-2);
  font-family: var(--font-letter);
  font-size: var(--step-1);
  font-style: italic;
  line-height: 1.4;
  text-align: center;
}

html[lang="ar"] .cert-statement {
  font-style: normal;
}

.cert-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--ink);
}

.cert-meta > div {
  padding: 0.75rem 0.5rem;
  text-align: center;
}

.cert-meta > div + div {
  border-inline-start: 1px solid var(--line);
}

.cert-meta dt {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

html[lang="ar"] .cert-meta dt {
  font-size: 0.8rem;
}

.cert-meta dd {
  margin-top: 0.25rem;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
}

.cert-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.25rem;
}

.cert-names {
  color: var(--ink-2);
  font-family: var(--font-letter);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.35;
}

html[lang="ar"] .cert-names {
  font-size: 1.25rem;
  font-style: normal;
}

.cert-names small {
  display: block;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-style: normal;
}

html[lang="ar"] .cert-names small {
  font-size: 0.85rem;
}

.cert-seal {
  width: clamp(84px, 11vw, 104px);
  height: auto;
  flex: none;
  color: var(--red);
  opacity: 0.88;
  transform: rotate(-14deg);
  animation: stamp 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.9s both;
}

.cert-seal text {
  font-family: var(--font-latin-body);
  font-weight: 700;
}

@keyframes stamp {
  from {
    opacity: 0;
    transform: rotate(-14deg) scale(1.7);
  }
  to {
    opacity: 0.88;
    transform: rotate(-14deg) scale(1);
  }
}

/* ---------- The idea ---------- */
.idea {
  border-top: 1px solid var(--line);
}

.idea-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: end;
  gap: clamp(2.5rem, 6vw, 6rem);
}

.idea-copy {
  display: grid;
  gap: 1.3rem;
}

.idea-copy .idea-note {
  max-width: 52ch;
  color: var(--muted);
}

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

.names-lede {
  color: var(--muted);
  font-family: var(--font-letter);
  font-size: var(--step-1);
  font-style: italic;
}

html[lang="ar"] .names-lede {
  font-style: normal;
}

.names-list {
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}

.names-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.names-list .name {
  font-family: var(--font-display);
  font-size: var(--step-4);
  line-height: 1.1;
}

html[lang="ar"] .names-list .name {
  font-weight: 700;
  line-height: 1.5;
}

.names-list .name-alt {
  color: var(--cedar);
  font-size: var(--step-1);
}

.names-list .name-alt:lang(ar) {
  font-family: "Amiri", "Traditional Arabic", serif;
  font-size: var(--step-2);
}

.names-list .name-alt:lang(en) {
  font-family: var(--font-latin-display);
}

/* ---------- Hope ---------- */
.hope {
  background: var(--paper-2);
}

.hope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 5rem);
}

.hope-item {
  display: grid;
  align-content: start;
  gap: 0.9rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--ink);
}

.hope-item .hope-kicker {
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

html[lang="ar"] .hope-item .hope-kicker {
  font-size: 0.92rem;
}

.hope-item h3 {
  font-size: var(--step-3);
}

.hope-item p:last-child {
  max-width: 46ch;
  color: var(--ink-2);
}

/* ---------- How it works ---------- */
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.5rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

/* dashed connector from each step marker to the next */
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1.35rem;
  inset-inline-start: 3.1rem;
  inset-inline-end: -1.1rem;
  height: 1px;
  background-image: linear-gradient(to right, var(--cedar) 55%, transparent 55%);
  background-size: 9px 1px;
  opacity: 0.55;
}

.step {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.6rem;
  padding-top: 4rem;
  counter-increment: step;
}

.step::before {
  content: counter(step);
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid var(--cedar);
  border-radius: 50%;
  background: var(--paper);
  color: var(--cedar);
  font-family: var(--font-latin-display);
  font-size: 1.25rem;
  line-height: 1;
}

.step:first-child::before {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.step h3 {
  font-family: var(--font-body);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
}

.step p {
  color: var(--ink-2);
  font-size: 0.96rem;
  line-height: 1.58;
}

.cycle-note {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  max-width: 62ch;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.cycle-note svg {
  width: 28px;
  height: 28px;
  flex: none;
  color: var(--cedar);
}

/* ---------- Shared returns ---------- */
.returns {
  border-top: 1px solid var(--line);
}

.returns-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(2.5rem, 6vw, 6rem);
}

.returns-copy {
  display: grid;
  gap: 1.3rem;
}

.values {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.values-label,
.sectors-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

html[lang="ar"] .values-label,
html[lang="ar"] .sectors-label {
  font-size: 0.92rem;
}

.values-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0;
  list-style: none;
}

.values-list li {
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--cedar);
  border-radius: 999px;
  color: var(--cedar);
  font-size: 0.95rem;
  font-weight: 600;
}

.sectors {
  display: grid;
  gap: 0.8rem;
}

.sectors-list {
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}

.sectors-list li {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.2;
}

html[lang="ar"] .sectors-list li {
  font-weight: 700;
}

.sectors-list svg {
  width: 2.1rem;
  height: 2.1rem;
  color: var(--cedar);
}

/* ---------- Manifesto band ---------- */
.manifesto {
  --guilloche: #6F9A83;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(4.5rem, 10vw, 8.5rem);
  background: var(--cedar-deep);
  color: var(--on-dark);
}

.manifesto canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.manifesto-inner {
  display: grid;
  gap: 1.1rem;
}

.manifesto-line {
  max-width: 20ch;
  font-family: var(--font-display);
  font-size: var(--step-5);
  line-height: 1.04;
  text-wrap: balance;
}

html[lang="ar"] .manifesto-line {
  max-width: 22ch;
  font-weight: 700;
  line-height: 1.35;
}

.manifesto-line .hl {
  color: var(--red-soft);
}

.manifesto-coda {
  max-width: 44ch;
  margin-top: 1.4rem;
  color: var(--on-dark-muted);
  font-size: var(--step-1);
}

/* ---------- Letter ---------- */
.letter-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  align-items: start;
  gap: clamp(2.5rem, 5vw, 5rem);
}

.founder {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
  display: grid;
  gap: 1.1rem;
}

.founder-mark {
  width: 64px;
  height: 64px;
  padding: 12px;
  border: 1px solid var(--cedar);
  border-radius: 50%;
  color: var(--cedar);
}

.founder-name {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1.1;
}

html[lang="ar"] .founder-name {
  font-weight: 700;
  line-height: 1.4;
}

.founder-cred {
  margin-top: -0.6rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.founder-story {
  color: var(--ink-2);
}

.founder-roles {
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.founder-roles li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 0.9rem;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  line-height: 1.35;
}

.founder-roles .role {
  min-width: 2.6rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

html[lang="ar"] .founder-roles li {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

html[lang="ar"] .founder-roles .role {
  font-size: 0.82rem;
}

.letter {
  position: relative;
  padding: clamp(1.75rem, 4.5vw, 3.75rem);
  background: var(--sheet);
  border: 1px solid var(--line);
  box-shadow: 0 40px 70px -55px rgb(14 47 35 / 0.55);
}

.letter-content {
  display: grid;
  gap: 1.15rem;
  max-width: 64ch;
  color: var(--ink);
  font-family: var(--font-letter);
  font-size: 1.08rem;
  line-height: 1.78;
}

html[lang="ar"] .letter-content {
  font-size: 1.32rem;
  line-height: 2.05;
}

.letter-content .letter-salutation {
  font-weight: 700;
}

.letter-content .letter-refrain {
  display: grid;
  gap: 0.1rem;
  padding-block: 0.6rem;
  font-size: 1.22rem;
  font-style: italic;
}

html[lang="ar"] .letter-content .letter-refrain {
  font-size: 1.45rem;
  font-style: normal;
  font-weight: 700;
}

.letter-sign {
  display: grid;
  gap: 0.2rem;
  margin-top: 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.letter-sign .sig-name {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.2;
}

html[lang="ar"] .letter-sign .sig-name {
  font-weight: 700;
}

.letter-sign .sig-role {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.5;
}

.letter-sign .sig-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.2rem;
  margin-top: 0.8rem;
  font-family: var(--font-latin-body);
  font-size: 0.92rem;
}

/* Collapsible letter — only when JS is running, so the full text is never lost */
.letter-toggle {
  margin-top: 1.75rem;
}

.js .letter.is-collapsed .letter-content {
  max-height: 34rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent);
  mask-image: linear-gradient(to bottom, #000 62%, transparent);
}

/* ---------- Join ---------- */
.join {
  background: var(--paper-2);
}

.join-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 6rem);
}

.join-copy {
  display: grid;
  gap: 1.3rem;
}

.join-card {
  display: grid;
  gap: 1.1rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  background: var(--sheet);
  border: 1px solid var(--line);
  box-shadow: 0 40px 70px -55px rgb(14 47 35 / 0.55);
}

.join-card-title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.2;
  text-wrap: balance;
}

html[lang="ar"] .join-card-title {
  font-weight: 700;
  line-height: 1.5;
}

.join-card .btn {
  width: 100%;
}

.contact-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.contact-list > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.contact-list dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

html[lang="ar"] .contact-list dt {
  font-size: 0.88rem;
}

.contact-list dd {
  font-family: var(--font-latin-body);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.join-coda {
  color: var(--ink-2);
  font-family: var(--font-letter);
  font-size: 1.05rem;
  font-style: italic;
}

html[lang="ar"] .join-coda {
  font-size: 1.25rem;
  font-style: normal;
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
  background: var(--ink);
  color: var(--on-dark-muted);
}

.site-footer a {
  color: var(--on-dark);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--red-soft);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
}

.footer-brand {
  display: grid;
  justify-items: start;
  gap: 1rem;
}

.footer-brand .brand,
.footer-brand .brand:hover {
  color: var(--on-dark);
}

.footer-brand .brand-mark {
  color: var(--on-dark);
}

.footer-brand .brand-name small {
  color: var(--on-dark-muted);
}

.footer-tagline {
  max-width: 30ch;
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.35;
}

html[lang="ar"] .footer-tagline {
  font-weight: 700;
  line-height: 1.6;
}

.footer-col {
  display: grid;
  align-content: start;
  gap: 0.6rem;
}

.footer-col h2 {
  margin-bottom: 0.25rem;
  color: var(--on-dark-muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1.4;
  text-transform: uppercase;
}

html[lang="ar"] .footer-col h2 {
  font-size: 0.88rem;
  font-weight: 600;
}

.footer-col ul {
  display: grid;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.footer-col .latin {
  font-family: var(--font-latin-body);
  overflow-wrap: anywhere;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 0.12);
  font-size: 0.85rem;
}

.site-footer .lang-switch {
  border-color: rgb(255 255 255 / 0.18);
}

.site-footer .lang-switch a {
  color: var(--on-dark-muted);
}

.site-footer .lang-switch a:hover {
  background: rgb(255 255 255 / 0.08);
  color: var(--on-dark);
}

.site-footer .lang-switch a[aria-current="page"] {
  background: var(--on-dark);
  color: var(--ink);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1080px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    max-width: 44rem;
  }

  .step:not(:last-child)::after {
    top: 3.1rem;
    bottom: 0.3rem;
    inset-inline-start: 1.35rem;
    inset-inline-end: auto;
    width: 1px;
    height: auto;
    background-image: linear-gradient(to bottom, var(--cedar) 55%, transparent 55%);
    background-size: 1px 9px;
  }

  .step {
    padding-top: 0.35rem;
    padding-bottom: 2.25rem;
    padding-inline-start: 4.25rem;
  }

  .step:last-child {
    padding-bottom: 0;
  }
}

@media (max-width: 960px) {
  .nav-toggle {
    display: inline-flex;
  }

  /* Without JS the menu simply wraps under the brand; with JS it becomes a drop-down */
  .site-nav {
    flex-basis: 100%;
    flex-wrap: wrap;
    padding-bottom: 1rem;
  }

  .js .site-nav {
    position: absolute;
    top: 100%;
    inset-inline: calc(-1 * var(--gutter));
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    padding: 0.5rem var(--gutter) 1.5rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -30px rgb(14 47 35 / 0.5);
  }

  .js .site-nav.is-open {
    display: flex;
  }

  .js .nav-links {
    flex-direction: column;
    gap: 0;
  }

  .js .nav-links a {
    display: block;
    padding-block: 0.85rem;
    border-bottom: 1px solid var(--line);
    font-size: 1.05rem;
  }

  .js .nav-links a::after {
    display: none;
  }

  .lang-switch {
    align-self: flex-start;
  }

  .hero-grid,
  .idea-grid,
  .returns-grid,
  .letter-grid,
  .join-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .certificate,
  html[dir="rtl"] .certificate {
    justify-self: center;
  }

  .founder {
    position: static;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 66px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-name b {
    font-size: 1.15rem;
  }

  .hope-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .certificate,
  html[dir="rtl"] .certificate {
    transform: none;
  }

  .cert-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .cert-meta > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-inline: 0;
    text-align: start;
  }

  .cert-meta > div + div {
    border-inline-start: 0;
    border-top: 1px solid var(--line);
  }

  .cert-meta dd {
    margin-top: 0;
    text-align: end;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

  *,
  *::before,
  *::after {
    animation-delay: 0s !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .flag-rule,
  .letter-toggle,
  canvas {
    display: none !important;
  }

  .js .letter.is-collapsed .letter-content {
    max-height: none;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .manifesto {
    background: none;
    color: var(--ink);
  }
}
