:root {
  --bg: #0b0d12;
  --bg-2: #0f1218;
  --surface: #141821;
  --surface-2: #1a1f2b;
  --border: #252b3a;
  --border-strong: #343c50;
  --text: #eceef4;
  --muted: #9aa2b5;
  --faint: #6c7489;
  --accent: #4d86ff;
  --accent-2: #7ba5ff;
  --accent-ink: #ffffff;
  --hot: #ff9248;
  --hot-bg: rgba(255, 146, 72, 0.12);
  --open: #46d39a;
  --open-bg: rgba(70, 211, 154, 0.1);
  --rolling: #b49cff;
  --rolling-bg: rgba(180, 156, 255, 0.12);
  --danger: #ff6b6b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.sr-only, .hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow .wrap { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.strong { font-weight: 700; margin: 0; }
.accent { color: var(--accent-2); }
.warn { color: var(--hot); }
.pre { white-space: pre-wrap; }
.link { color: var(--accent-2); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 13, 18, 0.82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: -0.01em; font-size: 1.08rem; }
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; color: var(--accent); }
.brand-small svg { width: 22px; height: 22px; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a:not(.btn) { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 0.94rem; display: inline-flex; align-items: center; gap: 8px; }
.site-nav a:not(.btn):hover, .site-nav a.is-active { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-account img { border-radius: 50%; }
.menu-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; width: 40px; height: 40px; font-size: 1.1rem; cursor: pointer; }

@media (max-width: 760px) {
  .menu-toggle { display: inline-block; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 8px 16px 16px; background: var(--bg-2); border-bottom: 1px solid var(--border); }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px !important; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid transparent; border-radius: 10px;
  padding: 11px 18px; font: 700 0.95rem/1 var(--sans); cursor: pointer;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover { background: #3d76f0; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-ghost.is-on { border-color: var(--accent); color: var(--accent-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(255, 107, 107, 0.35); }
.btn-danger:hover { background: rgba(255, 107, 107, 0.1); }
.btn-small { padding: 8px 12px; font-size: 0.86rem; border-radius: 8px; }
.btn-large { padding: 15px 24px; font-size: 1.02rem; border-radius: 12px; }
.btn-block { width: 100%; }
.inline-form { display: inline; margin: 0; }

/* Cards & layout */
.section { padding: 56px 0; }
.section-band { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.page-title { font-family: var(--serif); font-size: clamp(1.7rem, 3.4vw, 2.3rem); font-weight: 700; letter-spacing: -0.015em; }
.section-title { font-family: var(--serif); font-size: clamp(1.7rem, 3.6vw, 2.5rem); letter-spacing: -0.015em; }
.h3 { font-size: 1.1rem; font-weight: 700; }
.lede { color: var(--muted); font-size: 1.08rem; max-width: 60ch; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.74rem; font-weight: 700; color: var(--accent-2); margin-bottom: 14px; }
.back { display: inline-block; color: var(--muted); margin-bottom: 18px; font-weight: 600; }

/* Flash */
.flash { border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; border: 1px solid; font-weight: 600; }
.flash-success { background: var(--open-bg); border-color: rgba(70, 211, 154, 0.35); color: #9ff0cc; }
.flash-error { background: rgba(255, 107, 107, 0.08); border-color: rgba(255, 107, 107, 0.35); color: #ffb3b3; }

/* Hero */
.hero { padding: 64px 0 40px; background:
  radial-gradient(900px 400px at 85% -10%, rgba(77, 134, 255, 0.18), transparent 60%),
  radial-gradient(600px 300px at -10% 10%, rgba(180, 156, 255, 0.08), transparent 60%); }
.hero-grid > *, .schools > *, .pricing > *, .grant-card > * { min-width: 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero h1 { font-family: var(--serif); font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -0.025em; line-height: 1.04; margin-bottom: 20px; }
.hero h1 em { font-style: normal; color: var(--accent-2); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 34px; }
.hero-stats { display: flex; gap: 32px; margin: 0; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column-reverse; }
.hero-stats dt { color: var(--muted); font-size: 0.84rem; font-weight: 600; }
.hero-stats dd { margin: 0; font-family: var(--serif); font-size: 2rem; font-weight: 700; }
.hero-reel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.reel-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; margin: 2px 4px 14px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--open); box-shadow: 0 0 0 0 rgba(70, 211, 154, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(70, 211, 154, 0); } 100% { box-shadow: 0 0 0 0 rgba(70, 211, 154, 0); } }
.reel-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.reel-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); }
.reel-text { flex: 1; min-width: 0; }
.reel-title { margin: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.95rem; }
.reel-text .muted { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.reel-amount { margin: 0; font-weight: 800; }
.reel-more { display: block; text-align: center; padding: 12px 0 2px; font-weight: 700; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero { padding-top: 40px; }
}

/* Features */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 28px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--muted); margin: 0; font-size: 0.95rem; }
.feature-num { display: block; font-family: var(--serif); color: var(--accent-2); font-size: 1.1rem; margin-bottom: 10px; }
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }

/* Schools */
.schools { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.school-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.school { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.school img { border-radius: 10px; background: #fff; object-fit: contain; padding: 4px; }
.school-name { margin: 0; font-weight: 700; }
.school .muted { margin: 0; }
@media (max-width: 760px) { .schools { grid-template-columns: 1fr; } }

/* Pricing */
.pricing { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; align-items: center; }
.price-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.price-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; }
.price-card.is-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.price-card .checks { flex: 1; }
.price { font-family: var(--serif); font-size: 2.4rem; font-weight: 700; margin: 4px 0 12px; }
.price span { font-family: var(--sans); font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.checks { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; color: var(--muted); font-size: 0.95rem; }
.checks li::before { content: '✓'; color: var(--open); font-weight: 800; margin-right: 8px; }
@media (max-width: 860px) { .pricing { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .price-cards { grid-template-columns: 1fr; } }

/* FAQ */
.faq details { border-bottom: 1px solid var(--border); padding: 16px 0; max-width: 760px; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.04rem; list-style: none; display: flex; justify-content: space-between; }
.faq summary::after { content: '+'; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--muted); margin: 10px 0 0; }

/* Dashboard */
.dash { padding-top: 36px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.dash-head .page-title { font-size: clamp(1.4rem, 3vw, 1.9rem); max-width: 30ch; }
.dash-head p { margin: 0; }
.filters { position: sticky; top: 64px; z-index: 10; background: rgba(11, 13, 18, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 12px 0; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.search-field { position: relative; display: block; margin-bottom: 10px; }
.search-field svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: var(--faint); stroke-width: 2; }
.search-field input { padding-left: 42px; height: 48px; font-size: 1rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-row select { width: auto; height: 38px; padding: 0 30px 0 12px; font-size: 0.9rem; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.result-count { color: var(--faint); font-size: 0.85rem; margin: 10px 0 0; }

.grant-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.grant-card {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  transition: border-color 0.15s, background 0.15s;
}
.grant-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.grant-card.is-closed { opacity: 0.6; }
.grant-main { display: flex; gap: 14px; min-width: 0; }
.grant-text { min-width: 0; }
.grant-title { font-size: 1.02rem; font-weight: 700; margin: 0 0 2px; line-height: 1.35; }
.grant-title a { color: var(--text); }
.grant-org { color: var(--muted); margin: 0 0 8px; font-size: 0.9rem; }
.grant-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 0.74rem; font-weight: 700; color: var(--muted); background: var(--bg-2); border: 1px solid var(--border); padding: 3px 8px; border-radius: 999px; }
.tag-soft { color: var(--accent-2); border-color: rgba(77, 134, 255, 0.3); }
.tag-warn { color: var(--hot); border-color: rgba(255, 146, 72, 0.35); }
.grant-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.grant-amount { font-weight: 800; font-size: 1.05rem; margin: 0; }
.grant-actions { display: flex; gap: 6px; align-items: center; }
.grant-logo { position: relative; flex: none; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; font-weight: 800; color: var(--muted); }
.grant-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 6px; background: #fff; }
@media (max-width: 640px) {
  .grant-card { grid-template-columns: 1fr; gap: 12px; }
  .grant-side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; text-align: left; }
}

.chip { display: inline-block; font-size: 0.78rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.chip-hot { color: var(--hot); background: var(--hot-bg); }
.chip-open { color: var(--open); background: var(--open-bg); }
.chip-rolling { color: var(--rolling); background: var(--rolling-bg); }
.chip-muted { color: var(--muted); background: var(--bg-2); }
.chip-closed { color: var(--faint); background: var(--bg-2); text-decoration: line-through; }

.icon-btn { display: inline-flex; align-items: center; gap: 4px; height: 34px; min-width: 34px; padding: 0 8px; justify-content: center; background: transparent; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); cursor: pointer; font: 700 0.84rem var(--sans); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn.is-on { color: var(--accent-2); border-color: rgba(77, 134, 255, 0.5); background: rgba(77, 134, 255, 0.1); }
.icon-btn.is-on svg { fill: currentColor; }

.upsell { display: flex; justify-content: space-between; gap: 20px; align-items: center; flex-wrap: wrap; border-color: rgba(77, 134, 255, 0.4); background: linear-gradient(120deg, rgba(77, 134, 255, 0.12), var(--surface) 60%); }
.upsell h2 { font-size: 1.15rem; margin-bottom: 4px; }
.upsell p { margin: 0; }
.upsell-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.locked { position: relative; text-align: center; padding: 40px 22px; margin-top: 10px; }
.locked h2 { font-family: var(--serif); font-size: 1.6rem; }
.empty { text-align: center; padding: 40px 22px; }

/* Detail */
.detail-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.detail-head .lede { margin: 0; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin: 0 0 20px; }
.facts div { background: var(--bg-2); padding: 14px 16px; }
.facts dt { color: var(--faint); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.facts dd { margin: 4px 0 0; font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.description { font-size: 1.04rem; color: #d4d8e3; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 18px; }
.votes { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.notes textarea { min-height: 140px; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } }

/* Saved / calendar */
.calendar-card { display: grid; grid-template-columns: 1fr 1.1fr; gap: 18px; align-items: center; }
.calendar-card p { margin: 0; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-size: 0.84rem; color: var(--muted); }
.list-heading { margin: 28px 0 12px; color: var(--muted); }
@media (max-width: 760px) { .calendar-card { grid-template-columns: 1fr; } }

/* Account / unlock */
.account-card { display: flex; gap: 16px; align-items: center; }
.avatar { border-radius: 50%; }
.unlock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .unlock-grid { grid-template-columns: 1fr; } }

/* Forms */
.form { display: grid; gap: 14px; }
.form-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form-row.two { grid-template-columns: 1fr; } }
label { display: grid; gap: 6px; font-weight: 600; font-size: 0.92rem; color: #cfd3de; }
label.check { display: inline-flex; }
input, select, textarea {
  width: 100%; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 11px 13px; font: 400 0.98rem/1.4 var(--sans);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(77, 134, 255, 0.25); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 14px; }
legend { color: var(--muted); font-weight: 700; font-size: 0.85rem; padding: 0 6px; }

/* Admin */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 700; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.is-active { color: var(--text); border-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.badge { background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 0.74rem; }
.table-wrap { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th { text-align: left; color: var(--faint); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 6px; border-bottom: 1px solid var(--border); }
td { padding: 12px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
td.actions, .actions { white-space: nowrap; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.admin-search { display: flex; gap: 8px; margin-bottom: 16px; max-width: 420px; }
.message { border-bottom: 1px solid var(--border); padding: 14px 0; }
.message p { margin: 8px 0 0; color: #d4d8e3; }
.stat-list { list-style: none; padding: 0; display: grid; gap: 6px; color: var(--muted); }
.stat-list strong { color: var(--text); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; margin-top: 40px; }
.footer-row { display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; align-items: start; }
.footer-row nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-row nav a { color: var(--muted); font-weight: 600; }
.footer-row p { margin: 6px 0 0; }
.footer-row > p { grid-column: 1 / -1; }
@media (max-width: 560px) { .footer-row { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
