/* ============================================================
   KETURAH Integrated City — Design System
   Blueprint-navy / brass / parchment / olive
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,200..900;1,9..144,300..600&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@300;400;500&family=Amiri:wght@400;700&display=swap');

:root {
  /* Core palette — Blueprint-navy lean */
  --ink:           #0c1219;          /* deep blueprint */
  --ink-2:         #131c28;          /* card backs */
  --ink-3:         #1c2735;          /* elevated surfaces */
  --ink-line:      #243043;          /* hairlines on dark */

  --parchment:     #ece2cb;          /* warm light */
  --parchment-2:   #d8cbac;          /* aged */
  --parchment-3:   #b9a984;          /* worn */

  --brass:         #c9a869;          /* primary accent */
  --brass-bright:  #e0bd7b;
  --brass-deep:    #8a6f3f;

  --rose:          #9c4a3f;          /* madder */
  --olive:         #6e7a4d;          /* agricultural */
  --olive-deep:    #4a5536;
  --wadi:          #6f8c89;          /* water */
  --terracotta:    #b6764a;
  --stone:         #8a8579;          /* mid-tone neutral */

  --text-on-ink:   #e6dcc4;          /* primary on dark */
  --text-on-ink-mute: #a89c83;       /* secondary on dark */
  --text-on-ink-dim:  #6e6651;       /* tertiary on dark */

  --text-on-parch:    #1c2530;
  --text-on-parch-mute: #4a4537;

  /* Type */
  --serif: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --arabic: 'Amiri', 'Times New Roman', serif;

  /* Density (tweakable) */
  --density: 1;
  --gutter: calc(40px * var(--density));
  --section-y: calc(140px * var(--density));
  --rhythm:  calc(24px * var(--density));

  /* Motion */
  --ease-cinematic: cubic-bezier(.22,.61,.36,1);
  --ease-quiet:     cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html, body { overflow-x: clip; max-width: 100%; }
img, svg, video, canvas { max-width: 100%; height: auto; }

body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-on-ink);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
}

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

a { color: inherit; text-decoration: none; }

/* --------- Type ramp --------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
}
.eyebrow .num {
  color: var(--text-on-ink-dim);
  margin-right: 12px;
  font-variant-numeric: tabular-nums;
}

.display {
  font-family: var(--serif);
  font-weight: 200;
  font-style: normal;
  letter-spacing: -0.02em;
  line-height: 1.02;
  font-size: clamp(48px, 7vw, 112px);
  color: var(--text-on-ink);
}
.display em {
  font-style: italic;
  font-weight: 300;
  color: var(--brass);
}

h1.title, .title-xl {
  font-family: var(--serif);
  font-weight: 250;
  letter-spacing: -0.015em;
  line-height: 1.05;
  font-size: clamp(40px, 5vw, 76px);
  margin: 0;
}
h2.title, .title-lg {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.1;
  font-size: clamp(32px, 3.4vw, 52px);
  margin: 0;
}
h3.title, .title-md {
  font-family: var(--serif);
  font-weight: 350;
  letter-spacing: -0.005em;
  line-height: 1.2;
  font-size: clamp(22px, 1.8vw, 28px);
  margin: 0;
}

.lede {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.5;
  color: var(--text-on-ink);
  letter-spacing: 0.005em;
}

.body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-on-ink-mute);
  max-width: 58ch;
}

.caption, .meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-on-ink-dim);
}

.num-display {
  font-family: var(--serif);
  font-weight: 250;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.02em;
}

.arabic {
  font-family: var(--arabic);
  direction: rtl;
}

/* --------- Layout --------- */
.wrap {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wrap-narrow { max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter); }

.section { padding: var(--section-y) 0; position: relative; }

.hairline { height: 1px; background: var(--ink-line); border: 0; margin: 0; }
.hairline-brass { height: 1px; background: linear-gradient(90deg, transparent, var(--brass-deep) 20%, var(--brass) 50%, var(--brass-deep) 80%, transparent); border: 0; opacity: .55; }

/* Surfaces */
.parch {
  background: var(--parchment);
  color: var(--text-on-parch);
}
.parch .body, .parch .caption, .parch .meta { color: var(--text-on-parch-mute); }
.parch .eyebrow { color: var(--brass-deep); }
.parch .display em { color: var(--rose); }

/* --------- Buttons / chrome --------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border: 1px solid var(--brass-deep);
  background: transparent;
  color: var(--text-on-ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .35s var(--ease-cinematic);
  text-decoration: none;
}
.btn:hover {
  background: var(--brass);
  color: var(--ink);
  border-color: var(--brass);
}
.btn .arrow { width: 18px; height: 1px; background: currentColor; position: relative; }
.btn .arrow::after { content: ''; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }

.btn-ghost {
  border-color: var(--ink-line);
  color: var(--text-on-ink-mute);
}
.btn-ghost:hover {
  background: var(--ink-3);
  color: var(--brass);
  border-color: var(--brass-deep);
}

/* --------- Nav --------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--gutter);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-on-ink-mute);
  background: linear-gradient(180deg, rgba(12,18,25,.85), rgba(12,18,25,0));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background .4s var(--ease-quiet);
}
.nav.solid {
  background: rgba(12,18,25,.92);
  border-bottom: 1px solid var(--ink-line);
}
.nav-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  line-height: 1;
}
.nav-mark .nav-logo {
  display: block;
  height: 16px;
  width: auto;
  filter: brightness(0) invert(1);
}
.nav-mark .k {
  font-family: var(--serif);
  font-weight: 250;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--text-on-ink);
  text-transform: none;
}
.nav-mark .sub {
  font-size: 9.5px;
  color: var(--text-on-ink-dim);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}
.nav-links a {
  color: var(--text-on-ink-mute);
  transition: color .25s;
  position: relative;
  padding: 4px 0;
}
.nav-links a:hover, .nav-links a.active { color: var(--brass); }
.nav-links a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--brass);
}
.nav-cta {
  padding: 10px 16px;
  border: 1px solid var(--brass-deep);
  color: var(--brass);
  transition: all .25s;
}
.nav-cta:hover { background: var(--brass); color: var(--ink); }

/* --- Dropdown groups --- */
.nav-group {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-trigger {
  background: none;
  border: 0;
  color: var(--text-on-ink-mute);
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  transition: color .25s;
}
.nav-trigger:hover,
.nav-group:hover .nav-trigger,
.nav-group.is-active .nav-trigger { color: var(--brass); }
.nav-group.is-active .nav-trigger::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--brass);
}
.nav-trigger .caret {
  font-size: .7em;
  opacity: .65;
  transition: transform .25s;
  line-height: 1;
}
.nav-group[data-open] .nav-trigger .caret,
.nav-group:hover .nav-trigger .caret { transform: rotate(180deg); }
.nav-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: -16px;
  min-width: 220px;
  background: rgba(6,10,16,.96);
  border: 1px solid var(--ink-line);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .22s, visibility .22s, transform .22s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  box-shadow: 0 18px 40px rgba(6,10,16,.6);
}
.nav-group:hover .nav-dropdown,
.nav-group[data-open] .nav-dropdown,
.nav-group:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -12px; left: 0; right: 0; height: 12px;
}
.nav-dropdown a {
  padding: 10px 22px;
  white-space: nowrap;
  font-size: .95em;
  color: var(--text-on-ink-mute);
}
.nav-dropdown a:hover,
.nav-dropdown a.active {
  color: var(--brass);
  background: rgba(201,168,105,.05);
}
.nav-dropdown a.active::after { display: none; }

@media (max-width: 1100px) { .nav-links { gap: 24px; } }

/* --- Hamburger toggle (mobile only) --- */
.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--ink-line);
  width: 44px; height: 44px;
  padding: 0;
  cursor: pointer;
  position: relative;
  align-items: center;
  justify-content: center;
  transition: border-color .25s, background .25s;
  -webkit-tap-highlight-color: transparent;
}
.nav-hamburger:hover { border-color: var(--brass-deep); }
.nav-hamburger .bars {
  position: relative;
  width: 18px; height: 14px;
  display: block;
}
.nav-hamburger .bars::before,
.nav-hamburger .bars::after,
.nav-hamburger .bars span {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 1.5px;
  background: var(--brass);
  transition: transform .35s var(--ease-cinematic), opacity .25s, top .35s, width .35s;
}
.nav-hamburger .bars::before { top: 0; }
.nav-hamburger .bars span    { top: 50%; transform: translateY(-50%); width: 70%; }
.nav-hamburger .bars::after  { top: 100%; transform: translateY(-100%); }
.nav-hamburger:hover .bars span { width: 100%; }
.nav-hamburger[aria-expanded="true"] .bars::before {
  top: 50%; transform: translateY(-50%) rotate(45deg);
}
.nav-hamburger[aria-expanded="true"] .bars::after {
  top: 50%; transform: translateY(-50%) rotate(-45deg);
}
.nav-hamburger[aria-expanded="true"] .bars span { opacity: 0; }

/* --- Mobile drawer --- */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: flex;
  flex-direction: column;
  background: rgba(6,10,16,.985);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity .42s var(--ease-cinematic), transform .42s var(--ease-cinematic), visibility .42s;
  padding: 92px 28px 40px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mobile-drawer.open {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.mobile-drawer-inner {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-drawer .md-link,
.mobile-drawer .md-trigger {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--ink-line);
  padding: 22px 4px;
  color: var(--text-on-ink);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 250;
  font-size: 28px;
  letter-spacing: -.01em;
  line-height: 1.1;
  cursor: pointer;
  text-align: left;
  transition: color .25s, padding-left .3s;
  text-transform: none;
  width: 100%;
}
.mobile-drawer .md-trigger { justify-content: space-between; }
.mobile-drawer .md-link:hover,
.mobile-drawer .md-trigger:hover { color: var(--brass); padding-left: 12px; }
.mobile-drawer .md-link.active,
.mobile-drawer .md-trigger.active { color: var(--brass); }
.mobile-drawer .md-link.active::before,
.mobile-drawer .md-trigger.active::before {
  content: ''; display: inline-block;
  width: 16px; height: 1px; background: var(--brass);
  margin-right: 14px; vertical-align: middle;
}
.mobile-drawer .md-trigger .caret {
  font-size: .55em;
  color: var(--brass);
  transition: transform .3s var(--ease-cinematic);
}
.mobile-drawer .md-group[data-open] .md-trigger .caret { transform: rotate(180deg); }
.mobile-drawer .md-submenu {
  display: none;
  flex-direction: column;
  padding: 6px 0 14px 18px;
  border-bottom: 1px solid var(--ink-line);
}
.mobile-drawer .md-group[data-open] .md-submenu { display: flex; }
.mobile-drawer .md-submenu a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-on-ink-mute);
  padding: 12px 4px;
  text-decoration: none;
  transition: color .25s, padding-left .25s;
}
.mobile-drawer .md-submenu a:hover,
.mobile-drawer .md-submenu a.active { color: var(--brass); padding-left: 10px; }
.mobile-drawer .md-cta {
  margin-top: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 24px;
  background: var(--brass);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--brass);
  transition: background .25s, transform .25s;
}
.mobile-drawer .md-cta:hover { background: #e0bd7b; transform: translateX(2px); }
.mobile-drawer .md-foot {
  margin-top: auto;
  padding-top: 32px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-on-ink-dim);
  text-align: center;
}
body.no-scroll { overflow: hidden; touch-action: none; }

@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-hamburger { display: inline-flex; }
  .nav { padding: 16px var(--gutter); }
  .nav-mark .nav-logo { height: 14px; }
  .nav-mark .sub { font-size: 8.5px; }
}
@media (min-width: 881px) {
  .mobile-drawer { display: none; }
}

/* --------- Footer --------- */
.foot {
  background: #060a10;
  border-top: 1px solid var(--ink-line);
  padding: 80px var(--gutter) 40px;
  font-size: 13px;
  color: var(--text-on-ink-dim);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 60px;
  max-width: 1480px;
  margin: 0 auto;
}
.foot-col h6 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-on-ink-mute);
  margin: 0 0 18px;
  font-weight: 400;
}
.foot-col ul { list-style: none; padding: 0; margin: 0; }
.foot-col li { margin-bottom: 10px; }
.foot-col a:hover { color: var(--brass); }
.foot-base {
  max-width: 1480px; margin: 64px auto 0;
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 24px;
  border-top: 1px solid var(--ink-line);
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-on-ink-dim);
}
@media (max-width: 880px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 40px; } }

/* --------- Evidence chips --------- */
.ev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 7px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: middle;
  cursor: help;
  position: relative;
  border: 1px solid;
  transition: all .2s;
}
.ev::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor;
}
.ev-T0 { color: #8a8579; border-color: rgba(138,133,121,.45); }
.ev-T1 { color: #c9a869; border-color: rgba(201,168,105,.45); }
.ev-T2 { color: #6f8c89; border-color: rgba(111,140,137,.5); }
.ev-T3 { color: #6e7a4d; border-color: rgba(110,122,77,.55); }
.ev-PENDING { color: #9c4a3f; border-color: rgba(156,74,63,.5); }

[data-evfilter] .ev:not([data-ev]) { display: none; }

.ev-tip {
  position: absolute;
  bottom: calc(100% + 8px); left: 0;
  width: 280px;
  padding: 14px 16px;
  background: var(--ink-3);
  border: 1px solid var(--ink-line);
  border-left: 2px solid var(--brass);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-on-ink);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
  z-index: 50;
  pointer-events: none;
  box-shadow: 0 16px 48px rgba(0,0,0,.45);
}
.ev-tip strong {
  color: var(--brass);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  display: block;
  margin-bottom: 6px;
}
.ev-tip span.src {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--ink-line);
  color: var(--text-on-ink-dim);
  font-size: 11px;
  font-family: var(--mono);
}
.ev:hover .ev-tip { opacity: 1; visibility: visible; }

/* When global evidence filter is active, dim non-matching cards */
body.evfilter-T0 [data-claim-ev]:not([data-claim-ev="T0"]),
body.evfilter-T1 [data-claim-ev]:not([data-claim-ev="T1"]),
body.evfilter-T2 [data-claim-ev]:not([data-claim-ev="T2"]),
body.evfilter-T3 [data-claim-ev]:not([data-claim-ev="T3"]),
body.evfilter-PENDING [data-claim-ev]:not([data-claim-ev="PENDING"]) {
  opacity: 0.18;
  filter: grayscale(0.7);
  transition: opacity .35s, filter .35s;
}

/* --------- Texture / atmosphere --------- */
.grain {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/></filter><rect width='240' height='240' filter='url(%23n)' opacity='.6'/></svg>");
}

.contour-bg {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 600'><g fill='none' stroke='%23c9a869' stroke-width='.5' opacity='.18'><path d='M0,420 Q200,360 400,400 T800,380'/><path d='M0,440 Q200,380 400,420 T800,400'/><path d='M0,460 Q200,400 400,440 T800,420'/><path d='M0,480 Q200,420 400,460 T800,440'/><path d='M0,500 Q200,440 400,480 T800,460'/><path d='M0,520 Q200,460 400,500 T800,480'/><path d='M0,540 Q200,480 400,520 T800,500'/></g></svg>");
  background-size: cover;
  pointer-events: none;
  opacity: .8;
}

/* --------- Image utilities --------- */
.img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--ink-2);
}
.img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.2s var(--ease-cinematic), filter 1.2s;
}
.img-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12,18,25,0) 40%, rgba(12,18,25,.4) 100%);
  pointer-events: none;
}
.img-caption {
  position: absolute;
  bottom: 14px; left: 16px; right: 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-on-ink-mute);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  z-index: 2;
}

/* --------- Reveal animation (vanilla intersection observer) --------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.1s var(--ease-cinematic), transform 1.1s var(--ease-cinematic);
}
.reveal.in { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .12s; }
.reveal-delay-2 { transition-delay: .24s; }
.reveal-delay-3 { transition-delay: .36s; }
.reveal-delay-4 { transition-delay: .48s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --------- Scroll-driven helpers --------- */
.pinned-stage {
  position: relative;
  height: 320vh;
}
.pinned-stage > .pinned-frame {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

/* --------- Density variants --------- */
body[data-density="compact"] { --density: 0.72; }
body[data-density="luxe"]    { --density: 1.18; }

/* --------- Image with subtle zoom on hover --------- */
.zoomable:hover img { transform: scale(1.04); filter: brightness(1.05); }

/* --------- Misc --------- */
.kerning-mono {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.dotline { display: inline-block; width: 30px; height: 1px; background: currentColor; vertical-align: middle; opacity: .4; margin: 0 10px; }

/* --------- Chapter mark (eyebrow + rule) --------- */
.chapter-mark {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 36px;
}
.chapter-mark .num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-on-ink-dim);
}
.chapter-mark .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
}
.chapter-mark .line { flex: 1; height: 1px; background: var(--ink-line); max-width: 140px; }
.parch .chapter-mark .num { color: var(--text-on-parch-mute); }
.parch .chapter-mark .label { color: var(--brass-deep); }
.parch .chapter-mark .line { background: rgba(0,0,0,.18); }
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 36px;
}
.chapter-mark .num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-on-ink-dim);
}
.chapter-mark .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
}
.chapter-mark .line { flex: 1; height: 1px; background: var(--ink-line); max-width: 140px; }
.parch .chapter-mark .num { color: var(--text-on-parch-mute); }
.parch .chapter-mark .label { color: var(--brass-deep); }
.parch .chapter-mark .line { background: rgba(0,0,0,.18); }

/* keyboard fade */
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.pulse-dot { animation: pulse 2.4s ease-in-out infinite; }

/* Fade-up specific timings used inline */
@keyframes slideup { from { opacity:0; transform: translateY(28px); } to { opacity:1; transform: none; } }
@keyframes fadein { from { opacity:0; } to { opacity:1; } }

/* --------- GSAP / ScrollTrigger hooks --------- */
/* Initial state for [data-reveal] elements before GSAP plays */
.gsap-ready [data-reveal] { opacity: 0; will-change: transform, opacity; }
.gsap-ready.reduced-motion [data-reveal] { opacity: 1 !important; transform: none !important; }
/* If GSAP fails to load, ensure [data-reveal] elements are still visible */
[data-reveal] { opacity: 1; }
.gsap-ready [data-reveal] { opacity: 0; }

/* Nav hide-on-scroll-down */
.nav { transition: transform .42s cubic-bezier(.7,0,.2,1), background .35s, border-color .35s; }
.nav.nav-hidden { transform: translateY(-105%); }

/* Smooth scroll baseline (snap library handles the rest) */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav.nav-hidden { transform: none; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* Hero parallax: parent must clip + size the image */
.hero-media, .page-head .contour-bg { will-change: transform; }
.hero { overflow: hidden; }

/* Mobile niceties — touch scroll feels best with no snap */
@media (max-width: 980px) {
  html { scroll-snap-type: none; }
}

/* ====== Mobile responsive tightening ====== */
@media (max-width: 880px) {
  :root { --gutter: 20px; --section-y: 90px; }
  body { font-size: 14.5px; }
  .wrap { padding-left: var(--gutter); padding-right: var(--gutter); }
  .title-xl { font-size: clamp(34px, 9vw, 56px); line-height: 1.05; }
  h1, h2 { word-break: break-word; }
  .lede { font-size: 16.5px; line-height: 1.55; }
  /* Evidence tooltips — keep visible on hover, but constrain so they never overflow the viewport */
  .ev-tip { width: min(calc(100vw - 40px), 280px); max-width: calc(100vw - 40px); left: auto; right: 0; }
  /* Tables and wide content shouldn't bleed past viewport */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Footer base stacks */
  .foot-base { flex-direction: column; gap: 8px; align-items: flex-start; }
  /* Stat grids in heroes should breathe at 2-col */
  .hero-mp-stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 16px !important; }
  .hero-mp-content { padding-top: 0; }
  /* Generic section padding */
  .sec { padding: 80px 0 !important; }
  /* Drop big background contour SVGs */
  .contour-bg { opacity: .25; }
}
@media (max-width: 480px) {
  :root { --gutter: 16px; }
  .foot-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ====== Masterplan detail-page hero — universal responsive fix ======
   Overrides the per-page inline .hero-mp rules. Lives in shared CSS so it
   cascades after the page-local <style> block (later source wins for equal
   specificity, so we keep selectors at the same specificity as the inline
   defaults). */

/* Cap the hero at the visible viewport. The per-page rules use
   `height: 100svh; min-height: 720px;` which causes overflow on
   wide-but-short viewports (laptop landscape, external monitors set short).
   Replace the 720px floor with a viewport-aware floor. */
.hero-mp {
  min-height: min(720px, 100svh) !important;
}

/* Tall mobile/portrait keeps the original min-height behaviour */
@media (min-aspect-ratio: 4/3) and (max-height: 760px) {
  .hero-mp { min-height: 100svh !important; height: 100svh !important; }
  .hero-mp-content { padding-top: 90px; padding-bottom: 40px; }
  .hero-mp-top { padding-top: 80px !important; }
  .hero-mp-title { font-size: clamp(40px, 5.4vw, 88px) !important; margin-bottom: 14px !important; }
  .hero-mp-tagline { font-size: clamp(14px, 1.1vw, 18px) !important; margin-bottom: 14px !important; }
  .hero-mp-lede { font-size: clamp(15px, 1.2vw, 19px) !important; line-height: 1.4 !important; margin-bottom: 22px !important; max-width: 58ch !important; }
  .hero-mp-eyebrow { margin-bottom: 16px !important; }
  .hero-mp-cta { gap: 12px !important; }
  .hero-mp-stats { padding: 14px var(--gutter) !important; }
  .hero-mp-stats-grid { gap: 18px !important; }
  .hstat .v { font-size: clamp(20px, 2vw, 28px) !important; }
  .hstat .l { font-size: 9px !important; letter-spacing: .12em !important; margin-top: 2px !important; }
  .scroll-cue { display: none !important; }
}

/* Tablet / landscape phones with narrow vertical: drop scroll cue + tighten */
@media (max-height: 600px) {
  .scroll-cue { display: none !important; }
  .hero-mp-stats { padding: 12px var(--gutter) !important; }
  .hstat .v { font-size: clamp(18px, 2vw, 26px) !important; }
  .hstat .l { font-size: 8.5px !important; letter-spacing: .1em !important; margin-top: 2px !important; }
}

/* Belt-and-braces overflow guard: the stats labels must never get clipped */
.hero-mp-stats { overflow: visible !important; }
.hero-mp-stats-grid { align-items: end !important; }
.hstat { min-width: 0; overflow: visible; }
.hstat .l {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* On very narrow desktop or wide tablet, allow the label to wrap rather than ellipsis */
@media (min-width: 881px) and (max-width: 1180px) {
  .hstat .l { white-space: normal; line-height: 1.25; }
  .hero-mp-stats-grid { gap: 20px !important; }
}

/* Detail-page TOC: hide on very short viewports too */
@media (max-height: 600px) {
  .toc { display: none !important; }
}

/* Masterplan listings — wrap headlines / breadcrumbs that overflow */
.hero-mp-top { row-gap: 12px; }
.hero-mp-top .breadcrumb { flex-wrap: wrap; }

/* Universal: any long inline-flex stat label gets a min-width: 0 */
[class*="stat"] { min-width: 0; }
