/* ============================================================================
   Demo portal — warm ivory / sand / bronze design system.

   Colours follow about-heritage.com (primary bronze #8F6E41) and the partner
   logo's gradient (bronze #9D7335 to gold #EBBF5E). Rules:
   - gold and the gradient are for accents, lines and large display text only;
   - body text is the deep brown --ink (or --ink-soft / --muted);
   - links and filled buttons use the darker --accent, which passes WCAG AA
     with white text and on every background below.
   Contrast ratios are listed in docs/design-palette.md.

   Card 1 of the archaeology flow ("Capture a survey point") keeps its own
   Esri-style look (the .phone / .s123 block).
   ============================================================================ */
:root {
  --ink:        #2E2418;   /* text */
  --ink-soft:   #5A4A36;   /* secondary text */
  --muted:      #756550;   /* hints, captions */
  --bg:         #FBF7EF;   /* page: warm ivory */
  --surface:    #FFFDF8;   /* cards */
  --surface-2:  #F3EBDD;   /* sand: insets, table heads */
  --sand:       #F3EBDD;
  --line:       #E8DDC8;
  --line-strong:#D5C4A4;
  --field-line: #9C8660;   /* borders of form fields and controls: 3:1 or more */

  --bronze:      #8F6E41;  /* about-heritage.com primary: lines, icons, large text */
  --accent:      #7A5A2E;  /* links, filled buttons (white text 6.3:1) */
  --accent-hover:#6B4E24;
  --accent-strong:#6B4E24; /* link text on sand */
  --accent-tint: #F6EEDD;
  --gold:        #EBBF5E;  /* accents on dark, large display text on dark */
  --gold-soft:   #CFA067;
  --grad: linear-gradient(90deg, #9D7335, #EBBF5E);   /* the logo's gradient */

  --ok:      #3E6B3E;  --ok-bg:    #E3EDDC;
  --warn:    #6B4E24;  --warn-bg:  #F4E7C8;
  --olive:   #5C5A38;  --olive-bg: #E9EBD9;
  --danger:  #9A3B32;  --danger-bg:#F5E1DC;

  --r-sm: 8px; --r: 10px; --r-lg: 12px; --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(46, 36, 24, .05);
  --shadow:    0 1px 2px rgba(46, 36, 24, .04), 0 8px 24px rgba(46, 36, 24, .06);
  --shadow-lg: 0 2px 6px rgba(46, 36, 24, .05), 0 18px 44px rgba(46, 36, 24, .10);

  /* Survey123-app accent (used only inside card 1 of the archaeology flow) */
  --s123-green: #3c9d3c;
  --s123-green-dark: #2f7d30;
  --s123-tint: #e9f3e7;

  --maxw: 1360px;
  /* Body: Roboto, as on about-heritage.com. Headings: a serif, for warmth. */
  --font: "Roboto", "IBM Plex Sans Arabic", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "Lora", "Noto Naskh Arabic", Georgia, "Times New Roman", serif;
}

/* Self-hosted fonts (all SIL OFL; licence texts in fonts/). The unicode-range
   keeps a file from downloading until its script is on the page. */
@font-face {
  font-family: "Roboto"; src: url("fonts/Roboto-latin-variable.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lora"; src: url("fonts/Lora-latin-variable.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans Arabic"; src: url("fonts/IBMPlexSansArabic-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "IBM Plex Sans Arabic"; src: url("fonts/IBMPlexSansArabic-Bold.woff2") format("woff2");
  font-weight: 600 800; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Noto Naskh Arabic"; src: url("fonts/NotoNaskhArabic-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Noto Naskh Arabic"; src: url("fonts/NotoNaskhArabic-Bold.woff2") format("woff2");
  font-weight: 600 800; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

* { box-sizing: border-box; }
/* Hidden until the dictionary and the brand names are applied (see i18n.js). */
html.i18n-pending body { visibility: hidden; }
[hidden] { display: none !important; }

html { background-color: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }

/* ---- Top bar: demo ribbon + co-brand header ---------------------------------- */
.topbar { position: sticky; top: 0; z-index: 20; }
.demo-ribbon {
  margin: 0; padding: .3rem 1rem; text-align: center;
  background: var(--ink); color: #F6EEDD;
  font-size: .76rem; font-weight: 500; letter-spacing: .04em;
}
.site-header {
  display: flex; align-items: center; gap: .5rem .8rem; flex-wrap: wrap;
  padding: 16px clamp(16px, 4vw, 2.2rem);   /* at least 16 px all round; 12 px on phones (below) */
  background: rgba(251, 247, 239, .93);
  backdrop-filter: saturate(1.3) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; color: var(--ink); text-decoration: none; }
/* Product logo: about 46 px tall, which keeps the horizontal logo at its
   minimum width of 140 px. Narrow screens get the square icon instead. */
.brand-logo { display: block; }
.brand-logo img { display: block; height: 46px; width: auto; }
@media (max-width: 640px) { .brand-logo img { height: 32px; border-radius: 7px; } }
@media (max-width: 640px) { .site-header { padding: 12px; } }
/* Text name (shown when no logo is set): calm, same weight as the partner's. */
.brand-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 500; line-height: 1.2; }
.brand-with { color: var(--muted); font-size: .88rem; }
.cobrand {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--ink-soft); font-weight: 500; font-size: .95rem; text-decoration: none; white-space: nowrap;
}
.cobrand img { display: block; height: 32px; width: auto; }
.cobrand:hover span { text-decoration: underline; }
@media (max-width: 640px) {
  .brand-with { font-size: 0; }           /* the word gives way to a mark on phones */
  .brand-with::after { content: "×"; font-size: .95rem; color: var(--bronze); }
  .cobrand img { height: 28px; }
  .cobrand { font-size: .86rem; gap: .4rem; }
}

/* ---- Language switch -------------------------------------------------------- */
.lang-switch {
  margin-inline-start: auto; display: inline-flex; align-self: center;
  border: 1px solid var(--field-line); border-radius: var(--r-pill);
  background: var(--surface); padding: 2px;
}
.lang-switch button {
  font: inherit; font-size: .82rem; font-weight: 500; line-height: 1.2;
  min-height: 2rem; padding: .25rem .8rem; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--ink-soft); cursor: pointer;
}
.lang-switch button[lang="ar"] { font-family: "IBM Plex Sans Arabic", var(--font); }
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* ---- Type ------------------------------------------------------------------ */
h1, h2, h3 { font-family: var(--font-display); }
h1 { font-size: clamp(1.6rem, 3.2vw, 2rem); line-height: 1.2; letter-spacing: -.005em; margin: 0 0 .55rem; text-wrap: balance; font-weight: 700; }
.lede { color: var(--ink-soft); margin: 0 0 1.3rem; font-size: 1.02rem; }
.hint { color: var(--muted); font-size: .88rem; margin: 0 0 1rem; }
.opt  { color: var(--muted); font-weight: 400; font-size: .8rem; }

/* ---- Cards ----------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 2.6vw, 1.7rem);
}

/* ---- Gate ------------------------------------------------------------------ */
.gate { display: grid; place-items: center; padding: clamp(2rem, 8vh, 5rem) 1.2rem; }
.gate-card { max-width: 480px; width: 100%; box-shadow: var(--shadow-lg); }
.gate-card h1::before {
  content: ""; display: block; width: 4.5rem; height: 3px; border-radius: 3px;
  background: var(--grad); margin-bottom: 1rem;
}

.lead-note {
  margin: 0 0 1.1rem; padding: .6rem .8rem; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink-soft); font-size: .86rem; line-height: 1.5;
}

/* ---- App / intro ----------------------------------------------------------- */
.app { padding: clamp(1.2rem, 3vw, 2.2rem); }
.intro {
  max-width: var(--maxw); margin: 0 auto 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--gold-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.2rem 1.5rem;
}
.intro h1 { font-size: 1.4rem; margin: 0 0 .35rem; }
.intro p { margin: 0; color: var(--ink-soft); line-height: 1.55; }
.intro a { color: var(--accent-strong); font-weight: 600; }

/* ---- Columns --------------------------------------------------------------- */
.columns {
  display: grid; gap: 1.4rem;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  max-width: var(--maxw); margin: 0 auto;
}
/* Let the cards shrink: without this a long, non-wrapping item title in the
   submissions list widens the whole page on a phone. */
.columns > * { min-width: 0; }
@media (max-width: 1080px) { .columns { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px)  { .columns { grid-template-columns: 1fr; gap: 1.1rem; } }

/* ---- Section headings (numbered) ------------------------------------------- */
.card h2 {
  display: flex; align-items: center; gap: .6rem;
  font-size: 1.08rem; font-weight: 700; color: var(--ink); margin: 0 0 .35rem;
  letter-spacing: -.01em;
}
.step {
  flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: .82rem; font-weight: 700;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.12);
}

/* ---- Forms ----------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: .8rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.form input, .form select, .form textarea {
  font: inherit; padding: .6rem .7rem; width: 100%; min-width: 0;
  border: 1px solid var(--field-line); border-radius: var(--r-sm);
  background: #fff; color: var(--ink);
  transition: border-color .12s, box-shadow .12s;
}
.form input::placeholder, .form textarea::placeholder { color: #8B7B64; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122, 90, 46, .18);
}
.form input[readonly] { background: var(--surface-2); color: var(--ink-soft); }
.form textarea { resize: vertical; min-height: 2.6rem; }
.row, .coords { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.row > label, .coords > label { min-width: 0; } /* let grid cells shrink so fields don't overflow */

/* ---- File drop ------------------------------------------------------------- */
.filedrop {
  position: relative; display: block; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--field-line); border-radius: var(--r);
  padding: 1rem; color: var(--muted); font-size: .88rem;
  transition: border-color .12s, background .12s, color .12s;
}
.filedrop:hover { border-color: var(--accent); color: var(--ink-soft); }
.filedrop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.filedrop span.has-file { color: var(--ink); font-weight: 600; }
.filedrop:has(span.has-file) { border-style: solid; border-color: var(--accent); background: var(--accent-tint); }

/* ---- Buttons --------------------------------------------------------------- */
.btn {
  font: inherit; font-weight: 500; letter-spacing: .01em; padding: .7rem 1.15rem;
  border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  transition: background .14s, box-shadow .14s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(46, 36, 24, .18); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: var(--line-strong); color: #fff; opacity: .7; cursor: not-allowed; box-shadow: none; }
.btn.is-loading { pointer-events: none; opacity: .85; }
.spinner {
  width: 1rem; height: 1rem; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Map ------------------------------------------------------------------- */
.map {
  height: clamp(240px, 34vh, 320px);
  border-radius: var(--r); overflow: hidden; margin-bottom: 1rem;
  border: 1px solid var(--line-strong);
}

/* ---- Feed ------------------------------------------------------------------ */
.feed { list-style: none; padding: 0; margin: .3rem 0 0; display: flex; flex-direction: column; gap: .6rem; }
.feed-empty { color: var(--muted); font-size: .88rem; padding: .4rem 0; }
.feed-item {
  display: flex; align-items: center; justify-content: space-between; gap: .7rem;
  padding: .65rem .8rem; background: var(--surface-2);
  border: 1px solid var(--line); border-inline-start: 3px solid var(--line-strong);
  border-radius: var(--r-sm); font-size: .9rem;
}
.feed-item.is-new { animation: rise .25s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.feed-item .label { display: flex; flex-direction: column; min-width: 0; }
.feed-item .label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item .kind { color: var(--muted); font-size: .76rem; }
.feed-item.s-processing { border-inline-start-color: var(--olive); }
.feed-item.s-published  { border-inline-start-color: var(--ok); background: linear-gradient(90deg, var(--ok-bg), var(--surface-2) 55%); }
.feed-item.s-failed     { border-inline-start-color: var(--danger); }

.badge {
  flex: none; font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: .24rem .55rem; border-radius: var(--r-pill);
}
.badge.received   { background: var(--warn-bg);  color: var(--warn); }
.badge.processing { background: var(--olive-bg); color: var(--olive); }
.badge.published  { background: var(--ok-bg);    color: var(--ok); }
.badge.failed     { background: var(--danger-bg);color: var(--danger); }

.view-btn {
  flex: none; display: inline-flex; align-items: center; gap: .3rem;
  font-size: .76rem; font-weight: 700; text-decoration: none;
  color: #fff; background: var(--ok); padding: .3rem .6rem; border-radius: var(--r-pill);
  transition: filter .12s;
}
.view-btn:hover { filter: brightness(1.06); }
.view-btn::after { content: "→"; }
[dir="rtl"] .view-btn::after { content: "←"; }

/* ---- Toasts ---------------------------------------------------------------- */
.toasts {
  position: fixed; inset-inline-end: 1rem; bottom: 1rem; z-index: 50;
  display: flex; flex-direction: column; gap: .55rem; max-width: min(92vw, 24rem);
}
.toast {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .7rem .9rem; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  border-inline-start: 4px solid var(--accent); box-shadow: var(--shadow-lg);
  font-size: .9rem; color: var(--ink);
  animation: toast-in .22s ease both;
}
.toast.success { border-inline-start-color: var(--ok); }
.toast.error   { border-inline-start-color: var(--danger); }
.toast.leaving { animation: toast-out .2s ease forwards; }
.toast .t-ico { font-weight: 800; line-height: 1.4; }
.toast.success .t-ico { color: var(--ok); }
.toast.error .t-ico { color: var(--danger); }
@keyframes toast-in  { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(10px); } }

/* ---- Utilities ------------------------------------------------------------- */
.error { color: var(--danger); font-size: .85rem; margin: .2rem 0 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
@media (max-width: 560px) {
  .site-header { gap: .3rem .55rem; }
  .brand-name { font-size: 1.05rem; }
  .brand-mark { font-size: 1.3rem; }
  .cobrand { font-size: .82rem; }
  .cobrand img { height: 16px; }
  .lang-switch button { padding: .25rem .6rem; }
  .row, .coords { grid-template-columns: 1fr; }
  .toasts { inset-inline: 1rem; max-width: none; }
  /* On phones, let the whole page scroll instead of a nested scroll inside the mockup. */
  .s123-body { max-height: none; overflow: visible; }
}

/* ============================================================================
   CARD 1 ONLY — Esri Survey123-style mobile app mockup
   ============================================================================ */
.phone {
  max-width: 344px; margin: .5rem auto 0;
  background: #1b1b1d; border-radius: 40px; padding: 10px;
  box-shadow: 0 16px 36px rgba(43, 38, 32, .30);
}
.s123 {
  position: relative; background: #fff; border-radius: 30px; overflow: hidden;
  display: flex; flex-direction: column;
}
.s123::before { /* notch */
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 42%; height: 18px; background: #1b1b1d; border-radius: 0 0 13px 13px; z-index: 3;
}
.s123-bar {
  display: flex; align-items: center; gap: .5rem;
  padding: 1.35rem .7rem .55rem; /* extra top clears the notch */
  background: var(--s123-green); color: #fff;
}
.s123-title { flex: 1; text-align: center; font-weight: 600; font-size: .98rem; }
.s123-x, .s123-menu { flex: none; display: grid; place-items: center; width: 26px; height: 26px; }
.s123-x { border: 1.5px solid rgba(255,255,255,.75); border-radius: 50%; font-size: .8rem; }
.s123-menu { font-size: 1.25rem; }
.s123-body {
  padding: .9rem; display: flex; flex-direction: column; gap: .85rem;
  max-height: 60vh; overflow-y: auto; background: #fff;
}
/* Retheme the map + form inside the phone to the Survey123 look */
.s123 .map { height: 180px; flex: none; margin: 0; border: 1px solid #c4c4c4; border-radius: 6px; } /* flex:none — don't let the column-flex shrink the map to 0 */
.s123 .form { gap: .85rem; }
.s123 .form label { color: #232323; font-size: .9rem; font-weight: 600; }
.s123 .form input, .s123 .form select, .s123 .form textarea {
  border: 1px solid #c4c4c4; border-radius: 4px;
}
.s123 .form input[readonly] { background: #f4f4f4; color: #555; }
.s123 .form input:focus, .s123 .form select:focus, .s123 .form textarea:focus {
  border-color: var(--s123-green); box-shadow: 0 0 0 3px rgba(60, 157, 60, .18);
}
.s123 .filedrop { border-color: #c4c4c4; color: #8a8a8a; }
.s123 .filedrop:hover { border-color: var(--s123-green); }
.s123 .filedrop:has(span.has-file) { border-color: var(--s123-green); background: var(--s123-tint); }
.s123 .filedrop span.has-file { color: #232323; }
.s123-foot {
  display: flex; align-items: center; justify-content: flex-end;
  padding: .5rem .8rem; background: var(--s123-green);
}
.s123-check {
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: #fff; color: var(--s123-green); font-size: 1.4rem; font-weight: 800; line-height: 1;
  display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.22);
  transition: transform .06s, background .12s;
}
.s123-check:hover { background: #f2f2f2; }
.s123-check:active { transform: scale(.93); }
.s123-check:disabled { background: rgba(255,255,255,.4); color: rgba(255,255,255,.7); cursor: not-allowed; box-shadow: none; }
.s123-check .spinner { border-color: rgba(60,157,60,.35); border-top-color: var(--s123-green); }

/* ============================================================================
   Welcome page
   ============================================================================ */
.welcome { position: relative; padding: 0 clamp(1rem, 4vw, 2.2rem) 2.5rem; overflow: hidden; }
.welcome > * { position: relative; max-width: 1120px; margin-inline: auto; }
/* The interlocking H of the partner's logo, very faint, behind the hero. */
.welcome::before {
  content: ""; position: absolute; z-index: 0; top: 28px; inset-inline-end: -70px;
  width: 430px; height: 478px; max-width: none; margin: 0;
  background: url("brand/h-motif.svg") no-repeat center / contain; opacity: .05; pointer-events: none;
}
/* On a phone the motif sits behind text: keep it small and fainter. */
@media (max-width: 900px) { .welcome::before { top: 8px; inset-inline-end: -50px; width: 210px; height: 233px; opacity: .04; } }
.btn-lg { font-size: 1.02rem; padding: .85rem 1.5rem; border-radius: var(--r); text-decoration: none; }

.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center; padding: clamp(2.2rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem);
}
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }
.hero-logo { display: block; height: 120px; width: auto; margin: 0 0 1.4rem; }
@media (max-width: 640px) { .hero-logo { height: 88px; margin-bottom: 1rem; } }
.prepared-for {
  display: inline-block; margin: 0 0 1.2rem; padding: .3rem .85rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-soft); font-size: .84rem; font-weight: 500;
}
.hero-title {
  font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.14; letter-spacing: -.01em;
  margin: 0 0 1.1rem; font-weight: 700; text-wrap: balance;
}
/* Tagline: large display text, so the bronze is allowed here (4.4:1 on ivory, AA for large text). */
.tagline {
  margin: 0 0 1.1rem; padding-top: 1rem; position: relative;
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: clamp(1.25rem, 2.2vw, 1.55rem); line-height: 1.35; color: var(--bronze);
}
.tagline::before { content: ""; position: absolute; top: 0; inset-inline-start: 0; width: 4.5rem; height: 3px; border-radius: 3px; background: var(--grad); }
[dir="rtl"] .tagline::before { background: linear-gradient(270deg, #9D7335, #EBBF5E); }
.hero-sub { font-size: clamp(1.02rem, 1.6vw, 1.15rem); color: var(--ink-soft); margin: 0 0 1.7rem; max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.promise { margin: 1.6rem 0 0; color: var(--ink-soft); font-size: .98rem; font-weight: 500; }
.hero-photo { margin: 0; position: relative; }
.hero-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
/* a thin gold frame, offset behind the photo */
.hero-photo::before {
  content: ""; position: absolute; inset: 14px -14px -14px 14px; border: 1.5px solid var(--gold-soft);
  border-radius: var(--r-lg); z-index: -1;
}
[dir="rtl"] .hero-photo::before { inset: 14px 14px -14px -14px; }
@media (max-width: 900px) {
  .hero-photo img { aspect-ratio: 16 / 10; }
  .hero-photo::before { display: none; }
}

.quote { margin-block: 0 2rem; padding: 1.2rem 1.4rem; border-inline-start: 3px solid var(--gold-soft); background: var(--surface); border-radius: var(--r); }
.quote blockquote { margin: 0; font-family: var(--font-display); font-size: 1.2rem; font-style: italic; }
.quote figcaption { margin-top: .5rem; color: var(--muted); font-size: .88rem; }

.band { padding: clamp(1.8rem, 4.5vw, 3.2rem) 0; }
.band-title { font-size: clamp(1.45rem, 2.8vw, 1.95rem); letter-spacing: -.005em; margin: 0 0 1.4rem; font-weight: 700; text-wrap: balance; }
.band-actions { margin-top: 1.8rem; }

.problem-grid, .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .problem-grid, .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .problem-grid, .steps { grid-template-columns: 1fr; } }
.problem h3, .step-card h3 { margin: 0 0 .4rem; font-size: 1.15rem; font-weight: 700; }
.problem p, .step-card p { margin: 0; color: var(--ink-soft); font-size: .95rem; line-height: 1.6; }
.p-ico {
  width: 2.6rem; height: 2.6rem; margin-bottom: .9rem; padding: .5rem; display: block;
  border-radius: 50%; background: var(--accent-tint);
  fill: none; stroke: var(--bronze); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

/* Vision: the one dark band. Gold is used here for the large line only. */
.vision {
  background: var(--ink); color: #F6EEDD; border-radius: var(--r-lg);
  padding: clamp(1.5rem, 4vw, 2.6rem); margin-block: .8rem; position: relative; overflow: hidden;
}
.vision::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); }
.vision-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: clamp(1.2rem, 3vw, 2.4rem); align-items: center; padding: 0; }
.vision-photo { display: block; width: 100%; height: 100%; min-height: 15rem; object-fit: cover; }
.vision-body { padding: clamp(1.5rem, 4vw, 2.6rem); padding-inline-start: 0; }
@media (max-width: 900px) {
  .vision-split { grid-template-columns: 1fr; gap: 0; }
  .vision-photo { height: 11rem; min-height: 0; }
  .vision-body { padding: 1.4rem; }
}
.eyebrow { margin: 0 0 .4rem; font-size: .78rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-soft); }
.vision-text { margin: 0 0 1.5rem; font-family: var(--font-display); font-size: clamp(1.35rem, 2.8vw, 1.9rem); line-height: 1.3; font-weight: 600; color: var(--gold); text-wrap: balance; }
.mission-text { margin: 0; font-size: 1.02rem; color: #EADFCB; max-width: 50rem; }

/* Divider: the H mark between two gradient hairlines. */
.h-divider { display: flex; align-items: center; gap: 1rem; padding: .6rem 0; }
.h-divider::before, .h-divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-soft)); }
.h-divider::after { background: linear-gradient(270deg, transparent, var(--gold-soft)); }
.h-divider { background: url("brand/h-motif.svg") no-repeat center / 1.5rem auto; min-height: 2.2rem; }
.h-divider::before { margin-inline-end: 1.6rem; }
.h-divider::after { margin-inline-start: 1.6rem; }

.step-card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 1.2rem 1.3rem; box-shadow: var(--shadow-sm);
}
.step-num {
  display: grid; place-items: center; width: 2rem; height: 2rem; margin-bottom: .8rem;
  border-radius: 50%; background: var(--accent); color: #fff; font-weight: 500; font-size: .9rem;
}
/* Arrow between steps on wide screens; it points the reading direction. */
@media (min-width: 981px) {
  .step-card:not(:last-child)::after {
    content: "→"; position: absolute; inset-inline-end: -1.05rem; top: 1.35rem; width: 1rem;
    text-align: center; color: var(--bronze); font-weight: 700; z-index: 1;
  }
  [dir="rtl"] .step-card:not(:last-child)::after { content: "←"; }
}

.band-sub { margin: -.8rem 0 1.3rem; color: var(--ink-soft); }
.roadmap { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .roadmap { grid-template-columns: 1fr; } }
.roadmap li {
  display: flex; align-items: flex-start; gap: .7rem; padding: .85rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  font-size: .95rem; line-height: 1.5;
}
.badge.coming { background: var(--olive-bg); color: var(--olive); margin-top: .15rem; white-space: nowrap; }

.site-footer {
  display: flex; align-items: center; gap: 1.4rem; margin-top: 2rem; padding: 1.6rem 0 0;
  border-top: 1px solid var(--line-strong); color: var(--ink-soft); font-size: .9rem;
}
.footer-logo img { display: block; height: 104px; width: auto; }
.footer-text p { margin: 0 0 .35rem; }
.footer-cobrand { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.footer-links a { color: var(--accent); font-weight: 500; }

/* ============================================================================
   "Who are you?" + the link back to it
   ============================================================================ */
.who { padding: clamp(1.6rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.2rem) 3rem; max-width: 1120px; margin-inline: auto; }
.who-title { font-size: clamp(1.7rem, 4vw, 2.5rem); margin: 0 0 .4rem; }
.who-sub { margin: 0 0 1.8rem; color: var(--ink-soft); font-size: 1.08rem; }
.who-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; grid-template-columns: repeat(3, 1fr); align-items: stretch; }
.who-grid > li { display: flex; }
@media (max-width: 860px) { .who-grid { grid-template-columns: 1fr; } }
.who-card {
  position: relative; display: flex; flex-direction: column; width: 100%;
  color: inherit; text-decoration: none;
  transition: border-color .12s, box-shadow .12s, transform .08s;
}
.who-card:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.who-card h2 { display: block; font-size: 1.2rem; margin: 0 0 .35rem; }
.who-card p { margin: 0 0 1.1rem; color: var(--ink-soft); }
.who-go { margin-top: auto; align-self: flex-start; font-weight: 700; color: var(--accent-strong); }
.who-go::after { content: " →"; }
[dir="rtl"] .who-go::after { content: " ←"; }
.who-card.is-suggested { border: 2px solid var(--accent); background: var(--surface); box-shadow: var(--shadow-lg); }
.suggested {
  position: absolute; top: -.8rem; inset-inline-start: 1.1rem;
  background: var(--accent); color: #fff; font-size: .76rem; font-weight: 700;
  padding: .2rem .7rem; border-radius: var(--r-pill);
}
/* On a phone the suggested card comes first. */
@media (max-width: 860px) { .who-grid > li:has(.is-suggested) { order: -1; } }

.crumb { max-width: var(--maxw); margin: 0 auto; padding: .9rem clamp(1rem, 3vw, 1.8rem) 0; font-size: .9rem; }
.crumb a { color: var(--accent-strong); font-weight: 600; text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.crumb a::before { content: "← "; }
[dir="rtl"] .crumb a::before { content: "→ "; }

/* ============================================================================
   Institutional flow: "Add to the archive"
   ============================================================================ */
.columns-2 { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
@media (max-width: 900px) { .columns-2 { grid-template-columns: 1fr; } }
/* 16px controls: readable, and iOS does not zoom the page when one is focused. */
#inst-form input, #inst-form select, #inst-form textarea { font-size: 1rem; font-weight: 400; }
.fieldset-plain { border: 0; margin: 0; padding: 0; min-width: 0; }
.fieldset-plain:disabled { opacity: .45; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field-head { display: flex; align-items: center; gap: .4rem; position: relative; }
.field-head label, .field > label { font-size: .82rem; font-weight: 600; color: var(--ink-soft); flex-direction: row; }
.field-note { margin: .1rem 0 0; font-size: .8rem; line-height: 1.45; color: var(--muted); }
.notice {
  margin: 0; padding: .7rem .9rem; border-radius: var(--r-sm);
  background: var(--warn-bg); color: var(--warn); font-size: .9rem; line-height: 1.5;
  border-inline-start: 4px solid var(--warn);
}
.notice strong { display: block; }

/* (i) help: a native <details>, so it works by tap and by keyboard without script. */
.tip { position: static; }
.tip summary {
  list-style: none; cursor: pointer; display: grid; place-items: center;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  border: 1.5px solid var(--accent); color: var(--accent-strong);
  font: italic 700 .82rem/1 Georgia, "Times New Roman", serif;
}
.tip summary::-webkit-details-marker { display: none; }
.tip[open] summary { background: var(--accent); color: #fff; }
.tip > p {
  position: absolute; z-index: 5; inset-inline: 0; top: calc(100% + .35rem); margin: 0;
  padding: .7rem .85rem; border-radius: var(--r-sm);
  background: var(--ink); color: #F6EEDD; font-size: .84rem; font-weight: 400; line-height: 1.5;
  box-shadow: var(--shadow-lg);
}
.tip > p a { color: var(--gold); font-weight: 600; }

/* ---- Processing explained: one stepper per item ------------------------------- */
#processing { scroll-margin-top: 6.5rem; } /* clear the sticky ribbon + header */
.proc-info { margin: 0 0 1rem; padding: .85rem 1rem; border-radius: var(--r); background: var(--accent-tint); border: 1px solid var(--line); font-size: .92rem; line-height: 1.5; }
.proc-info p { margin: 0 0 .45rem; }
.proc-info p:last-child { margin-bottom: 0; }
.proc-title { font-weight: 750; font-size: 1.02rem; color: var(--ink); }
.archive-link { font-weight: 700; color: var(--accent-strong); }
.archive-link::after { content: " ↗"; }
[dir="rtl"] .archive-link::after { content: " ↖"; }
.proc-cleared { color: var(--muted); font-size: .84rem; }
html:not([lang="ar"]) .ar-only { display: none; }
.ar-only { color: var(--ink-soft); font-size: .86rem; }

.feed-item.steps-item { display: block; padding: .9rem 1rem; }
.steps-head { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: .7rem; }
.steps-head strong { min-width: 0; overflow-wrap: anywhere; font-size: .98rem; }
.steps-track { list-style: none; margin: 0; padding: 0; }
.st { position: relative; display: flex; gap: .7rem; padding-bottom: .75rem; }
.st:last-child { padding-bottom: 0; }
/* the line joining one step to the next */
.st:not(:last-child)::before {
  content: ""; position: absolute; inset-inline-start: calc(.7rem - 1px); top: 1.4rem; bottom: 0;
  width: 2px; background: var(--line-strong);
}
.st-done:not(:last-child)::before { background: var(--ok); }
.st-dot {
  flex: none; position: relative; z-index: 1; display: grid; place-items: center;
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  border: 2px solid var(--field-line); background: var(--surface);
  font-size: .78rem; font-weight: 800; line-height: 1; color: #fff;
}
.st-done .st-dot { background: var(--ok); border-color: var(--ok); }
.st-failed .st-dot { background: var(--danger); border-color: var(--danger); }
.st-coming .st-dot { border-style: dashed; }
.st-current .st-dot { border-color: var(--accent); border-top-color: transparent; animation: spin .9s linear infinite; }
.st-text { display: flex; flex-direction: column; min-width: 0; }
.st-label { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; font-weight: 650; font-size: .92rem; line-height: 1.4; }
.st-state { font-size: .72rem; font-weight: 600; color: var(--muted); }
.st-current .st-state { color: var(--accent-strong); }
/* the active step carries the logo's gradient */
.st-current .st-label > span:first-child { padding-bottom: 2px; background: var(--grad) no-repeat bottom / 100% 2px; }
.st-failed .st-state, .st-failed .st-note { color: var(--danger); }
.st-note { color: var(--ink-soft); font-size: .82rem; line-height: 1.45; }
.st-todo .st-label, .st-coming .st-label > span:first-child { color: var(--muted); }
.st .badge.coming { margin-top: 0; }

/* ============================================================================
   Archiving strategy page
   ============================================================================ */
.strategy { padding: clamp(1.6rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.2rem) 3rem; max-width: 1120px; margin-inline: auto; }
.q-grid { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .q-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .q-grid { grid-template-columns: 1fr; } }
.q-card h2 { display: block; font-size: 1.15rem; margin: 0 0 .35rem; }
.q-card p { margin: 0; color: var(--ink-soft); font-size: .95rem; line-height: 1.55; }

.formats { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; font-size: .95rem; }
.formats th, .formats td { text-align: start; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.formats thead th { background: var(--surface-2); font-size: .8rem; letter-spacing: .03em; color: var(--ink-soft); }
.formats tbody tr:last-child > * { border-bottom: 0; }
.formats tbody th { font-weight: 700; }
.cell-label { display: none; }
/* On a phone each row becomes a small block, with the column name before each value. */
@media (max-width: 640px) {
  .formats thead { display: none; }
  .formats, .formats tbody, .formats tr, .formats th, .formats td { display: block; }
  .formats tr { padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
  .formats tbody tr:last-child { border-bottom: 0; }
  .formats th, .formats td { padding: .1rem 0; border: 0; }
  .cell-label { display: block; margin-top: .35rem; font-size: .74rem; font-weight: 700; color: var(--muted); }
}
.formats-note { display: flex; align-items: flex-start; gap: .6rem; margin: .9rem 0 0; color: var(--ink-soft); font-size: .92rem; }
.closing { text-align: center; }
.closing-text { max-width: 44rem; margin: 0 auto 1.3rem; font-size: clamp(1.1rem, 2.4vw, 1.4rem); font-weight: 700; line-height: 1.4; text-wrap: balance; }

.btn-ghost { background: transparent; color: var(--accent-strong); border-color: var(--bronze); }
.btn-ghost:hover { background: var(--accent-tint); }
.nav-link { margin-inline-start: auto; color: var(--ink-soft); font-weight: 500; font-size: .9rem; text-decoration: none; }
.nav-link:hover { color: var(--accent-strong); text-decoration: underline; }
.nav-link + .lang-switch { margin-inline-start: .4rem; }
@media (max-width: 720px) { .nav-link { display: none; } .nav-link + .lang-switch { margin-inline-start: auto; } }
.tip > p a { display: block; margin-top: .4rem; }

/* ============================================================================
   Guided tour
   ============================================================================ */
/* Spotlight: a clear box over the step's target; its shadow dims the rest of
   the page. Clicks pass through, so the visitor can use what it points at. */
.tour-spot {
  position: fixed; z-index: 38; pointer-events: none; border-radius: var(--r-lg);
  box-shadow: 0 0 0 2px var(--gold-soft), 0 0 0 9999px rgba(46, 36, 24, .45);
}
/* Popover: the same light card on every background. */
.tour-card {
  position: fixed; z-index: 40; width: min(21.5rem, calc(100vw - 2rem)); padding: 1.05rem 1.15rem 1rem;
  background: var(--surface); color: var(--ink); border-radius: var(--r-lg);
  border: 1px solid var(--line-strong); border-top: 3px solid var(--bronze);
  box-shadow: 0 4px 10px rgba(46, 36, 24, .12), 0 18px 44px rgba(46, 36, 24, .28);
}
.tour-card:focus { outline: none; }
.tour-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tour-count { margin: 0 0 .2rem; font-size: .76rem; font-weight: 500; letter-spacing: .04em; color: var(--muted); }
.tour-title { margin: 0 0 .35rem; font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.tour-body { margin: 0 0 .9rem; font-size: .93rem; line-height: 1.55; color: var(--ink-soft); }
.tour-wait { margin: -.3rem 0 .9rem; font-size: .88rem; font-weight: 500; color: var(--accent-strong); }
.tour-actions { display: flex; align-items: center; gap: .5rem; }
.tour-skip { margin-inline-end: auto; padding: .4rem 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: .88rem; font-weight: 500; text-decoration: underline; cursor: pointer; }
.tour-card .btn { padding: .48rem 1rem; font-size: .9rem; }
.tour-back { background: transparent; color: var(--accent-strong); border-color: var(--field-line); }
/* Arrow: a small diamond on the edge facing the target. */
.tour-arrow { position: absolute; width: 14px; height: 14px; background: var(--surface); transform: rotate(45deg); }
.tour-card[data-side="right"] .tour-arrow { left: -8px; margin-top: -7px; border-inline-start: 0; border-left: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.tour-card[data-side="left"] .tour-arrow { right: -8px; left: auto; margin-top: -7px; border-right: 1px solid var(--line-strong); border-top: 1px solid var(--line-strong); }
.tour-card[data-side="bottom"] .tour-arrow { top: -9px; margin-left: -7px; border-left: 1px solid var(--line-strong); border-top: 3px solid var(--bronze); background: var(--bronze); }
.tour-card[data-side="top"] .tour-arrow { bottom: -8px; top: auto; margin-left: -7px; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
/* Phones: a bottom sheet, no arrow. */
.tour-card.is-sheet {
  left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0; border-inline: 0; border-bottom: 0;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 30px rgba(46, 36, 24, .3);
}
.tour-card.is-sheet .tour-arrow { display: none; }
.who-foot { margin: 1.6rem 0 0; font-size: .88rem; }
.who-foot a { color: var(--accent-strong); font-weight: 600; }
/* Room below the page so the bottom sheet never hides its end. */
@media (max-width: 640px) { body.tour-on .view { padding-bottom: 16rem; } }
/* Paused: the tour never describes a screen the visitor is not on. */
.tour-pill {
  position: fixed; z-index: 40; bottom: 1rem; inset-inline-start: 1rem;
  display: flex; align-items: center; gap: .6rem; max-width: calc(100vw - 2rem);
  padding-block: .45rem; padding-inline: 1rem .5rem; border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong);
  box-shadow: 0 4px 10px rgba(46, 36, 24, .12), 0 14px 34px rgba(46, 36, 24, .24); font-size: .88rem;
}
.tour-pill .btn { padding: .35rem .85rem; font-size: .86rem; border-radius: var(--r-pill); }
.tour-x { width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.tour-x:hover { background: var(--surface-2); }
.archive-cta { margin: 0 0 .9rem; }
.hero-link { color: var(--accent-strong); font-weight: 650; }

/* ============================================================================
   Phone header menu
   ============================================================================ */
.nav-menu { display: none; position: relative; }
.nav-menu summary {
  list-style: none; cursor: pointer; display: grid; place-items: center; width: 2.25rem; height: 2.25rem;
  border: 1px solid var(--field-line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.nav-menu[open] summary { background: var(--accent); color: #fff; border-color: var(--accent); }
.nav-menu-panel {
  position: absolute; z-index: 30; top: calc(100% + .5rem); inset-inline-end: 0; min-width: 14.5rem;
  display: flex; flex-direction: column; padding: .4rem;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
}
.nav-menu-panel a { padding: .7rem .8rem; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-weight: 500; }
.nav-menu-panel a:hover, .nav-menu-panel a:focus-visible { background: var(--surface-2); }
@media (max-width: 720px) {
  .nav-menu { display: block; margin-inline-start: auto; }
  .nav-menu + .lang-switch { margin-inline-start: 0; }
}
/* Narrow phones: keep the header on one line. */
@media (max-width: 480px) {
  .site-header { gap: .4rem; }
  .cobrand { font-size: .78rem; gap: .3rem; }
  .cobrand img { height: 24px; }
  .lang-switch button { padding: .25rem .5rem; font-size: .78rem; }
}

/* ============================================================================
   Welcome page: the archiving strategy in short (inside "Our approach")
   ============================================================================ */
.brief {
  margin-top: 1.6rem; padding: clamp(1.2rem, 3vw, 1.9rem); border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--line);
}
.brief-title { margin: 0 0 .35rem; font-size: clamp(1.2rem, 2.2vw, 1.45rem); }
.brief-lede { margin: 0 0 1.1rem; color: var(--ink-soft); }
.brief-q { list-style: none; margin: 0 0 1.1rem; padding: 0; display: grid; gap: .8rem 1.4rem; grid-template-columns: repeat(4, 1fr); counter-reset: q; }
@media (max-width: 980px) { .brief-q { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .brief-q { grid-template-columns: 1fr; } }
.brief-q li { counter-increment: q; padding-inline-start: .9rem; border-inline-start: 2px solid var(--gold-soft); font-size: .93rem; line-height: 1.5; color: var(--ink-soft); }
.brief-q strong { display: block; font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); }
.brief-assess { margin: 0 0 1.3rem; font-family: var(--font-display); font-size: 1.1rem; line-height: 1.45; color: var(--ink); }
.brief-sub { margin: 0 0 .6rem; font-family: var(--font-display); font-size: 1.05rem; }
.formats-brief { font-size: .9rem; }
.formats-brief th, .formats-brief td { padding: .5rem .8rem; }
.brief-more { margin: 1rem 0 0; }
.brief-more a { font-weight: 500; }
.brief-more a::after { content: " →"; }
[dir="rtl"] .brief-more a::after { content: " ←"; }

/* ============================================================================
   Optional contact card
   ============================================================================ */
.cta-slot { margin-top: 1.1rem; }
.cta-card { padding: 1.1rem 1.2rem; border-radius: var(--r-lg); background: var(--accent-tint); border: 1px solid var(--line-strong); border-top: 3px solid var(--bronze); }
.cta-title { margin: 0 0 .25rem; font-size: 1.15rem; }
.cta-body { margin: 0 0 .9rem; color: var(--ink-soft); font-size: .95rem; }
.cta-card .form { gap: .65rem; }
.cta-card input { font-size: 1rem; font-weight: 400; }
.cta-note { margin: 0; font-size: .82rem; line-height: 1.45; color: var(--muted); }
.cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.cta-dismiss { border: 0; background: none; padding: .4rem 0; color: var(--accent); font: inherit; font-size: .9rem; font-weight: 500; text-decoration: underline; cursor: pointer; }
.cta-thanks { margin: 0; font-weight: 500; color: var(--ok); }
/* compact: at the end of the tour, inside the popover */
.cta-card.is-compact { padding: 0; border: 0; background: none; }
.cta-card.is-compact .cta-title { font-size: 1.05rem; }
.cta-card.is-compact .cta-body { font-size: .88rem; margin-bottom: .6rem; }
.cta-card.is-compact .form { gap: .45rem; }
.cta-card.is-compact label { font-size: .78rem; gap: .15rem; }
.cta-card.is-compact input { padding: .4rem .55rem; }
.cta-card.is-compact .cta-note { font-size: .76rem; }
.cta-card.is-compact .btn { padding: .45rem .95rem; font-size: .9rem; }
.tour-done { margin-top: .8rem; }
.tour-card.is-closing > .tour-count, .tour-card.is-closing > .tour-title, .tour-card.is-closing > .tour-body,
.tour-card.is-closing > .tour-wait, .tour-card.is-closing > .tour-actions { display: none; }
.tour-card.is-sheet.is-closing { max-height: 86vh; overflow-y: auto; }
.hint.proc-cleared { margin-top: -.6rem; }

/* ============================================================================
   Arabic / right-to-left
   Layout uses logical properties, so most of the page mirrors by itself. What
   is left: the font, Latin-only type tweaks, and directional gradients.
   ============================================================================ */
:lang(ar) {
  --font: "IBM Plex Sans Arabic", "Roboto", -apple-system, "Segoe UI", Tahoma, sans-serif;
  --font-display: "Noto Naskh Arabic", "Lora", Georgia, serif;
}
html[lang="ar"] body { line-height: 1.8; }
html[lang="ar"] h1,
html[lang="ar"] .card h2,
html[lang="ar"] .brand-name { letter-spacing: 0; }
html[lang="ar"] h1 { line-height: 1.4; }
html[lang="ar"] .badge { letter-spacing: 0; font-size: .74rem; }
[dir="rtl"] .feed-item.s-published { background: linear-gradient(270deg, var(--ok-bg), var(--surface-2) 55%); }
/* The English language button keeps the Latin font. */
html[lang="ar"] [lang="en"] { font-family: "Roboto", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; }
html[lang="ar"] .hero-title { letter-spacing: 0; line-height: 1.45; }
html[lang="ar"] .band-title { letter-spacing: 0; line-height: 1.5; }
html[lang="ar"] .vision-text { line-height: 1.6; }
html[lang="ar"] .eyebrow, html[lang="ar"] .demo-ribbon { letter-spacing: 0; font-size: .86rem; }
html[lang="ar"] .brand-name { font-size: 1.7rem; line-height: 1.1; }
html[lang="ar"] .tagline { font-style: normal; font-weight: 700; line-height: 1.6; }
html[lang="ar"] .hero-title { font-size: clamp(2.1rem, 4.6vw, 3.3rem); }
html[lang="ar"] .vision-text { font-weight: 700; }
html[lang="ar"] .problem h3, html[lang="ar"] .step-card h3 { font-size: 1.25rem; }
html[lang="ar"] .formats thead th { letter-spacing: 0; font-size: .86rem; }
html[lang="ar"] .closing-text { line-height: 1.7; }
html[lang="ar"] .brief-q strong { font-size: 1.15rem; }
