/* ==========================================================================
   Abdullah Shahid — site styles
   --------------------------------------------------------------------------
   Colour: the neutrals of the approved reference card (black, soft grey,
   warm ivory) with two charcoals for dark sections. Nothing else.

   Text contrast (WCAG 2.x):
     black   #000    on ivory #E9DFD3   15.3:1
     ink-2   #45444A on ivory           8.1:1
     ivory           on night #131314   14.6:1
     muted   #A6A49F on night           7.6:1
   Type: Cormorant Garamond (headings) + Manrope (text). The signature face
   is used for the name only.
   ========================================================================== */

:root {
  --black:  #000000;
  --night:  #131314;
  --char:   #1D1D1F;
  --char-2: #3A3A3D;
  --grey:   #D9DDDC;
  --ivory:  #E9DFD3;

  --ink:    var(--black);
  --ink-2:  #45444A;
  --rule:   rgba(0, 0, 0, .16);
  --rule-2: rgba(0, 0, 0, .32);
  --on-dark:   var(--ivory);
  --on-dark-2: #A6A49F;
  --rule-d:    rgba(233, 223, 211, .16);

  --serif: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --sans:  "Manrope", "Helvetica Neue", Arial, sans-serif;
  --sign:  "Mrs Saint Delafield", "Brush Script MT", cursive;

  --t-h1: clamp(2.5rem, 4.6vw, 4.25rem);
  --t-h2: clamp(1.9rem, 3vw, 2.75rem);
  --t-h3: 1.45rem;
  --t-lead: 1.2rem;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --wrap: min(1180px, 100% - 2 * var(--gutter));
  --sec: clamp(4rem, 8vw, 7rem);
  --header-h: 72px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; background: var(--ivory); color: var(--ink); font: 400 1.0625rem/1.7 var(--sans); font-variant-numeric: lining-nums; -webkit-font-smoothing: antialiased; }
img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 500; line-height: 1.1; letter-spacing: -.005em; }
h1 em, h2 em { font-style: normal; }
p { margin: 0 0 1em; } p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
address { font-style: normal; }
::selection { background: var(--char); color: var(--ivory); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.skip { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--black); color: var(--ivory); padding: .7rem 1rem; text-decoration: none; }
.skip:focus { top: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.wrap { width: var(--wrap); margin-inline: auto; }
.section { padding-block: var(--sec); }
.section + .section:not(.dark):not(.grey) { border-top: 1px solid var(--rule); }
.dark, .section.ink, .section.char { background: var(--night); color: var(--on-dark); }
.grey, .section.mist, .section.sage { background: var(--grey); }
.section.light { background: var(--ivory); color: var(--ink); }

.lead { font-size: var(--t-lead); line-height: 1.6; color: var(--ink-2); max-width: 60ch; }
.dark .lead, .page-hero .lead { color: var(--on-dark-2); }
.small { font-size: .9375rem; }
.mute { color: var(--ink-2); } .dark .mute { color: var(--on-dark-2); }
.note { font-size: .875rem; color: var(--ink-2); max-width: 72ch; }
.dark .note { color: var(--on-dark-2); }
.label { font: 600 .75rem/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.dark .label, .page-hero .label { color: var(--on-dark-2); }
.label.plain::before { content: none; }

/* editorial two-column: heading in the margin, text beside it */
.cols { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(1.5rem, 5vw, 5rem); }
.cols > h2, .cols .side h2 { font-size: var(--t-h2); }
.sec-head { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(1.5rem, 5vw, 5rem); align-items: baseline; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.sec-head h2 { font-size: var(--t-h2); }
.sec-head.stack { grid-template-columns: 1fr; gap: 1rem; }
.prose p { max-width: 64ch; }
.prose p + p { margin-top: 1em; }

/* ---------- buttons & links ---------- */
.btn { display: inline-flex; align-items: center; gap: .6rem; min-height: 48px; padding: .75rem 1.4rem; border: 1px solid var(--ink); background: var(--ink); color: var(--ivory); border-radius: 2px; font: 600 .9375rem/1 var(--sans); text-decoration: none; transition: background-color .2s, color .2s, border-color .2s; }
.btn:hover { background: var(--char-2); border-color: var(--char-2); text-decoration: none; }
.btn-line { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.btn-line:hover { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.dark .btn, .page-hero .btn, .hero .btn, .site-header .btn, .menu .btn { background: var(--ivory); color: var(--black); border-color: var(--ivory); }
.dark .btn:hover, .page-hero .btn:hover, .hero .btn:hover, .site-header .btn:hover, .menu .btn:hover { background: var(--grey); border-color: var(--grey); }
.dark .btn-line, .hero .btn-line, .page-hero .btn-line { background: transparent; color: var(--ivory); border-color: var(--rule-d); }
.dark .btn-line:hover, .hero .btn-line:hover, .page-hero .btn-line:hover { background: var(--ivory); color: var(--black); }
.form-card .btn { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.form-card .btn-line { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.form-card .btn-line:hover { background: var(--ink); color: var(--ivory); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.link { font-weight: 600; text-decoration: underline; text-underline-offset: .25em; }
.arw { display: inline-block; }
.flag { width: 1.1em; height: .74em; display: inline-block; vertical-align: -.04em; margin-right: .45em; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); display: flex; align-items: center; background: var(--night); color: var(--on-dark); border-bottom: 1px solid var(--rule-d); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: flex; align-items: baseline; gap: .75rem; text-decoration: none; }
.brand-name { font: 400 1.9rem/1 var(--sign); white-space: nowrap; }
.brand-role { font-size: .8125rem; color: var(--on-dark-2); white-space: nowrap; }
.nav { display: flex; align-items: center; gap: clamp(1rem, 1.8vw, 1.75rem); }
.nav a { font-size: .9375rem; text-decoration: none; color: var(--on-dark-2); padding-block: .5rem; border-bottom: 1px solid transparent; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--on-dark); border-bottom-color: currentColor; }
.nav-list { display: flex; align-items: center; gap: clamp(1rem, 1.8vw, 1.75rem); }
.header-cta { display: flex; align-items: center; gap: 1rem; }
.header-cta .btn { min-height: 40px; padding: .55rem 1rem; font-size: .875rem; }
.menu-toggle { display: none; align-items: center; gap: .6rem; min-height: 44px; background: none; border: 0; color: var(--on-dark); font-size: .9375rem; }
.menu-toggle .bars { width: 22px; height: 9px; position: relative; }
.menu-toggle .bars::before, .menu-toggle .bars::after { content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform .2s, top .2s; }
.menu-toggle .bars::before { top: 0; } .menu-toggle .bars::after { top: 7.5px; }
.menu-toggle[aria-expanded="true"] .bars::before { top: 4px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars::after { top: 4px; transform: rotate(-45deg); }
.menu { position: fixed; inset: var(--header-h) 0 0 0; z-index: 49; background: var(--night); color: var(--on-dark); padding: 1.5rem var(--gutter) 2rem; overflow-y: auto; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.menu-open .menu { opacity: 1; visibility: visible; }
.menu li { border-bottom: 1px solid var(--rule-d); }
.menu li a { display: block; padding: .9rem 0; font: 500 1.6rem/1.2 var(--serif); text-decoration: none; }
.menu li a[aria-current="page"] { font-style: italic; }
.menu-foot { margin-top: 1.75rem; display: grid; gap: .5rem; color: var(--on-dark-2); }
.menu-foot a { text-decoration: none; }
.menu-foot .btn { margin-top: 1rem; justify-content: center; }
@media (max-width: 1100px) { .nav, .header-cta .btn { display: none; } .menu-toggle { display: inline-flex; } }

/* ---------- home hero ---------- */
.hero { background: var(--night); color: var(--on-dark); text-align: center; padding: clamp(5rem, 13vh, 9rem) 0 0; }
.hero-inner { padding: 0 var(--gutter) clamp(4rem, 9vh, 6rem); }
.signature { font: 400 clamp(4.2rem, 12vw, 10rem)/1 var(--sign); margin: 0; padding: .1em .2em 0; letter-spacing: 0; }
.hero .role { margin: 1rem 0 0; font-size: .9375rem; letter-spacing: .08em; color: var(--on-dark-2); }
.hero .tagline { margin: 1.75rem auto 2.25rem; max-width: 30ch; font: italic 400 clamp(1.4rem, 2.4vw, 1.9rem)/1.35 var(--serif); }
.hero .btn-row { justify-content: center; }
.hero-meta { border-top: 1px solid var(--rule-d); }
.hero-meta ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 2.5rem; padding-block: 1.1rem; font-size: .9375rem; color: var(--on-dark-2); }
.hero-meta a { color: var(--on-dark); text-decoration: none; }
.hero-meta a:hover { text-decoration: underline; }

/* ---------- inner page header ---------- */
.page-hero { background: var(--night); color: var(--on-dark); padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 4.5rem); }
.page-hero h1 { font-size: var(--t-h1); font-weight: 500; margin: 0 0 1rem; max-width: 20ch; }
.page-hero .crumbs { font-size: .875rem; color: var(--on-dark-2); margin-top: 2rem; }
.page-hero .crumbs a { color: var(--on-dark); }
.page-hero h1.about-name { font: 400 clamp(4rem, 10vw, 8rem)/1 var(--sign); max-width: none; margin: 0 0 .5rem; padding-top: .1em; }

/* ---------- intro ---------- */
.intro-text p { font-size: 1.25rem; line-height: 1.65; max-width: 60ch; }
.facts-side { border-top: 1px solid var(--rule-2); }
.facts-side div { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--rule); font-size: .9375rem; }
.facts-side dt { color: var(--ink-2); }
.facts-side dd { margin: 0; }
.pull { margin: clamp(3rem, 6vw, 4.5rem) 0 0; padding-top: 2rem; border-top: 1px solid var(--rule); }
.pull blockquote { margin: 0; font: italic 400 clamp(1.9rem, 3.4vw, 2.8rem)/1.2 var(--serif); }
.pull figcaption { margin-top: .75rem; font-size: .9375rem; color: var(--ink-2); }

/* ---------- numbered list (services, rules) ---------- */
.numbered { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(2rem, 5vw, 4.5rem); counter-reset: n; }
.numbered li { counter-increment: n; display: grid; grid-template-columns: 2.5rem 1fr; gap: .25rem 1rem; padding: 1.4rem 0; border-top: 1px solid var(--rule); }
.numbered li::before { content: counter(n, decimal-leading-zero); grid-row: span 2; font: 500 1.05rem/1.5 var(--serif); color: var(--ink-2); }
.numbered h3 { font-size: var(--t-h3); }
.numbered p { color: var(--ink-2); font-size: .9875rem; }
.dark .numbered li { border-color: var(--rule-d); }
.dark .numbered li::before, .dark .numbered p { color: var(--on-dark-2); }
.numbered.single { grid-template-columns: 1fr; max-width: 52rem; }

/* ---------- tables (process, engagement) ---------- */
.table-wrap { overflow-x: auto; }
.ledger { width: 100%; border-collapse: collapse; font-size: .9875rem; }
.ledger th, .ledger td { text-align: left; vertical-align: top; padding: 1rem 1.25rem 1rem 0; border-top: 1px solid var(--rule); }
.ledger thead th { font: 600 .8125rem/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); border-top: 0; padding-bottom: .75rem; }
.ledger td:first-child { font-family: var(--serif); color: var(--ink-2); width: 3.5rem; }
.ledger .stage-name { font: 500 1.2rem/1.3 var(--serif); width: 22%; }
.ledger .doc { width: 24%; font-weight: 600; }
.dark .ledger th, .dark .ledger td { border-color: var(--rule-d); }
.dark .ledger thead th, .dark .ledger td:first-child { color: var(--on-dark-2); }
.compare th[scope="row"] { font-weight: 500; }
.compare thead th:not(:first-child), .compare td { text-align: center; width: 18%; }
.compare thead th { vertical-align: bottom; }
.compare thead .tier { display: block; font: 500 1.3rem/1.2 var(--serif); text-transform: none; letter-spacing: 0; color: var(--ink); }
.compare thead .tier-note { display: block; margin-top: .25rem; text-transform: none; letter-spacing: 0; font-weight: 500; }
.compare .yes::before { content: "✓"; font-size: 1.05rem; }
.compare .no::before { content: "—"; color: var(--ink-2); }

/* ---------- definition pairs (categories, regions) ---------- */
.pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(2rem, 5vw, 4.5rem); }
.pairs div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--rule); font-size: .9687rem; }
.pairs dt { font-weight: 600; } .pairs dd { margin: 0; color: var(--ink-2); }
.pairs.wide { grid-template-columns: 1fr; }
.pairs.wide div { grid-template-columns: minmax(0, 3fr) minmax(0, 7fr); }
.dark .pairs div { border-color: var(--rule-d); } .dark .pairs dd { color: var(--on-dark-2); }

/* ---------- markets ---------- */
.markets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule-2); }
.markets > div { padding: 1.5rem 1.75rem 0 0; }
.markets > div + div { padding-left: 1.75rem; border-left: 1px solid var(--rule); }
.markets h3 { font-size: 1.7rem; margin-bottom: .75rem; }
.markets dl div { padding: .75rem 0; border-top: 1px solid var(--rule); font-size: .9687rem; }
.markets dt { font-size: .8125rem; font-weight: 600; color: var(--ink-2); margin-bottom: .2rem; }
.markets dd { margin: 0; }

/* ---------- checklist (terms) ---------- */
.checks { border-top: 1px solid var(--rule-2); }
.checks li { padding: .9rem 0; border-bottom: 1px solid var(--rule); max-width: 70ch; }
.checks b { font-weight: 600; }

/* ---------- two ventures (about) ---------- */
.ventures h3 { font-size: 1.9rem; margin-bottom: .25rem; }

/* ---------- businesses ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule-2); }
.split > div { padding: 1.75rem 2rem 1.75rem 0; }
.split > div + div { padding-left: 2rem; border-left: 1px solid var(--rule); }
.split h3 { font-size: 1.9rem; margin-bottom: .25rem; }
.split .role { font-size: .9375rem; color: var(--ink-2); margin-bottom: 1rem; }

/* ---------- films ---------- */
.film { margin: 0; }
.film-frame { position: relative; aspect-ratio: 16 / 9; background: var(--char); border-radius: 6px; overflow: hidden; }
.film-frame img, .film-frame iframe, .film-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.film-frame iframe { z-index: 2; }
.film-play { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; background: transparent; border: 0; color: var(--ivory); }
.film-frame.is-live .film-play { display: none; }
.film-play .disc { width: 64px; height: 64px; border-radius: 50%; border: 1px solid rgba(233,223,211,.7); display: grid; place-items: center; background: rgba(19,19,20,.55); }
.film-play .disc svg { width: 22px; margin-left: 3px; }
.film-sound { position: absolute; right: 12px; bottom: 12px; z-index: 3; display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .7rem; border: 1px solid rgba(233,223,211,.5); border-radius: 2px; background: rgba(19,19,20,.7); color: var(--ivory); font-size: .8125rem; }
.film-sound svg { width: 14px; height: 14px; }
.film figcaption { padding-top: .9rem; }
.film .f-meta { display: block; font-size: .8125rem; color: var(--ink-2); margin-bottom: .2rem; }
.dark .film .f-meta, .dark .film p, .dark .film .f-src { color: var(--on-dark-2); }
.film h3 { font-size: 1.35rem; }
.film p { margin: .3rem 0 0; font-size: .9375rem; color: var(--ink-2); }
.film .f-src { font-size: .8125rem; color: var(--ink-2); }
.films { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 2rem; }
.films .film.wide { grid-column: 1 / -1; }
.films-feature { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.films-feature .stack { display: grid; gap: 1.75rem; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--rule-2); max-width: 54rem; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; display: flex; justify-content: space-between; gap: 1.5rem; padding: 1.2rem 0; cursor: pointer; font: 500 1.3rem/1.35 var(--serif); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.4rem/1 var(--sans); color: var(--ink-2); }
.faq details[open] summary::after { content: "−"; }
.faq summary .n, .faq summary .x { display: none; }
.faq details p { padding: 0 0 1.4rem; color: var(--ink-2); max-width: 68ch; }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2.5rem, 6vw, 5rem); }
.channels { border-top: 1px solid var(--rule-2); }
.channels a { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; align-items: baseline; padding: .9rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.channels a:hover .v { text-decoration: underline; }
.channels .k { font-size: .875rem; color: var(--ink-2); display: flex; align-items: center; }
.channels .v { font: 500 1.0625rem/1.4 var(--sans); overflow-wrap: anywhere; }
.channels .arw { display: none; }
.dark .channels { border-color: var(--rule-d); } .dark .channels a { border-color: var(--rule-d); } .dark .channels .k { color: var(--on-dark-2); }
.wechat { display: grid; grid-template-columns: 13.75rem 1fr; gap: 1.5rem; align-items: center; margin: 2rem 0 0; scroll-margin-top: calc(var(--header-h) + 16px); }
.wechat img { width: 100%; height: auto; aspect-ratio: 1; background: #fff; border: 1px solid var(--rule); image-rendering: auto; }
.wechat figcaption { display: grid; gap: .45rem; font-size: .9375rem; }
.wechat .link { justify-self: start; margin-top: .25rem; }
.wechat .v { font: 500 1.0625rem/1.4 var(--sans); }
.form-card { background: var(--ivory); color: var(--ink); padding: clamp(1.5rem, 3.5vw, 2.5rem); border: 1px solid var(--rule); }
.dark .form-card { border-color: transparent; }
.form-card h3 { font-size: 1.8rem; margin-bottom: .4rem; }
.form-card .mute { color: var(--ink-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; margin-top: 1.5rem; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: .35rem; margin-bottom: 1.1rem; }
.field label { font-size: .875rem; font-weight: 600; }
.field label .opt { font-weight: 400; color: var(--ink-2); }
.field input, .field textarea, .field select { width: 100%; min-height: 48px; padding: .7rem .85rem; font-size: max(16px, 1rem); background: #fff; border: 1px solid var(--rule-2); border-radius: 2px; color: var(--ink); }
.field textarea { min-height: 8.5rem; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
.field [aria-invalid="true"] { border-color: var(--ink); border-left-width: 4px; }
.field .err { font-size: .8125rem; font-weight: 600; }
.field .err:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .25rem; }
.form-status { margin-top: 1rem; font-size: .9375rem; padding: .8rem 1rem; background: var(--grey); }
.form-status:empty { display: none; }
.form-note { font-size: .8125rem; color: var(--ink-2); margin-top: .9rem; }

/* ---------- about ---------- */
.roles { margin-top: 2rem; border-top: 1px solid var(--rule-d); max-width: 44rem; }
.roles li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .25rem 1rem; padding: .8rem 0; border-bottom: 1px solid var(--rule-d); }
.roles b { font: 500 1.2rem/1.3 var(--serif); }
.roles span { font-size: .9375rem; color: var(--on-dark-2); }
.words { border-top: 1px solid var(--rule-2); }
.words li { padding: 1.5rem 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 3fr); gap: 1rem; align-items: baseline; }
.words q { font: italic 400 clamp(1.5rem, 2.4vw, 2rem)/1.3 var(--serif); quotes: "\201C" "\201D"; }
.words span { font-size: .9375rem; color: var(--ink-2); text-align: right; }
.family { border-top: 1px solid var(--rule-2); }
.family small a { white-space: nowrap; }
.family li { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 5fr) minmax(0, 4fr); gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.family b { font: 500 1.35rem/1.3 var(--serif); }
.family span, .family small { color: var(--ink-2); font-size: .9375rem; }
.family small a { color: var(--ink); }

/* ---------- Stone Atlas ---------- */
.atlas-tools { position: sticky; top: var(--header-h); z-index: 10; background: var(--ivory); border-bottom: 1px solid var(--rule-2); padding: 1rem 0; }
.atlas-tools .wrap { display: grid; grid-template-columns: minmax(0, 2.2fr) repeat(3, minmax(0, 1fr)) auto; gap: .75rem; align-items: end; }
.atlas-tools .field { margin: 0; }
.atlas-tools select { appearance: none; -webkit-appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.atlas-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: baseline; padding: 1.5rem 0 1rem; }
.atlas-count { font: 500 1.5rem/1.2 var(--serif); }
.legend { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: .2rem .5rem; border: 1px solid var(--rule-2); border-radius: 2px; }
.tag[data-type="processing"] { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.tag[data-type="quarry"] { background: var(--grey); }
.tag[data-type="engineered"] { background: var(--char-2); color: var(--ivory); border-color: var(--char-2); }
.cities { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); border-top: 1px solid var(--rule-2); border-left: 1px solid var(--rule); }
.city { padding: 1.4rem 1.3rem 1.2rem; display: flex; flex-direction: column; gap: .6rem; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.city header { display: grid; gap: .2rem; }
.city .place { font-size: .8125rem; color: var(--ink-2); }
.city h3 { font-size: 1.5rem; }
.city .tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.city .mat { font-size: .875rem; font-weight: 600; }
.city p { font-size: .9375rem; margin: 0; color: var(--ink-2); line-height: 1.55; }
.city footer { margin-top: auto; padding-top: .8rem; border-top: 1px solid var(--rule); display: grid; gap: .2rem; font-size: .78rem; color: var(--ink-2); }
.city footer a { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.city .q { font-weight: 600; }
.city .status { font-size: .8125rem; font-weight: 600; color: var(--ink); }
.atlas-empty, .atlas-error { padding: 2.5rem 1.5rem; text-align: center; background: var(--grey); }
.atlas-empty h3, .atlas-error h3 { font-size: 1.6rem; margin-bottom: .4rem; }
.method { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
.method h3 { font-size: 1.35rem; margin: .4rem 0 .5rem; }
.method p { font-size: .9375rem; color: var(--ink-2); }

/* ---------- Canton Fair ---------- */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule-2); }
.figures div { padding: 1.25rem 1rem 1.25rem 0; border-bottom: 1px solid var(--rule); }
.figures div + div { padding-left: 1rem; border-left: 1px solid var(--rule); }
.figures dt { font-size: .8125rem; color: var(--ink-2); margin-bottom: .4rem; }
.figures dd { margin: 0; font: 500 1.8rem/1.15 var(--serif); }
.figures dd small { display: block; font: 400 .8125rem/1.5 var(--sans); color: var(--ink-2); margin-top: .3rem; }
.edition { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(2rem, 5vw, 4.5rem); }
.edition + .edition { margin-top: clamp(3.5rem, 7vw, 5.5rem); padding-top: clamp(3.5rem, 7vw, 5.5rem); border-top: 1px solid var(--rule-2); }
.edition h2 { font-size: var(--t-h2); }
.phases { border-top: 1px solid var(--rule-2); margin: 1.75rem 0; }
.phases li { display: grid; grid-template-columns: 5rem 1fr; gap: .15rem 1rem; padding: .85rem 0; border-bottom: 1px solid var(--rule); font-size: .9375rem; }
.phases b { font: 500 1.15rem/1.3 var(--serif); grid-row: span 2; }
.phases span:nth-of-type(1) { font-weight: 600; }
.phases span:nth-of-type(2) { color: var(--ink-2); }
.sources { display: grid; gap: .5rem; font-size: .875rem; color: var(--ink-2); counter-reset: s; }
.sources li { counter-increment: s; display: grid; grid-template-columns: 1.8rem 1fr; gap: .4rem; }
.sources li::before { content: counter(s) "."; }
.sources a { color: var(--ink); overflow-wrap: anywhere; }

/* ---------- WordPress generic content ---------- */
.wp-content { max-width: 68ch; }
.wp-content h2 { font-size: var(--t-h3); margin: 2rem 0 .75rem; }
.wp-content img { height: auto; }

/* ---------- footer ---------- */
.site-footer { background: var(--night); color: var(--on-dark-2); padding: clamp(3.5rem, 7vw, 5rem) 0 2rem; }
.foot-top { display: grid; grid-template-columns: minmax(0, 4fr) repeat(2, minmax(0, 2fr)) minmax(0, 3fr); gap: clamp(2rem, 4vw, 3.5rem); padding-bottom: 2.5rem; }
.foot-name { font: 400 2.6rem/1 var(--sign); color: var(--on-dark); margin-bottom: .75rem; padding-top: .1em; }
.foot-maxim { font: italic 400 1.2rem/1.4 var(--serif); color: var(--on-dark); margin-bottom: 1rem; }
.site-footer h2 { font: 600 .8125rem/1.3 var(--sans); color: var(--on-dark); margin-bottom: 1rem; }
.site-footer ul { display: grid; gap: .45rem; font-size: .9375rem; }
.site-footer a { text-decoration: none; overflow-wrap: anywhere; }
.site-footer a:hover { color: var(--on-dark); text-decoration: underline; }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; border-top: 1px solid var(--rule-d); font-size: .8125rem; }

.quickbar { display: none; }
@media (max-width: 760px) {
  .quickbar { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; inset: auto 0 0 0; z-index: 40; background: var(--night); border-top: 1px solid var(--rule-d); padding-bottom: env(safe-area-inset-bottom); }
  .quickbar a { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .6rem .25rem .7rem; color: var(--ivory); text-decoration: none; font-size: .75rem; font-weight: 600; }
  .quickbar a + a { border-left: 1px solid var(--rule-d); }
  .quickbar svg { width: 20px; height: 20px; }
  body { padding-bottom: 62px; }
}

/* ---------- assistant ---------- */
.ai-launch { position: fixed; right: clamp(1rem, 2.5vw, 1.75rem); bottom: clamp(1rem, 2.5vw, 1.75rem); z-index: 45; display: inline-flex; align-items: center; gap: .55rem; padding: .7rem 1rem; border: 1px solid var(--rule-d); border-radius: 2px; background: var(--char); color: var(--ivory); font-size: .9375rem; font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.ai-launch:hover { background: var(--char-2); }
.ai-launch svg { width: 18px; height: 18px; }
.ai-open .ai-launch { visibility: hidden; }
.ai-panel { position: fixed; right: clamp(.75rem, 2vw, 1.75rem); bottom: clamp(.75rem, 2vw, 1.75rem); z-index: 46; width: min(400px, calc(100vw - 1.5rem)); height: min(600px, calc(100svh - 6rem)); display: flex; flex-direction: column; background: var(--char); color: var(--ivory); border: 1px solid var(--rule-d); border-radius: 4px; box-shadow: 0 16px 40px rgba(0,0,0,.35); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.ai-open .ai-panel { opacity: 1; visibility: visible; }
.ai-head { display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; border-bottom: 1px solid var(--rule-d); }
.ai-head b { display: block; font: 500 1.15rem/1.2 var(--serif); }
.ai-head small { display: block; font-size: .78rem; color: var(--on-dark-2); }
.ai-close { margin-left: auto; width: 36px; height: 36px; border: 1px solid var(--rule-d); border-radius: 2px; background: transparent; color: var(--ivory); display: grid; place-items: center; }
.ai-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.ai-msg { max-width: 90%; padding: .7rem .9rem; border-radius: 4px; font-size: .9375rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-msg a { color: inherit; }
.ai-msg.bot { background: rgba(233,223,211,.07); align-self: flex-start; }
.ai-msg.me { background: var(--ivory); color: var(--black); align-self: flex-end; }
.ai-msg.typing { color: var(--on-dark-2); }
.ai-sugg { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .75rem; }
.ai-sugg button { padding: .4rem .65rem; border: 1px solid var(--rule-d); border-radius: 2px; background: transparent; color: var(--on-dark-2); font-size: .8125rem; }
.ai-sugg button:hover { color: var(--ivory); border-color: var(--on-dark-2); }
.ai-form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--rule-d); }
.ai-form input { flex: 1; min-width: 0; min-height: 44px; padding: .6rem .8rem; border: 1px solid var(--rule-d); border-radius: 2px; background: transparent; color: var(--ivory); font-size: max(16px, .95rem); }
.ai-form input:focus { outline: 2px solid var(--ivory); outline-offset: 0; }
.ai-form button { min-width: 64px; border: 0; border-radius: 2px; background: var(--ivory); color: var(--black); font-weight: 600; }
.ai-foot { padding: 0 1rem .75rem; font-size: .75rem; color: var(--on-dark-2); }
@media (max-width: 760px) { .ai-launch { bottom: calc(62px + 10px + env(safe-area-inset-bottom)); padding: .75rem; } .ai-launch .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .ai-panel { bottom: calc(62px + 8px); height: calc(100svh - 62px - var(--header-h) - 1rem); } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .cols, .sec-head, .contact-grid, .edition, .films-feature { grid-template-columns: 1fr; }
  .numbered, .pairs { grid-template-columns: 1fr; }
  .markets { grid-template-columns: 1fr; }
  .markets > div, .markets > div + div { padding: 1.5rem 0 .5rem; border-left: 0; }
  .markets > div + div { border-top: 1px solid var(--rule-2); }
  .method { grid-template-columns: 1fr; }
  .foot-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-top > :first-child { grid-column: 1 / -1; }
  .atlas-tools .wrap { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .atlas-tools .field.search { grid-column: 1 / -1; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures div:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 700px) {
  :root { --header-h: 64px; }
  .brand-role { display: none; }
  .films, .split { grid-template-columns: 1fr; }
  .split > div, .split > div + div { padding: 1.5rem 0; border-left: 0; }
  .split > div + div { border-top: 1px solid var(--rule); }
  .form-grid { grid-template-columns: 1fr; }
  .channels a { grid-template-columns: 1fr; gap: .1rem; }
  .wechat { grid-template-columns: 1fr; }
  .wechat img { width: min(100%, 15rem); }
  .foot-top { grid-template-columns: 1fr 1fr; }
  .foot-top > :last-child { grid-column: 1 / -1; }
  .atlas-tools { position: static; }
  .atlas-tools .wrap { grid-template-columns: 1fr; }
  .figures { grid-template-columns: 1fr; }
  .figures div + div { padding-left: 0; border-left: 0; }
  .words li, .family li { grid-template-columns: 1fr; }
  .words span { text-align: left; }
  .pairs.wide div, .pairs div { grid-template-columns: 1fr; gap: .1rem; }
  /* tables become stacked rows */
  .ledger:not(.compare) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ledger:not(.compare), .ledger:not(.compare) tbody, .ledger:not(.compare) tr, .ledger:not(.compare) td, .ledger:not(.compare) th { display: block; width: auto !important; }
  .ledger:not(.compare) tr { border-top: 1px solid var(--rule); padding: .9rem 0; }
  .dark .ledger:not(.compare) tr { border-color: var(--rule-d); }
  .ledger:not(.compare) td, .ledger:not(.compare) th { border: 0; padding: .1rem 0; }
  .ledger td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: var(--ink-2); }
  .dark .ledger td[data-label]::before { color: var(--on-dark-2); }
  .compare { font-size: .875rem; }
  .compare th, .compare td { padding: .75rem .4rem .75rem 0; }
  .compare thead .tier { font-size: 1rem; }
  .compare thead .tier-note { display: none; }
}
@media print { .site-header, .menu, .quickbar, .ai-launch, .ai-panel { display: none !important; } body { background: #fff; } }
