:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --text: #2b2a27;
  --muted: #6b6760;
  --border: #e4ddd2;
  --primary: #2f5d50;
  --primary-dark: #22463c;
  --accent: #b7892b;
  --accent-soft: #f3e7cf;
  --danger: #a33a2a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(43, 42, 39, 0.06), 0 8px 24px rgba(43, 42, 39, 0.06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.6; font-size: 17px; }
img { max-width: 100%; display: block; }
a { color: var(--primary); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); font-size: .95rem; }
.prewrap { white-space: pre-wrap; }
small { color: var(--muted); }

.container { width: min(1100px, 100% - 32px); margin-inline: auto; }
.narrow { max-width: 720px; padding: 48px 0; }
.wide { padding: 32px 0; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
/* Page content sits above the bee layer (z-index 0). Light surfaces are translucent so the honeycomb shows through. */
.site-header, main, .site-footer { position: relative; z-index: 1; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.nav nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.nav nav a { text-decoration: none; color: var(--text); font-weight: 500; }
.nav nav a:hover { color: var(--primary); }

/* buttons */
.btn { display: inline-block; background: var(--primary); color: #fff; border: 2px solid var(--primary); padding: 14px 24px; border-radius: 10px; font: inherit; font-size: 1.05rem; font-weight: 600; line-height: 1.25; text-align: center; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.btn-cta { font-size: 1.15rem; padding: 16px 28px; }
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-sm { padding: 8px 16px; font-size: .95rem; }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--accent-soft); border-color: var(--primary); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #9a7222; border-color: #9a7222; }

/* hero */
.hero { padding: 64px 0 56px; }
.hero h1 { max-width: 18ch; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 46ch; margin-bottom: 1.5em; }

section { padding: 56px 0; }
section.alt { background: rgba(255, 255, 255, .5); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.narrow-col { max-width: 560px; margin-inline: auto; }
.narrow-col h2 { margin-bottom: .3em; }
.narrow-col > p { margin-bottom: 1.4em; }
.card { background: rgba(255, 255, 255, .78); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
#contact .card { background: rgba(255, 255, 255, .45); } /* lighter so the bee stays visible on its way to the hive */
.card h3 { margin-top: 0; }
.card > p:last-child { margin-bottom: 0; }

/* forms */
.form label { display: block; font-weight: 600; margin-bottom: 14px; }
.form input[type=text], .form input[type=email], .form input[type=number], .form textarea {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; font: inherit; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
.form input:focus, .form textarea:focus { outline: 3px solid rgba(47, 93, 80, .25); border-color: var(--primary); }
.form textarea { min-height: 120px; resize: vertical; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.form .check input { margin-top: 5px; }
.form-status { min-height: 1.5em; color: var(--primary); font-weight: 500; margin: 12px 0 0; }
.form-status.error { color: var(--danger); }
.form button[type=submit] { width: 100%; margin-top: 8px; }
.turnstile { margin: 8px 0; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 600; margin-bottom: 8px; }
.segmented { display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: #fff; }
.segmented label { flex: 1; margin: 0; text-align: center; font-weight: 600; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 10px; }
.segmented input:checked + span { background: var(--primary); color: #fff; }
.segmented input:focus-visible + span { outline: 3px solid rgba(47, 93, 80, .35); outline-offset: -3px; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.presets button { font: inherit; font-weight: 600; padding: 10px 0; border: 1px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; color: var(--text); }
.presets button.active, .presets button:hover { border-color: var(--primary); background: var(--primary); color: #fff; }
.amount-wrap { position: relative; }
.amount-wrap::before { content: "$"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; margin-top: 3px; }
.amount-wrap input { padding-left: 30px !important; }
#fee-preview { color: var(--muted); font-size: .95rem; margin: 4px 0 12px; min-height: 1.5em; }

/* footer */
.site-footer { background: var(--primary-dark); color: #e9e4da; padding: 40px 0; font-size: .95rem; }
.site-footer a { color: #fff; }
.site-footer p { margin-bottom: 8px; }

/* admin */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 20px 0; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.tile-value { font-family: var(--serif); font-size: 1.8rem; font-weight: 600; color: var(--primary); }
.tile-label { color: var(--muted); font-size: .9rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.actions .form-status { margin: 0; }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 36px; font-size: .95rem; }
table.data th, table.data td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
table.data th { background: #faf8f4; font-weight: 600; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.handled td { color: var(--muted); }
tr.status-failed td:nth-child(4), tr.status-past_due td:nth-child(3), tr.status-canceled td:nth-child(3) { color: var(--danger); font-weight: 600; }
tr.status-skipped td:nth-child(4) { color: var(--muted); }

/* generic pages */
.narrow h1 { margin-bottom: .6em; }
.narrow h2 { font-size: 1.4rem; margin-top: 1.6em; }

@media (max-width: 820px) {
  .hero { padding: 40px 0 36px; }
  .hero .btn-cta { display: block; width: 100%; }
  section { padding: 40px 0; }
  .card { padding: 20px 16px; }
  table.data { display: block; overflow-x: auto; }
}

/* =========================================================
   Bee layer (home page): scroll-driven bee, honeycomb that fills as you scroll, hive at the end. See public/bees.js.
   ========================================================= */
.bee-layer{position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden}
.bee-comb{position:absolute;inset:0;width:100%;height:100%}
.bee-comb .cell{fill:#F5B82E;fill-opacity:0;stroke:#C98A10;stroke-opacity:.10;stroke-width:1.5;transition:fill-opacity .7s ease}
.bee-comb .cell.on{fill-opacity:.11}

/* The hive lives on the footer's top edge (content layer), so the bee disappears behind the footer as it enters. */
.bee-hive{position:absolute;right:16px;top:-74px;width:96px;transform:scale(0);transform-origin:50% 100%;transition:transform .9s cubic-bezier(.2,.9,.25,1.15);pointer-events:none}
.bee-hive.show{transform:scale(1)}
.bee-hive svg{display:block;width:100%;height:auto}

.bee-main{position:absolute;left:0;top:0;width:60px;height:60px;will-change:transform}
.bee-main svg,.bee-mini svg{display:block;width:100%;height:100%;overflow:visible}
.bee-wing{transform-box:fill-box;transform-origin:50% 100%;animation:bee-flap .08s ease-in-out infinite alternate}
@keyframes bee-flap{from{transform:scaleY(1)}to{transform:scaleY(.3)}}

.bee-dot{position:absolute;left:0;top:0;width:6px;height:6px;margin:-3px 0 0 -3px;border-radius:50%;background:#E39B12;opacity:0}

.bee-mini{position:absolute;left:0;top:0;width:22px;height:22px;opacity:.55}
.bee-mini.a{animation:bee-driftA 19s linear infinite}
.bee-mini.b{animation:bee-driftB 26s linear infinite -9s}
.bee-mini.c{animation:bee-driftC 23s linear infinite -4s}
.bee-mini.c svg{transform:scaleX(-1)}
@keyframes bee-driftA{0%{transform:translate(-12vw,78vh)}25%{transform:translate(25vw,68vh)}50%{transform:translate(55vw,82vh)}75%{transform:translate(85vw,70vh)}100%{transform:translate(115vw,80vh)}}
@keyframes bee-driftB{0%{transform:translate(-12vw,12vh)}30%{transform:translate(30vw,20vh)}60%{transform:translate(65vw,8vh)}100%{transform:translate(115vw,16vh)}}
@keyframes bee-driftC{0%{transform:translate(112vw,45vh)}35%{transform:translate(70vw,38vh)}70%{transform:translate(30vw,52vh)}100%{transform:translate(-14vw,42vh)}}

@media (prefers-reduced-motion: reduce){
  .bee-wing,.bee-mini{animation:none}
  .bee-mini{display:none}
  .bee-comb .cell{transition:none}
}
