/* balatat.com — shared theme ("The Dial"). Every page loads this file first.
   Tokens → reset → page ground → top bar + menu (markup injected by chrome.js) → components → footer → fallbacks.
   Rules of the house: light ground, dark ink, maroon only for the brand and limited-edition marks.
   Logical properties everywhere, so dir="rtl" needs no second stylesheet. */

/* ───────── tokens ───────── */
:root {
  /* ink */
  --ink: #15171c;
  --ink-2: rgba(21, 23, 28, .64);          /* muted text: 4.6:1 on the lightest grounds */
  --ink-3: rgba(21, 23, 28, .42);          /* decoration, counters, separators — never body text */
  --line: rgba(21, 23, 28, .12);
  --maroon: #8a1538;                       /* brand + limited editions only */
  --lim: var(--maroon);
  --maroon-deep: #4a0d20;                  /* footer */

  /* tint: chrome.js sets --tint (hex of the visitor's last selected colour) plus --accent / --on-accent / --deep.
     The ground is always the tint at low strength on white, so it stays light and ink stays dark. */
  --tint: #8d9099;
  --ground: #f5f5f6;                       /* solid fallback (no color-mix) */
  --wash: #e8e8ea;
  --surface: rgba(255, 255, 255, .7);      /* cards on the ground */
  --accent: var(--ink);                    /* primary button fill; contrast-safe pair with --on-accent */
  --on-accent: #fff;
  --deep: #5d6068;                         /* small marks in the tint, ≥ 3.4:1 on white */

  /* type */
  --font: "Readex Pro", system-ui, -apple-system, "Segoe UI", "Geeza Pro", "Noto Sans Arabic", sans-serif;
  --fs-tag: 9.5px;
  --fs-xs: 11.5px;                         /* footnotes, pills on phones */
  --fs-s: 12.5px;                          /* secondary lines */
  --fs-body: 15px;
  --fs-m: 17px;                            /* card titles */
  --fs-h2: 24px;
  --fs-h1: 34px;

  /* layout */
  --gut: 16px;                             /* page gutter: 16 phone · 40 tablet · 48 desktop */
  --bar-h: 52px;                           /* top bar: 52 phone · 100 tablet (two rows) · 64 wide desktop */
  --maxw: 1180px;
  --buy-h: 0px;                            /* height of a page's sticky bottom bar, if it has one (home sets it) */
  --r-card: 20px;
  --ease: cubic-bezier(0, .97, .43, 1);
}
@supports (background: color-mix(in srgb, red 50%, blue)) {
  :root {
    --ground: color-mix(in srgb, var(--tint) 9%, #fff);
    --wash: color-mix(in srgb, var(--tint) 20%, #fff);
  }
}
@media (min-width: 700px) { :root { --gut: 40px; --bar-h: 100px; --fs-xs: 12px; --fs-h2: 30px; --fs-h1: 48px; --r-card: 20px; } }
@media (min-width: 900px) { :root { --gut: 48px; --fs-h2: 34px; --fs-h1: 56px; } }
@media (min-width: 1180px) { :root { --bar-h: 64px; } }

/* ───────── reset ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; scroll-behavior: smooth; background: var(--ground); }
body {
  margin: 0; min-height: 100vh; min-height: 100svh; overflow-x: hidden; overflow-x: clip;
  font-family: var(--font); font-size: var(--fs-body); line-height: 1.4; font-weight: 400; color: var(--ink);
  background: var(--ground);
  /* the top bar is injected by chrome.js; its height is reserved here so nothing jumps */
  padding-block-start: calc(var(--bar-h) + env(safe-area-inset-top, 0px));
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body > main { flex: 1 0 auto; display: block; min-width: 0; }
:lang(ar) { letter-spacing: 0 !important; }
img, svg { display: block; }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, figure { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ───────── top bar (chrome.js) ───────── */
.ka-top {
  position: absolute; inset-block-start: 0; inset-inline: 0; z-index: 30;
  height: calc(var(--bar-h) + env(safe-area-inset-top, 0px)); padding-block-start: env(safe-area-inset-top, 0px);
  padding-inline: 6px 12px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.ka-nav { display: none; }
.ka-menu-btn { width: 44px; height: 44px; display: grid; place-content: center; gap: 6px; justify-self: start; }
.ka-menu-btn span { display: block; width: 20px; height: 1.5px; border-radius: 2px; background: var(--ink); transition: transform .45s var(--ease); }
.ka-menu-open .ka-menu-btn span:first-child { transform: translateY(3.75px) rotate(45deg); }
.ka-menu-open .ka-menu-btn span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
.ka-logo { display: grid; align-items: center; justify-items: center; min-height: 44px; padding: 0 8px; }
.ka-logo img { max-width: none; }
.ka-logo .wm-en { width: clamp(138px, 41vw, 232px); height: auto; }
.ka-logo .wm-ar { height: 40px; width: auto; }
html:not([lang="ar"]) .wm-ar, html[lang="ar"] .wm-en { display: none; }
.ka-lang { justify-self: end; display: flex; height: 30px; padding: 2px; border-radius: 999px; background: rgba(255, 255, 255, .6); box-shadow: inset 0 0 0 1px var(--line); }
.ka-lang button { position: relative; min-width: 34px; padding-inline: 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; line-height: 26px; color: var(--ink-2); transition: background-color .3s, color .3s; }
.ka-lang button::after { content: ""; position: absolute; inset-block: -9px; inset-inline: -12px 0; }        /* 44 px touch target, outwards only */
.ka-lang button:last-child::after { inset-inline: 0 -12px; }
.ka-lang button[lang="ar"] { font-size: 14px; line-height: 24px; }
.ka-lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* phone menu: an opaque sheet of the page ground; large light links that rise in one after another.
   Only opacity and transform are animated. */
.ka-menu {
  position: fixed; inset: 0; z-index: 25; display: flex; flex-direction: column;
  padding-block: calc(var(--bar-h) + env(safe-area-inset-top, 0px) + 18px) calc(22px + env(safe-area-inset-bottom, 0px));
  padding-inline: max(24px, env(safe-area-inset-left, 0px)) max(24px, env(safe-area-inset-right, 0px));
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: var(--ground);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .22s linear, visibility 0s linear .22s;
}
.ka-menu-open .ka-menu { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .28s linear, visibility 0s; }
.ka-menu-open .ka-top { position: fixed; }
html.ka-menu-open { overflow: hidden; }
.ka-menu ul { display: flex; flex-direction: column; flex: 1 0 auto; width: 100%; max-width: 520px; margin-inline: auto; }
.ka-menu li { opacity: 0; transform: translateY(14px); transition: opacity .18s linear, transform 0s linear .22s; }
.ka-menu-open .ka-menu li { opacity: 1; transform: none; transition: opacity .42s linear calc(var(--i, 0) * 34ms + 40ms), transform .72s var(--ease) calc(var(--i, 0) * 34ms + 40ms); }
.ka-menu a:not(.btn) { display: block; padding-block: 8px; font-size: 31px; line-height: 1.16; font-weight: 300; letter-spacing: -.028em; color: var(--ink); }
.ka-menu a[aria-current] { font-weight: 500; }
.ka-menu a:not(.btn):active { opacity: .55; }
html[lang="ar"] .ka-menu a:not(.btn) { font-size: 28px; line-height: 1.5; padding-block: 3px; }
.ka-menu li.ka-menu-cta { margin-block-start: auto; padding-block-start: 26px; }
.ka-menu .btn { width: 100%; }
.ka-menu-foot { display: block; margin-block-start: 12px; text-align: center; font-size: 12px; color: var(--ink-2); }
@media (max-height: 640px) { .ka-menu a:not(.btn) { font-size: 26px; padding-block: 5px; } html[lang="ar"] .ka-menu a:not(.btn) { font-size: 24px; padding-block: 1px; } .ka-menu li.ka-menu-cta { padding-block-start: 14px; } }

@media (min-width: 700px) {
  .ka-top { padding-inline: 40px; grid-template-rows: 56px 44px; align-content: start; }
  .ka-menu-btn, .ka-menu { display: none; }
  .ka-logo { grid-column: 2; grid-row: 1; }
  .ka-lang { grid-column: 3; grid-row: 1; }
  .ka-nav { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: center; align-items: center; gap: clamp(0px, 2.2vw - 12px, 14px); white-space: nowrap; }
  .ka-nav a { position: relative; padding: 13px 6px; font-size: 13px; color: var(--ink-2); transition: color .25s; }
  .ka-nav a:hover { color: var(--ink); }
  .ka-nav a[aria-current] { color: var(--ink); font-weight: 500; }
  .ka-nav a[aria-current]::after { content: ""; position: absolute; inset-inline: 6px; bottom: 8px; height: 1.5px; border-radius: 2px; background: var(--deep); transition: background-color .5s; }
}
@media (min-width: 1180px) {
  .ka-top { grid-template-rows: 64px; padding-inline: 32px 40px; column-gap: 20px; }
  .ka-logo { grid-column: 1; justify-self: start; }
  .ka-nav { grid-column: 2; grid-row: 1; gap: clamp(2px, 1.7vw - 12px, 16px); }
  .ka-lang { grid-column: 3; }
}

/* ───────── layout helpers ───────── */
.wrap { width: 100%; max-width: calc(var(--maxw) + 2 * var(--gut)); margin-inline: auto; padding-inline: var(--gut); }
.wrap-narrow { max-width: calc(720px + 2 * var(--gut)); }
.sec { padding-block: 44px; }
.page-head { padding-block: 28px 8px; display: grid; gap: 10px; }
@media (min-width: 700px) { .sec { padding-block: 72px; } .page-head { padding-block: 44px 12px; gap: 14px; } }
@media (min-width: 900px) { .sec { padding-block: 96px; } .page-head { padding-block: 64px 16px; } }
.stack { display: grid; gap: 14px; justify-items: start; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }

/* ───────── type ───────── */
.h1 { font-size: var(--fs-h1); line-height: 1.14; font-weight: 500; letter-spacing: -.02em; text-wrap: balance; }
.h2 { font-size: var(--fs-h2); line-height: 1.2; font-weight: 300; letter-spacing: -.02em; text-wrap: balance; }
.h3 { font-size: var(--fs-m); line-height: 1.3; font-weight: 500; letter-spacing: -.01em; }
:lang(ar).h1, :lang(ar) .h1 { line-height: 1.4; }
:lang(ar).h2, :lang(ar) .h2 { line-height: 1.5; }
.eyebrow { font-size: var(--fs-s); line-height: 1.5; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.lead { font-size: 17px; line-height: 1.5; font-weight: 300; color: var(--ink); max-width: 34em; text-wrap: pretty; }
.muted { color: var(--ink-2); }
.num { font-size: 11px; font-weight: 400; letter-spacing: .06em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
:lang(ar) .lead, :lang(ar) p { line-height: 1.75; }
@media (min-width: 700px) { .lead { font-size: 19px; } }

/* section heading: small index numeral + title */
.sec-head { display: flex; align-items: baseline; gap: 10px; margin-block-end: 18px; }

/* ───────── pills ───────── */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills > li, .pill { flex: none; display: inline-block; height: 26px; padding-inline: 10px; border-radius: 999px; font-size: var(--fs-xs); line-height: 26px; white-space: nowrap; color: var(--ink); background: rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 1px var(--line); }
.pill-dot::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-end: 7px; border-radius: 50%; background: var(--deep); vertical-align: 1px; transition: background-color .5s; }
.pills > li.dag::after, .pill.dag::after { content: "†"; display: inline-block; margin-inline-start: 1px; font-size: .82em; line-height: 0; vertical-align: .22em; color: var(--ink-2); }      /* a figure covered by the size note */
@media (min-width: 700px) { .pills > li, .pill { height: 30px; line-height: 30px; font-size: 13px; padding-inline: 14px; } .pills { gap: 8px; } }

/* filter / toggle pills (buttons) */
.fpills { display: flex; flex-wrap: wrap; gap: 6px; }
.fpill { position: relative; flex: none; height: 28px; padding-inline: 12px; border-radius: 999px; font-size: 12px; line-height: 28px; white-space: nowrap; color: var(--ink); background: rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .2s, color .2s, box-shadow .2s, transform .12s; }
.fpill::after { content: ""; position: absolute; inset: -8px -3px; }                /* 44 px touch target */
.fpill:active { transform: scale(.95); }
.fpill[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.fpill sup { font-size: .8em; line-height: 0; margin-inline-start: 1px; }

/* ───────── buttons ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-width: 44px; height: 52px; padding-inline: 22px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-size: 15px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background-color .5s, color .5s, transform .15s;
}
.btn:active { transform: scale(.97); }
.btn svg { flex: none; }
.btn-2 { background: rgba(255, 255, 255, .6); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(21, 23, 28, .22); }
.btn-2:hover { background: #fff; }
.btn-s { height: 44px; padding-inline: 18px; font-size: 14px; }
.btn-maroon { background: var(--maroon); color: #fff; }
.link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
@media (max-width: 374px) { .btn { padding-inline: 18px; font-size: 14.5px; } }
@media (min-width: 700px) { .btn { height: 56px; padding-inline: 30px; font-size: 16px; } .btn-s { height: 44px; padding-inline: 20px; font-size: 14px; } }
@media (min-width: 900px) { .btn { height: 52px; padding-inline: 26px; font-size: 15px; } }

/* ───────── cards ───────── */
.card { border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px rgba(21, 23, 28, .06); padding: 20px; }
.card-solid { background: #fff; }
@media (min-width: 700px) { .card { padding: 28px; } }

/* link cards: a ruled list on phones, tiles from tablet up */
.lcards { display: grid; }
.lcard { position: relative; display: grid; gap: 2px; min-height: 44px; padding-block: 13px; padding-inline-end: 40px; border-block-start: 1px solid var(--line); }
.lcard:last-child { border-block-end: 1px solid var(--line); }
.lcard-t { font-size: var(--fs-m); font-weight: 500; letter-spacing: -.01em; }
.lcard-s { font-size: var(--fs-s); color: var(--ink-2); }
.lcard-a { position: absolute; inset-inline-end: 4px; top: 50%; width: 9px; height: 9px; margin-top: -5px; border-block-start: 1.5px solid var(--ink); border-inline-end: 1.5px solid var(--ink); transform: rotate(45deg); transition: transform .4s var(--ease); }
[dir="rtl"] .lcard-a { transform: rotate(-45deg); }
.lcard:hover .lcard-a { transform: translateX(4px) rotate(45deg); }
[dir="rtl"] .lcard:hover .lcard-a { transform: translateX(-4px) rotate(-45deg); }
@media (min-width: 700px) {
  .lcards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .lcard, .lcard:last-child { border: 0; padding: 22px; padding-inline-end: 48px; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px rgba(21, 23, 28, .06); min-height: 96px; align-content: start; transition: background-color .3s, transform .5s var(--ease); }
  .lcard:hover { background: #fff; transform: translateY(-3px); }
  .lcard-a { inset-inline-end: 24px; top: 28px; margin: 0; }
}
@media (min-width: 900px) { .lcards { grid-template-columns: repeat(4, minmax(0, 1fr)); } .lcard, .lcard:last-child { min-height: 118px; } }

/* ───────── small marks ───────── */
/* tag: a quiet factual label on or beside a photo ("sample disc") */
.tag { display: inline-block; font-size: var(--fs-tag); line-height: 1; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; color: var(--ink-2); padding: 4px 6px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line); }
/* edition mark: set like an engraving, never a badge */
.ed { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; font-size: 11px; line-height: 14px; color: var(--ink-2); }
.ed-l { font-size: .86em; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--lim); }
:lang(ar) .ed-l { font-size: 1.05em; font-weight: 500; }      /* Arabic has no capitals: the label needs its full size to read */
.ed-n b { font-size: 1.2em; font-weight: 600; color: var(--lim); font-variant-numeric: tabular-nums; }
.ed-n small { font-size: 1em; color: var(--ink-2); }
.ed-open { color: var(--ink-2); }
.lim { color: var(--lim); font-weight: 600; font-variant-numeric: tabular-nums; }
/* footnotes: .note-ast is the pattern note (*), .note-dag the size note (†) */
.note { font-size: var(--fs-xs); line-height: 1.45; color: var(--ink-2); max-width: 46em; }
:lang(ar) .note { line-height: 1.7; }
.note-dag::before { content: "† "; }
.ast { font-size: .8em; font-weight: 400; color: var(--ink-2); vertical-align: top; line-height: 1.1; margin-inline-start: 1px; }

/* ───────── footer (chrome.js) ───────── */
.ka-foot { flex: none; background: var(--maroon-deep); color: rgba(255, 255, 255, .8); padding: 44px var(--gut) calc(var(--buy-h) + 36px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; justify-items: center; text-align: center; font-size: 12.5px; font-weight: 300; }
.ka-foot-notes { display: grid; gap: 6px; max-width: 54em; margin-block-end: 26px; padding-block-end: 26px; border-block-end: 1px solid rgba(255, 255, 255, .16); font-size: var(--fs-xs); line-height: 1.5; color: rgba(255, 255, 255, .8); }
.ka-foot-logo { width: 132px; height: auto; margin-block-end: 14px; filter: brightness(0) invert(1); opacity: .95; }
.ka-foot-line span { white-space: nowrap; }
.ka-foot-line i { font-style: normal; }
.ka-foot-line a { color: #fff; font-weight: 400; display: inline-block; padding-block: 14px; }
.ka-foot-line:has(a) { margin-block: -6px -8px; }
.ka-foot-pre { color: rgba(255, 255, 255, .8); }
@media (max-width: 520px) { .ka-foot-line i.sep { display: none; } .ka-foot-line span.wa { display: block; margin-block-start: 6px; } }
.ka-foot-nav { margin-block-start: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 4px; max-width: 560px; }
.ka-foot-nav a { color: #fff; font-weight: 400; padding: 14px 10px; }
.ka-foot-nav a:hover, .ka-foot-line a:hover { text-decoration: underline; text-underline-offset: 4px; }
.ka-foot :focus-visible { outline-color: #fff; }
@media (min-width: 700px) { .ka-foot { padding-block-start: 64px; font-size: 13.5px; } .ka-foot-nav { max-width: none; } }

/* ───────── entrance for below-the-fold sections: add .reveal, chrome.js adds .is-in ───────── */
.ka-js .reveal > * { opacity: 0; transform: translateY(22px); transition: opacity .6s, transform .9s var(--ease); }
.ka-js .reveal.is-in > * { opacity: 1; transform: none; }
.reveal.is-in > :nth-child(2) { transition-delay: .08s } .reveal.is-in > :nth-child(3) { transition-delay: .16s } .reveal.is-in > :nth-child(4) { transition-delay: .24s }
.reveal.is-in > :nth-child(5) { transition-delay: .3s } .reveal.is-in > :nth-child(6) { transition-delay: .36s } .reveal.is-in > :nth-child(7) { transition-delay: .42s }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto; }
}
@media print { .ka-top, .ka-menu, .ka-foot-nav { display: none; } body { padding: 0; background: #fff; } }
