/* THEF org root (theholyearthfoundation.github.io) — shared by every portal page: index.html,
   /donate/, /map/ and 404.html.
   Palette + vine are copied from changelog-astro/astro/src/styles/global.css so the portal and the
   Astro porch stay one family; the vine SVG itself comes from changelog-astro/astro/src/lib/vine.mjs.
   Every URL here is absolute: the 404 is served at arbitrary nested paths. */
@import url("https://fonts.googleapis.com/css2?family=Literata:ital,opsz,wght@0,7..72,300..700;1,7..72,300..600&display=swap");

/* PapyrusStd — designer Chris Costello, itcfonts.com, (c) 1997 International Typeface Corporation.
   Headings/brand only, credited in the footer of every page that uses it. */
@font-face {
  font-family: "PapyrusStd";
  src: url("/fonts/PapyrusStd.woff") format("woff");
  font-display: swap;
}

/* The palette (Canopy and Morning mist, the vine's sky / gold / glow, fireflies) lives in
   /arrival/org.css, shared with the AstroLog through the arrival kit. Load that first. Older names
   (--bg, --ink, --signature…) stay mapped here so nothing that reads them breaks. */
:root {
  --bg: var(--canopy);
  --surface: var(--panel-solid);
  --ink: var(--mist);
  --ink-soft: var(--moss);
  --signature: var(--gold);
  --font-display: "PapyrusStd", "Literata", Georgia, serif;
  --font-body: "Literata", "Iowan Old Style", Georgia, serif;
  --wrap: 760px;
  --r: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  color: var(--mist);
  font: 400 17px/1.72 var(--font-body);
  font-optical-sizing: auto;
  padding-bottom: 80px;
  background:
    radial-gradient(900px 560px at 88% -14%, color-mix(in srgb, var(--gold) 17%, transparent), transparent 64%),
    radial-gradient(820px 600px at -14% 18%, color-mix(in srgb, var(--sky) 12%, transparent), transparent 62%),
    radial-gradient(900px 520px at 50% 118%, color-mix(in srgb, var(--leaf) 13%, transparent), transparent 62%),
    var(--canopy);
  background-attachment: fixed;
}

#starfield-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

h1,
h2,
.brand-title,
.footer-brand {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.12;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--sky);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--gold);
}

::selection {
  background: color-mix(in srgb, var(--gold) 35%, transparent);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  z-index: 99;
  background: var(--panel-solid);
  color: var(--mist);
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
}

.skip:focus {
  left: 0.5rem;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── header (kit 1.2): one row at every width. The brand may shrink (its text ellipsizes), the kit's
      <arrival-nav> takes the room that's left and folds what doesn't fit into "More", then into a
      Menu button below 1100px; the kit's tools never shrink. ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: color-mix(in srgb, var(--canopy) 72%, transparent);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1680px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  display: inline-flex;
  flex: 0 1 auto;
  min-width: 0;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--mist);
  white-space: nowrap;
}

.brand:hover {
  color: var(--mist);
}

.brand img {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line-strong), 0 0 16px color-mix(in srgb, var(--gold) 35%, transparent);
}

.brand-title {
  font-size: 1.25rem;
}

@media (max-width: 400px) {
  .header-inner {
    padding-inline: 1rem;
    gap: 0.5rem;
  }
  .brand .brand-title {
    display: none;
  }
}

/* ── buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  font: 600 0.97rem var(--font-body);
  text-decoration: none;
  color: var(--mist);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s;
}

.btn:hover {
  color: var(--mist);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.btn.primary {
  color: var(--canopy);
  background: var(--gold);
  border-color: var(--gold);
}

.btn.primary:hover {
  color: var(--canopy);
  background: color-mix(in srgb, var(--gold) 88%, #fff);
}

.btn svg {
  width: 16px;
  height: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── inner pages (/donate/, /map/) ── */
.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

.page-narrow {
  max-width: 760px;
}

.page h1 {
  font-size: clamp(2.3rem, 6vw, 3.3rem);
  margin: 0 0 0.9rem;
}

.page .lede {
  max-width: 42rem;
  margin: 0 0 2rem;
  color: var(--moss);
  font-size: 1.1rem;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--moss);
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--moss);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--gold);
}

/* ── the page footer: link groups from the kit (<arrival-footer>), above the dock ── */
.page-foot {
  max-width: 1040px;
  margin: 1rem auto 0;
  padding: 1.5rem 1.25rem 1.5rem;
}

.page-foot arrival-footer {
  padding: 1.4rem 1.5rem 1.1rem;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── footer (the dock) ── */
.universal-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--canopy) 86%, transparent);
  border-top: 1px solid var(--line);
  padding: 0.6rem 1.25rem;
  font-size: 0.8rem;
  color: var(--moss);
}

/* One row at every width: swipeable rather than wrapping into the bottom of the screen. */
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: safe center;
  gap: 0.2rem 1.1rem;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.footer-inner::-webkit-scrollbar {
  display: none;
}

.footer-inner > * {
  flex: none;
}

.footer-inner a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--moss);
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--gold);
}

.footer-brand {
  font-size: 0.95rem;
  color: var(--mist);
}

.font-credit {
  font-size: 0.72rem;
  font-style: italic;
  opacity: 0.75;
}

@media (max-width: 520px) {
  .footer-inner .long {
    display: none;
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: 72px;
  }
  .universal-footer {
    padding: 0.55rem 0;
  }
  .footer-inner {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 1rem;
    gap: 1rem;
    white-space: nowrap;
    -webkit-mask: linear-gradient(90deg, transparent, #000 1rem, #000 calc(100% - 1.5rem), transparent);
    mask: linear-gradient(90deg, transparent, #000 1rem, #000 calc(100% - 1.5rem), transparent);
  }
  .footer-inner::-webkit-scrollbar {
    display: none;
  }
  .footer-inner > * {
    flex-shrink: 0;
  }
}

/* ── The hero vine (Vine.astro, and the same markup inlined on the github.io root) ──────────
   One orchestrated moment: the two strands grow from the root, leaves open along the way, and
   the crown lights where they meet. Plays once per page load; reduced motion shows it finished. */
.vine {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.vine .strand,
.vine .strand-rib {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: vine-grow 2.8s cubic-bezier(0.3, 0.55, 0.2, 1) 0.15s forwards;
}

.vine .strand {
  stroke-width: 5;
}

.vine .strand-rib {
  stroke-width: 1.3;
  opacity: 0.55;
  stroke: var(--canopy);
}

.vine .strand-sky {
  stroke: var(--sky);
}

.vine .strand-gold {
  stroke: var(--gold);
}

.vine-leaf {
  opacity: 0;
  animation: vine-leaf 0.9s ease-out var(--d, 1s) forwards;
}

.vine-leaf path {
  fill: color-mix(in srgb, var(--leaf) 85%, transparent);
}

.vine-leaf .rib {
  fill: none;
  stroke: var(--canopy);
  stroke-width: 1;
  opacity: 0.6;
}

.vine-crown,
.vine-crown-dot {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: vine-crown 1.6s ease-out 2.7s forwards;
}

.vine-crown-dot {
  fill: var(--glow);
}

@keyframes vine-grow {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes vine-leaf {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes vine-crown {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }
  60% {
    opacity: 1;
    transform: scale(1.25);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vine .strand,
  .vine .strand-rib {
    animation: none;
    stroke-dashoffset: 0;
  }
  .vine-leaf,
  .vine-crown,
  .vine-crown-dot {
    animation: none;
    opacity: 1;
  }
}
