/* ==========================================================================
   Branding A to Z — shared stylesheet
   Editorial knowledge portal. One CSS file, linked by every page.
   ========================================================================== */

:root {
  --ink: #1A1A22;
  --paper: #FCFBF8;
  --sand: #F0EBE1;
  --sand-deep: #E7E0D2;
  --cobalt: #2E4BF0;
  --cobalt-ink: #1E33B0;
  --coral: #FF5C39;
  --slate: #5A5A68;
  --line: #E4DED2;
  --white: #FFFFFF;

  --maxw: 1120px;
  --readw: 720px;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;

  --shadow: 0 1px 2px rgba(26,26,34,.05), 0 8px 30px rgba(26,26,34,.06);

  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --f-mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--cobalt); text-decoration: none; }
a:hover { color: var(--cobalt-ink); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---- Eyebrows / labels ---- */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--coral);
  margin: 0 0 12px;
  font-weight: 500;
}

/* ---- Skip link ---- */
.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 0 0 var(--r-sm) 0; z-index: 1000;
}
.skip:focus { left: 0; color: var(--paper); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(252,251,248,.86);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--f-display); font-weight: 600; font-size: 20px;
  color: var(--ink); letter-spacing: -.01em;
}
.brand:hover { color: var(--ink); }
.brand .mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--ink); color: var(--paper);
  font-family: var(--f-mono); font-size: 15px; font-weight: 600;
  letter-spacing: -.02em;
}
.brand .mark b { color: var(--coral); font-weight: 600; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a.navlink {
  font-size: 15px; color: var(--slate); font-weight: 500;
}
.nav a.navlink:hover { color: var(--ink); }
.nav .btn-sm { margin-left: 4px; }

.menu-toggle { display: none; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-body); font-weight: 600; font-size: 16px;
  padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-sm { padding: 9px 16px; font-size: 14px; }

/* ==========================================================================
   Hero (home)
   ========================================================================== */
.hero { padding: 72px 0 48px; border-bottom: 1px solid var(--line); }
.hero .kicker {
  font-family: var(--f-mono); font-size: 13px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--slate); margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: 0 0 22px;
  max-width: 15ch;
}
.hero h1 em { font-style: italic; color: var(--cobalt); }
.hero .lede {
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  color: var(--slate); max-width: 56ch; margin: 0 0 30px;
}
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* Alphabet index ribbon — the signature device */
.az-ribbon {
  margin-top: 44px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.az-track {
  display: flex; gap: 30px; width: max-content;
  animation: az-scroll 38s linear infinite;
  font-family: var(--f-display); font-weight: 600;
  font-size: 30px; color: var(--sand-deep);
}
.az-track span { letter-spacing: -.01em; }
.az-track span.hot { color: var(--ink); }
.az-track span.hot b { color: var(--coral); font-weight: 600; }
@keyframes az-scroll { to { transform: translateX(-50%); } }

/* ==========================================================================
   Section scaffolding
   ========================================================================== */
.section { padding: 64px 0; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 34px; flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.05;
  letter-spacing: -.015em; margin: 0; max-width: 20ch;
}
.section-head p { margin: 8px 0 0; color: var(--slate); max-width: 46ch; }
.section-alt { background: var(--sand); border-block: 1px solid var(--line); }

/* ==========================================================================
   Article cards
   ========================================================================== */
.card-grid {
  display: grid; gap: 26px;
  grid-template-columns: repeat(3, 1fr);
}
.card-grid.two { grid-template-columns: repeat(2, 1fr); }

.card {
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card .thumb {
  aspect-ratio: 16 / 10; position: relative;
  display: grid; place-items: center;
  font-family: var(--f-display); font-size: 4rem; font-weight: 600;
  color: rgba(255,255,255,.9);
}
.card .thumb .tnum { position: absolute; bottom: 12px; right: 16px; font-family: var(--f-mono); font-size: 13px; opacity: .75; }
.card .body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.tag {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--coral); font-weight: 500;
  margin-bottom: 10px;
}
.card h3 {
  font-family: var(--f-display); font-weight: 600; font-size: 1.32rem;
  line-height: 1.16; letter-spacing: -.01em; margin: 0 0 10px;
}
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--cobalt); }
.card p { margin: 0 0 18px; color: var(--slate); font-size: .98rem; }
.card .meta {
  margin-top: auto; font-family: var(--f-mono); font-size: 12px;
  color: var(--slate); letter-spacing: .02em;
}

/* Gradient thumbs */
.g1 { background: linear-gradient(135deg,#2E4BF0,#6D28D9); }
.g2 { background: linear-gradient(135deg,#FF5C39,#FF9E2C); }
.g3 { background: linear-gradient(135deg,#0EA5A0,#2E4BF0); }
.g4 { background: linear-gradient(135deg,#7C3AED,#FF5C39); }
.g5 { background: linear-gradient(135deg,#111827,#374151); }
.g6 { background: linear-gradient(135deg,#F59E0B,#EF4444); }

/* ==========================================================================
   Topic / category chips
   ========================================================================== */
.topics { display: flex; flex-wrap: wrap; gap: 12px; }
.topic {
  display: inline-flex; align-items: baseline; gap: 10px;
  border: 1px solid var(--line); background: var(--white);
  border-radius: 999px; padding: 11px 18px 11px 14px;
  font-weight: 500; color: var(--ink); font-size: 15px;
}
.topic:hover { border-color: var(--ink); color: var(--ink); }
.topic .lt { font-family: var(--f-mono); color: var(--cobalt); font-size: 13px; }

/* ==========================================================================
   Ad slots
   ========================================================================== */
.ad-slot {
  margin: 40px auto; max-width: var(--maxw);
  padding: 0 24px; text-align: center;
}
.ad-slot .ad-inner {
  border: 1px dashed var(--sand-deep);
  border-radius: var(--r-sm);
  min-height: 100px;
  display: grid; place-items: center;
  background: var(--sand);
}
.ad-label {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: #A79E8C; display: block;
  margin-bottom: 6px;
}
.ad-slot ins { display: block; }

/* ==========================================================================
   Newsletter
   ========================================================================== */
.newsletter { background: var(--ink); color: var(--paper); border-radius: var(--r-lg); padding: 48px; }
.newsletter h2 { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.6rem,3vw,2.3rem); margin: 0 0 10px; letter-spacing: -.015em; }
.newsletter p { color: #C9C6BE; margin: 0 0 24px; max-width: 48ch; }
.nl-form { display: flex; gap: 12px; flex-wrap: wrap; max-width: 480px; }
.nl-form input {
  flex: 1; min-width: 220px; padding: 14px 18px; border-radius: 999px;
  border: 1px solid #3A3A46; background: #24242E; color: var(--paper);
  font-family: var(--f-body); font-size: 16px;
}
.nl-form input::placeholder { color: #8A8794; }
.nl-form input:focus { outline: 2px solid var(--cobalt); outline-offset: 1px; }
.nl-note { font-size: 13px; color: #8A8794; margin-top: 14px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 40px; margin-top: 24px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.foot-grid h4 { font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); margin: 0 0 16px; font-weight: 500; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin-bottom: 10px; }
.foot-grid a { color: var(--ink); font-size: 15px; }
.foot-grid a:hover { color: var(--cobalt); }
.foot-brand p { color: var(--slate); font-size: 15px; margin: 14px 0 0; max-width: 34ch; }
.foot-legal { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--slate); font-size: 14px; }

/* ==========================================================================
   Article page
   ========================================================================== */
.article-head { padding: 56px 0 8px; }
.breadcrumb { font-family: var(--f-mono); font-size: 13px; color: var(--slate); margin-bottom: 22px; }
.breadcrumb a { color: var(--slate); }
.breadcrumb a:hover { color: var(--cobalt); }
.article-head h1 {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.05;
  letter-spacing: -.02em; margin: 10px 0 18px; max-width: 20ch;
}
.article-head .standfirst { font-size: 1.22rem; color: var(--slate); max-width: 60ch; margin: 0 0 22px; }
.byline { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--slate); font-family: var(--f-mono); letter-spacing: .02em; }
.byline .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--sand-deep); }

.article-hero-img { aspect-ratio: 21/9; border-radius: var(--r-md); margin: 8px 0 0; }

.article-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 56px; padding: 40px 0 20px; align-items: start; }

.prose { max-width: var(--readw); font-size: 1.12rem; line-height: 1.75; }
.prose > p { margin: 0 0 1.35em; }
.prose h2 { font-family: var(--f-display); font-weight: 600; font-size: 1.85rem; letter-spacing: -.01em; line-height: 1.15; margin: 2em 0 .6em; scroll-margin-top: 90px; }
.prose h3 { font-family: var(--f-display); font-weight: 600; font-size: 1.35rem; margin: 1.6em 0 .5em; scroll-margin-top: 90px; }
.prose ul, .prose ol { margin: 0 0 1.35em; padding-left: 1.3em; }
.prose li { margin-bottom: .5em; }
.prose strong { font-weight: 700; }
.prose blockquote {
  margin: 1.6em 0; padding: 6px 0 6px 24px;
  border-left: 3px solid var(--coral);
  font-family: var(--f-display); font-style: italic; font-size: 1.3rem;
  color: var(--ink); line-height: 1.35;
}
.prose .callout {
  background: var(--sand); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 22px 24px; margin: 1.8em 0;
}
.prose .callout .eyebrow { margin-bottom: 8px; }
.prose .callout p:last-child { margin-bottom: 0; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: rgba(46,75,240,.35); }
.prose a:hover { text-decoration-color: var(--cobalt); }

/* Case study block */
.prose .case-study {
  border: 1px solid var(--line);
  border-left: 4px solid var(--cobalt);
  border-radius: var(--r-md);
  padding: 24px 26px;
  margin: 1.9em 0;
  background: linear-gradient(180deg, rgba(46,75,240,.045), rgba(46,75,240,0));
}
.prose .case-study .cs-label {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--cobalt); font-weight: 500;
  display: inline-block; margin-bottom: 12px;
}
.prose .case-study h3 { margin: 0 0 10px; font-size: 1.32rem; }
.prose .case-study ul { margin: .6em 0 1em; }
.prose .case-study p:last-child { margin-bottom: 0; }
.cs-stats { display: flex; flex-wrap: wrap; gap: 30px; margin: 18px 0 6px; }
.cs-stat { display: flex; flex-direction: column; }
.cs-stat b { font-family: var(--f-display); font-weight: 600; font-size: 2rem; line-height: 1; color: var(--ink); letter-spacing: -.01em; }
.cs-stat span { font-family: var(--f-mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--slate); margin-top: 7px; }

/* Sidebar */
.aside { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 28px; }
.toc { border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; background: var(--white); }
.toc h4 { font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); margin: 0 0 14px; font-weight: 500; }
.toc ol { list-style: none; counter-reset: t; padding: 0; margin: 0; }
.toc li { counter-increment: t; margin-bottom: 10px; }
.toc a { display: flex; gap: 10px; font-size: 14.5px; color: var(--slate); }
.toc a::before { content: counter(t, decimal-leading-zero); font-family: var(--f-mono); color: var(--coral); font-size: 12px; }
.toc a:hover { color: var(--ink); }

.aside .ad-slot { margin: 0; padding: 0; }
.aside .ad-inner { min-height: 250px; }

/* Related */
.related { border-top: 1px solid var(--line); padding: 48px 0 8px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .card-grid, .card-grid.two { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; gap: 8px; }
  .aside { position: static; flex-direction: row; flex-wrap: wrap; }
  .aside .toc { flex: 1; min-width: 260px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 17px; }
  .nav { display: none; }
  .nav.open {
    display: flex; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 4px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 12px 24px 20px;
  }
  .nav.open a.navlink { padding: 8px 0; }
  .menu-toggle {
    display: inline-grid; place-items: center; width: 42px; height: 42px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--white);
    cursor: pointer;
  }
  .menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
    content: ""; display: block; width: 18px; height: 2px; background: var(--ink); position: relative;
  }
  .menu-toggle span::before { position: absolute; top: -6px; }
  .menu-toggle span::after { position: absolute; top: 6px; }
  .card-grid, .card-grid.two { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .newsletter { padding: 32px 24px; }
  .section { padding: 48px 0; }
  .hero { padding: 48px 0 36px; }
}

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

:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }
