/* ==========================================================
   Capinex Matruvandana Foundation — site styles
   ========================================================== */

:root {
  --teal: #0f5c55;
  --teal-dark: #0a3f3a;
  --teal-deep: #072e2a;
  --saffron: #e07b1f;
  --saffron-dark: #c4650f;
  --marigold: #f4b544;
  --cream: #fbf7f0;
  --sand: #f3ead9;
  --white: #ffffff;
  --ink: #1b2a28;
  --muted: #5a6a67;
  --line: #e6ddcc;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 40, 36, .05), 0 12px 32px -12px rgba(15, 40, 36, .18);
  --container: 1180px;
  --header-h: 76px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute; left: 16px; top: -60px;
  background: var(--teal); color: #fff; padding: 10px 16px; border-radius: 8px;
  z-index: 100; text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

/* ---------- Type helpers ---------- */
.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--saffron-dark);
  margin-bottom: 14px;
}
.eyebrow-light { color: var(--marigold); }

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -.01em;
  color: var(--teal-deep);
}

.lead { font-size: 18px; color: var(--muted); max-width: 60ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font: 600 16px/1 var(--font-body);
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--saffron); color: #fff; box-shadow: 0 8px 20px -8px rgba(224, 123, 31, .6); }
.btn-primary:hover { background: var(--saffron-dark); }
.btn-ghost { border-color: var(--teal); color: var(--teal); background: transparent; }
.btn-ghost:hover { background: rgba(15, 92, 85, .07); }
.btn-sm { padding: 10px 20px; font-size: 15px; }

.link-arrow {
  display: inline-flex; gap: 6px; align-items: center;
  font-weight: 600; color: var(--teal); margin-top: auto;
}
.link-arrow span { transition: transform .2s; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(251, 247, 240, .88);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 20px -12px rgba(0,0,0,.15); }

.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--teal-deep); }
.brand-sub { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--saffron-dark); font-weight: 600; }

.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a:not(.btn) {
  text-decoration: none; font-weight: 500; font-size: 15px; color: var(--ink);
  position: relative; padding: 6px 0;
}
.site-nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--saffron); transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.site-nav a:not(.btn):hover::after,
.site-nav a.is-current::after { transform: scaleX(1); }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--teal-deep); border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 96px; }
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 400px at 85% 10%, rgba(244, 181, 68, .28), transparent 70%),
    radial-gradient(500px 500px at 5% 90%, rgba(15, 92, 85, .12), transparent 70%);
}
.hero-bg::after {
  content: ""; position: absolute; right: -160px; top: -120px; width: 620px; height: 620px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 38px, rgba(224, 123, 31, .09) 38px 39px);
}

.hero-inner { display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: center; }

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(38px, 5.4vw, 66px);
  letter-spacing: -.02em;
  color: var(--teal-deep);
  margin-bottom: 24px;
}
.hero h1 span { display: block; }
.hero h1 .accent { color: var(--saffron); font-style: italic; }
.hero .lead { margin-bottom: 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.mission-card {
  position: relative;
  background: var(--teal);
  color: #fff;
  border-radius: 28px;
  padding: 40px 36px;
  box-shadow: 0 30px 60px -24px rgba(7, 46, 42, .55);
  overflow: hidden;
}
.mission-card::before {
  content: ""; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 181, 68, .35), transparent 70%);
}
.mission-text {
  font-family: var(--font-display);
  font-size: 23px; line-height: 1.4; font-weight: 500;
  margin-bottom: 28px; position: relative;
}
.serve-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.serve-list li {
  font-size: 14px; font-weight: 500;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  cursor: default;
  transition: color .25s ease, background-color .25s ease, border-color .25s ease, translate .25s ease;
}

/* ---------- Stats ---------- */
.stats { background: var(--teal-deep); color: #fff; padding: 56px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat { display: flex; flex-direction: column; gap: 6px; padding-left: 20px; border-left: 2px solid var(--saffron); }
.stat-num { font-family: var(--font-display); font-size: clamp(34px, 4vw, 50px); font-weight: 600; color: var(--marigold); line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 15px; color: rgba(255,255,255,.8); }

/* ---------- Sections ---------- */
.section { padding: 104px 0; }
.section-head { max-width: 680px; margin-bottom: 52px; }
.section-dark { background: var(--teal); color: #fff; }
.section-dark h2 { color: #fff; }
.section-sand { background: var(--sand); }

/* ---------- Programs ---------- */
.program-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.program {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.program-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.program-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(224, 123, 31, .1); color: var(--saffron-dark);
}
.program-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.program-num { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--line); }
.program h3 { font-size: 19px; font-weight: 700; color: var(--teal-deep); }
.program p { font-size: 15.5px; color: var(--muted); }

.program-cta { background: var(--saffron); border-color: var(--saffron); color: #fff; text-decoration: none; justify-content: center; }
.program-cta h3 { color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.program-cta p { color: rgba(255,255,255,.88); }
.program-cta .link-arrow { color: #fff; margin-top: 8px; }
.program-cta:hover .link-arrow span, .involve-card:hover .link-arrow span { transform: translateX(4px); }

/* ---------- Values ---------- */
.values-wrap { display: grid; grid-template-columns: 1fr 1.6fr; gap: 56px; align-items: start; }
.values-wrap .section-head { margin-bottom: 0; position: sticky; top: calc(var(--header-h) + 40px); }
.values-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0;
  border-top: 1px solid rgba(255,255,255,.18);
}
.values-grid li {
  display: flex; align-items: baseline; gap: 18px;
  padding: 24px 8px;
  border-bottom: 1px solid rgba(255,255,255,.18);
  font-family: var(--font-display); font-size: 24px; font-weight: 500;
}
.values-grid li:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.18); padding-right: 24px; }
.values-grid li:nth-child(even) { padding-left: 28px; }
.values-grid span { font-family: var(--font-body); font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--marigold); }

/* ---------- Stories ---------- */
.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.story {
  margin: 0;
  display: flex; flex-direction: column; gap: 22px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 28px;
}
.story-head { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; }
.story-head .tag { grid-column: 1 / -1; justify-self: start; margin-top: 10px; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 22px; font-weight: 600; color: #fff;
}
.avatar-1 { background: var(--saffron); }
.avatar-2 { background: var(--teal); }
.avatar-3 { background: #8a5a9e; }
.story-name { font-weight: 700; color: var(--teal-deep); }
.story-meta { font-size: 14px; color: var(--muted); }
.tag {
  font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  background: rgba(15, 92, 85, .08); color: var(--teal);
}
.story blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px; line-height: 1.5; color: var(--ink);
}

/* ---------- Key initiatives ---------- */
.initiative-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.initiative {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 5px solid var(--saffron);
  border-radius: var(--radius);
  padding: 32px 28px;
}
.initiative .program-icon { margin-bottom: 8px; }
.initiative-tag { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--saffron-dark); }
.initiative h3 { font-family: var(--font-display); font-weight: 600; font-size: 23px; color: var(--teal-deep); }
.initiative p:not(.initiative-tag) { font-size: 16px; color: var(--muted); }

/* ---------- CSR ---------- */
.csr-inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.csr-inner h2 { margin-bottom: 18px; }
.csr-card { background: var(--white); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow); }
.check-list { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 14px; }
.check-list li { position: relative; padding-left: 34px; font-weight: 500; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 13px no-repeat;
}

/* ---------- Get involved ---------- */
.involve-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.involve-card {
  display: flex; flex-direction: column; gap: 12px; text-align: left;
  font: inherit; color: inherit; cursor: pointer;
  background: var(--white); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 34px 32px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.involve-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 26px; color: var(--teal-deep); }
.involve-card p:not(.eyebrow) { color: var(--muted); }
.involve-card .eyebrow { margin-bottom: 0; }
.involve-card .link-arrow { margin-top: 10px; }
.involve-card:hover { border-color: var(--marigold); }
.involve-card.is-active { border-color: var(--saffron); box-shadow: var(--shadow); background: #fffdf9; }

.form-panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; }
.form { display: grid; gap: 18px; max-width: 760px; }
.form-title { font-family: var(--font-display); font-weight: 600; font-size: 26px; color: var(--teal-deep); }
.form-note { color: var(--muted); margin-top: -8px; }
.hidden-field { position: absolute; left: -9999px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 7px; font-size: 14.5px; font-weight: 600; color: var(--teal-deep); }
.field input, .field select, .field textarea {
  font: 400 16px/1.4 var(--font-body); color: var(--ink);
  padding: 13px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--cream); width: 100%;
  transition: border-color .2s, background .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal); background: #fff; }
.field textarea { resize: vertical; }

.amounts { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.amounts legend { font-size: 14.5px; font-weight: 600; color: var(--teal-deep); margin-bottom: 10px; padding: 0; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-block; padding: 10px 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--cream);
  font-weight: 600; font-size: 15px; transition: all .15s;
}
.chip input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--marigold); outline-offset: 2px; }
.form .btn { justify-self: start; margin-top: 6px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--teal-deep); color: rgba(255,255,255,.78); padding: 80px 0 0; font-size: 15.5px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.2fr; gap: 48px; padding-bottom: 56px; }
.brand-light .brand-name { color: #fff; }
.brand-light .brand-sub { color: var(--marigold); }
.footer-about p { margin-top: 20px; max-width: 42ch; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--marigold); margin-bottom: 8px; }
.footer-col a { text-decoration: none; transition: color .2s; }
.footer-col a:hover { color: #fff; }
.footer-col address { font-style: normal; }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 24px; padding-bottom: 28px;
  font-size: 14px; color: rgba(255,255,255,.55);
}

/* ---------- Hover: gradient card fill (ported from blueorbit .hover-fill) ----------
   Card lifts, a teal gradient fades in behind the content and text turns white. */
.hover-fill {
  position: relative;
  isolation: isolate;
  transition: translate .3s ease, box-shadow .3s ease, border-color .3s ease, background-color .3s ease;
}
.js .hover-fill.reveal {
  transition: opacity .7s ease, transform .7s ease, translate .3s ease, box-shadow .3s ease, border-color .3s ease, background-color .3s ease;
}
.hover-fill::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--teal-deep) 0%, var(--teal) 60%, #23907f 100%);
  opacity: 0;
  transition: opacity .3s ease;
}
.hover-fill--warm::before { background: linear-gradient(135deg, #b0560b 0%, var(--saffron) 65%, #ec9a3c 100%); }
.hover-fill :is(h3, p, span, li) { transition: color .3s ease, background-color .3s ease, box-shadow .3s ease, scale .3s ease; }

@media (hover: hover) {
  .hover-fill:hover {
    border-color: transparent;
    background-color: transparent;
    translate: 0 -4px;
    box-shadow: 0 24px 48px -20px rgba(7, 46, 42, .55);
  }
  .hover-fill:hover::before { opacity: 1; }
  .hover-fill:hover :is(h3, p, span, li) { color: #fff; }
  .hover-fill:hover .program-icon {
    background: rgba(255, 255, 255, .18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4);
    color: #fff;
    scale: 1.1;
  }
  .hover-fill:hover .program-num { color: rgba(255, 255, 255, .5); }
  .hover-fill:hover .initiative-tag,
  .hover-fill:hover .eyebrow { color: var(--marigold); }
  .values-grid li.hover-fill:hover { translate: none; box-shadow: none; }
}

/* ---------- Hover: position-aware circle (ported from blueorbit .btn-flair) ----------
   A circle grows from where the cursor enters, trails it, and exits the side it left.
   The .flair span is injected by main.js on pointer devices only. */
.has-flair { position: relative; overflow: hidden; isolation: isolate; }
.flair {
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
  transform: scale(0);
  transform-origin: 0 0;
  transition: transform .9s cubic-bezier(.22, 1, .36, 1);
}
.flair::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 220%; aspect-ratio: 1 / 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--flair-bg);
}
.btn-primary { --flair-bg: linear-gradient(135deg, #fffaf0, #fbd9a3); --flair-text: var(--teal-deep); }

@media (hover: hover) {
  .btn-primary.has-flair:hover { background: var(--saffron); }
  /* Mission tags: subtle lift only, no colour fill */
  .serve-list li:hover { translate: 0 -2px; background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); }
}
.btn.has-flair.is-flaired { color: var(--flair-text); }
.btn-primary.has-flair.is-flaired { box-shadow: inset 0 0 0 1px #f1d3a5, 0 10px 24px -10px rgba(224, 123, 31, .55); }

/* ---------- Reveal animation ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0s !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .program-grid { grid-template-columns: repeat(2, 1fr); }
  .site-nav { gap: 18px; }
}

@media (max-width: 960px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--cream); border-bottom: 1px solid var(--line);
    padding: 8px 24px 24px;
    box-shadow: 0 20px 30px -20px rgba(0,0,0,.25);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .site-nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .site-nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
  .site-nav a:not(.btn)::after { display: none; }
  .site-nav .btn { margin-top: 18px; }

  .hero-inner, .values-wrap, .csr-inner { grid-template-columns: 1fr; gap: 40px; }
  .values-wrap .section-head { position: static; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 24px; }
  .story-grid, .initiative-grid { grid-template-columns: 1fr; max-width: 640px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .hero { padding: 48px 0 72px; }
  .section { padding: 72px 0; }
  .section-head { margin-bottom: 36px; }
  .program-grid, .involve-grid, .field-row { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: 1fr; }
  .values-grid li:nth-child(odd) { border-right: 0; padding-right: 8px; }
  .values-grid li:nth-child(even) { padding-left: 8px; }
  .mission-card { padding: 32px 24px; }
  .mission-text { font-size: 20px; }
  .form-panel { padding: 28px 20px; }
  .csr-card { padding: 28px 22px; }
  .footer-grid { grid-template-columns: 1fr; }
  .brand-name { font-size: 17px; }
  .hero-actions .btn { flex: 1 1 auto; }
}
