:root {
  --paper: #0a0a0b;
  --paper-raised: #121114;
  --paper-soft: #1b1914;
  --ink: #f3ecda;
  --ink-soft: #b7ac8e;
  --line: rgb(212 175 55 / 14%);
  --line-strong: rgb(212 175 55 / 36%);
  --gold: #d4af37;
  --gold-deep: #a5811f;
  --gold-soft: #f0d999;
  --danger: #df756c;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; min-width: 320px; color: var(--ink); background: radial-gradient(ellipse 900px 500px at 50% -10%, rgb(212 175 55 / 8%), transparent 60%), var(--paper); font-family: Inter, sans-serif; }
button, input { font: inherit; }
button { touch-action: manipulation; }
a { color: inherit; }

.shell { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.site-header { padding-block: 36px 22px; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--gold-deep); font: 500 12px/1.3 "JetBrains Mono", monospace; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow::before { width: 8px; height: 8px; content: ""; background: var(--gold); border-radius: 1px; transform: rotate(45deg); }
.eyebrow.centered { justify-content: center; }
h1, h2 { font-family: Fraunces, Georgia, serif; }
h1 { margin: 10px 0 6px; font-size: clamp(34px, 6vw, 64px); font-weight: 600; line-height: 1.02; letter-spacing: -.02em; background: linear-gradient(110deg, var(--gold-soft), var(--gold) 45%, var(--gold-deep)); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 7s linear infinite; }
h1 em { color: var(--ink-soft); font-style: italic; font-weight: 400; -webkit-text-fill-color: var(--ink-soft); }
.subhead { max-width: 680px; margin: 0 0 22px; color: var(--ink-soft); font-size: 16px; line-height: 1.6; }

.philanthropy-note { max-width: 760px; margin: 0 0 16px; padding: 13px 16px; border: 1px solid var(--line-strong); border-left: 3px solid var(--gold); background: rgb(212 175 55 / 5%); color: var(--ink-soft); font-size: 12.5px; line-height: 1.6; }
.philanthropy-note strong { color: var(--gold-soft); }
.transparency { margin-top: 10px; }
.transparency-labels { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-soft); font: 10.5px "JetBrains Mono", monospace; }
.transparency-track { height: 6px; margin-top: 5px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper-soft); }
.transparency-fill { width: 0; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft)); transition: width .5s ease; }

.ledger-bar { display: flex; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--paper-soft); }
.ledger-cell { flex: 1 1 150px; padding: 14px 18px; border-right: 1px solid var(--line); }
.ledger-cell:last-child { border-right: 0; }
.ledger-label, .field > span, .field-label { display: block; margin-bottom: 4px; color: var(--ink-soft); font: 10.5px/1.3 "JetBrains Mono", monospace; letter-spacing: .07em; text-transform: uppercase; }
.ledger-value { display: block; font: 700 19px/1.2 "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; }
.copper { color: var(--gold); }
.teal { color: var(--gold-soft); }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 22px; padding-block: 26px 42px; }
.stage-panel, .side-panel { border: 1px solid var(--line-strong); background: var(--paper-raised); }
.stage-panel { min-width: 0; overflow: hidden; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--paper-soft); }
.toolbar-group { display: flex; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 2px; }
.tool-button { min-height: 32px; padding: 6px 11px; border: 0; border-right: 1px solid var(--line); background: var(--paper-raised); color: var(--ink-soft); font: 12px "JetBrains Mono", monospace; cursor: pointer; }
.tool-button:last-child { border-right: 0; }
.tool-button:hover, .tool-button:focus-visible { color: var(--gold-soft); background: var(--paper-soft); outline: none; }
.tool-button.active { background: var(--gold); color: #11100b; font-weight: 700; }
.icon-button { min-width: 33px; padding-inline: 9px; font-size: 18px; line-height: 1; }
.coord-readout { margin-left: auto; color: var(--ink-soft); font: 11.5px "JetBrains Mono", monospace; white-space: nowrap; }

.canvas-wrap { position: relative; height: min(640px, 68vh); min-height: 420px; overflow: hidden; background: #0d0c0e; touch-action: none; }
.canvas-wrap.is-pan { cursor: grab; }
.canvas-wrap.is-pan.is-dragging { cursor: grabbing; }
#mural-canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.canvas-wrap.is-pan #mural-canvas { cursor: inherit; }
.canvas-hint { position: absolute; right: 10px; bottom: 8px; margin: 0; padding: 5px 7px; border: 1px solid rgb(212 175 55 / 18%); background: rgb(5 5 5 / 72%); color: var(--ink-soft); font: 10px "JetBrains Mono", monospace; pointer-events: none; }

.side-panel { position: sticky; top: 20px; align-self: start; padding: 20px; }
.side-panel h2 { margin: 0 0 4px; font-size: 21px; }
.deed-sub { margin: 0 0 16px; color: var(--ink-soft); font: 11px "JetBrains Mono", monospace; letter-spacing: .04em; }
.empty-state { padding: 20px 15px; border: 1px dashed var(--line-strong); color: var(--ink-soft); font-size: 13px; line-height: 1.6; text-align: center; }
.empty-state b { color: var(--gold-soft); }
.status-banner { display: none; margin-bottom: 14px; padding: 8px 10px; border: 1px solid; font: 11.5px/1.45 "JetBrains Mono", monospace; }
.status-banner.error { display: block; border-color: #c1443a; background: rgb(193 68 58 / 12%); color: #f09a92; }
.status-banner.ok { display: block; border-color: var(--gold); background: rgb(212 175 55 / 10%); color: var(--gold-soft); }
.deed-card { margin: 0 0 16px; border-top: 1px solid var(--line); }
.deed-card div, .certificate-facts div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.deed-card dt, .certificate-facts dt { color: var(--ink-soft); }
.deed-card dd, .certificate-facts dd { margin: 0; color: var(--ink); font-weight: 700; text-align: right; }
.deed-card, .certificate-facts { font: 12px "JetBrains Mono", monospace; }
.field { display: block; margin: 13px 0; }
.field input { width: 100%; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--paper-soft); color: var(--ink); padding: 9px 10px; font-size: 13.5px; }
.field input:focus { border-color: var(--gold); outline: 2px solid rgb(212 175 55 / 30%); outline-offset: 1px; }
.file-drop { display: grid; width: 100%; min-height: 64px; place-items: center; padding: 9px; border: 1px dashed var(--line-strong); border-radius: 2px; background: var(--paper-soft); color: var(--ink-soft); cursor: pointer; font-size: 12px; line-height: 1.45; text-align: center; }
.file-drop:hover, .file-drop:focus-visible { border-color: var(--gold); color: var(--gold-soft); outline: none; }
.file-drop img { display: block; max-width: 100%; max-height: 76px; margin: 0 auto 5px; }
.register-button, .clear-button { width: 100%; border-radius: 2px; font: 700 12px "JetBrains Mono", monospace; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
.register-button { margin-top: 2px; padding: 12px; border: 0; background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: #11100b; box-shadow: 0 4px 16px rgb(212 175 55 / 20%); }
.register-button:hover { background: linear-gradient(135deg, var(--gold), var(--gold-deep)); }
.register-button:disabled { background: #3a362c; color: #817868; box-shadow: none; cursor: not-allowed; }
.clear-button { margin-top: 8px; padding: 9px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink-soft); }
.clear-button:hover { border-color: var(--danger); color: var(--danger); }
.fineprint { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; line-height: 1.6; }

.faq-section { padding-block: 6px 40px; }
.faq-section .eyebrow { margin-bottom: 12px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { display: flex; justify-content: space-between; padding: 14px 4px; color: var(--ink); cursor: pointer; font: 16px Fraunces, Georgia, serif; }
.faq-item summary::after { content: "+"; color: var(--gold); font-family: "JetBrains Mono", monospace; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { max-width: 800px; margin: 0 4px 16px; color: var(--ink-soft); font-size: 13.5px; line-height: 1.65; }
.site-footer { display: flex; justify-content: space-between; gap: 9px 18px; padding-bottom: 50px; color: var(--ink-soft); font: 11px/1.5 "JetBrains Mono", monospace; }
.site-footer a:hover { color: var(--gold-soft); }

.tooltip { position: fixed; z-index: 10; max-width: 250px; padding: 8px 10px; border: 1px solid var(--line-strong); background: #050505; color: var(--ink); font: 11px/1.45 "JetBrains Mono", monospace; pointer-events: none; }
.tooltip strong { color: var(--gold-soft); }
.modal-overlay { position: fixed; z-index: 20; inset: 0; display: none; place-items: center; padding: 20px; background: rgb(0 0 0 / 72%); }
.modal-overlay.show { display: grid; }
.certificate { width: min(100%, 480px); border: 1px solid var(--line-strong); background: var(--paper-raised); box-shadow: 0 20px 60px rgb(0 0 0 / 60%); }
.certificate-inner { margin: 10px; padding: 32px 28px; border: 1px solid var(--line-strong); background: radial-gradient(circle at 50% 0%, rgb(212 175 55 / 8%), transparent 58%); text-align: center; }
.certificate-seal { display: grid; width: 56px; height: 56px; place-items: center; margin: 16px auto 12px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font: 26px Fraunces, serif; }
.certificate h2 { margin: 0; font-size: 24px; }
.certificate-sub { margin: 5px 0 16px; color: var(--ink-soft); font: 11px "JetBrains Mono", monospace; letter-spacing: .05em; }
.certificate-name { margin: 0 0 18px; color: var(--gold-soft); font: italic 21px Fraunces, serif; }
.certificate-facts { padding-top: 12px; border-top: 1px solid var(--line); text-align: left; }
.modal-actions { display: flex; gap: 8px; padding: 10px 20px 20px; }
.modal-actions button { flex: 1; margin: 0; }

@keyframes shimmer { to { background-position: 200% center; } }
@media (max-width: 900px) { .workspace { grid-template-columns: 1fr; } .side-panel { position: static; } }
@media (max-width: 640px) { .shell { width: min(100% - 28px, 1180px); } .site-header { padding-top: 26px; } .ledger-bar { flex-wrap: wrap; } .ledger-cell { flex-basis: 50%; } .toolbar { gap: 6px; } .zoom-controls { order: 2; } .coord-readout { order: 3; width: 100%; margin-left: 0; } .canvas-wrap { height: 56vh; min-height: 350px; } .site-footer { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
@media print { body > * { visibility: hidden; } .modal-overlay, .modal-overlay * { visibility: visible; } .modal-overlay { position: fixed; display: grid; background: #fff; } .certificate { box-shadow: none; } .modal-actions { display: none; } }
