/* ============================================================
   AAMAR LAW FIRM - stylesheet
   Palette: pine green (environmental-law scholarship), warm
   paper, muted brass. Type: Cormorant Garamond + Source Serif 4
   (Latin), Amiri + Noto Naskh (Arabic), Noto Serif/Sans SC (中文).
   ============================================================ */

:root {
  --pine: #16332b;
  --pine-deep: #0e231d;
  --pine-soft: #1d443a;
  --ink: #1e2a24;
  --muted: #59655d;
  --brass: #b28a4e;
  --brass-bright: #c49d63;   /* brass on dark surfaces */
  --bronze: #8a6b3a;         /* brass for small text on light */
  --paper: #f6f3ea;
  --stone: #ece7db;
  --paper-on-dark: #f1ecdd;
  --line: rgba(30, 42, 36, 0.15);
  --line-dark: rgba(241, 236, 221, 0.16);

  --font-display: "Cormorant Garamond", "Amiri", Georgia, serif;
  --font-body: "Source Serif 4", "Noto Naskh Arabic", Georgia, serif;
  --font-ui: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, sans-serif;

  --container: 1120px;
  --header-h: 4.25rem;
}

/* Per-language type systems */
html[data-lang="ar"] {
  --font-display: "Amiri", "Cormorant Garamond", serif;
  --font-body: "Noto Naskh Arabic", "Amiri", serif;
  --font-ui: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif;
}
html[data-lang="zh"] {
  --font-display: "Noto Serif SC", "Cormorant Garamond", serif;
  --font-body: "Noto Sans SC", "Source Serif 4", sans-serif;
  --font-ui: "Noto Sans SC", "IBM Plex Sans", system-ui, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { max-width: 100%; display: block; height: auto; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
a { color: inherit; }

body {
  overflow-x: clip;            /* never scroll sideways; clip keeps position:sticky alive */
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Arabic: Naskh runs small and needs air */
html[data-lang="ar"] body { font-size: 1.125rem; line-height: 1.95; }
html[data-lang="zh"] body { line-height: 1.85; }

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

::selection { background: var(--brass); color: var(--pine-deep); }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.skip-link {
  position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 100;
  background: var(--pine); color: var(--paper-on-dark);
  padding: 0.6em 1.2em; font-family: var(--font-ui); font-size: 0.85rem;
  transition: top 0.2s ease;
}
.skip-link:focus-visible { top: 1rem; }

/* ---------- Shared type ---------- */
.eyebrow {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bronze);
  display: flex;
  align-items: center;
  gap: 0.9em;
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: "";
  width: 2rem; height: 1px;
  background: var(--brass);
  flex: none;
}
.eyebrow--dark { color: var(--brass-bright); }

/* Letter-spacing breaks Arabic joining - never track Arabic */
html[data-lang="ar"] .eyebrow { letter-spacing: 0; font-size: 0.92rem; }
html[data-lang="zh"] .eyebrow { letter-spacing: 0.28em; }

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 1.4rem;
}
html[data-lang="ar"] .section-title { font-weight: 700; line-height: 1.45; }
html[data-lang="zh"] .section-title { line-height: 1.35; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  padding: 0.78em 1.6em;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
html[data-lang="ar"] .btn { letter-spacing: 0; }

.btn-solid { background: var(--paper-on-dark); color: var(--pine-deep); }
.btn-solid:hover { background: #ffffff; }

.btn-ghosted { border-color: rgba(241, 236, 221, 0.4); color: var(--paper-on-dark); }
.btn-ghosted:hover { border-color: var(--paper-on-dark); background: rgba(241, 236, 221, 0.07); }

.btn-outline { border-color: var(--pine); color: var(--pine); background: transparent; }
.btn-outline:hover { background: var(--pine); color: var(--paper-on-dark); }

.ext { width: 0.7em; height: 0.7em; flex: none; }
html[dir="rtl"] .ext { transform: scaleX(-1); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 110;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
  padding-block: 0.55rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: var(--pine);
  margin-inline-end: auto;
}
.brand-mark { width: 2.4rem; height: auto; flex: none; }
.mark-ring { fill: none; stroke: var(--brass); stroke-width: 2; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.16rem;
  letter-spacing: 0.045em;
  white-space: nowrap;
}
html[data-lang="ar"] .brand-name { letter-spacing: 0; font-weight: 700; }
.brand-sub {
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bronze);
}
html[data-lang="ar"] .brand-sub { letter-spacing: 0; font-size: 0.78rem; }

.site-nav { display: flex; gap: clamp(1rem, 2.5vw, 2rem); }
.site-nav a {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  padding-block: 0.3em;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.site-nav a:hover { color: var(--bronze); border-bottom-color: var(--brass); }
.site-nav a.is-current { color: var(--bronze); border-bottom-color: var(--brass); }

.lang {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.lang-btn {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.45em 0.85em;
  color: var(--muted);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.lang-btn:hover { color: var(--pine); background: var(--stone); }
.lang-btn.is-active { background: var(--pine); color: var(--paper-on-dark); }

/* Mobile menu toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 44px;
  height: 44px;
  margin-inline-end: -0.6rem;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--pine);
  transition: transform 0.25s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(4.25px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { transform: translateY(-4.25px) rotate(-45deg); }

/* Full-screen mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.6rem;
  padding: 5.5rem 2rem 3.5rem;
  background: linear-gradient(180deg, var(--pine) 0%, var(--pine-deep) 100%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: none; }
.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}
.mobile-menu-nav a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.75rem;
  color: var(--paper-on-dark);
  text-decoration: none;
  letter-spacing: 0.02em;
}
html[data-lang="ar"] .mobile-menu-nav a { font-weight: 700; letter-spacing: 0; }
.mobile-menu-rule { width: 40px; height: 1px; background: var(--brass-bright); }
.mobile-menu-langs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}
.mobile-menu-langs .lang-btn {
  border: 1px solid rgba(241, 236, 221, 0.35);
  border-radius: 2px;
  color: rgba(241, 236, 221, 0.85);
  padding: 0.55em 1em;
  font-size: 0.84rem;
}
.mobile-menu-langs .lang-btn.is-active {
  background: var(--paper-on-dark);
  color: var(--pine-deep);
  border-color: var(--paper-on-dark);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(110% 90% at 50% -10%, var(--pine-soft) 0%, var(--pine) 52%, var(--pine-deep) 100%);
  color: var(--paper-on-dark);
}

/* The colonnade: faint column rhythm behind the centered composition */
.hero-columns {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  padding-inline: clamp(2.5rem, 7vw, 6.5rem);
  pointer-events: none;
}
.hero-columns span { width: 1px; background: rgba(241, 236, 221, 0.06); }

.hero-seal {
  width: clamp(3.4rem, 6vw, 4rem);
  height: auto;
  color: rgba(241, 236, 221, 0.92);
  margin-bottom: 1.7rem;
}
.hero-seal-ring { fill: none; stroke: var(--brass-bright); stroke-width: 2; }

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-block: clamp(4rem, 10vh, 6.5rem) clamp(3.5rem, 8vh, 5rem);
}
.hero-inner .eyebrow { justify-content: center; }
.hero-inner .eyebrow::before { display: none; }
.hero-title { max-width: 50rem; }
.hero-lede { max-width: 40rem; }
.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.9rem, 8vw, 5.3rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin-bottom: 0.7rem;
  text-wrap: balance;
}
html[data-lang="ar"] .hero-title { font-weight: 700; letter-spacing: 0; line-height: 1.35; }
html[data-lang="zh"] .hero-title {
  line-height: 1.22;
  letter-spacing: 0.01em;
  font-size: clamp(2.5rem, 6.4vw, 4.3rem);
  word-break: keep-all; /* never break inside 律师事务所 - wrap at the space only */
}

.hero-subtitle {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 5.4vw, 3.5rem);
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--brass-bright);
  margin-bottom: 1.5rem;
  text-wrap: balance;
}
html[data-lang="ar"] .hero-subtitle { font-weight: 700; line-height: 1.45; }
html[data-lang="zh"] .hero-subtitle { line-height: 1.4; }

.hero-rule { width: 4.5rem; height: 1px; background: var(--brass-bright); margin-bottom: 1.6rem; }

.hero-lede {
  font-size: clamp(1.06rem, 1.6vw, 1.22rem);
  line-height: 1.8;
  max-width: 40rem;
  color: rgba(241, 236, 221, 0.88);
  margin-bottom: 2.4rem;
  text-wrap: pretty;
}
.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

.hero-facts {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line-dark);
}
.hero-facts-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.9rem 1.1rem;
  padding-block: 1.1rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: rgba(241, 236, 221, 0.68);
}
html[data-lang="ar"] .hero-facts-inner { font-size: 0.92rem; letter-spacing: 0; }
.gem { width: 5px; height: 5px; background: var(--brass); transform: rotate(45deg); flex: none; }

/* ---------- Inner-page head (articles.html) ---------- */
.page-head {
  background: linear-gradient(180deg, var(--pine) 0%, var(--pine-deep) 100%);
  color: var(--paper-on-dark);
  padding-block: clamp(3.5rem, 8vw, 5.5rem) clamp(2.5rem, 5vw, 3.5rem);
}
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.12;
  margin-bottom: 1.1rem;
}
html[data-lang="ar"] .page-head h1 { font-weight: 700; line-height: 1.4; }
.page-head p { max-width: 46rem; color: rgba(241, 236, 221, 0.82); text-wrap: pretty; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(200px, 264px) 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.portrait { position: relative; margin-top: 0.5rem; }
.portrait img {
  width: 100%;
  border: 1px solid var(--line);
  filter: saturate(0.88) contrast(1.04);
  position: relative;
  z-index: 1;
  background: var(--stone);
}
.portrait::before {
  content: "";
  position: absolute;
  inset: 14px auto auto 0;
  inset-inline-start: -14px;
  width: 100%; height: 100%;
  border: 1px solid var(--brass);
  z-index: 0;
}
.portrait figcaption {
  margin-top: 1.1rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
html[data-lang="ar"] .portrait figcaption { letter-spacing: 0; font-size: 0.9rem; }

.about-role {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--bronze);
  margin-bottom: 1.6rem;
}
.about-body > p + p { margin-top: 1.1rem; }
.about-body .btn { margin-top: 1.2rem; }

/* ---------- Practice ---------- */
/* ---------- Practice ----------
   Seven areas as a ruled two-column index, not five floating cards. */
.practice { padding-block: clamp(3.25rem, 6.5vw, 4.5rem); }
.practice-grid {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 1.5rem;
  counter-reset: area;
}
@media (min-width: 760px) {
  .practice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, auto);
    grid-auto-flow: column;              /* 1-4 in the first column, 5-7 in the second */
    column-gap: clamp(2rem, 5vw, 4rem);
  }
}
.practice-item {
  counter-increment: area;
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  align-items: baseline;
  gap: 1.4rem;
  padding-block: 0.95rem;
  border-top: 1px solid var(--line);
}
.practice-item:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 760px) {
  /* close the ruled columns off at the foot of each one */
  .practice-item:nth-child(4), .practice-item:nth-child(7) { border-bottom: 1px solid var(--line); }
}
.practice-item::before {
  content: counter(area, decimal-leading-zero);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--bronze);
}
.practice-item h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.06rem;
  line-height: 1.5;
  text-wrap: pretty;
}
html[data-lang="ar"] .practice-item h3 { font-size: 1.12rem; line-height: 1.7; }
html[data-lang="zh"] .practice-item h3 { line-height: 1.6; }

/* ---------- Lawyers ----------
   Ruled rows in the same language as the publication list: an index in
   brass, the name, and the role sitting at the end of the row. */
.lawyers { background: var(--stone); padding-block: clamp(3.25rem, 6.5vw, 4.5rem); }
.lawyers-list { list-style: none; margin-top: 1.5rem; counter-reset: lawyer; }
.lawyer {
  counter-increment: lawyer;
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 22rem) minmax(0, 1fr);
  align-items: baseline;
  gap: 0.25rem 1.6rem;
  padding-block: 1.15rem;
  border-top: 1px solid var(--line);
}
.lawyer:last-child { border-bottom: 1px solid var(--line); }
.lawyer::before {
  content: counter(lawyer, decimal-leading-zero);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--bronze);
}
.lawyer-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.07rem;
  line-height: 1.5;
  text-wrap: pretty;
}
.lawyer-role {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}
html[data-lang="ar"] .lawyer-name { font-size: 1.12rem; line-height: 1.7; }
html[data-lang="ar"] .lawyer-role { font-size: 0.95rem; letter-spacing: 0; }
html[data-lang="zh"] .lawyer-name { line-height: 1.6; }

/* narrow: the role drops under the name instead of squeezing the row */
@media (max-width: 700px) {
  .lawyer { grid-template-columns: 2.1rem 1fr; padding-block: 1rem; }
  .lawyer-role { grid-column: 2; text-align: start; }
}

/* ---------- Publications ---------- */
.pubs { background: var(--stone); }
.pubs-note { max-width: 44rem; color: var(--muted); margin-bottom: 2.6rem; text-wrap: pretty; }

.pub {
  display: grid;
  grid-template-columns: 5.2rem 1fr auto;
  gap: 0.4rem 1.6rem;
  align-items: baseline;
  padding-block: 1.3rem;
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.pubs-list > .pub:last-of-type { border-bottom: 1px solid var(--line); }
.pub-year {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bronze);
  letter-spacing: 0.05em;
}
.pub-main { min-width: 0; }
.pub-title {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.07rem;
  line-height: 1.5;
  color: var(--ink);
  transition: color 0.2s ease;
  text-wrap: pretty;
  text-align: start; /* with dir="auto": English titles align left even in RTL mode, Arabic right in LTR */
}
.pub-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  margin-top: 0.4rem;
}
.pub-venue { font-size: 0.88rem; color: var(--muted); }
.pub-tag {
  font-family: var(--font-ui);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze);
  border: 1px solid color-mix(in srgb, var(--brass) 45%, transparent);
  padding: 0.18em 0.65em;
  border-radius: 2px;
  white-space: nowrap;
}
html[data-lang="ar"] .pub-tag { letter-spacing: 0; font-size: 0.78rem; }
.pub-arrow { width: 0.85rem; height: 0.85rem; color: var(--brass); opacity: 0; transform: translateX(-4px); transition: opacity 0.2s ease, transform 0.2s ease; align-self: center; }
html[dir="rtl"] .pub-arrow { transform: translateX(4px) scaleX(-1); }
.pub:hover .pub-title { color: var(--bronze); }
.pub:hover .pub-arrow { opacity: 1; transform: translateX(0); }
html[dir="rtl"] .pub:hover .pub-arrow { transform: translateX(0) scaleX(-1); }

.pubs-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 2.2rem;
}
.pubs-scholar {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--bronze);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--brass) 50%, transparent);
  padding-bottom: 0.15em;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.pubs-scholar:hover { color: var(--pine); border-color: var(--pine); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) 1.1fr;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  align-items: start;
  margin-top: 0.8rem;
}
.contact-lede { color: var(--muted); margin-bottom: 2rem; text-wrap: pretty; }
.contact-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1.4rem;
  padding-block: 1rem;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.contact-row:last-child { border-bottom: 1px solid var(--line); }
.contact-row dt {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze);
}
html[data-lang="ar"] .contact-row dt { letter-spacing: 0; font-size: 0.85rem; }
.contact-row dd a { color: var(--ink); text-decoration-color: var(--brass); text-underline-offset: 3px; }
.contact-hours { white-space: pre-line; }
.contact-row dd a:hover { color: var(--bronze); }

/* ---------- Consultation form ---------- */
.consult { background: var(--stone); }
.consult-intro { color: var(--muted); max-width: 42rem; margin-bottom: 1.9rem; text-wrap: pretty; }

.form-card {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: clamp(1.35rem, 3.5vw, 2.6rem);
  max-width: 56rem;
}

.consult-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem 1.7rem;
}
.field--full,
.consult-form .form-actions,
.consult-form .form-note { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .consult-form { grid-template-columns: 1fr; gap: 1.2rem; }
}

.consult-form label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 0.5rem;
}
/* Letter-spacing breaks Arabic joining - never track Arabic */
html[data-lang="ar"] .consult-form label { letter-spacing: 0; text-transform: none; font-size: 0.9rem; }
html[data-lang="zh"] .consult-form label { letter-spacing: 0.2em; }

.consult-form input,
.consult-form select,
.consult-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0.55rem 0;
  transition: border-color 0.2s ease;
  appearance: none;
}
.consult-form textarea { resize: vertical; min-height: 6.5rem; }
.consult-form input:hover,
.consult-form select:hover,
.consult-form textarea:hover { border-bottom-color: rgba(30, 42, 36, 0.35); }
.consult-form input:focus,
.consult-form select:focus,
.consult-form textarea:focus { outline: none; border-bottom-color: var(--brass); }
/* Addresses and numbers stay left-to-right even on the Arabic page */
.consult-form input[type="email"],
.consult-form input[type="tel"] { direction: ltr; text-align: start; }

.consult-form select {
  /* the caret is drawn here because appearance:none removes the native one */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 L6 8 L9.5 4.5' fill='none' stroke='%23b28a4e' stroke-width='1.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.1rem center;
  background-size: 0.85rem;
  padding-inline-end: 1.5rem;
  cursor: pointer;
}
html[dir="rtl"] .consult-form select { background-position: left 0.1rem center; }

/* Honeypot - out of sight for people, still reachable for bots.
   Clipped rather than pushed off-canvas: an offset field would widen
   the page and give the RTL layout a horizontal scrollbar. */
.field-hp {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  margin-top: 0.6rem;
}
.consult-form button[disabled] { opacity: 0.55; pointer-events: none; }
.form-status {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
  flex: 1 1 13rem;
  text-wrap: pretty;
}
.form-status.is-ok { color: var(--pine); }
.form-status.is-error { color: #a4442f; }
html[data-lang="ar"] .form-status { font-size: 0.95rem; }
.form-note {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 0.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}
html[data-lang="ar"] .form-note { font-size: 0.88rem; }

.map-frame {
  border: 1px solid var(--line);
  background: var(--stone);
  aspect-ratio: 4 / 3;
}
.map-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--pine-deep); color: var(--paper-on-dark); }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.6rem;
  padding-block: 3.2rem 2.2rem;
}
.footer-brand { display: flex; align-items: center; gap: 1rem; color: var(--paper-on-dark); }
.footer-brand .brand-mark { width: 2.9rem; }
.footer-names { display: flex; flex-direction: column; line-height: 1.5; }
.footer-name-en { font-family: "Cormorant Garamond", serif; font-weight: 600; font-size: 1.2rem; letter-spacing: 0.05em; }
.footer-name-ar { font-family: "Amiri", serif; font-size: 1.05rem; color: rgba(241, 236, 221, 0.72); }
.footer-tagline { font-family: var(--font-ui); font-size: 0.85rem; color: rgba(241, 236, 221, 0.62); max-width: 22rem; }

.footer-base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  border-top: 1px solid var(--line-dark);
  padding-block: 1.4rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: rgba(241, 236, 221, 0.55);
}
.footer-base a { color: var(--brass-bright); text-decoration: none; }
.footer-base a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Hero entrance ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes ghost-in { from { opacity: 0; } to { opacity: 1; } }
.js .hero-inner > * { animation: rise 0.9s cubic-bezier(0.2, 0.65, 0.2, 1) both; }
.js .hero-inner > *:nth-child(2) { animation-delay: 0.08s; }
.js .hero-inner > *:nth-child(3) { animation-delay: 0.16s; }
.js .hero-inner > *:nth-child(4) { animation-delay: 0.24s; }
.js .hero-inner > *:nth-child(5) { animation-delay: 0.34s; }
.js .hero-inner > *:nth-child(6) { animation-delay: 0.44s; }
.js .hero-inner > *:nth-child(7) { animation-delay: 0.54s; } /* subtitle added a child to the stagger */
.js .hero-columns { animation: ghost-in 1.6s ease 0.2s both; }

/* ---------- Anchor offset for sticky header ---------- */
section[id] { scroll-margin-top: calc(var(--header-h) + 1rem); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 240px; }
  .contact-grid { grid-template-columns: 1fr; }
  .map-frame { aspect-ratio: 16 / 10; }
}

@media (max-width: 760px) {
  /* Slim single-row header: brand + hamburger; nav lives in the overlay */
  .header-inner { column-gap: 0.75rem; justify-content: space-between; flex-wrap: nowrap; }
  .brand { gap: 0.6rem; }
  .brand-mark { width: 2.1rem; }
  .brand-name { font-size: 1.06rem; letter-spacing: 0.02em; }
  .brand-sub { display: none; }
  .lang { display: none; }
  .site-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .mobile-menu { display: flex; }

  .hero-inner { padding-block: 3.5rem 3rem; }
  .hero-facts-inner { flex-direction: column; align-items: center; gap: 0.7rem; }
  .hero-facts-inner .gem { display: none; }
  .hero-columns span:nth-child(even) { display: none; }

  .pub { grid-template-columns: 1fr; gap: 0.15rem; padding-block: 1.15rem; }
  .pub-year { font-size: 0.78rem; }
  .pub-arrow { display: none; }

  .contact-row { grid-template-columns: 1fr; gap: 0.25rem; padding-block: 0.9rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; padding-block: 2.6rem 1.8rem; }
}

@media (max-width: 420px) {
  .hero-ctas .btn { flex: 1 1 100%; justify-content: center; }
  .lang-btn { padding: 0.45em 0.65em; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
