/* ==========================================================================
   Cryptoku — design system
   Light + dark, WCAG AA contrast, long-form reading comfort.
   Ad classes (.ad-slot, .ad-slot__frame, .ad-rotate-*) are a contract with
   assets/ads-loader.js — do not rename.
   ========================================================================== */

/* --- tokens: light --- */
:root {
  color-scheme: light;

  --bg: #f6f8f7;
  --bg-tint-a: rgba(11, 122, 85, 0.045);
  --bg-tint-b: rgba(160, 107, 28, 0.03);
  --surface: #ffffff;
  --surface-2: #eef2ef;
  --surface-3: #e6ebe7;

  --ink: #0f1f18;
  --ink-2: #48594f;
  --ink-3: #5a6b61;
  --on-brand: #ffffff;

  --brand: #06694a;
  --brand-hover: #05543b;
  --brand-fill: #0b7a55;
  --brand-soft: rgba(11, 122, 85, 0.08);
  --brand-ring: rgba(11, 122, 85, 0.32);

  --amber: #8a5a12;
  --amber-soft: rgba(160, 107, 28, 0.09);
  --amber-ring: rgba(160, 107, 28, 0.28);

  --line: #dde5e0;
  --line-strong: #c8d4cc;

  --logo-tile: #ffffff;
  --logo-tile-line: #e2e8e4;

  --shadow-sm: 0 1px 2px rgba(15, 31, 24, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 31, 24, 0.07);
  --shadow-lg: 0 12px 32px rgba(15, 31, 24, 0.1);

  --header-bg: rgba(246, 248, 247, 0.82);

  /* layout */
  --content: 44rem;
  --measure: 68ch;
  --rail: 15rem;
  --pad-x: 1.25rem;
  --radius-sm: 0.5rem;
  --radius: 0.75rem;
  --radius-lg: 1.1rem;
  --tap: 44px;
  --header-h: 3.5rem;

  /* type */
  --font-body: "Manrope", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --font-head: "Space Grotesk", "Manrope", ui-sans-serif, system-ui, sans-serif;
}

/* --- tokens: dark --- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0c1411;
  --bg-tint-a: rgba(78, 207, 154, 0.05);
  --bg-tint-b: rgba(230, 176, 58, 0.035);
  --surface: #141f1a;
  --surface-2: #1a2721;
  --surface-3: #22322a;

  --ink: #e9f0ec;
  --ink-2: #a9bab0;
  --ink-3: #94a69b;
  --on-brand: #06231a;

  --brand: #58d5a0;
  --brand-hover: #79e0b4;
  --brand-fill: #2ba97a;
  --brand-soft: rgba(88, 213, 160, 0.12);
  --brand-ring: rgba(88, 213, 160, 0.4);

  --amber: #e9bc62;
  --amber-soft: rgba(233, 188, 98, 0.12);
  --amber-ring: rgba(233, 188, 98, 0.3);

  --line: #26352d;
  --line-strong: #35483d;

  --logo-tile: #f4f7f5;
  --logo-tile-line: rgba(255, 255, 255, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);

  --header-bg: rgba(12, 20, 17, 0.82);
}

/* --- reset --- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 480px at 8% -10%, var(--bg-tint-a), transparent 60%),
    radial-gradient(760px 400px at 100% 0%, var(--bg-tint-b), transparent 55%);
  background-repeat: no-repeat;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--brand-fill);
  outline-offset: 2px;
  border-radius: 0.35rem;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3.5rem;
  z-index: 60;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--brand-fill);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.18s ease;
}

.skip-link:focus { top: 0; }

/* --- reading progress --- */
.reading-progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 50;
  width: 100%;
  height: 3px;
  background: transparent;
  pointer-events: none;
}

.reading-progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand-fill), var(--brand));
  transform-origin: left center;
  transition: width 0.08s linear;
}

/* --- shell --- */
.page {
  width: min(100%, calc(var(--content) + var(--pad-x) * 2));
  margin: 0 auto;
  padding: 1.5rem var(--pad-x) calc(3rem + env(safe-area-inset-bottom, 0px));
}

/* --- header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--header-h);
  margin: 0 calc(var(--pad-x) * -1) 1.5rem;
  padding: 0.5rem var(--pad-x);
  border-bottom: 1px solid transparent;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1 1 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  white-space: nowrap;
}

.brand span { color: var(--brand); }
.brand:hover span { color: var(--ink); }

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  padding: 0.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.lang-switch a,
.lang-switch button {
  appearance: none;
  border: 0;
  margin: 0;
  min-width: 2.3rem;
  min-height: 1.9rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.lang-switch a.is-active,
.lang-switch button.is-active {
  color: var(--on-brand);
  background: var(--brand-fill);
}

.lang-switch a:hover:not(.is-active),
.lang-switch button:hover:not(.is-active) { color: var(--ink); }

.article-page .meta__updated {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--ink-3);
  font-size: 0.85em;
}

.article-page .meta__updated time {
  font-variant-numeric: tabular-nums;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.theme-toggle:hover {
  color: var(--brand);
  border-color: var(--brand-ring);
  background: var(--brand-soft);
}

.theme-toggle svg { width: 1.05rem; height: 1.05rem; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* --- hero --- */
.hero { margin-bottom: 1.75rem; }

.hero h1 {
  margin: 0 0 0.6rem;
  font-family: var(--font-head);
  font-size: clamp(1.75rem, 5.2vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
  max-width: 22ch;
}

.hero__lead {
  margin: 0;
  max-width: 54ch;
  color: var(--ink-2);
  font-size: 1.03rem;
  line-height: 1.6;
}

.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-3);
  font-size: 0.85rem;
  font-weight: 600;
}

.hero__trust li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hero__trust li::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--brand-fill);
}

/* --- market pills --- */
.market-pills {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.25rem 0 0;
}

.market-pills a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.1rem;
  padding: 0.3rem 0.7rem 0.3rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 650;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.market-pills img {
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
  background: var(--logo-tile);
  box-shadow: inset 0 0 0 1px var(--logo-tile-line);
}

.market-pills a:hover {
  border-color: var(--brand-ring);
  color: var(--brand);
  background: var(--brand-soft);
  box-shadow: var(--shadow-sm);
}

/* --- section heads --- */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 2.25rem 0 0.9rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-head span {
  color: var(--ink-3);
  font-size: 0.8rem;
  font-weight: 600;
}

/* --- article cards --- */
.article-list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.article-card:hover {
  border-color: var(--brand-ring);
  box-shadow: var(--shadow-md);
}

.article-card:focus-within {
  border-color: var(--brand-ring);
  box-shadow: var(--shadow-md);
}

.card-logo {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.25rem;
  border-radius: 0.65rem;
  background: var(--logo-tile);
  box-shadow: inset 0 0 0 1px var(--logo-tile-line);
}

.card-body { min-width: 0; }

.card-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin-bottom: 0.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 0.3rem;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge--global {
  background: var(--amber-soft);
  color: var(--amber);
}

.article-card h3 {
  margin: 0 0 0.3rem;
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.article-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.article-card h3 a:hover { color: var(--brand); }

/* whole card clickable without nesting interactive elements */
.article-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.article-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* --- ads (class contract with ads-loader.js) --- */
.ad-slot {
  margin: 1.5rem 0;
  width: 100%;
}

.ad-slot[hidden],
.ad-slot.is-off { display: none !important; }

.ad-slot__label {
  display: none !important;
}

.ad-slot__frame {
  display: block;
  width: 100%;
  min-height: 90px;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 0.8rem;
  font-weight: 600;
  transition: opacity 0.2s ease;
}

.ad-slot__frame.is-fade { opacity: 0; }

.ad-slot__frame:empty::before {
  content: "Ad space";
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
}

.ad-rotate-stage {
  border-style: solid;
  border-color: transparent;
  background: transparent;
}

.ad-rotate-pane {
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.ad-rotate-pane iframe,
.ad-slot__frame iframe {
  display: block;
  border: 0;
  max-width: none;
  vertical-align: top;
}

/* --- article page --- */
.article-page .back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  margin-bottom: 0.85rem;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 650;
}

.article-page .back:hover { color: var(--brand); }

.article-page h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 4.6vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  max-width: 26ch;
}

.article-page .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin: 0 0 1.5rem;
  color: var(--ink-3);
  font-size: 0.82rem;
  font-weight: 600;
}

.article-page .meta strong {
  color: var(--brand);
  font-weight: 750;
}

.article-page .meta img {
  width: 1.55rem;
  height: 1.55rem;
  padding: 0.12rem;
  border-radius: 999px;
  background: var(--logo-tile);
  box-shadow: inset 0 0 0 1px var(--logo-tile-line);
}

/* --- table of contents --- */
.toc {
  margin: 0 0 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.toc > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  list-style: none;
}

.toc > summary::-webkit-details-marker { display: none; }

.toc > summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  margin-left: auto;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.toc[open] > summary::after { transform: rotate(-135deg); }

.toc__list {
  margin: 0;
  padding: 0 1rem 0.85rem 1rem;
  list-style: none;
  counter-reset: toc;
}

.toc__list li { counter-increment: toc; }

.toc__list a {
  display: flex;
  gap: 0.55rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.89rem;
  line-height: 1.45;
  transition: color 0.15s ease;
}

.toc__list a::before {
  content: counter(toc);
  flex: 0 0 1.25rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.78rem;
  text-align: right;
}

.toc__list a:hover { color: var(--brand); }

.toc__list a.is-current {
  color: var(--brand);
  font-weight: 700;
}

.toc__list a.is-current::before { color: var(--brand); }

/* --- prose --- */
.prose {
  max-width: var(--measure);
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.75;
}

.prose > * + * { margin-top: 1.05em; }

.prose h2 {
  margin: 2.25rem 0 0.7rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.prose h3 {
  margin: 1.6rem 0 0.45rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.prose p { margin: 0 0 1.05rem; }

.prose ul,
.prose ol {
  margin: 0 0 1.15rem;
  padding-left: 1.4rem;
}

.prose li { margin: 0.35rem 0; }
.prose li::marker { color: var(--brand); font-weight: 700; }

.prose a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  font-weight: 600;
}

.prose a:hover {
  color: var(--brand-hover);
  text-decoration-thickness: 2px;
}

.prose strong { color: var(--ink); font-weight: 750; }

/* checklist lists written with ✅ read badly; style a real checklist */
.prose .checklist {
  padding-left: 0;
  list-style: none;
}

.prose .checklist li {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.5rem 0;
  border-top: 1px solid var(--line);
}

.prose .checklist li::before {
  content: "";
  flex: 0 0 1.2rem;
  height: 1.2rem;
  margin-top: 0.2rem;
  background-color: var(--brand);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 1.05rem no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 1.05rem no-repeat;
}

/* --- callouts --- */
.note,
.warn,
.disclaimer {
  margin: 1.5rem 0;
  padding: 0.9rem 1rem 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 0.97rem;
  line-height: 1.65;
}

.note {
  border-color: var(--brand-ring);
  border-left-color: var(--brand-fill);
  background: var(--brand-soft);
}

.warn {
  border-color: var(--amber-ring);
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.disclaimer {
  border-left-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 0.93rem;
}

.note strong,
.warn strong { color: var(--ink); }

/* --- next reads --- */
.next-reads {
  margin: 2.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.next-reads h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
}

.next-reads ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.next-reads a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: var(--tap);
  padding: 0.35rem 0.8rem 0.35rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 650;
}

.next-reads img {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: var(--logo-tile);
  box-shadow: inset 0 0 0 1px var(--logo-tile-line);
}

.next-reads a:hover {
  border-color: var(--brand-ring);
  color: var(--brand);
  background: var(--brand-soft);
}

/* --- back to top --- */
.to-top {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, color 0.15s ease;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover { color: var(--brand); border-color: var(--brand-ring); }
.to-top svg { width: 1.1rem; height: 1.1rem; }

/* --- footer --- */
.site-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.88rem;
  line-height: 1.6;
  text-align: center;
}

.site-footer p { margin: 0 auto; max-width: 46ch; }

.site-footer__domain {
  margin-top: 0.6rem !important;
  color: var(--ink-3);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.site-footer a { color: var(--brand); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 0.15em; }

/* ==========================================================================
   Responsive
   ========================================================================== */

/* two-column cards once there is room */
@media (min-width: 46rem) {
  :root { --content: 46rem; --pad-x: 1.5rem; }

  .article-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .page { padding-top: 0.5rem; }
}

/* article layout with sticky TOC rail */
@media (min-width: 64rem) {
  :root { --content: 62rem; }

  .article-page main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--rail);
    gap: 2.75rem;
    align-items: start;
  }

  .article-page .back,
  .article-page h1,
  .article-page .meta,
  .article-page .prose,
  .article-page .next-reads,
  .article-page .ad-slot { grid-column: 1; }

  .article-page .toc {
    grid-column: 2;
    grid-row: 1 / span 20;
    position: sticky;
    top: calc(var(--header-h) + 1rem);
    margin: 0;
    max-height: calc(100vh - var(--header-h) - 3rem);
    overflow-y: auto;
  }

  .article-page .toc > summary {
    cursor: default;
    pointer-events: none;
    padding-bottom: 0.4rem;
  }

  .article-page .toc > summary::after { display: none; }

  .brand { font-size: 1.4rem; }
}

/* mobile */
@media (max-width: 45.99rem) {
  :root {
    --pad-x: 1rem;
    --measure: 100%;
  }

  .page { padding-top: 0.75rem; }

  .hero h1 { max-width: 100%; }

  /* pills scroll horizontally with a fade affordance */
  .market-pills {
    flex-wrap: nowrap;
    margin-left: calc(var(--pad-x) * -1);
    margin-right: calc(var(--pad-x) * -1);
    padding: 0.2rem var(--pad-x) 0.4rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    mask-image: linear-gradient(90deg, transparent 0, #000 0.75rem, #000 calc(100% - 1.75rem), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 0.75rem, #000 calc(100% - 1.75rem), transparent 100%);
  }

  .market-pills::-webkit-scrollbar { display: none; }

  .market-pills a {
    flex: 0 0 auto;
    min-height: var(--tap);
    scroll-snap-align: start;
  }

  .article-card { padding: 0.9rem; gap: 0.75rem; }
  .card-logo { width: 2.4rem; height: 2.4rem; }
  .article-card:hover { border-color: var(--line); box-shadow: var(--shadow-sm); }

  .prose { font-size: 1.02rem; line-height: 1.72; }
  .prose h2 { font-size: 1.2rem; margin-top: 1.9rem; }

  /* Keep mobile reserve short; ads-loader.js sets the real fitted height.
     A tall CSS min-height + 728x90 creative = black empty band under the ad. */
  .ad-slot__frame {
    min-height: 50px;
    line-height: 0;
  }
  .ad-slot__frame:empty::before {
    min-height: 50px;
    line-height: 1.2;
  }

  .to-top { right: 0.75rem; }
}

@media (hover: none) and (pointer: coarse) {
  .article-card:hover,
  .market-pills a:hover,
  .next-reads a:hover {
    border-color: var(--line);
    color: inherit;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header, .toc, .to-top, .ad-slot, .reading-progress, .next-reads { display: none !important; }
  body { background: #fff; color: #000; }
  .page { width: 100%; }
}

/* --- five ad positions (contract with ads-loader.js) --- */

/* Article top banner (under meta): full-width leaderboard, calm spacing */
.ad-slot--top {
  margin: 1.1rem 0 1.35rem;
}

.ad-slot--top .ad-slot__label {
  margin-bottom: 0.25rem;
}

.ad-slot--top .ad-slot__frame {
  max-width: 100%;
  min-height: 0;
  line-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: transparent;
}

.ad-slot--top .ad-slot__frame > * {
  margin: 0 auto;
  vertical-align: top;
}

/* Desktop / Windows: tighten the top banner so the dashed box hugs the creative */
@media (min-width: 46rem) {
  .article-page .ad-slot--top {
    margin: 0.55rem 0 0.75rem;
  }

  .article-page .ad-slot--top .ad-slot__label {
    margin-bottom: 0.15rem;
    font-size: 0.58rem;
  }

  .article-page .ad-slot--top .ad-slot__frame {
    min-height: 0 !important;
    padding: 0;
  }

  .article-page .ad-slot--end {
    margin: 1.75rem 0 1.25rem;
    padding-top: 0.85rem;
  }

  .article-page .ad-slot--rect {
    margin: 1.75rem auto;
  }
}

/* in-content rectangles: centred with breathing room so they read as a break,
   not as part of the guide steps */
.ad-slot--rect {
  margin: 2.25rem auto;
  text-align: center;
  max-width: 22rem;
}

/* Never give the box a min-width: a 300px floor overflows a 320px phone once
   page padding is taken out. Stay fluid and centre the creative instead. */
.ad-slot--rect .ad-slot__frame {
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
}

.ad-slot--rect .ad-slot__frame > *,
.ad-slot--rect .ad-slot__frame iframe,
.ad-slot--rect .ad-slot__frame img {
  margin-left: auto;
  margin-right: auto;
}

/* End-of-guide banner: clear visual break before related links */
.ad-slot--end {
  margin: 2.5rem 0 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.ad-slot--end .ad-slot__label {
  margin-bottom: 0.45rem;
}

.article-page .ad-slot.is-off {
  display: none !important;
}

/* Homepage mid slot between lokal / global keeps full content width */
main > .ad-slot[data-ad-zone="in_article_1"] {
  margin: 1.25rem 0 0.35rem;
  max-width: none;
  text-align: center;
}

main > .ad-slot[data-ad-zone="in_article_1"] .ad-slot__frame,
main > .ad-slot.ad-slot--home-end .ad-slot__frame {
  min-height: 0;
  line-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: transparent;
}

/* Homepage: below Global exchanges — tight, full-width, desktop + mobile */
main > .ad-slot.ad-slot--home-end {
  margin: 1.35rem 0 0.25rem;
  padding-top: 0;
  border-top: 0;
  text-align: center;
  max-width: none;
}

@media (max-width: 45.99rem) {
  main > .ad-slot[data-ad-zone="in_article_1"],
  main > .ad-slot.ad-slot--home-end {
    margin: 1rem 0 0.15rem;
  }
}

@media (min-width: 46rem) {
  main > .ad-slot[data-ad-zone="in_article_1"],
  main > .ad-slot.ad-slot--home-end {
    margin: 1.5rem 0 0.35rem;
  }
}

/* position 5: bottom anchor, mobile only, dismissible */
.ad-slot--anchor {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 46;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.25rem 2.4rem calc(0.25rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 -2px 12px rgb(0 0 0 / 8%);
}

.ad-slot--anchor .ad-slot__label { display: none; }

.ad-slot--anchor .ad-slot__frame {
  min-height: 50px;
  border: 0;
  background: transparent;
  line-height: 0;
}

.ad-slot--anchor .ad-slot__frame:empty::before { content: none; }

.ad-slot__close {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.ad-slot__close:hover { color: var(--brand); border-color: var(--brand-ring); }

/* keep the footer and the back-to-top button clear of the anchor */
body.has-ad-anchor .page { padding-bottom: 4.5rem; }
body.has-ad-anchor .to-top { bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px)); }

/* the anchor is a phone position; desktop gets the width for real banners */
@media (min-width: 46rem) {
  .ad-slot--anchor { display: none !important; }
  body.has-ad-anchor .page { padding-bottom: 0; }
  body.has-ad-anchor .to-top { bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
}

@media print {
  .ad-slot--anchor { display: none !important; }
}