/* Saathi Foundation — warm, hopeful, hand-made NGO theme
   Fonts: Outfit (clean geometric) + Caveat (handwritten notes)
   Motion: hand-drawn underline that draws itself, filling progress bars,
           tilted polaroid collage, gentle sway, donut chart sweep */

:root {
  --paper: #fdfaf3;
  --paper-2: #f5efe1;
  --forest: #17402f;
  --forest-2: #24583f;
  --sun: #f4b942;
  --coral: #e8684a;
  --sky: #9cc9d8;
  --ink: #1d2a24;
  --muted: #5f6b64;
  --line: #e4dccb;
  --r: 18px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --sans: "Outfit", system-ui, sans-serif;
  --hand: "Caveat", cursive;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--sans); color: var(--ink); line-height: 1.6; overflow-x: hidden;
  background-color: var(--paper);
  /* subtle paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { width: 100%; height: 100%; object-fit: cover; display: block; position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 800; line-height: 1.08; letter-spacing: -.025em; }
h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
section { padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1rem, 5vw, 4rem); }
.scribble { font-family: var(--hand); font-size: 1.6rem; font-weight: 700; color: var(--coral); line-height: 1; transform: rotate(-2deg); display: inline-block; }
h2 .scribble { font-size: 1em; color: var(--forest-2); }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem; margin-bottom: 2.5rem; }
.sec-head p { color: var(--muted); }

.btn { display: inline-block; background: var(--forest); color: var(--paper); padding: .75rem 1.4rem; border-radius: 99px; font: 600 1rem var(--sans); border: 0; cursor: pointer; transition: background .3s, transform .4s var(--ease), box-shadow .4s; }
.btn:hover { background: var(--coral); transform: translateY(-3px); box-shadow: 0 10px 24px rgba(232,104,74,.3); }
.btn-big { padding: 1rem 1.8rem; font-size: 1.05rem; }
.full { width: 100%; }
.text-link { font-weight: 600; border-bottom: 2px solid var(--sun); }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 2rem; padding: 1rem clamp(1rem, 5vw, 4rem); background: rgba(253,250,243,.92); backdrop-filter: blur(8px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.nav.scrolled { border-color: var(--line); }
.logo { font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; color: var(--forest); }
.logo span { font-weight: 300; }
.nav-links { display: flex; gap: 1.6rem; margin-left: auto; font-weight: 400; }
.nav-links a { position: relative; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; border-radius: 3px; background: var(--sun); transform: scaleX(0); transition: transform .4s var(--ease); }
.nav-links a:hover::after { transform: scaleX(1); }
.burger { display: none; background: none; border: 1.5px solid var(--forest); border-radius: 99px; padding: .4rem .9rem; font: 600 .9rem var(--sans); color: var(--forest); cursor: pointer; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; min-height: calc(100vh - 70px); }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.6rem); margin: .8rem 0 1.4rem; color: var(--forest); }
.draw { position: relative; display: inline-block; color: var(--coral); }
.draw svg { position: absolute; left: 0; bottom: -.15em; width: 100%; height: .35em; overflow: visible; }
.draw path { fill: none; stroke: var(--sun); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 220; stroke-dashoffset: 220; animation: drawLine 1.2s var(--ease) .9s forwards; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 520px; margin-bottom: 2rem; }
.hero-actions { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }

.hero-collage { position: relative; height: 520px; }
.ph { position: absolute; margin: 0; background: linear-gradient(140deg, var(--sky), #c9e3c3 60%, var(--sun)); border: 10px solid #fff; box-shadow: 0 18px 40px rgba(23,64,47,.15); overflow: hidden; transition: transform .6s var(--ease); }
.ph > span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3.5rem; z-index: 0; }
.ph:hover { z-index: 3; transform: rotate(0) scale(1.04) !important; }
.p1 { width: 62%; height: 64%; top: 4%; left: 6%; transform: rotate(-4deg); animation: sway 7s ease-in-out infinite; }
.p2 { width: 46%; height: 44%; top: 38%; right: 0; transform: rotate(5deg); background: linear-gradient(140deg, var(--sun), var(--coral)); animation: sway 8s ease-in-out -3s infinite; }
.p3 { width: 42%; height: 36%; bottom: 0; left: 0; transform: rotate(3deg); background: linear-gradient(140deg, #c9e3c3, var(--forest-2)); animation: sway 9s ease-in-out -5s infinite; }
@keyframes sway { 50% { translate: 0 -8px; } }
.note { position: absolute; top: 0; right: 0; font-family: var(--hand); font-size: 1.6rem; color: var(--forest); transform: rotate(6deg); background: var(--sun); padding: .2rem .8rem; border-radius: 4px; box-shadow: 0 6px 14px rgba(0,0,0,.08); z-index: 4; }

/* ---------- impact ---------- */
.impact { background: var(--forest); color: var(--paper); border-radius: 40px 40px 0 0; }
.impact h2 { margin-bottom: 3rem; max-width: 640px; }
.impact h2 .scribble { color: var(--sun); }
.impact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.imp { border-top: 2px solid rgba(253,250,243,.2); padding-top: 1.2rem; }
.imp .ic { font-size: 1.8rem; }
.imp b { display: block; font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 800; color: var(--sun); letter-spacing: -.03em; line-height: 1.1; margin: .4rem 0; }
.imp span { color: #cfe0d6; }

/* ---------- programs ---------- */
.programs { background: var(--forest); color: var(--paper); padding-top: 0; border-radius: 0 0 40px 40px; }
.prog-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.prog { background: var(--forest-2); border-radius: var(--r); padding: 1.8rem; position: relative; overflow: hidden; transition: transform .5s var(--ease); }
.prog:hover { transform: translateY(-6px); }
.prog::after { content: ""; position: absolute; width: 160px; height: 160px; border-radius: 50%; background: var(--sun); opacity: .12; right: -50px; bottom: -50px; transition: transform .7s var(--ease); }
.prog:hover::after { transform: scale(2.2); }
.prog .ic { font-size: 2.2rem; }
.prog h3 { font-size: 1.4rem; margin: .7rem 0 .4rem; }
.prog p { color: #cfe0d6; font-size: .97rem; }

/* ---------- campaigns ---------- */
.camp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.camp { background: #fff; border-radius: var(--r); border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; transition: transform .5s var(--ease), box-shadow .5s; }
.camp:hover { transform: translateY(-6px) rotate(-.5deg); box-shadow: 0 20px 40px rgba(23,64,47,.1); }
.camp-top { height: 140px; display: grid; place-items: center; font-size: 3.6rem; position: relative; }
.camp-top .days { position: absolute; top: .8rem; right: .8rem; background: #fff; border-radius: 99px; padding: .2rem .7rem; font-size: .8rem; font-weight: 600; }
.camp-body { padding: 1.4rem; display: flex; flex-direction: column; flex: 1; }
.camp h3 { font-size: 1.25rem; margin-bottom: .4rem; }
.camp p { color: var(--muted); font-size: .95rem; flex: 1; }
.bar { height: 10px; background: var(--paper-2); border-radius: 99px; overflow: hidden; margin: 1.2rem 0 .6rem; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--sun), var(--coral)); transition: width 1.6s var(--ease); }
.camp-nums { display: flex; justify-content: space-between; font-size: .9rem; }
.camp-nums b { font-size: 1.1rem; }
.camp-nums span { color: var(--muted); }
.camp .btn { margin-top: 1.2rem; text-align: center; background: var(--paper-2); color: var(--forest); }
.camp .btn:hover { background: var(--forest); color: var(--paper); }

/* ---------- donate ---------- */
.donate { background: linear-gradient(180deg, transparent, var(--paper-2)); }
.donate-card { display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-radius: 32px; overflow: hidden; box-shadow: 0 30px 60px rgba(23,64,47,.12); max-width: 1100px; margin: 0 auto; }
.donate-left { background: var(--sun); padding: clamp(1.8rem, 5vw, 3.5rem); display: flex; flex-direction: column; }
.donate-left .scribble { color: var(--forest); }
.donate-left h2 { color: var(--forest); margin: .5rem 0 2rem; }
.impact-msg { background: rgba(255,255,255,.6); border-radius: var(--r); padding: 1.3rem; font-size: 1.15rem; display: flex; gap: 1rem; align-items: center; min-height: 110px; }
.impact-msg .big { font-size: 2.6rem; }
.impact-msg.swap { animation: swap .5s var(--ease); }
@keyframes swap { from { opacity: 0; transform: translateY(10px); } }
.tax { margin-top: auto; padding-top: 1.5rem; font-size: .92rem; color: var(--forest); min-height: 3em; }
.donate-form { padding: clamp(1.8rem, 5vw, 3.5rem); display: flex; flex-direction: column; gap: .9rem; }
.freq { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper-2); border-radius: 99px; padding: 4px; position: relative; }
.freq button { border: 0; background: none; padding: .7rem; border-radius: 99px; font: 600 .95rem var(--sans); cursor: pointer; color: var(--muted); transition: all .35s var(--ease); }
.freq button.on { background: #fff; color: var(--forest); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.sel { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.amounts button { border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: .8rem .2rem; font: 600 1rem var(--sans); cursor: pointer; transition: all .3s var(--ease); color: var(--ink); }
.amounts button:hover { border-color: var(--forest); }
.amounts button.on { background: var(--forest); color: var(--paper); border-color: var(--forest); transform: scale(1.04); }
.custom { display: flex; align-items: center; gap: .4rem; border: 1.5px solid var(--line); border-radius: 14px; padding-left: 1rem; font-weight: 600; color: var(--muted); }
.custom input { border: 0; flex: 1; }
input, select { font: 400 1rem var(--sans); padding: .85rem 1rem; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--forest); }
.custom:focus-within { border-color: var(--forest); }
input.bad { border-color: var(--coral); background: #fff4f1; }
.check { display: flex; align-items: center; gap: .6rem; font-size: .95rem; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--forest); }
.secure { font-size: .82rem; color: var(--muted); text-align: center; }
.form-msg { font-weight: 600; color: var(--forest-2); min-height: 1.4em; }

/* ---------- stories ---------- */
.story-rail { display: flex; gap: 1.5rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: 1rem .5rem 2rem; margin: 0 -.5rem; scrollbar-width: thin; scrollbar-color: var(--sun) transparent; }
.story { flex: 0 0 min(360px, 85vw); scroll-snap-align: start; background: #fff; border-radius: var(--r); padding: 1.8rem; border: 1px solid var(--line); position: relative; transition: transform .5s var(--ease); }
.story:nth-child(odd) { transform: rotate(-1deg); }
.story:nth-child(even) { transform: rotate(1deg); }
.story:hover { transform: rotate(0) translateY(-6px); }
.story .who { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.story .ava { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; }
.story .who b { display: block; }
.story .who small { color: var(--muted); }
.story blockquote { font-size: 1.08rem; }
.story .tagline { font-family: var(--hand); font-size: 1.5rem; color: var(--coral); margin-top: 1rem; display: block; }

/* ---------- volunteer ---------- */
.volunteer { background: var(--paper-2); }
.events { display: grid; gap: .8rem; max-width: 1000px; }
.event { display: grid; grid-template-columns: 90px 1fr auto; gap: 1.5rem; align-items: center; background: #fff; border-radius: var(--r); padding: 1rem 1.4rem; border: 1px solid var(--line); transition: transform .4s var(--ease); }
.event:hover { transform: translateX(6px); }
.date { text-align: center; background: var(--forest); color: var(--paper); border-radius: 14px; padding: .5rem; line-height: 1.1; }
.date b { display: block; font-size: 1.7rem; }
.date small { text-transform: uppercase; font-size: .75rem; letter-spacing: .1em; }
.event h3 { font-size: 1.15rem; }
.event p { color: var(--muted); font-size: .92rem; }
.seats { display: flex; align-items: center; gap: 1rem; }
.seats small { color: var(--muted); white-space: nowrap; }
.event .btn { padding: .55rem 1.1rem; font-size: .9rem; }
.event .btn.going { background: var(--sun); color: var(--forest); }

/* ---------- money ---------- */
.money { display: grid; grid-template-columns: .8fr 1.2fr; gap: 4rem; align-items: center; max-width: 1100px; margin: 0 auto; }
.donut { --p: 0; width: min(340px, 80vw); aspect-ratio: 1; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: conic-gradient(var(--stops)); position: relative; }
.donut::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(transparent calc(var(--p) * 1%), var(--paper) 0); transition: none; }
.donut > div { width: 62%; aspect-ratio: 1; border-radius: 50%; background: var(--paper); display: grid; place-content: center; text-align: center; position: relative; z-index: 1; }
.donut b { font-size: 3rem; font-weight: 800; color: var(--forest); line-height: 1; }
.donut span { font-size: .85rem; color: var(--muted); }
.legend { list-style: none; margin: 1.5rem 0; }
.legend li { display: grid; grid-template-columns: 16px 1fr auto; gap: .8rem; align-items: center; padding: .65rem 0; border-bottom: 1px dashed var(--line); }
.legend i { width: 16px; height: 16px; border-radius: 4px; }
.legend b { font-size: 1.1rem; }
.badges { display: flex; flex-wrap: wrap; gap: .5rem; }
.badges span { font-size: .82rem; font-weight: 600; background: #e3efe7; color: var(--forest); padding: .3rem .8rem; border-radius: 99px; }

/* ---------- newsletter ---------- */
.news { text-align: center; }
.news h2 { margin: .5rem 0 1.5rem; color: var(--forest); }
.news-form { display: flex; gap: .5rem; max-width: 480px; margin: 0 auto; }
.news-form input { border-radius: 99px; }

.footer { background: var(--forest); color: #cfe0d6; display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem; padding: 2.5rem clamp(1rem, 5vw, 4rem); font-size: .88rem; }
.footer .logo { color: var(--paper); }

/* entrance (only hidden when JS is running, so no-JS visitors still see everything) */
.js .fade { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.fade.in { opacity: 1; transform: none; }

/* accessibility */
.skip { position: fixed; left: 1rem; top: -4rem; z-index: 300; background: var(--forest); color: var(--paper); padding: .6rem 1rem; border-radius: 99px; font-weight: 600; transition: top .3s; }
.skip:focus { top: 1rem; }
main:focus { outline: none; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(244,185,66,.45); }
.custom input:focus-visible { box-shadow: none; }
.story-rail:focus-visible { outline-offset: -3px; border-radius: var(--r); }

@media (max-width: 900px) {
  .burger { display: block; margin-left: auto; }
  .nav > .btn { display: none; }
  .nav-links { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); margin: 0; clip-path: inset(0 0 100% 0); transition: clip-path .5s var(--ease); }
  .nav-links a { padding: .9rem clamp(1rem, 5vw, 4rem); }
  .nav.open .nav-links { clip-path: inset(0); }
  .hero, .donate-card, .money { grid-template-columns: 1fr; }
  .hero-collage { height: 400px; }
  .hero h1 br { display: none; }
  .impact-grid { grid-template-columns: 1fr 1fr; }
  .prog-list, .camp-grid { grid-template-columns: 1fr; }
  .amounts { grid-template-columns: repeat(2, 1fr); }
  .event { grid-template-columns: 70px 1fr; }
  .seats { grid-column: 1 / -1; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fade { opacity: 1; transform: none; }
  .draw path { stroke-dashoffset: 0; }
}
