:root {
  --bg: #14110f;
  --bg-panel: #1c1815;
  --bg-panel-2: #241f1b;
  --border: #3a322a;
  --text: #ece4d6;
  --text-dim: #b3a794;
  --text-faint: #7d7263;
  --accent: #c98a3a;
  --accent-2: #8a6b3a;
  --good: #6fa878;
  --warn: #cf8b4a;
  --bad: #c2604f;
  --link: #d9a85c;
  --radius: 10px;
  --shadow: 0 4px 18px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  background: radial-gradient(ellipse at top, #211c17 0%, var(--bg) 60%);
  color: var(--text);
  line-height: 1.5;
  /* Stops the browser's native pull-to-refresh/bounce-navigation from hijacking down
     swipes at the top of the page -- normal in-page scrolling is untouched. Needed for
     Chipper Mode's swipe code (chipper-mode.js) to ever see a completed downward swipe. */
  overscroll-behavior-y: contain;
}

a { color: var(--link); }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 18px 80px;
}

header.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

header.top .brand h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.03em;
  color: var(--accent);
}
header.top .brand p {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

nav.top-links {
  display: flex;
  gap: 14px;
  font-size: 0.92rem;
  flex-wrap: wrap;
}
nav.top-links a {
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
}
nav.top-links a:hover { color: var(--accent); border-color: var(--accent-2); }

#account-status {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  font-size: 0.85rem;
  margin: -12px 0 20px;
}
.account-pill {
  color: var(--good);
  background: rgba(111,168,120,0.08);
  border: 1px solid rgba(111,168,120,0.25);
  border-radius: 999px;
  padding: 4px 12px;
}

h2.section-title {
  color: var(--accent);
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin: 34px 0 14px;
}

.intro {
  color: var(--text-dim);
  font-size: 0.96rem;
  margin-bottom: 4px;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.item-card { display: flex; flex-direction: column; gap: 8px; }
.item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.item-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.item-name.fulfilled { text-decoration: line-through; color: var(--text-faint); }
.item-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  white-space: pre-line;
}
.item-status {
  font-size: 0.85rem;
  color: var(--warn);
}
.item-status.fulfilled { color: var(--good); }
.thankyou {
  font-size: 0.85rem;
  color: var(--good);
  background: rgba(111,168,120,0.08);
  border: 1px solid rgba(111,168,120,0.25);
  border-radius: 6px;
  padding: 6px 10px;
}

button, .btn {
  font-family: inherit;
  background: var(--accent);
  color: #201808;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease;
}
button:hover, .btn:hover { filter: brightness(1.1); }
button.secondary, .btn.secondary {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
button.danger { background: var(--bad); color: #200; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.small { padding: 5px 10px; font-size: 0.8rem; }

input, select, textarea {
  font-family: inherit;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.92rem;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

label.field {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.field-group { margin-bottom: 12px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; color: var(--text); font-size: 0.9rem; }

.pill {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-faint);
}
.pill.pending { color: var(--warn); border-color: var(--warn); }
.pill.approved { color: var(--good); border-color: var(--good); }
.pill.denied { color: var(--bad); border-color: var(--bad); }

.sticky-cart {
  position: sticky;
  bottom: 0;
  background: var(--bg-panel);
  border: 1px solid var(--accent-2);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.notice {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.notice.error { background: rgba(194,96,79,0.12); border: 1px solid var(--bad); color: #f0c9c1; }
.notice.success { background: rgba(111,168,120,0.12); border: 1px solid var(--good); color: #d3ecd7; }
.notice.info { background: rgba(201,138,58,0.1); border: 1px solid var(--accent-2); color: var(--text); }

.hidden { display: none !important; }

.step-indicator {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  font-size: 0.8rem;
  color: var(--text-faint);
}
.step-indicator .step.active { color: var(--accent); font-weight: 600; }

.detail-block {
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  margin-top: 10px;
}

.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.tabs button.active { background: var(--accent); color: #201808; border-color: var(--accent); }

footer.foot {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.8rem;
  margin-top: 50px;
}
footer.foot a { color: var(--text-faint); }

.donor-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--bg-panel);
}
.donor-block summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
}

.add-row, .qty-form {
  margin-top: 8px;
}
.change-form { border-top: 1px dashed var(--border); padding-top: 10px; }

.progress-track {
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin: 6px 0;
}
.progress-fill { height: 100%; background: var(--accent); }
.progress-fill.fulfilled { background: var(--good); }
.progress-line {
  font-size: 0.88rem;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.qty-badge { font-weight: 700; font-size: 1.05rem; color: var(--text); }

.cat-pill.volunteer { border-color: #6f9bd6; color: #9dbfe8; }
.cat-pill.material { border-color: var(--accent-2); color: var(--accent); }
.cat-pill.donation { border-color: var(--good); color: var(--good); }

.contrib-row {
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.contrib-row .row { margin-top: 8px; }
.contrib-row .field-group { margin-bottom: 8px; }

/* ---------- landing page hero ---------- */
.hero {
  text-align: center;
  padding: 36px 0 12px;
}

/* Sized to the source PNG's aspect ratio so the wrapper holds its shape before the
   image finishes loading. Sized big and stays put at rest (no shift) — the shrink
   only happens at the very end, in place, once the drawing is done (see
   erebe-art-settle below). The source PNG is cropped tight to its visible line-work
   (see assets/elevation-view-white.png) — it used to carry ~15% transparent padding
   above the art and ~22% below, which left a dead blank strip in the box even once
   the reveal had finished (issue #15 reopened). */
.hero-art-wrap {
  position: relative;
  max-width: 460px;
  width: 92%;
  margin: 0 auto;
  aspect-ratio: 736 / 878;
  filter: drop-shadow(0 0 18px rgba(201, 138, 58, 0.28));
  transform-origin: center center;
}
/* Once the spires finish drawing (slices run 6.6s, last one starts at 1.08s, so all
   are done by 7.68s), shrink a bit and fade to semi-transparent in place — scaling
   from the center so nothing shifts downward — while .hero-text fades in on the same
   schedule and overlaps it. */
.hero-art-wrap.play {
  animation: erebe-art-settle 1.3s ease forwards;
  animation-delay: 7.8s;
}
@keyframes erebe-art-settle {
  to { transform: scale(0.88); opacity: 0.45; }
}

/* 7 stacked copies of the same artwork, each clipped to one vertical slice (--l/--r,
   set inline per element) so it looks like each spire rises on its own, rather than
   one uniform wipe across the whole image. Each slice reveals bottom-up. Hidden by
   default; hero-reveal.js adds .play once the hero actually scrolls into view, so
   the reveal isn't already finished off-screen by the time someone gets to it. */
.hero-art-slice {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  clip-path: inset(100% var(--r) 0 var(--l));
}
.hero-art-wrap.play .hero-art-slice {
  animation: erebe-spire-rise 6.6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
@keyframes erebe-spire-rise {
  to { clip-path: inset(0 var(--r) 0 var(--l)); }
}

/* Transforms (the settle shrink on .hero-art-wrap) don't affect layout flow, so this
   negative margin is sized against the art's own resting (unscaled) box to pull the
   text up into the space the art vacates once it shrinks — giving a real overlap with
   the settled, semi-transparent art rather than just closing the gap below it. */
.hero-text {
  opacity: 0;
  position: relative;
  z-index: 1;
  margin-top: -60px;
}
.hero-art-wrap.play ~ .hero-text {
  animation: erebe-fade-in 1.3s ease forwards;
  animation-delay: 7.8s;
}
@keyframes erebe-fade-in {
  to { opacity: 1; }
}
.hero-text h1 {
  font-size: 2.4rem;
  letter-spacing: 0.08em;
  color: var(--text);
  margin: 10px 0 4px;
}
.hero-text .tagline {
  color: var(--accent);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  margin: 0 0 4px;
}
.hero-text .subtagline {
  color: var(--text-faint);
  font-size: 0.88rem;
  margin: 0;
}
@media (prefers-reduced-motion: reduce) {
  .hero-art-slice,
  .hero-art-wrap.play .hero-art-slice {
    clip-path: inset(0 var(--r) 0 var(--l));
    animation: none;
  }
  .hero-art-wrap,
  .hero-art-wrap.play {
    transform: scale(0.88);
    opacity: 0.45;
    animation: none;
  }
  .hero-text,
  .hero-art-wrap.play ~ .hero-text {
    opacity: 1;
    animation: none;
  }
}

.landing-section {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 0;
}
.landing-section h2 {
  color: var(--accent);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  margin: 40px 0 10px;
}
.landing-section p {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.7;
}

.principles-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 18px 0 8px;
}

.cta-block {
  text-align: center;
  margin: 44px 0 20px;
  padding: 28px 20px;
  border: 1px solid var(--accent-2);
  border-radius: var(--radius);
  background: var(--bg-panel);
}
.cta-block p { color: var(--text-dim); margin: 0 0 16px; }
.cta-block .btn { font-size: 1rem; padding: 12px 26px; }

.discord-block {
  text-align: center;
  margin: 24px 0 20px;
}
.discord-block p { color: var(--text-dim); margin: 0 0 12px; }
.discord-block iframe {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ---------- rich text editor (admin homepage copy) ---------- */
.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.rte-toolbar button {
  padding: 5px 10px;
  font-size: 0.85rem;
  min-width: 34px;
}
.rte-editable {
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  min-height: 90px;
  color: var(--text);
  line-height: 1.6;
}
.rte-editable:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
.rte-editable p { margin: 0 0 10px; }
.rte-editable h1, .rte-editable h2, .rte-editable h3 { color: var(--accent); margin: 10px 0; }
.rte-editable ul, .rte-editable ol { margin: 0 0 10px; padding-left: 22px; }
.rte-editable a { color: var(--link); }

/* ---------- Chipper Mode easter egg ---------- */

/* Smooth crossfade for the handful of elements whose colors change between the
   default gloom and Chipper Mode. */
body, header.top, nav.top-links a, .pill, .card, button, .btn,
.cta-block, .hero-art-wrap {
  transition: background-color 0.8s ease, border-color 0.8s ease, color 0.8s ease,
    filter 0.8s ease, box-shadow 0.8s ease;
}

/* "Hemera" hover hint — deliberately styled to be indistinguishable from surrounding
   text; only the tooltip on hover/focus gives it away. */
.hemera-hint {
  color: inherit;
  cursor: default;
  position: relative;
}

.chipper-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, -6px);
  width: max-content;
  max-width: 240px;
  background: linear-gradient(135deg, #fff6d8, #ffe3b3);
  color: #7a4a00;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}
.chipper-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: #ffe3b3;
}
.hemera-hint:hover .chipper-tooltip,
.hemera-hint:focus-visible .chipper-tooltip,
.chipper-corner-sun:hover .chipper-tooltip,
.chipper-corner-sun:focus-visible .chipper-tooltip {
  opacity: 1;
  transform: translate(-50%, -14px);
}

/* The corner sun sits fixed at the top-right of the viewport, so the shared tooltip's
   default "centered above" placement pushes it off the top and right edges of the
   screen — invisible instead of just hard to read. Anchor it below-right of the sun
   and let it grow left/down, which keeps it fully on screen. */
.chipper-corner-sun .chipper-tooltip {
  bottom: auto;
  top: 100%;
  left: auto;
  right: 0;
  transform: translate(0, 6px);
}
.chipper-corner-sun .chipper-tooltip::after {
  top: auto;
  bottom: 100%;
  left: auto;
  right: 12px;
  margin-left: 0;
  border-top-color: transparent;
  border-bottom-color: #ffe3b3;
}
.chipper-corner-sun:hover .chipper-tooltip,
.chipper-corner-sun:focus-visible .chipper-tooltip {
  transform: translate(0, 14px);
}

/* Sunrise flood: a small disc planted behind the hero art that grows until it floods
   the whole viewport, pushing daylight through the dark theme. Removed once Chipper
   Mode's own bright background takes over. */
.chipper-flood {
  position: fixed;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffbe0 0%, #ffe58a 32%, #ffb347 62%, #ff8c42 100%);
  transform: translate(-50%, -50%) scale(0.05);
  opacity: 0;
  z-index: 9998;
  pointer-events: none;
}
body.chipper-dawning .chipper-flood {
  animation: chipper-sun-grow 2.6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
@keyframes chipper-sun-grow {
  0% { transform: translate(-50%, -50%) scale(0.05); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(70); opacity: 1; }
}

/* Floating sun/cat icons that drift up the screen while Chipper Mode is arriving and,
   more sparsely, while it stays active. */
.chipper-float {
  position: fixed;
  bottom: -60px;
  z-index: 9997;
  pointer-events: none;
  animation-name: chipper-float-up;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}
@keyframes chipper-float-up {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { transform: translateY(-115vh) translateX(var(--drift, 0px)) rotate(var(--spin, 0deg)); opacity: 0; }
}

/* The sun that settles in a corner and stays for the duration of Chipper Mode —
   itself a hint-bearing anchor, mirroring the Hemera hint, for how to reverse it. */
.chipper-corner-sun {
  position: fixed;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffbe0 0%, #ffe58a 40%, #ffb347 75%, #ff8c42 100%);
  box-shadow: 0 0 20px 6px rgba(255, 200, 80, 0.55);
  z-index: 9999;
  cursor: default;
  animation: chipper-pulse 3s ease-in-out infinite;
}
.chipper-corner-sun--settled {
  top: 16px;
  right: 16px;
}
@keyframes chipper-pulse {
  0%, 100% { box-shadow: 0 0 20px 6px rgba(255, 200, 80, 0.55); }
  50% { box-shadow: 0 0 32px 10px rgba(255, 200, 80, 0.85); }
}

/* The theme itself: bright, colorful, pastel, sunny. Custom properties are inherited
   by every descendant, so redefining them here reskins nearly the whole site — the
   overrides below handle the handful of spots with hardcoded colors instead of var(). */
body.chipper-mode {
  --bg: #fff6e0;
  --bg-panel: #fffaf0;
  --bg-panel-2: #fff1cf;
  --border: #ffd27a;
  --text: #4a3200;
  --text-dim: #8a6420;
  --text-faint: #b3903f;
  --accent: #ff8c42;
  --accent-2: #ffb347;
  --good: #4caf50;
  --warn: #ff9800;
  --bad: #ef5350;
  --link: #ff6f3c;
  --shadow: 0 4px 18px rgba(255, 180, 80, 0.25);
  background: radial-gradient(ellipse at top, #fffef0 0%, var(--bg) 60%);
}
body.chipper-mode .hero-art-wrap {
  filter: drop-shadow(0 0 26px rgba(255, 179, 71, 0.6)) brightness(1.12) saturate(1.25);
}
body.chipper-mode .hero-art-slice {
  filter: sepia(0.45) hue-rotate(-10deg) saturate(1.7) brightness(1.05);
}
body.chipper-mode button, body.chipper-mode .btn {
  color: #3a2200;
}

@media (prefers-reduced-motion: reduce) {
  .chipper-flood,
  body.chipper-dawning .chipper-flood {
    animation: none;
    display: none;
  }
  .chipper-float {
    animation: none;
    display: none;
  }
  .chipper-corner-sun {
    animation: none;
  }
}
