@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #15163b;
  --ink-2: #3b3e6b;
  --paper: #f3f5ff;
  --paper-2: #e6e9fc;
  --surface: #ffffff;
  --line: #cfd4f3;
  --violet: #4b2fe8;
  --violet-dark: #3920c4;
  --violet-soft: #e3ddff;
  --lime: #d9ff4f;
  --lime-soft: #f3ffc4;
  --supply: #0fa896;
  --supply-soft: #d3f4ee;
  --supply-ink: #0a6a5e;
  --demand: #ff6a3d;
  --demand-soft: #ffe1d6;
  --demand-ink: #a8390d;
  --font-head: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow-hard: 0 4px 0 var(--ink);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  padding-top: env(safe-area-inset-top, 0px);
}

img, svg { max-width: 100%; height: auto; }

a {
  color: var(--violet);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { color: var(--ink); text-decoration-color: var(--violet); }

:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 24px;
}
.narrow { max-width: 760px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  background: var(--ink);
  color: var(--lime);
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
}
.skip-link:focus { top: 16px; }

/* ---------- progress ---------- */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  z-index: 60;
  background: transparent;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--violet);
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--ink);
  padding-top: env(safe-area-inset-top, 0px);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.logo-mark { width: 36px; height: 36px; flex: none; }
.brand-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.main-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background-color .15s ease, color .15s ease;
}
.main-nav a:hover { background: var(--violet-soft); color: var(--ink); }
.main-nav a[aria-current="page"] { background: var(--ink); color: var(--lime); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease, color .12s ease;
}
.btn:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }

.btn-primary { background: var(--violet); color: #fff; }
.btn-primary:hover { background: var(--ink); color: var(--lime); }

.btn-ghost { background: var(--surface); color: var(--ink); }
.btn-ghost:hover { background: var(--lime); color: var(--ink); }

.btn-cta { background: var(--ink); color: var(--lime); padding: 11px 20px; }
.btn-cta:hover { background: var(--violet); color: #fff; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 36px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
}
.nowrap { white-space: nowrap; }
.hero h1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2.5rem, 5.6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 24px;
  text-wrap: balance;
}
.hero-lead {
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 36em;
  margin: 0 0 28px;
}
.hero-lead a { color: var(--ink); font-weight: 600; text-decoration-color: var(--violet); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.hero-note { font-size: .95rem; color: var(--ink-2); margin: 0; }

.hero-art {
  position: relative;
  background: var(--violet-soft);
  border: 2px solid var(--ink);
  border-radius: 36px;
  padding: 22px;
  box-shadow: 0 8px 0 var(--ink);
}
.hero-disc {
  position: absolute;
  left: 50%;
  top: -34px;
  margin-left: -38px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--lime);
  border: 2px solid var(--ink);
  z-index: 0;
}
.hero-svg { position: relative; z-index: 1; display: block; width: 100%; height: auto; overflow: visible; }
.svg-col { font-weight: 800; font-size: 17px; font-family: var(--font-head); }
.supply-t { fill: var(--supply-ink); }
.demand-t { fill: var(--demand-ink); }
.svg-tile { font-weight: 800; font-size: 17px; fill: var(--ink); font-family: var(--font-head); }
.svg-sub { font-weight: 500; font-size: 13px; fill: var(--ink-2); }
.svg-core { font-weight: 800; font-size: 19px; fill: #fff; font-family: var(--font-head); }
.svg-core-sub { font-weight: 600; font-size: 11px; fill: var(--lime); }
.svg-pill { font-weight: 700; font-size: 12px; fill: #fff; }
.flow-lines path { stroke-dasharray: 7 8; animation: dash 1.4s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -30; } }
@media (prefers-reduced-motion: reduce) {
  .flow-lines path { animation: none; }
}

/* ---------- takeaways ---------- */
.takeaways { padding: 36px 0 28px; }
.takeaways h2 {
  line-height: 1.15;
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: -0.025em;
  margin: 0 0 22px;
}
.take-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}
.take {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  height: 100%;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  font-size: .98rem;
  line-height: 1.28;
  padding: 16px 14px 18px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  transition: transform .14s ease, background-color .14s ease, box-shadow .14s ease;
}
.take:hover {
  background: var(--lime-soft);
  color: var(--ink);
  transform: translateY(-4px);
  box-shadow: 0 6px 0 var(--ink);
}
.take-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--violet);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.05rem;
}
.take:hover .take-num { background: var(--ink); color: var(--lime); }

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 860px);
  gap: 48px;
  justify-content: center;
  padding-top: 40px;
  padding-bottom: 80px;
}
.rail {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow: auto;
}
.rail-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1rem;
  margin: 0 0 12px;
}
.rail ol {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0;
  border-left: 3px solid var(--line);
}
.rail a {
  display: block;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.3;
  padding: 7px 12px;
  margin-left: -3px;
  border-left: 3px solid transparent;
  transition: color .12s ease, border-color .12s ease, background-color .12s ease;
}
.rail a:hover { color: var(--ink); background: var(--violet-soft); }
.rail a.is-active {
  color: var(--ink);
  border-left-color: var(--violet);
  background: var(--surface);
  font-weight: 800;
}

/* ---------- article ---------- */
.article h2, .page-simple h2 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -0.028em;
  margin: 0 0 18px;
  text-wrap: balance;
}
.article h3 {
  font-family: var(--font-head);
  font-weight: 750;
  font-size: 1.32rem;
  line-height: 1.2;
  letter-spacing: -0.018em;
  margin: 0 0 10px;
}
.sec { padding-top: 56px; scroll-margin-top: 90px; }
.sec:first-child { padding-top: 0; }
.sub { padding-top: 26px; scroll-margin-top: 90px; }
.article p, .page-simple p { margin: 0 0 1.05em; max-width: 68ch; }
.article p a, .page-simple p a, .page-simple li a, .article li a { font-weight: 600; }

.list-title {
  font-family: var(--font-head);
  font-weight: 750;
  font-size: 1.08rem;
  margin: 1.4em 0 .6em;
  max-width: none !important;
}

.plain-list { margin: 0 0 1.3em; padding-left: 1.2em; max-width: 68ch; }
.plain-list li { margin-bottom: .55em; padding-left: .2em; }
.plain-list li::marker { color: var(--violet); }

.steps-list {
  list-style: none;
  counter-reset: roadmap;
  margin: 0 0 1.3em;
  padding: 0;
  max-width: 68ch;
}
.steps-list li {
  counter-increment: roadmap;
  position: relative;
  padding: 0 0 18px 52px;
  margin: 0;
}
.steps-list li::before {
  content: counter(roadmap);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--violet);
  color: #fff;
  border-radius: 50%;
  font-family: var(--font-head);
  font-weight: 800;
}
.steps-list li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 38px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
}

.checklist {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 20px;
  padding: 6px 22px 12px;
  margin: 1.2em 0 1.4em;
}
.checklist ul { list-style: none; margin: 0; padding: 0; }
.checklist li {
  position: relative;
  padding: 7px 0 7px 36px;
  border-top: 1px solid var(--line);
}
.checklist li:first-child { border-top: 0; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--supply) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}

.callout {
  background: var(--lime-soft);
  border: 2px solid var(--ink);
  border-radius: 20px;
  padding: 4px 22px 14px;
  margin: 1.4em 0;
}
.callout ul { margin: 0; padding-left: 1.2em; }
.callout li { margin-bottom: .5em; }
.callout li::marker { color: var(--ink); }

/* ---------- tables ---------- */
.table-wrap {
  margin: 1.4em 0 1.6em;
  overflow-x: auto;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.table-wrap:focus-visible { outline-offset: 4px; }
table { width: 100%; border-collapse: collapse; font-size: .96rem; line-height: 1.45; min-width: 640px; }
caption {
  caption-side: top;
  text-align: left;
  font-family: var(--font-head);
  font-weight: 750;
  font-size: 1.02rem;
  padding: 14px 16px 12px;
  background: var(--surface);
  border-bottom: 2px solid var(--ink);
}
thead th {
  background: var(--violet-soft);
  text-align: left;
  font-weight: 800;
  padding: 11px 14px;
  border-bottom: 2px solid var(--ink);
  white-space: nowrap;
}
tbody th {
  text-align: left;
  font-weight: 800;
  padding: 12px 14px;
  vertical-align: top;
  white-space: nowrap;
}
tbody td { padding: 12px 14px; vertical-align: top; }
tbody tr + tr > * { border-top: 1px solid var(--line); }
tbody tr { transition: background-color .12s ease; }
tbody tr:hover { background: var(--lime-soft); }
table a { font-weight: 700; }

/* ---------- figures ---------- */
.fig {
  margin: 1.6em 0;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 24px;
  padding: 18px 18px 12px;
}
.fig svg { display: block; width: 100%; height: auto; }
.fig figcaption { font-size: .95rem; color: var(--ink-2); padding: 12px 6px 4px; }

.flow-fig {
  margin: 1.6em 0;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 24px;
  padding: 18px;
}
.fig-title {
  font-family: var(--font-head);
  font-weight: 750;
  font-size: 1.08rem;
  margin-bottom: 14px;
}
.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}
.flow-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px 16px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--supply-soft);
  line-height: 1.3;
}
.flow-step.side-exchange { background: var(--violet-soft); }
.flow-step.side-demand { background: var(--demand-soft); }
.flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -17px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-top: 3px solid var(--ink);
  border-right: 3px solid var(--ink);
  transform: rotate(45deg) scale(.8);
}
.flow-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--lime);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: .95rem;
  margin-bottom: 6px;
}
.flow-name { font-family: var(--font-head); font-weight: 800; font-size: 1.02rem; }
.flow-text { font-size: .9rem; color: var(--ink-2); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; margin-top: 8px; }
.faq-item {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 18px;
  transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.faq-item:hover { background: var(--lime-soft); }
.faq-item[open] { background: var(--surface); box-shadow: 0 5px 0 var(--ink); transform: translateY(-2px); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-family: var(--font-head);
  font-weight: 750;
  font-size: 1.1rem;
  line-height: 1.25;
  padding: 16px 20px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--violet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 70% no-repeat;
  border: 2px solid var(--ink);
  transition: transform .2s ease, background-color .15s ease;
}
.faq-item summary:hover::after { background-color: var(--ink); }
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-a { padding: 0 20px 18px; }
.faq-a p { margin: 0; }
@keyframes faq-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.faq-item[open] .faq-a { animation: faq-open .22s ease; }

/* ---------- simple pages ---------- */
.page-simple { padding: 56px 0 96px; }
.page-simple h1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}
.page-lead { font-size: 1.15rem; color: var(--ink-2); margin-bottom: 1.6em !important; max-width: 40em; }
.page-simple h2 { margin-top: 2.2em; font-size: clamp(1.4rem, 2.4vw, 1.8rem); }
.src-group { margin-top: 0; }
.src-list { list-style: none; margin: 0 0 1em; padding: 0; display: grid; gap: 0; }
.src-list li {
  display: grid;
  gap: 2px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.src-list li:first-child { border-top: 0; }
.src-list a { font-weight: 700; }
.src-note { color: var(--ink-2); font-size: .97rem; line-height: 1.5; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--paper-2);
  border-top: 2px solid var(--ink);
  padding: 44px 0 28px;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 28px 48px; justify-content: space-between; align-items: flex-start; }
.brand-foot { margin-bottom: 8px; }
.foot-note { margin: 0; color: var(--ink-2); font-size: .95rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.footer-nav a {
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: background-color .12s ease, border-color .12s ease;
}
.footer-nav a:hover { background: var(--lime); border-color: var(--ink); color: var(--ink); }
.foot-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.foot-bottom p { margin: 0; font-size: .92rem; color: var(--ink-2); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .take-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1060px) {
  .layout { grid-template-columns: minmax(0, 860px); gap: 0; }
  .rail { display: none; }
}
@media (max-width: 760px) {
  .take-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .take { flex-direction: row; align-items: flex-start; }
}
@media (max-width: 900px) {
  .hero { padding-top: 32px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero-art { max-width: 560px; }
  .flow { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .flow-step { flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
  .flow-num { margin-bottom: 0; }
  .flow-step:not(:last-child)::after {
    right: auto;
    left: 24px;
    top: auto;
    bottom: -19px;
    margin-top: 0;
    transform: rotate(135deg) scale(.8);
  }
  .flow-text { flex-basis: 100%; padding-left: 40px; }
}
@media (max-width: 720px) {
  body { font-size: 1.03rem; }
  .container { padding-inline: 18px; }
  .header-inner { flex-wrap: wrap; gap: 6px 10px; padding-block: 10px; }
  .brand { min-width: 0; gap: 8px; }
  .logo-mark { width: 30px; height: 30px; }
  .brand-name { font-size: .85rem; }
  .main-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .btn-cta { margin-left: auto; padding: 8px 13px; font-size: .86rem; white-space: nowrap; box-shadow: 0 3px 0 var(--ink); }
  .hero-actions .btn { width: 100%; }
  .hero-art { padding: 14px; border-radius: 28px; }
  .hero-disc { width: 64px; height: 64px; right: -10px; top: -18px; }
  .sec { padding-top: 44px; }
  .faq-item summary { font-size: 1.03rem; padding: 14px 16px; }
  .faq-a { padding: 0 16px 16px; }
}

@media (max-width: 420px) {
  .logo-mark { display: none; }
  .brand-name { font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .take, .faq-item, .faq-item summary::after { transition: none; }
  .faq-item[open] .faq-a { animation: none; }
}

@media print {
  .site-header, .rail, .progress, .hero-actions, .skip-link { display: none !important; }
  body { background: #fff; }
}
