/* Analyseize design tokens — warm & humane */
:root {
  --ink-900: #11201C;
  --forest-700: #1F3F3D;
  --ivory-50: #F7F3EC;
  --sand-100: #EFE7D6;
  --sand-200: #E5DAC3;
  --ochre-500: #C88A2C;
  --ochre-600: #A67122;
  --terracotta-600: #B5533A;
  --teal-600: #2F6E6A;
  --stone-400: #8A857B;
  --stone-300: #B8B3A8;
  --moss-600: #4E7A4B;
  --amber-700: #A06B1F;

  --accent: var(--ochre-500);
  --accent-ink: #11201C;
  --bg: var(--ivory-50);
  --bg-alt: var(--sand-100);
  --text: var(--ink-900);
  --muted: var(--stone-400);
  --rule: rgba(17, 32, 28, 0.12);
  --rule-strong: rgba(17, 32, 28, 0.22);

  --font-display: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;

  --density-y: 1;
  --ease-in: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-std: cubic-bezier(0.4, 0, 0.2, 1);

  --shadow-sm: 0 1px 2px rgba(17, 32, 28, 0.04), 0 1px 1px rgba(17, 32, 28, 0.03);
  --shadow-md: 0 4px 16px rgba(17, 32, 28, 0.06), 0 1px 3px rgba(17, 32, 28, 0.04);
  --shadow-lg: 0 20px 48px rgba(17, 32, 28, 0.12), 0 4px 12px rgba(17, 32, 28, 0.06);
}

/* Responsive collapses for narrow viewports / artboard contexts */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 48px !important; }
  .hero-h1 { font-size: clamp(54px, 9vw, 96px) !important; }
  .work-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 40px !important; }
  .work-aside { position: relative !important; top: auto !important; }
  .findings-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
  .featured-title-grid { grid-template-columns: 1fr !important; gap: 24px !important; }
  .featured-cta { flex-direction: column; align-items: flex-start !important; }
  .twenty-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
  .sectors-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .subscribe-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
}

[data-theme="dark"] {
  --bg: #14221F;
  --bg-alt: #1F3F3D;
  --text: #EFE7D6;
  --muted: #A8A096;
  --rule: rgba(239, 231, 214, 0.14);
  --rule-strong: rgba(239, 231, 214, 0.28);
}

/* ──────────────────────────────────────────────────────────
   Brand palette — applied when [data-palette="brand"] is set
   Maps the 5-swatch Analyseize 2025 guide onto our token scale
   (ffffff · c6b7ab · a85828 · 767152 · 303742).
   ────────────────────────────────────────────────────────── */
[data-palette="brand"] {
  --ink-900: #303742;            /* deep charcoal-navy from guide */
  --forest-700: #4F4D38;         /* deep olive (derived) */
  --ivory-50: #F6F2EA;           /* warm off-white pairing with brand sand */
  --sand-100: #E8DFD2;           /* lighter sand (derived from c6b7ab) */
  --sand-200: #C6B7AB;           /* brand sand */
  --ochre-500: #A85828;          /* brand terracotta (primary accent) */
  --ochre-600: #8A4720;          /* deeper terracotta */
  --terracotta-600: #8A4720;     /* dark terracotta — distinct from ochre for chart bands */
  --teal-600: #767152;           /* brand olive */
  --moss-600: #4F4D38;           /* darker olive (derived) */
  --amber-700: #C46B3A;          /* terracotta light (derived) */
  --stone-400: #6B6862;          /* muted neutral */
  --stone-300: #C6B7AB;          /* sand as light neutral */
  --rule: rgba(48, 55, 66, 0.14);
  --rule-strong: rgba(48, 55, 66, 0.26);
  --accent: var(--ochre-500);
  --bg: var(--ivory-50);
  --bg-alt: var(--sand-100);
  --text: var(--ink-900);
  --muted: #6B6862;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

.serif { font-family: var(--font-display); letter-spacing: -0.01em; }
.mono  { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow--accent { color: var(--ochre-600); }
.eyebrow--terracotta { color: var(--terracotta-600); }

.rule { height: 1px; background: var(--rule); border: 0; width: 100%; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: transform .15s var(--ease-std), background .15s, color .15s, border-color .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn--primary { background: var(--ochre-500); color: var(--ink-900); }
.btn--primary:hover { background: var(--ochre-600); color: var(--ivory-50); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--rule-strong); }
.btn--ghost:hover { background: var(--text); color: var(--bg); }
.btn--link { padding: 0; background: transparent; border: 0; border-bottom: 1px solid currentColor; border-radius: 0; }

.focus-ring:focus-visible,
.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ochre-500);
  outline-offset: 2px;
}

.container { max-width: 1240px; margin: 0 auto; padding: 0 40px; }
.container--narrow { max-width: 880px; }
.container--wide { max-width: 1440px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Topographic placeholder texture */
.topo {
  background-image:
    repeating-linear-gradient(115deg, transparent 0 22px, rgba(17,32,28,.045) 22px 23px),
    repeating-linear-gradient(25deg,  transparent 0 34px, rgba(17,32,28,.03) 34px 35px);
}

/* Image placeholder — editorial slot */
.img-slot {
  position: relative;
  background: var(--sand-100);
  overflow: hidden;
  border-radius: 2px;
}
.img-slot::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    45deg, transparent 0 14px, rgba(17,32,28,.035) 14px 15px
  );
}
.img-slot__caption {
  position: absolute; left: 14px; bottom: 12px; right: 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone-400);
  display: flex; justify-content: space-between; gap: 12px;
  z-index: 1;
}

/* Fluid type */
.type-display-xl { font-family: var(--font-display); font-weight: 600; font-size: clamp(56px, 7vw, 96px); line-height: 1.02; letter-spacing: -0.025em; }
.type-display-lg { font-family: var(--font-display); font-weight: 600; font-size: clamp(44px, 5vw, 68px); line-height: 1.06; letter-spacing: -0.02em; }
.type-display-md { font-family: var(--font-display); font-weight: 600; font-size: clamp(32px, 3.2vw, 48px); line-height: 1.12; letter-spacing: -0.015em; }
.type-display-sm { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 2.2vw, 36px); line-height: 1.2; letter-spacing: -0.01em; }
.type-body-lg    { font-size: clamp(18px, 1.25vw, 20px); line-height: 1.55; }
.type-body-md    { font-size: 17px; line-height: 1.6; }
.type-body-sm    { font-size: 15px; line-height: 1.55; color: var(--muted); }

[dir="rtl"] { font-family: "IBM Plex Sans Arabic", "Inter", sans-serif; }
[dir="rtl"] .serif,
[dir="rtl"] .type-display-xl,
[dir="rtl"] .type-display-lg,
[dir="rtl"] .type-display-md,
[dir="rtl"] .type-display-sm { font-family: "IBM Plex Serif Arabic", "Source Serif 4", serif; }
[dir="rtl"] { font-size: 17px; }
