/* Layout: one admission ticket, stub on the right (stacks on phones), progress and a receipt-style budget below */
:root {
  --bg: #eef0f6; --paper: #ffffff; --ink: #161a2b; --muted: #5a6079; --line: #d6d9e6;
  --accent: #3b4cf5; --accent-ink: #ffffff; --stub: #ffd84d; --stub-ink: #1d1a08; --good: #12865a;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1020; --paper: #181b2f; --ink: #eceefa; --muted: #9ba1c2; --line: #2c3150;
    --accent: #7f8cff; --accent-ink: #0e1020; --stub: #f2c935; --stub-ink: #1d1a08; --good: #3ccf91;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: calc(40px + env(safe-area-inset-top, 0px)) calc(64px + env(safe-area-inset-bottom, 0px));
}
.wrap { max-width: 860px; margin: 0 auto; display: grid; gap: 28px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.ticket { display: grid; grid-template-columns: 1fr 240px; background: var(--paper); border-radius: 18px; overflow: hidden; box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(20,24,60,.35); }
.main { padding: 32px; display: grid; gap: 16px; min-width: 0; }
h1 { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 6vw, 54px); line-height: 1.02; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
h1 em { font-style: normal; color: var(--accent); }
.lede { margin: 0; color: var(--muted); max-width: 52ch; font-size: 17px; }
.stub { background: var(--stub); color: var(--stub-ink); padding: 32px 24px; display: grid; align-content: space-between; gap: 18px; position: relative; border-left: 2px dashed rgba(0,0,0,.28); }
.stub::before, .stub::after { content: ""; position: absolute; left: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); }
.stub::before { top: -12px; } .stub::after { bottom: -12px; }
.stub .eyebrow { color: inherit; opacity: .7; }
.goal { font-family: var(--display); font-weight: 800; font-size: 38px; line-height: 1; white-space: nowrap; }
.stub p { margin: 0; font-size: 14px; }
.admit { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }

h2 { font-family: var(--display); font-weight: 800; font-size: 24px; margin: 0; letter-spacing: -.01em; }
.section { display: grid; gap: 14px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; gap: 14px; }

.progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.raised { font-family: var(--display); font-weight: 800; font-size: 32px; font-variant-numeric: tabular-nums; }
.togo { font-family: var(--mono); font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .8s ease; }
.donors { font-size: 14px; color: var(--muted); margin: 0; }

form { display: grid; gap: 14px; }
.amounts { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: 600 15px var(--body); padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; min-width: 0; }
input { font: 16px var(--body); padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%; }
.btn { font: 600 16px var(--body); border-radius: 999px; padding: 13px 22px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; justify-self: start; }
.btn.ghost { background: transparent; color: var(--accent); font-size: 14px; padding: 9px 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--stub); outline-offset: 2px; }
.note { color: var(--muted); font-size: 14px; margin: 0; }
.msg { margin: 0; font-weight: 600; }
.msg.ok { color: var(--good); }

.receipt div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.receipt div:last-child { border-bottom: 0; font-weight: 600; }
.receipt span:last-child { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.receipt.panel { gap: 0; padding-block: 8px; }

.story p { margin: 0; max-width: 62ch; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; }
[hidden] { display: none !important; }

@media (max-width: 720px) {
  .ticket { grid-template-columns: 1fr; }
  .stub { border-left: 0; border-top: 2px dashed rgba(0,0,0,.28); }
  .stub::before, .stub::after { top: -13px; bottom: auto; left: auto; }
  .stub::before { left: -12px; } .stub::after { right: -12px; }
  .main { padding: 24px; }
  .fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .bar span { transition: none; } }
