/* Elpiscomm design tokens — the CMS Colours tab maps onto every --color-* below.
   Taken from the charity's logo: a gold ring around four quarters (food, home,
   school, wellbeing) with a coral heart, on warm cream with deep navy ink. */
:root {
  --color-primary: #e0483b;
  --color-primary-dark: #b8352a;
  --color-secondary: #1d2340;
  --color-secondary-light: #2d3561;
  --color-accent: #f3a93c;
  --color-accent-light: #fdebc8;
  --color-sky: #3aa6dd;
  --color-leaf: #74b23f;
  --color-rose: #ec6f8f;
  --color-surface: #fff8ef;
  --color-tint: #fcede4;
  --color-default: #4a4f63;
  --color-muted: #858a9e;
  --color-line: #efe4d6;
  --color-white: #ffffff;
  --font-default: 'Nunito', system-ui, sans-serif;
  --font-primary: 'Nunito', system-ui, sans-serif;
  --font-heading: 'Bricolage Grotesque', 'Nunito', sans-serif;
  --radius: 28px;
  --radius-sm: 16px;
  --section-max-width: 80rem;
  --header-h: 86px;
  --section-pad-y: 110px;
  --base-size: 17px;
  --ease: cubic-bezier(.2, .75, .25, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: var(--base-size); scroll-behavior: smooth; }
body { font-family: var(--font-default); color: var(--color-default); line-height: 1.7; background: var(--color-white); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5 { font-family: var(--font-heading); color: var(--color-secondary); font-weight: 700; line-height: 1.06; letter-spacing: -.03em; }
a { color: inherit; text-decoration: none; transition: color .25s ease; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
::selection { background: var(--color-primary); color: var(--color-white); }
:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }

.container { max-width: var(--section-max-width); margin: 0 auto; padding: 0 24px; }
section { padding: var(--section-pad-y) 0; position: relative; }
/* entrance start positions must never widen the page; clip keeps sticky children working */
section, footer { overflow-x: clip; }
section.cream { background: var(--color-surface); }
section.tint { background: var(--color-tint); }
section.ink { background: var(--color-secondary); color: color-mix(in srgb, var(--color-white) 78%, var(--color-secondary)); }
section.ink h2, section.ink h3 { color: var(--color-white); }

/* the coral highlight under key words in headlines */
.hl { position: relative; white-space: nowrap; color: var(--color-primary); }
.hl::after { content: ''; position: absolute; left: -2%; right: -2%; bottom: .02em; height: .32em; z-index: -1; border-radius: 99px;
  background: color-mix(in srgb, var(--color-accent) 55%, transparent); }
h1 .hl, h2 .hl { isolation: isolate; }
.ink .hl, .on-photo .hl { color: var(--color-accent); }
.ink .hl::after, .on-photo .hl::after { background: color-mix(in srgb, var(--color-primary) 55%, transparent); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .65rem; background: var(--color-primary); color: var(--color-white);
  font: 800 1rem var(--font-primary); padding: 1rem 1.7rem; border-radius: 999px; border: 0; cursor: pointer; white-space: nowrap;
  box-shadow: 0 16px 30px -14px color-mix(in srgb, var(--color-primary) 80%, transparent);
  transition: background .3s ease, transform .3s var(--ease), box-shadow .3s ease, color .3s ease;
}
.btn svg { width: 20px; height: 20px; transition: transform .35s var(--ease); }
.btn:hover { background: var(--color-primary-dark); transform: translateY(-2px); }
.btn:hover svg { transform: translateX(3px); }
.btn.heart svg { transform: none; }
.btn.heart:hover svg { animation: el-beat .8s ease; }
.btn.gold { background: var(--color-accent); color: var(--color-secondary); box-shadow: 0 16px 30px -14px color-mix(in srgb, var(--color-accent) 90%, transparent); }
.btn.gold:hover { background: color-mix(in srgb, var(--color-accent) 85%, var(--color-secondary)); }
.btn.dark { background: var(--color-secondary); box-shadow: none; }
.btn.dark:hover { background: var(--color-secondary-light); }
.btn.light { background: var(--color-white); color: var(--color-secondary); box-shadow: 0 12px 30px -16px rgba(0, 0, 0, .3); }
.btn.light:hover { color: var(--color-primary); }
.btn.ghost { background: transparent; color: var(--color-secondary); box-shadow: inset 0 0 0 2px var(--color-line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 2px var(--color-primary); color: var(--color-primary); }
.btn.ghost-light { background: transparent; color: var(--color-white); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--color-white) 45%, transparent); }
.btn.ghost-light:hover { box-shadow: inset 0 0 0 2px var(--color-white); background: color-mix(in srgb, var(--color-white) 10%, transparent); }
.btn.small { padding: .7rem 1.25rem; font-size: .92rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }
@keyframes el-beat { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.25); } 60% { transform: scale(.95); } }

.text-link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; color: var(--color-primary); }
.text-link svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
.text-link:hover svg { transform: translateX(4px); }

/* ── Section heads ── */
.eyebrow { display: inline-flex; align-items: center; gap: .6rem; font: 800 .8rem var(--font-primary); letter-spacing: .14em; text-transform: uppercase; color: var(--color-primary); }
.eyebrow::before { content: ''; width: 26px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--color-accent) 0 50%, var(--color-primary) 50% 100%); }
.ink .eyebrow, .on-photo .eyebrow { color: var(--color-accent); }
.section-head { max-width: 760px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); margin: .9rem 0 1rem; }
.section-head > p { font-size: 1.08rem; color: var(--color-muted); }
.ink .section-head > p { color: color-mix(in srgb, var(--color-white) 70%, var(--color-secondary)); }
.section-head.centered { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.centered .eyebrow { justify-content: center; }
.section-head.split { max-width: none; display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px 64px; align-items: end; }
.section-head.split h2 { margin-bottom: 0; }
.section-head .head-actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: flex-end; }

.tick-list { list-style: none; display: grid; gap: .7rem; }
.tick-list li { position: relative; display: flex; gap: .75rem; align-items: flex-start; color: var(--color-secondary); font-weight: 600; }
.tick-list li::before { content: ''; flex: none; width: 24px; height: 24px; margin-top: .12em; border-radius: 50%; background: var(--color-accent-light); }
.tick-list li::after { content: ''; position: absolute; left: 9px; top: calc(.12em + 6px); width: 5px; height: 10px; border: solid var(--color-primary); border-width: 0 2.4px 2.4px 0; transform: rotate(45deg); }

/* ── Cards & chips ── */
.card { background: var(--color-white); border-radius: var(--radius); box-shadow: 0 24px 50px -36px color-mix(in srgb, var(--color-secondary) 55%, transparent), 0 0 0 1px var(--color-line); }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .8rem; border-radius: 999px; font: 800 .74rem var(--font-primary); letter-spacing: .04em; text-transform: uppercase;
  background: var(--color-accent-light); color: var(--color-secondary); }
.chip svg { width: 14px; height: 14px; }
.chip.coral { background: var(--color-primary); color: var(--color-white); }
.chip.done { background: color-mix(in srgb, var(--color-leaf) 18%, var(--color-white)); color: color-mix(in srgb, var(--color-leaf) 60%, var(--color-secondary)); }

/* programme colour families (the logo's four quarters) */
.tone-sun { --tone: var(--color-accent); }
.tone-sky { --tone: var(--color-sky); }
.tone-leaf { --tone: var(--color-leaf); }
.tone-rose { --tone: var(--color-rose); }
.tone-coral { --tone: var(--color-primary); }
.tone-ink { --tone: var(--color-secondary-light); }

/* ── Progress bars (campaign totals) ── */
.progress { height: 10px; border-radius: 99px; background: var(--color-tint); overflow: hidden; }
.progress > span { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit;
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary)); transition: width 1.6s var(--ease) .2s; }
.el-motion section:not(.el-inview) .progress > span { width: 0; }

/* ── Header ── */
.topbar { background: var(--color-secondary); color: color-mix(in srgb, var(--color-white) 75%, var(--color-secondary)); font-size: .86rem; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 42px; }
.topbar .info { display: flex; align-items: center; gap: 1.6rem; }
.topbar .info a, .topbar .info span { display: inline-flex; align-items: center; gap: .45rem; }
.topbar svg { width: 15px; height: 15px; color: var(--color-accent); }
.topbar a:hover { color: var(--color-white); }
.topbar .social { display: flex; gap: .3rem; }
.topbar .social a { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; }
.topbar .social a:hover { background: color-mix(in srgb, var(--color-white) 12%, transparent); }
.topbar .social svg { color: inherit; }

.site-header { position: sticky; top: 0; z-index: 60; height: var(--header-h); background: color-mix(in srgb, var(--color-white) 97%, transparent);
  transition: box-shadow .3s ease; }
.site-header.scrolled, .site-header.open { box-shadow: 0 14px 34px -22px color-mix(in srgb, var(--color-secondary) 45%, transparent); }
.site-header.open { height: auto; }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: var(--header-h); }
.site-header .actions { display: flex; align-items: center; gap: .6rem; }
.logo { display: inline-flex; align-items: center; gap: .7rem; font: 800 1.45rem var(--font-heading); color: var(--color-secondary); letter-spacing: -.03em; min-width: 0; }
.logo img { max-height: 52px; width: auto; max-width: min(46vw, 240px); object-fit: contain; }
.logo .mark { width: 50px; height: 50px; flex: none; }
.logo .mark img { width: 100%; height: 100%; max-height: none; }
.logo .wordmark { display: inline-flex; flex-direction: column; justify-content: center; line-height: 1.02; min-width: 0; }
.logo .wl { display: block; }
.logo .sub { display: block; margin-top: .3em; font: 700 .48em var(--font-primary); letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted); }

.nav { display: flex; align-items: center; gap: 1.5rem; font-weight: 800; font-size: .95rem; color: var(--color-secondary); }
.nav .item { position: relative; display: flex; align-items: center; gap: .1rem; }
.nav .item > a { position: relative; padding: .4rem 0; }
.nav .item > a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: var(--color-accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.nav .item > a:hover, .nav .item > a.on { color: var(--color-primary); }
.nav .item > a:hover::after, .nav .item > a.on::after { transform: scaleX(1); }
.nav .caret { border: 0; background: none; color: inherit; cursor: pointer; width: 22px; height: 22px; display: grid; place-items: center; }
.nav .caret svg { width: 16px; height: 16px; transition: transform .3s ease; }
.nav .dropdown { position: absolute; top: calc(100% + 14px); left: -18px; min-width: 250px; padding: 10px; border-radius: 20px; background: var(--color-white);
  box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--color-secondary) 55%, transparent), 0 0 0 1px var(--color-line);
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .25s ease, transform .3s var(--ease), visibility 0s linear .3s; }
.nav .dropdown::before { content: ''; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }
.nav .item.has:hover .dropdown, .nav .item.show .dropdown, .nav .item.has:focus-within .dropdown { opacity: 1; visibility: visible; transform: none; transition: opacity .25s ease, transform .3s var(--ease), visibility 0s; }
.nav .item.has:hover .caret svg, .nav .item.show .caret svg { transform: rotate(180deg); }
.nav .dropdown a { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: 12px; font-weight: 700; font-size: .92rem; }
.nav .dropdown a:hover { background: var(--color-surface); color: var(--color-primary); }
.nav .dropdown .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tone, var(--color-accent)); flex: none; }

.menu-btn { display: none; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer; background: var(--color-surface); flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.menu-btn span { width: 20px; height: 2px; border-radius: 2px; background: var(--color-secondary); transition: transform .3s ease, opacity .3s ease; }
.site-header.open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.open .menu-btn span:nth-child(2) { opacity: 0; }
.site-header.open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-panel { display: grid; gap: .2rem; padding: 8px 24px 26px; max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
.mobile-panel > a, .mobile-panel .group > p { padding: .75rem 0; border-bottom: 1px solid var(--color-line); font-weight: 800; color: var(--color-secondary); }
.mobile-panel .group { display: grid; }
.mobile-panel .group > a { padding: .5rem 0 .5rem 1rem; font-weight: 600; font-size: .95rem; }
.mobile-panel .btn { margin-top: 1rem; }
.drop-enter-active, .drop-leave-active { transition: opacity .25s ease, transform .3s var(--ease); }
.drop-enter-from, .drop-leave-to { opacity: 0; transform: translateY(-8px); }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid > .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-weight: 800; font-size: .86rem; color: var(--color-secondary); margin-bottom: .4rem; }
.form-grid input, .form-grid select, .form-grid textarea, .input {
  width: 100%; border: 2px solid var(--color-line); border-radius: 14px; background: var(--color-white); padding: .85rem 1rem; color: var(--color-secondary);
  transition: border-color .2s ease, box-shadow .2s ease; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .input:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 4px var(--color-accent-light); }
.form-grid textarea { resize: vertical; min-height: 120px; }
.form-grid ::placeholder { color: color-mix(in srgb, var(--color-muted) 70%, var(--color-white)); }
.field-err { color: #c0362c; font-size: .82rem; margin-top: .35rem; }
.form-error { color: #c0362c; font-weight: 700; font-size: .92rem; }
.form-note { font-size: .84rem; color: var(--color-muted); }
.form-done { text-align: center; padding: 30px 10px; }
.form-done .ic { width: 70px; height: 70px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; background: var(--color-accent-light); color: var(--color-primary); }
.form-done .ic svg { width: 34px; height: 34px; }
.form-done h3 { font-size: 1.6rem; margin-bottom: .5rem; }

/* ══ Motion: section-enter animations (plugins/motion.client.ts) ══
   Hidden states apply only while html.el-motion is set and the section has not
   entered the frame yet; --i staggers siblings, --d adds a fixed delay. */
.el-motion [data-anim] {
  transition:
    opacity .8s var(--ease) calc(var(--i, 0) * 90ms + var(--d, 0ms)),
    transform 1s var(--ease) calc(var(--i, 0) * 90ms + var(--d, 0ms)),
    filter .9s var(--ease) calc(var(--i, 0) * 90ms + var(--d, 0ms)),
    clip-path 1.1s var(--ease) calc(var(--i, 0) * 90ms + var(--d, 0ms));
}
.el-motion section:not(.el-inview) [data-anim], .el-motion footer:not(.el-inview) [data-anim] { opacity: 0; }
.el-motion section:not(.el-inview) [data-anim="up"], .el-motion footer:not(.el-inview) [data-anim="up"] { transform: translateY(42px); }
.el-motion section:not(.el-inview) [data-anim="down"] { transform: translateY(-34px); }
.el-motion section:not(.el-inview) [data-anim="left"] { transform: translateX(60px); }
.el-motion section:not(.el-inview) [data-anim="right"] { transform: translateX(-60px); }
.el-motion section:not(.el-inview) [data-anim="zoom"] { transform: scale(.88); }
.el-motion section:not(.el-inview) [data-anim="pop"] { transform: translateY(18px) scale(.8); }
.el-motion section:not(.el-inview) [data-anim="rise"] { clip-path: inset(0 0 100% 0); transform: translateY(40%); }
.el-motion section.el-inview [data-anim="rise"] { clip-path: inset(-10% -5% -20% -5%); }
.el-motion section:not(.el-inview) [data-anim="clip"] { opacity: 1; clip-path: inset(0 0 100% 0 round var(--radius)); }
.el-motion section.el-inview [data-anim="clip"] { clip-path: inset(0 0 0 0 round var(--radius)); }
.el-motion [data-anim="clip"] img { transition: transform 1.6s var(--ease) calc(var(--i, 0) * 90ms + var(--d, 0ms)); }
.el-motion section:not(.el-inview) [data-anim="clip"] img { transform: scale(1.18); }

@keyframes el-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.float { animation: el-float 6s ease-in-out infinite; }
.float.slow { animation-duration: 8s; animation-delay: -2s; }
@keyframes el-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .float, .spin { animation: none !important; }
  .progress > span { transition: none; }
}

@media (max-width: 1140px) {
  .nav { gap: 1.05rem; font-size: .9rem; }
}
@media (max-width: 1040px) {
  .nav, .site-header .actions .hide-sm { display: none; }
  .menu-btn { display: inline-flex; }
  .section-head.split { grid-template-columns: 1fr; gap: 14px; }
  .section-head .head-actions { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .topbar .info .hide-xs, .topbar .social { display: none; }
  .topbar .container { justify-content: center; }
}
@media (max-width: 640px) {
  :root { --section-pad-y: 78px; --radius: 22px; --base-size: 16px; --header-h: 74px; }
  .form-grid { grid-template-columns: 1fr; }
  .section-head { margin-bottom: 40px; }
  .logo { font-size: 1.2rem; }
  .logo .mark { width: 42px; height: 42px; }
  .site-header .actions .btn { padding: .7rem 1.1rem; font-size: .9rem; }
}
@media (max-width: 400px) { .site-header .actions .btn span { display: none; } }
.mobile-panel .group > a.group-head { padding: .75rem 0; font-weight: 800; font-size: 1rem; border-bottom: 1px solid var(--color-line); }
