/* Layout concept: white editorial header over a deep-navy hero where one bright path rises out of a fan of
   simulated random walks. Left-aligned, full-bleed bands alternating white / paper / navy, hairlines instead of cards.
   Single committed light look: navy + logo blues on cool paper. */
:root {
  --navy-950: #071634;
  --navy-900: #0A1F4A;
  --navy-800: #123273;
  --blue-600: #2B5EB5;
  --blue-500: #3F7BD6;
  --blue-400: #5C9BE6;
  --sky-200: #BCD8F7;
  --paper: #F4F7FC;
  --white: #FFFFFF;
  --ink: #10203F;
  --muted: #4B5B7A;
  --line: #D7E1F0;
  --on-navy: #DCE8FA;
  --on-navy-muted: #9DB3D6;
  --font-display: 'Red Hat Display', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-600); text-underline-offset: 3px; }
a:hover { color: var(--navy-800); }
:focus-visible { outline: 3px solid var(--blue-400); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--navy-900); line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.005em; }
p { margin: 0; }
.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.skip { position: absolute; left: -999px; top: 0; background: var(--navy-900); color: #fff; padding: 10px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* Header */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--white); z-index: 60; }
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--white); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 28px; min-height: 76px; }
.brand { display: block; flex: none; }
.brand img { height: 42px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a.link { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; padding: 10px 12px; border-radius: 6px; }
.nav a.link:hover { background: var(--paper); color: var(--navy-800); }
.nav a.link[aria-current="page"] { color: var(--blue-600); font-weight: 700; }
.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: 12px; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; width: 44px; height: 44px; cursor: pointer; color: var(--navy-900); }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 20px; height: 2px; background: currentColor; position: relative; margin: auto; content: ""; }
.menu-btn span::before { position: absolute; top: -6px; left: 0; }
.menu-btn span::after { position: absolute; top: 6px; left: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 0.95rem/1 var(--font-display); padding: 14px 22px; border-radius: 8px; border: 1.5px solid transparent; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s; min-height: 46px; }
.btn-primary { background: var(--blue-500); color: #fff; }
.btn-primary:hover { background: var(--blue-600); color: #fff; }
.btn-ghost { border-color: rgba(255,255,255,.45); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-outline { border-color: var(--navy-800); color: var(--navy-800); background: transparent; }
.btn-outline:hover { background: var(--navy-800); color: #fff; }
.btn-sm { padding: 10px 16px; min-height: 40px; font-size: 0.88rem; }
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* Hero */
.hero { position: relative; background: var(--navy-900); color: var(--on-navy); overflow: hidden; isolation: isolate; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--navy-900) 0%, var(--navy-900) 34%, rgba(10,31,74,0) 72%); z-index: -1; pointer-events: none; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero-inner { padding-block: clamp(72px, 11vw, 150px) clamp(64px, 9vw, 120px); }
.hero h1 { color: #fff; max-width: 11ch; }
.hero-lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 40rem; margin-top: 28px; color: var(--on-navy); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-tag { margin-top: 56px; font: 600 0.82rem/1 var(--font-display); letter-spacing: .18em; text-transform: uppercase; color: var(--sky-200); }
.hero-caption { position: absolute; right: var(--gutter-r); bottom: 14px; font-size: .75rem; color: var(--on-navy-muted); }

.page-hero { position: relative; background: var(--navy-900); color: var(--on-navy); overflow: hidden; isolation: isolate; }
.page-hero .wrap { padding-block: clamp(56px, 8vw, 104px) clamp(48px, 7vw, 88px); }
.page-hero h1 { color: #fff; font-size: clamp(2.4rem, 5.2vw, 4rem); max-width: 18ch; }
.page-hero .lede { margin-top: 22px; max-width: 42rem; font-size: 1.18rem; color: var(--on-navy); }
.page-hero svg.deco { position: absolute; right: -40px; bottom: -30px; width: min(520px, 70vw); height: auto; z-index: -1; opacity: .5; }

/* Bands */
.band { padding-block: clamp(56px, 8vw, 104px); }
.band-white { background: var(--white); }
.band-paper { background: var(--paper); }
.band-navy { background: var(--navy-900); color: var(--on-navy); }
.band-navy h2, .band-navy h3 { color: #fff; }
.band-head { max-width: 46rem; margin-bottom: clamp(32px, 5vw, 56px); }
.band-head p { margin-top: 16px; color: var(--muted); font-size: 1.1rem; }
.band-navy .band-head p { color: var(--on-navy); }
.lead { font-size: 1.15rem; color: var(--ink); }
.prose { max-width: 42rem; }
.prose p + p { margin-top: 1.1em; }
.prose h2 { margin-top: 2.2em; margin-bottom: .6em; font-size: 1.7rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.6em; margin-bottom: .4em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.muted { color: var(--muted); }

/* Grids */
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 4vw, 56px); }
.cols-2 > *, .cols-3 > * { min-width: 0; }
.item { border-top: 1px solid var(--line); padding-top: 20px; }
.item h3 { margin-bottom: 10px; }
.item p { color: var(--muted); }
.band-navy .item { border-top-color: rgba(255,255,255,.2); }
.band-navy .item p { color: var(--on-navy); }
.pillars .item { border-top: 2px solid var(--navy-900); }

/* Exchanges */
.exchanges { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.exchanges > div { padding: 28px 24px 8px 0; min-width: 0; }
.exchanges > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.ex-code { font: 800 clamp(2.6rem, 5vw, 4rem)/1 var(--font-display); color: var(--blue-600); letter-spacing: -0.03em; }
.ex-name { margin-top: 10px; color: var(--muted); }

/* Flow (a real sequence) */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: s; list-style: none; padding: 0; margin: 0; position: relative; }
.flow li { position: relative; padding: 36px 28px 0 0; min-width: 0; }
.flow li::before { content: ""; position: absolute; left: 0; top: 8px; width: 100%; height: 2px; background: rgba(255,255,255,.22); }
.flow li::after { content: ""; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--blue-400); box-shadow: 0 0 0 5px rgba(92,155,230,.25); }
.flow li:last-child::before { width: 40%; }
.flow h3 { margin-bottom: 8px; }
.flow p { color: var(--on-navy); font-size: .98rem; }
.flow.light li::before { background: var(--line); }
.flow.light li::after { background: var(--blue-500); box-shadow: 0 0 0 5px rgba(63,123,214,.15); }
.flow.light h3 { color: var(--navy-900); }
.flow.light p { color: var(--muted); }
.flow.six { grid-template-columns: repeat(3, 1fr); row-gap: 40px; }
.flow.six li:nth-child(3n)::before { width: 40%; }

/* Architecture diagram */
.arch { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: stretch; }
.arch > div { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 18px 16px; position: relative; min-width: 0; }
.arch > div:not(:last-child)::after { content: ""; position: absolute; right: -11px; top: 50%; width: 12px; height: 2px; background: var(--blue-500); }
.arch h3 { font-size: 1.02rem; margin-bottom: 6px; }
.arch p { font-size: .9rem; color: var(--muted); line-height: 1.5; }
.arch .gate { background: var(--navy-900); border-color: var(--navy-900); }
.arch .gate h3 { color: #fff; }
.arch .gate p { color: var(--on-navy); }
.arch-foot { margin-top: 10px; background: var(--white); border: 1px dashed var(--blue-400); border-radius: 10px; padding: 14px 18px; display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; color: var(--muted); font-size: .92rem; }
.arch-foot strong { color: var(--navy-900); font-family: var(--font-display); }

/* Lists */
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 26px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .55em; width: 10px; height: 10px; background: var(--blue-500); transform: rotate(45deg) scale(.85); }
.callout { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 24px 26px; }
.callout h3 { margin-bottom: 8px; font-size: 1.1rem; }
.callout p { color: var(--muted); font-size: .98rem; }
.callout p + p { margin-top: .8em; }
.band-paper .callout { background: var(--white); }

/* Blog */
.post { max-width: 44rem; padding-block: 48px; border-top: 1px solid var(--line); scroll-margin-top: 100px; }
.post:first-of-type { border-top: 0; padding-top: 0; }
.post h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 8px; }
.meta { color: var(--muted); font-size: .92rem; margin-bottom: 20px; }
.post p + p { margin-top: 1em; }
.toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.toc a { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--navy-900); text-decoration: none; }
.toc a:hover { color: var(--blue-600); text-decoration: underline; }

/* Contact + form */
.contact-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.contact-grid > * { min-width: 0; }
.details { display: grid; gap: 22px; }
.details dt { font: 700 .85rem/1 var(--font-display); color: var(--muted); letter-spacing: .02em; margin-bottom: 6px; }
.details dd { margin: 0; font-size: 1.08rem; overflow-wrap: anywhere; }
.copy { margin-left: 8px; font: 600 .78rem/1 var(--font-display); padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--white); color: var(--navy-800); cursor: pointer; }
.copy:hover { border-color: var(--blue-500); }
form { display: grid; gap: 18px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.row > * { min-width: 0; }
label { display: block; font: 600 .92rem/1.2 var(--font-display); color: var(--navy-900); margin-bottom: 8px; }
label .opt { font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; font: 400 1rem/1.4 var(--font-body); color: var(--ink); background: var(--white); border: 1.5px solid #BFCCE2; border-radius: 8px; padding: 12px 14px; min-height: 48px; }
textarea { min-height: 130px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(92,155,230,.5); outline-offset: 0; border-color: var(--blue-500); }
.err { color: #B3261E; font-size: .88rem; margin-top: 6px; }
.result { background: var(--white); border: 1px solid var(--blue-400); border-radius: 10px; padding: 24px; display: grid; gap: 14px; }
.result pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: 400 .95rem/1.55 var(--font-body); background: var(--paper); border-radius: 8px; padding: 16px; user-select: all; }
.fine { font-size: .88rem; color: var(--muted); }

/* Footer */
.site-footer { background: var(--navy-950); color: var(--on-navy-muted); padding-block: 64px 36px; font-size: .95rem; }
.site-footer a { color: var(--on-navy); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
.foot-grid > * { min-width: 0; }
.foot-grid img { height: 44px; width: auto; margin-bottom: 18px; }
.foot-grid h4 { color: #fff; font-size: .95rem; margin-bottom: 14px; letter-spacing: 0; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.foot-legal { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.14); display: grid; gap: 12px; font-size: .84rem; line-height: 1.6; }

/* Cookie notice */
.cookie { position: fixed; left: var(--gutter-l); right: var(--gutter-r); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 70; max-width: 640px; background: var(--navy-900); color: var(--on-navy); border-radius: 12px; padding: 18px 20px; display: grid; gap: 12px; box-shadow: 0 10px 40px rgba(7,22,52,.35); }
.cookie p { font-size: .92rem; line-height: 1.5; }
.cookie a { color: var(--sky-200); }
.cookie .actions { margin-top: 0; }

@media (max-width: 1100px) {
  .menu-btn { display: block; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 12px var(--gutter-r) 20px var(--gutter-l); gap: 2px; margin: 0; display: none; }
  .nav.open { display: flex; }
  .nav a.link { padding: 14px 8px; }
  .nav-actions { margin: 10px 0 0; flex-direction: column; align-items: stretch; }
  .nav-actions .btn { width: 100%; }
  .hero::after { background: linear-gradient(180deg, rgba(10,31,74,.88) 0%, rgba(10,31,74,.7) 100%); }
  .cols-3, .cols-2, .contact-grid { grid-template-columns: 1fr; }
  .flow, .flow.six { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .flow li:nth-child(2n)::before, .flow.six li:nth-child(3n)::before { width: 100%; }
  .flow li:nth-child(2n)::before { width: 40%; }
  .arch { grid-template-columns: 1fr; }
  .arch > div:not(:last-child)::after { right: auto; left: 50%; top: auto; bottom: -11px; width: 2px; height: 12px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .exchanges { grid-template-columns: 1fr; }
  .exchanges > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .exchanges > div { padding: 22px 0; }
  .flow, .flow.six { grid-template-columns: 1fr; }
  .flow li::before, .flow li:nth-child(2n)::before, .flow.six li:nth-child(3n)::before { width: 100%; }
  .flow li:last-child::before { width: 40%; }
  .row { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .brand img { height: 36px; }
  .hero-caption { position: static; padding: 0 var(--gutter-r) 16px var(--gutter-l); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

[hidden] { display: none !important; }
