/* Hallmark · macrostructure: Workbench (radial explorer + reading panel) · tone: soft editorial · anchor hue: blue #1088f2 (owner brand)
 * nav: N3 side-rail (drawer + bottom dock on phones) · footer: none (rail foot carries the note and icons) · studied: yes · DNA-source: Department of Emotions (Awwwards Nominee)
 */
@font-face { font-family: "Gilda Display"; src: url("/assets/fonts/gilda-display.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --blue: #1088f2;
  --blue-deep: #0b5fb0;
  --cream: #f7f4ec;
  --page: #f9f9f3;
  --ink: #22302a;
  --muted: #5d6862;
  --hair: #e3e2d9;
  --card: #fffefa;
  --c-climate: #bfe3b4; --c-children: #ffd6a5; --c-education: #fbe9a0; --c-health: #f9c2cf;
  --c-animals: #d9cdf6; --c-disaster: #ffc6b3; --c-open-internet: #bfe3ee;
  --d-climate: #8fcb80; --d-children: #ffbd70; --d-education: #f3d75e; --d-health: #f29bb0;
  --d-animals: #b9a6ef; --d-disaster: #ff9f80; --d-open-internet: #8fcfe0;
  --serif: "Gilda Display", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Calibri, Carlito, "Helvetica Neue", Arial, sans-serif;
  --rail: 248px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow-x: clip; }
body { background: var(--page); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--ink); color: var(--cream); padding: 8px 16px; border-radius: 8px; }
.skip:focus { left: 8px; }

.shell { display: grid; grid-template-columns: var(--rail) 1fr; height: 100vh; height: 100dvh; }

/* ---------- the blue rail ---------- */
.rail { background: var(--blue); color: var(--cream); display: flex; flex-direction: column; padding: 28px 20px 24px; position: relative; z-index: 5; }
.rail :focus-visible { outline-color: var(--cream); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 0 8px; }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; display: block; }
.brand-word { font: 400 34px/1 var(--serif); letter-spacing: -0.8px; }
.rail-line { margin: 20px 8px 28px; font-size: 15px; line-height: 1.45; color: rgba(247, 244, 236, .86); max-width: 190px; }
.rail-nav { position: relative; display: flex; flex-direction: column; gap: 2px; }
.rail-nav a { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: 10px; text-decoration: none; font-size: 15px; color: rgba(247, 244, 236, .82); transition: color .18s ease-out, background-color .18s ease-out; }
.rail-nav a:hover { color: var(--cream); background: rgba(247, 244, 236, .08); }
.rail-nav a[aria-current="page"] { color: var(--blue-deep); font-weight: 600; }
.rail-nav svg, .dock svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.rail-marker { position: absolute; left: 0; right: 0; top: 0; height: 42px; border-radius: 10px; background: var(--cream); z-index: 0; transform: translateY(0); opacity: 0; transition: transform .45s var(--ease), opacity .2s; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cream); margin-left: auto; animation: breathe 2.4s ease-in-out infinite; }
.rail-nav a[aria-current="page"] .live-dot { background: var(--blue); }
@keyframes breathe { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
.rail-foot { margin-top: auto; padding: 0 8px; }
.rail-note { font-size: 13px; line-height: 1.5; color: rgba(247, 244, 236, .8); margin: 0 0 16px; }
.rail-icons { display: flex; gap: 8px; }
.ico { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid rgba(247, 244, 236, .35); color: var(--cream); transition: background-color .18s ease-out; }
.ico:hover { background: rgba(247, 244, 236, .12); }
.ico svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- top bar ---------- */
.main { display: grid; grid-template-rows: auto 1fr; min-width: 0; height: 100vh; height: 100dvh; }
.top { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 20px clamp(20px, 3vw, 48px) 0; position: relative; z-index: 4; }
.menu { display: none; }
.top-tools { display: flex; align-items: center; gap: 12px; }
.ca { border: 1px solid var(--hair); background: var(--card); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ca span { color: var(--ink); margin-left: 4px; }
.ca[data-minted="1"] span { font-variant-numeric: tabular-nums; }
.buy { text-decoration: none; border-radius: 10px; padding: 8px 16px; font-size: 14px; font-weight: 600; border: 1px solid var(--ink); color: var(--ink); white-space: nowrap; }
.buy[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.ico-top { color: var(--ink); border-color: var(--hair); background: var(--card); }
.ico-top:hover { background: #f1f0e8; }
.phantom { display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--blue); color: var(--cream); padding: 8px 16px 8px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background-color .18s ease-out; }
.phantom:hover { background: var(--blue-deep); }
.phantom svg { width: 20px; height: 20px; fill: var(--cream); }

/* ---------- stage: wheel + panel ---------- */
.stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); gap: clamp(24px, 4vw, 80px); min-height: 0; padding-right: clamp(24px, 6vw, 120px); }
.wheel-wrap { position: relative; min-width: 0; overflow: hidden; }
.wheel { position: absolute; height: 128%; aspect-ratio: 1; top: 50%; right: 4%; transform: translateY(-50%); overflow: visible; }
.wheel-empty { position: absolute; left: 10%; top: 45%; max-width: 280px; color: var(--muted); }
.ring-g { transform-origin: 0 0; }
.sector { cursor: pointer; transition: opacity .18s ease-out; }
.sector path { stroke: var(--page); stroke-width: 2; transition: fill .3s ease-out; }
.sector text { fill: var(--ink); font: 400 21px var(--sans); pointer-events: none; }
.sector.cause text { font-size: 24px; font-weight: 600; }
.wheel.has-path .sector:not(.on) { opacity: .34; }
.wheel .sector:hover, .wheel .sector:focus-visible { opacity: 1; }
.sector:focus { outline: none; }
.sector:focus-visible path { stroke: var(--blue); stroke-width: 4; }
.sector .pick { fill: none; stroke: var(--card); stroke-width: 5; stroke-dasharray: 2000; stroke-dashoffset: 2000; transition: stroke-dashoffset .8s var(--ease); }
.sector.picked .pick { stroke-dashoffset: 0; }
.sector.pulse path:first-child { animation: pulse 1.6s ease-out 2; }
@keyframes pulse { 40% { fill: var(--card); } }
.hub-ring { fill: var(--page); }
.wheel-in .sector { animation: ringIn .7s var(--ease) both; }
@keyframes ringIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }

.panel { overflow-y: auto; padding: clamp(28px, 6vh, 72px) 4px 60px; scrollbar-width: thin; outline: none; }
.panel > * { max-width: 440px; }
.panel h1 { font: 400 clamp(36px, 3.2vw, 46px)/1.08 var(--serif); letter-spacing: -0.6px; margin: 0 0 16px; text-wrap: balance; overflow-wrap: normal; word-break: keep-all; hyphens: none; }
.panel .lead { font-size: 18px; line-height: 1.55; margin: 0 0 32px; letter-spacing: -0.2px; }
.trail { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 0 0 20px; flex-wrap: wrap; }
.trail a { text-decoration: none; }
.trail a:hover { text-decoration: underline; }
.trail .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.trail b { color: var(--ink); font-weight: 600; }
.block { border-top: 1px solid var(--hair); padding: 20px 0 24px; }
.block h2 { font: 600 14px/1.3 var(--sans); color: var(--muted); margin: 0 0 16px; letter-spacing: 0; }
.figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fig strong { display: block; font: 400 30px/1.1 var(--serif); letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
.fig span { font-size: 13px; color: var(--muted); }
.note { font-size: 14px; color: var(--muted); margin: 12px 0 0; line-height: 1.5; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--hair); font-size: 15px; }
.rows li:last-child { border-bottom: 0; }
.rows .sub { grid-column: 1 / -1; font-size: 13px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.rows .amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.rows a { text-decoration-color: var(--hair); text-underline-offset: 3px; }
.rows a:hover { text-decoration-color: currentColor; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--blue-deep); }
.tag img { width: 14px; height: 14px; border-radius: 4px; }
.row-in { animation: rowIn .6s var(--ease) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(10px); } }
.empty { color: var(--muted); font-size: 15px; margin: 0; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { border-bottom: 1px solid var(--hair); }
.link-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; text-decoration: none; }
.link-list a:hover .nm { text-decoration: underline; text-underline-offset: 3px; }
.link-list .nm { display: flex; align-items: center; gap: 12px; }
.link-list .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.link-list .meta { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* give form */
.amounts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.amounts button { border: 1px solid var(--hair); background: var(--card); padding: 8px 16px; border-radius: 10px; cursor: pointer; font-variant-numeric: tabular-nums; transition: border-color .18s, background-color .18s; }
.amounts button[aria-pressed="true"] { border-color: var(--blue); background: #e8f3fe; color: var(--blue-deep); font-weight: 600; }
.amount-field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--hair); background: var(--card); border-radius: 10px; padding: 0 12px; margin-bottom: 16px; }
.amount-field input { border: 0; outline: 0; background: none; font: 400 22px var(--serif); width: 100%; padding: 12px 0; color: var(--ink); }
.amount-field:focus-within { border-color: var(--blue); }
.amount-field span { color: var(--muted); font-size: 14px; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 0; border-radius: 12px; padding: 16px 20px; background: var(--blue); color: var(--cream); font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background-color .18s ease-out, transform .18s ease-out; }
.primary:hover { background: var(--blue-deep); }
.primary:active { transform: scale(.985); }
.primary[disabled] { opacity: .5; cursor: progress; }
.ghost { display: inline-flex; align-items: center; justify-content: center; width: 100%; border: 1px solid var(--ink); border-radius: 12px; padding: 12px 20px; background: none; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; margin-top: 12px; }
.review { margin-top: 16px; border: 1px solid var(--hair); background: var(--card); border-radius: 14px; padding: 16px; }
.review dl { margin: 0 0 12px; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.review dt { color: var(--muted); }
.review dd { margin: 0; min-width: 0; }
.addr { font: 500 13px/1.45 ui-monospace, "Cascadia Mono", Consolas, monospace; word-break: break-all; color: var(--ink); }
.sim-ok { color: #2f7a43; }
.sim-bad { color: #b3412b; }
.done { text-align: left; }
.done .primary { margin-top: 12px; }

/* receipt */
.receipt { width: 100%; aspect-ratio: 1200 / 675; background: var(--blue); color: var(--cream); border-radius: 14px; position: relative; overflow: hidden; container-type: inline-size; margin-bottom: 16px; }
.receipt img { position: absolute; right: 5%; top: 50%; width: 36%; transform: translateY(-50%); border-radius: 8%; }
.receipt .r-in { position: absolute; left: 6%; top: 10%; bottom: 10%; width: 56%; display: flex; flex-direction: column; }
.receipt .r-word { font: 400 5.4cqw/1 var(--serif); }
.receipt .r-amt { font: 400 10cqw/1 var(--serif); margin-top: auto; letter-spacing: -0.2cqw; }
.receipt .r-to { font-size: 3.2cqw; line-height: 1.25; margin-top: 2cqw; }
.receipt .r-meta { font-size: 2cqw; opacity: .85; margin-top: 2.4cqw; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: var(--cream); padding: 12px 16px; border-radius: 10px; font-size: 14px; z-index: 60; max-width: calc(100vw - 32px); }
.dock { display: none; }

/* ---------- laptops ---------- */
@media (max-width: 1180px) {
  :root { --rail: 220px; }
  .stage { grid-template-columns: minmax(0, 1fr) minmax(330px, 400px); padding-right: 28px; }
  .top-tools .ico-top { display: none; }
}

/* ---------- phones and small tablets: wheel on top, panel below, rail becomes a drawer + dock ---------- */
@media (max-width: 860px) {
  body { overflow: auto; }
  .shell { display: block; height: auto; }
  .rail { position: fixed; inset: 0 auto 0 0; width: min(300px, 84vw); transform: translateX(-102%); transition: transform .4s var(--ease); box-shadow: none; }
  body.drawer-open .rail { transform: none; }
  body.drawer-open::after { content: ""; position: fixed; inset: 0; background: rgba(34, 48, 42, .35); z-index: 4; }
  .main { display: block; height: auto; }
  .top { justify-content: space-between; padding: 12px 16px; position: sticky; top: 0; background: var(--page); border-bottom: 1px solid var(--hair); }
  .menu { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; cursor: pointer; }
  .menu img { border-radius: 9px; }
  .menu span { font: 400 26px/1 var(--serif); }
  .top-tools { gap: 8px; }
  .buy, .ico-top { display: none; }
  .ca { padding: 8px 12px; font-size: 12.5px; }
  .phantom { padding: 8px 12px 8px 8px; font-size: 13px; }
  .stage { display: block; padding: 0 0 92px; }
  .wheel-wrap { height: min(92vw, 520px); }
  .wheel { height: auto; width: 150%; right: auto; left: 50%; top: -20%; transform: translateX(-50%); }
  .panel { overflow: visible; padding: 24px 20px 24px; }
  .panel > * { max-width: none; }
  .dock { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--blue); padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); }
  .dock a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; font-size: 11px; text-decoration: none; color: rgba(247, 244, 236, .8); border-radius: 10px; }
  .dock a[aria-current="page"] { color: var(--blue-deep); background: var(--cream); font-weight: 600; }
  .dock :focus-visible { outline-color: var(--cream); }
}
@media (max-width: 380px) { .ca { display: none; } }

/* ---------- big screens ---------- */
@media (min-width: 1800px) {
  :root { --rail: 280px; }
  .stage { grid-template-columns: minmax(0, 1fr) 520px; padding-right: clamp(80px, 8vw, 220px); }
  .panel > * { max-width: 520px; }
  .panel h1 { font-size: 56px; }
  .panel .lead { font-size: 20px; }
}
@media (min-width: 2400px) {
  :root { --rail: 330px; }
  body { font-size: 18px; }
  .stage { grid-template-columns: minmax(0, 1fr) 640px; }
  .panel > * { max-width: 640px; }
  .panel h1 { font-size: 68px; }
  .rail-nav a { font-size: 17px; padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* scroll reveal: panel rows below the fold ease up as they come into view */
.block > .later { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.block > .later.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .block > .later { opacity: 1; transform: none; transition: none; } }

/* phones: the Phantom button goes icon-only (its label stays for screen readers) so the header fits 390px */
@media (max-width: 520px) {
  .phantom { padding: 8px; }
  .phantom #walletText { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .menu span { font-size: 22px; }
  .top { padding-left: 16px; padding-right: 16px; gap: 12px; }
}
@media (max-width: 520px) {
  .fig strong { white-space: nowrap; font-size: clamp(20px, 6.2vw, 30px); }
  .figs { gap: 8px; }
}

/* disabled states for every button-like control */
button:disabled, .primary[aria-disabled="true"], .ghost:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.amounts button:active, .ghost:active, .phantom:active, .ca:active { transform: scale(.985); }
.wheel .hub { fill: var(--blue); }
