*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
img, svg, video { max-width: 100%; height: auto; }
[hidden] { display: none !important; }

:root {
  --paper: #FAFAF7;
  --ink: #1A1A1A;
  --muted: #6B6B6B;
  --forest: #2F5D50;
  --line: #E6E4DD;
}

::selection { background: #2F5D50; color: #FAFAF7; }

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

/* Header */
.site-header {
  background: rgba(250, 250, 247, 0.86);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.nav-link { color: var(--muted); position: relative; padding: 6px 0; transition: color .15s ease; }
.nav-link:hover, .nav-link.is-active { color: var(--ink); }
.nav-link.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--ink);
}

.mobile-menu { display: none; border-bottom: 1px solid var(--line); background: var(--paper); }
.mobile-menu.is-open { display: block; animation: drop .2s ease; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.link-accent { color: var(--forest); font-weight: 500; text-decoration: underline; text-decoration-color: rgba(47,93,80,.3); text-underline-offset: 5px; transition: text-decoration-color .15s ease; }
.link-accent:hover { text-decoration-color: var(--forest); }

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--forest); color: var(--paper); font-weight: 500;
  padding: .85rem 1.5rem; border-radius: 999px; min-height: 48px;
  transition: background-color .15s ease, transform .15s ease;
}
.btn-primary:hover { background: #24493F; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 1px solid var(--line); color: var(--ink); padding: .7rem 1.2rem; border-radius: 999px; min-height: 44px;
  transition: border-color .15s ease, background-color .15s ease;
}
.btn-ghost:hover { border-color: var(--ink); background: #fff; }

/* Form fields */
.field {
  width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: .85rem 1rem; font-size: 1rem; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field:hover { border-color: #cfccc2; }
.field:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(47,93,80,.15); }
.field[aria-invalid="true"] { border-color: #B42318; }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* View transitions */
.view { transition: opacity .28s ease, transform .28s ease; }
.view.is-leaving { opacity: 0; transform: translateY(8px); }
.view.is-entering { opacity: 0; transform: translateY(-4px); }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }

/* Project cards */
.card { display: block; transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.card:hover { transform: translateY(-6px); }
.card .cover { box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: box-shadow .35s ease; }
.card:hover .cover { box-shadow: 0 24px 48px -24px rgba(26,26,26,.28); }
.card:hover .cover-art { transform: scale(1.045); }
.card .arrow { transition: transform .25s ease; }
.card:hover .arrow { transform: translateX(4px); }

/* Cover placeholders (abstract art until real images arrive) */
.cover { position: relative; overflow: hidden; border-radius: 14px; aspect-ratio: 4 / 3; }
.cover--wide { aspect-ratio: 16 / 9; border-radius: 18px; }
.cover-art { position: absolute; inset: 0; transition: transform .8s cubic-bezier(.2,.7,.2,1); display: grid; place-items: center; }

/* Banking */
.cover-art--banking { background: radial-gradient(120% 90% at 20% 10%, #3E7565 0%, #2F5D50 45%, #1F3F36 100%); }
.phone { width: 30%; aspect-ratio: 9 / 18.5; background: #F4F3EE; border-radius: 22px; padding: 7% 6%; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); display: flex; flex-direction: column; gap: 8%; }
.cover--wide .phone { width: 20%; }
.phone .bal { height: 14%; border-radius: 8px; background: #2F5D50; }
.phone .ln { height: 5%; border-radius: 4px; background: #DAD7CC; }
.phone .ln.s { width: 60%; }
.phone .chart { flex: 1; border-radius: 8px; background: linear-gradient(180deg, rgba(47,93,80,.18), rgba(47,93,80,0)); border-bottom: 2px solid #2F5D50; }

/* Farmers market */
.cover-art--market { background: #EDE6D4; }
.produce { position: absolute; border-radius: 50%; }
.produce.a { width: 38%; aspect-ratio: 1; background: #D4603B; left: 10%; top: 16%; }
.produce.b { width: 26%; aspect-ratio: 1; background: #E3B23C; left: 42%; top: 46%; }
.produce.c { width: 30%; aspect-ratio: 1; background: #6E8B4E; right: 8%; top: 12%; }
.produce.d { width: 14%; aspect-ratio: 1; background: #8C3B4A; right: 22%; bottom: 10%; }
.market-label { position: absolute; left: 8%; bottom: 10%; font-family: Fraunces, Georgia, serif; color: #3B3A33; font-size: clamp(14px, 2.4vw, 28px); letter-spacing: -.01em; }

/* Fitness */
.cover-art--fitness { background: #171717; }
.ring { position: absolute; border-radius: 50%; border-style: solid; border-color: transparent; }
.ring.r1 { width: 54%; aspect-ratio: 1; border-width: 10px; border-top-color: #9FD3B8; border-right-color: #9FD3B8; border-bottom-color: #9FD3B8; transform: rotate(20deg); }
.ring.r2 { width: 40%; aspect-ratio: 1; border-width: 10px; border-top-color: #F0C987; border-right-color: #F0C987; transform: rotate(-10deg); }
.ring.r3 { width: 26%; aspect-ratio: 1; border-width: 10px; border-top-color: #E88D7A; border-right-color: #E88D7A; border-bottom-color: #E88D7A; border-left-color: #E88D7A; opacity: .9; }
.ring-track { position: absolute; border-radius: 50%; border: 10px solid rgba(255,255,255,.06); }
.ring-track.t1 { width: 54%; aspect-ratio: 1; }
.ring-track.t2 { width: 40%; aspect-ratio: 1; }

/* Nonprofit */
.cover-art--donate { background: linear-gradient(160deg, #DCE6DF 0%, #C7D6CC 100%); }
.donate-card { width: 52%; background: #FAFAF7; border-radius: 14px; padding: 6%; box-shadow: 0 24px 50px -24px rgba(31,63,54,.45); display: grid; gap: 10px; }
.cover--wide .donate-card { width: 36%; }
.donate-amts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.donate-amts span { height: 22px; border-radius: 6px; border: 1px solid #D5D2C7; }
.donate-amts span.on { background: #2F5D50; border-color: #2F5D50; }
.donate-bar { height: 8px; border-radius: 999px; background: #E3E1D8; overflow: hidden; }
.donate-bar i { display: block; height: 100%; width: 68%; background: #2F5D50; }
.donate-btn { height: 26px; border-radius: 999px; background: #1A1A1A; }
.donate-line { height: 8px; border-radius: 4px; background: #DAD7CC; width: 70%; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--paper); padding: .8rem 1.2rem; border-radius: 999px;
  font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  max-width: calc(100% - 32px); z-index: 60;
}
.toast.is-open { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: #B42318; }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, #EFEDE6 25%, #F6F5F0 50%, #EFEDE6 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.prose-msg { white-space: pre-wrap; word-break: break-word; }

/* Inquiries */
.budget-chip, .status-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .8125rem; line-height: 1.25rem; padding: .2rem .7rem; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.status-chip { color: #8A5A00; border-color: #EBD9B4; background: #FFF8EA; }
.status-chip.is-replied { color: var(--forest); border-color: rgba(47,93,80,.25); background: rgba(47,93,80,.07); }
li.is-replied .prose-msg { color: var(--muted); }

.replied-toggle { position: relative; display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; min-height: 44px; font-weight: 500; user-select: none; }
.replied-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.replied-toggle .track { position: relative; width: 40px; height: 24px; border-radius: 999px; background: #D9D6CC; transition: background-color .15s ease; flex-shrink: 0; }
.replied-toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s ease; }
.replied-toggle:hover .track { background: #C9C5B9; }
.replied-toggle input:checked + .track { background: var(--forest); }
.replied-toggle input:checked + .track::after { transform: translateX(16px); }
.replied-toggle input:focus-visible + .track { outline: 2px solid var(--forest); outline-offset: 3px; }
.replied-toggle input:disabled + .track { opacity: .6; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
