/* Phinancer — Institutional site
   Self-hosted, JS-minimal, design-system aligned. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { background: var(--bg-0); color: var(--fg-1); font-family: var(--font-ui); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 3px; }
::selection { background: rgba(212,168,83,.25); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-500); }
.muted { color: var(--fg-3); }
.gold { color: var(--gold-200); }

/* ── Status bar ─────────────────────────────────── */
.statusbar { background: var(--bg-1); border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); letter-spacing: .04em; }
.statusbar .wrap { display: flex; align-items: center; gap: 10px; padding-top: 8px; padding-bottom: 8px; }
.st-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--warning); box-shadow: 0 0 0 3px rgba(240,168,53,.15); flex-shrink: 0; }
.statusbar b { color: var(--gold-200); font-weight: 500; }

.nav a[aria-current="page"] { color: var(--gold-200); }
.lang-switch { display: flex; gap: 2px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 2px; }
.lang-btn { background: transparent; border: none; color: var(--fg-3); font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .06em; padding: 6px 9px; border-radius: var(--radius-xs); cursor: pointer; }
.lang-btn.on { background: rgba(212,168,83,.14); color: var(--gold-200); }
.mnav-lang { display: flex; gap: 6px; margin-top: 16px; }
.mnav-lang .lang-btn { border: 1px solid var(--line); padding: 8px 14px; }
[data-lang="en"] .only-pt { display: none; }
[data-lang="pt"] .only-en { display: none; }

/* ── Light theme (site-scoped token overrides) ──── */
[data-theme="light"] {
  --bg-0: #f7f6f3; --bg-1: #ffffff; --bg-2: #f1efea; --bg-3: #e8e5de;
  --fg-1: #1a1a1a; --fg-2: #3f3f46; --fg-3: #6b6b73; --fg-4: #9a9aa2;
  --line: rgba(0,0,0,.08); --line-strong: rgba(0,0,0,.14); --line-soft: rgba(0,0,0,.05);
  --line-gold: rgba(150,120,46,.4);
  --gold-200: #96782e; --gold-500: #b8943f;
}
[data-theme="light"] body { background: var(--bg-0); color: var(--fg-1); }
[data-theme="light"] .hdr { background: rgba(247,246,243,.85); }
[data-theme="light"] .statusbar b, [data-theme="light"] .gold { color: #96782e; }
.theme-btn { background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--fg-3); width: 34px; height: 34px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.theme-btn:hover { color: var(--gold-200); border-color: var(--line-gold); }
.theme-btn svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.6; fill: none; }

/* ── Header ─────────────────────────────────────── */
.hdr { position: sticky; top: 0; z-index: 50; background: rgba(7,7,11,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); overflow: visible; }
.hdr .wrap { display: flex; align-items: center; gap: 20px; height: 64px; max-width: 100%; }
.hdr-cta { white-space: nowrap; }
.brand-hero { width: 150px; }
.brand { display: flex; align-items: center; flex-shrink: 0; position: relative; height: 64px; z-index: 30; margin-left: -22px; }
.brand-hero { position: relative; display: block; width: 150px; height: 64px; overflow: visible; }
.brand-hero canvas { position: absolute; top: 50%; left: -64px; transform: translateY(-50%); width: 540px; height: auto; pointer-events: none; z-index: 30; }
.brand-lock { display: flex; flex-direction: column; line-height: 1; }
.brand .bw { font-family: var(--font-editorial); font-weight: 300; font-size: 28px; letter-spacing: -.005em; color: var(--gold-200); line-height: 1; white-space: nowrap; }
.brand .bsub { font-family: var(--font-mono); font-weight: 500; font-size: 6.75px; color: rgba(212,168,83,.85); margin-top: 5px; white-space: nowrap; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { font-size: 13.5px; color: var(--fg-2); padding: 8px 12px; border-radius: var(--radius-sm); transition: color .15s, background .15s; }
.nav a:hover { color: var(--fg-1); background: var(--bg-2); }
.hdr-cta { display: inline-flex; align-items: center; gap: 7px; background: var(--gold-500); color: #1a1100; font-weight: 600; font-size: 13.5px; padding: 9px 16px; border-radius: var(--radius-sm); transition: background .15s; }
.hdr-cta:hover { background: var(--gold-200); }
.hdr-burger { display: none; background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--fg-1); width: 38px; height: 38px; cursor: pointer; align-items: center; justify-content: center; }
.hdr-burger svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.6; fill: none; }

/* ── Hero ───────────────────────────────────────── */
.page-hero { position: relative; padding: 64px 0 36px; border-bottom: 1px solid var(--line); overflow: hidden; }
.page-hero .wrap { position: relative; z-index: 2; }
.page-hero-globe { position: absolute; top: 50%; right: -120px; transform: translateY(-50%); width: 520px; height: 520px; opacity: .42; pointer-events: none; z-index: 1; }
.page-hero-globe canvas { display: block; width: 100%; height: 100%; }
.page-hero h1 { font-family: var(--font-editorial); font-weight: 300; font-size: clamp(34px,5vw,56px); line-height: 1.04; letter-spacing: -.02em; margin: 16px 0 0; max-width: 18ch; }
.page-hero h1 em { font-style: italic; color: var(--gold-200); }
.page-hero .lede { font-size: 18px; color: var(--fg-2); max-width: 62ch; margin-top: 20px; line-height: 1.65; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.prose { max-width: 70ch; }
.prose h3 { font-size: 18px; font-weight: 600; margin: 28px 0 8px; }
.prose p { color: var(--fg-2); margin-bottom: 14px; }
.prose ul { color: var(--fg-2); padding-left: 20px; margin-bottom: 14px; }
.prose li { padding: 3px 0; }
.post-meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--fg-4); text-transform: uppercase; }
.post-title { font-family: var(--font-editorial); font-weight: 300; font-size: clamp(30px,4.5vw,46px); line-height: 1.06; letter-spacing: -.02em; margin-top: 10px; }
.code-tabs { display: flex; align-items: center; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; min-height: 44px; }
.code-tab, .copy-btn { background: transparent; border: 0; color: var(--fg-4); font: inherit; padding: 12px 16px; cursor: pointer; }
.code-tab.on { color: var(--gold-200); box-shadow: inset 0 -2px 0 var(--gold-500); }
.copy-btn { margin-left: auto; border-left: 1px solid var(--line); color: var(--gold-200); }
.code-panel { display: none; margin: 0; min-height: 210px; padding: 20px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.8; color: var(--fg-2); overflow-x: auto; white-space: pre; }
.code-panel.on { display: block; }
.cform { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cform label { font-size: 12px; color: var(--fg-3); margin-top: 8px; }
.finput { background: var(--bg-0); border: 1px solid var(--line); color: var(--fg-1); border-radius: var(--radius-sm); padding: 10px 12px; font-family: var(--font-ui); font-size: 14px; }
.finput:focus { outline: none; border-color: var(--gold-500); }
.finput[aria-invalid="true"] { border-color: var(--danger); }
.fcheck { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-2); margin-top: 12px; }
.cform .btn { margin-top: 16px; align-self: flex-start; }
.cform .btn[disabled] { opacity: .55; cursor: wait; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 20px; margin-top: 10px; font-size: 13px; color: var(--fg-3); }
.form-status.ok { color: var(--success); }
.form-status.err { color: var(--danger); }

/* ── Hero ───────────────────────────────────────── */
.hero { position: relative; padding: 96px 0 80px; overflow: hidden; }
.hero-globe { position: absolute; top: 50%; right: -120px; transform: translateY(-50%); width: 620px; height: 620px; opacity: .68; pointer-events: none; }
.hero-globe canvas { display: block; width: 100%; height: 100%; }
.hero::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 60% 80% at 80% 50%, rgba(212,168,83,.07), transparent 70%); pointer-events: none; }
.hero .wrap { position: relative; z-index: 2; }
.hero h1 { font-family: var(--font-editorial); font-weight: 300; font-size: clamp(40px, 6vw, 76px); line-height: 1.02; letter-spacing: -.02em; max-width: 16ch; margin: 22px 0 0; }
.hero h1 em { font-style: italic; color: var(--gold-200); }
.hero .lede { font-size: 18px; color: var(--fg-2); max-width: 56ch; margin-top: 24px; line-height: 1.65; }
.hero .status-line { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-3); margin-top: 22px; max-width: 60ch; line-height: 1.7; border-left: 2px solid var(--gold-700); padding-left: 14px; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; padding: 12px 22px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; transition: all .15s; }
.btn-primary { background: var(--gold-500); color: #1a1100; }
.btn-primary:hover { background: var(--gold-200); }
.btn-secondary { background: transparent; border-color: var(--line-strong); color: var(--fg-1); }
.btn-secondary:hover { border-color: var(--gold-500); color: var(--gold-200); }
.btn-ghost { background: transparent; color: var(--fg-2); }
.btn-ghost:hover { color: var(--gold-200); }

/* ── Section scaffolding ────────────────────────── */
section { position: relative; }
.sec { padding: 80px 0; border-top: 1px solid var(--line); }
.sec-head { max-width: 64ch; margin-bottom: 44px; }
.sec-head h2 { font-family: var(--font-editorial); font-weight: 300; font-size: clamp(30px, 4vw, 44px); line-height: 1.08; letter-spacing: -.015em; margin: 14px 0 0; }
.sec-head h2 em { font-style: italic; color: var(--gold-200); }
.sec-head p { color: var(--fg-2); font-size: 17px; margin-top: 16px; }

/* ── Cards / grids ──────────────────────────────── */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 26px; transition: border-color .15s, transform .15s; }
.card.hov:hover { border-color: var(--line-gold); transform: translateY(-2px); }
.card h3 { font-family: var(--font-ui); font-weight: 600; font-size: 18px; letter-spacing: -.01em; margin-bottom: 8px; }
.card p { color: var(--fg-3); font-size: 14.5px; line-height: 1.6; }
.card .ico { width: 26px; height: 26px; stroke: var(--gold-500); stroke-width: 1.5; fill: none; margin-bottom: 14px; }
.card .num { font-family: var(--font-mono); font-size: 11px; color: var(--gold-500); opacity: .6; }
.card-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 13px; color: var(--gold-200); font-weight: 500; }
.card-link svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; fill: none; }

/* ── Pillars row ────────────────────────────────── */
.pillars { display: flex; flex-wrap: wrap; gap: 10px; }
.pillar { display: flex; align-items: center; gap: 9px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 9px 16px; font-size: 13.5px; color: var(--fg-2); }
.pillar .d { width: 6px; height: 6px; border-radius: 999px; background: var(--gold-500); }

/* ── Audience table ─────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-4); font-weight: 500; padding: 0 16px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 15px 16px; border-bottom: 1px solid var(--line); color: var(--fg-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl td .strong { color: var(--fg-1); font-weight: 600; }
.tbl td.r { text-align: right; }
.tbl .mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--gold-200); }
.tbl-link { color: var(--gold-200); font-weight: 500; }
.tbl-card { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-xl); overflow: hidden; padding: 8px 10px; }

/* ── Compare CEX/DEX/Phinancer ─────────────────── */
.cmp { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-xl); overflow: hidden; }
.cmp table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp th, .cmp td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); }
.cmp th { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-4); font-weight: 500; }
.cmp th.ph, .cmp td.ph { background: rgba(212,168,83,.05); color: var(--gold-200); }
.cmp td { color: var(--fg-3); }
.cmp tr:last-child td { border-bottom: none; }

/* ── HDEX supply ────────────────────────────────── */
.supply { display: grid; grid-template-columns: 280px 1fr; gap: 40px; align-items: center; }
.donut { position: relative; width: 240px; height: 240px; margin: 0 auto; }
.donut .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut .center .v { font-family: var(--font-mono); font-size: 26px; font-weight: 500; color: var(--gold-200); }
.donut .center .l { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-4); margin-top: 2px; }
.legend { display: flex; flex-direction: column; gap: 4px; }
.legend .row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend .nm { flex: 1; font-size: 14.5px; color: var(--fg-2); }
.legend .pc { font-family: var(--font-mono); font-size: 14px; color: var(--fg-1); font-weight: 500; }

/* ── Claims matrix ──────────────────────────────── */
.claim-badge { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em; padding: 4px 9px; border-radius: var(--radius-xs); white-space: nowrap; }
.cb-gated { background: var(--warning-soft); color: var(--warning); }
.cb-no { background: var(--danger-soft); color: var(--danger); }

/* ── Roadmap timeline ───────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-row { display: grid; grid-template-columns: 130px 1fr; gap: 24px; padding: 20px 0; border-top: 1px solid var(--line); position: relative; }
.tl-row:first-child { border-top: none; }
.tl-phase { font-family: var(--font-mono); font-size: 13px; color: var(--gold-200); font-weight: 500; }
.tl-sub { font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-4); margin-top: 3px; }
.tl-body h4 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.tl-body p { color: var(--fg-3); font-size: 14px; }
.badge { display: inline-block; font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; padding: 3px 8px; border-radius: var(--radius-xs); margin-left: 8px; vertical-align: middle; }
.bg-done { background: var(--success-soft); color: var(--success); }
.bg-active { background: rgba(212,168,83,.14); color: var(--gold-200); }
.bg-gated { background: var(--warning-soft); color: var(--warning); }
.bg-future { background: var(--bg-3); color: var(--fg-3); }

/* ── Disclaimer block ───────────────────────────── */
.disc { background: var(--bg-1); border: 1px solid var(--line); border-left: 2px solid var(--gold-700); border-radius: var(--radius-md); padding: 16px 20px; font-size: 13px; color: var(--fg-3); line-height: 1.6; }

/* ── Footer ─────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); background: var(--bg-1); padding: 56px 0 32px; margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr repeat(5, 1fr); gap: 32px; }
.foot-brand .bw { font-family: var(--font-editorial); font-weight: 300; font-size: 24px; color: var(--gold-200); }
.foot-brand p { font-size: 13px; color: var(--fg-3); margin-top: 12px; max-width: 30ch; line-height: 1.6; }
.foot-col h5 { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-4); margin-bottom: 14px; }
.foot-col a { display: block; font-size: 13.5px; color: var(--fg-2); padding: 5px 0; transition: color .12s; }
.foot-col a:hover { color: var(--gold-200); }
.foot-disc { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.foot-disc p { font-size: 12px; color: var(--fg-4); line-height: 1.6; max-width: 100ch; }
.foot-base { margin-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--fg-4); font-family: var(--font-mono); }

/* ── Mobile ─────────────────────────────────────── */
.mnav { display: none; }
@media (max-width: 1040px) {
  .nav, .hdr-cta, .lang-switch { display: none; }
  .hdr-burger { display: flex; margin-left: auto; }
  .mnav { display: none; position: fixed; inset: 64px 0 0; z-index: 49; background: var(--bg-0); padding: 24px 28px; flex-direction: column; gap: 4px; overflow-y: auto; }
  .mnav.open { display: flex; }
  .mnav a { font-size: 16px; color: var(--fg-1); padding: 14px 0; border-bottom: 1px solid var(--line); }
  .supply { grid-template-columns: 1fr; gap: 28px; }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .foot-brand { grid-column: 1 / -1; }
  .hero-globe { opacity: .48; right: -180px; }
  .page-hero-globe { opacity: .3; right: -220px; }
}
@media (max-width: 560px) {
  .g2, .g4 { grid-template-columns: 1fr; }
  .tl-row { grid-template-columns: 1fr; gap: 8px; }
  .foot-grid { grid-template-columns: 1fr; }
  .cmp { overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
