/* ==========================================================================
   Life Line Foundation: refined layer (loaded after main.css).
   Calm, professional composition; motion stays purposeful and quiet.
   ========================================================================== */

:root {
	--section-y: clamp(80px, 9vw, 136px);
	--night-3: #2a1c1f;
	--drop-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 126'%3E%3Cpath d='M50 0C64 22 92 52 92 82a42 42 0 0 1-84 0C8 52 36 22 50 0z'/%3E%3C/svg%3E");
}

/* ---------- Admin bar offset (logged-in editors only) ---------- */
.admin-bar .site-header { top: 32px; }
.admin-bar .mobile-menu { top: calc(var(--header-h) + 32px); }
@media (max-width: 782px) {
	.admin-bar .site-header { top: 46px; }
	.admin-bar .mobile-menu { top: calc(var(--header-h) + 46px); }
}

/* ---------- Floating red blood cells (hero, donate) ---------- */
.cells { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 1.6s var(--ease-out); }
.cells.is-live { opacity: 0.7; }

/* ---------- Hero ---------- */
.hero { min-height: min(100svh, 940px); padding-bottom: clamp(150px, 15vw, 210px); }
.hero__inner { grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); }
.hero__title { font-size: clamp(2.8rem, 1.1rem + 4.6vw, 5.1rem); }
.drop { width: min(100%, 480px); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.drop__fallback { inset: 2% 0 1%; width: 100%; height: 97%; }
.drop__ripple {
	position: absolute; left: var(--rx, 50%); top: var(--ry, 60%);
	width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
	border: 1.5px solid rgba(255, 236, 236, 0.7);
	opacity: 0; transform: scale(0.2); pointer-events: none;
}
.drop__ripple.is-on { animation: ripple 1.1s var(--ease-out) forwards; }
@keyframes ripple { 0% { opacity: 0.9; transform: scale(0.2); } 100% { opacity: 0; transform: scale(7); } }
.hero.is-racing .hero__ecg-pulse { animation-duration: 1s; }
.hero__ecg { top: 54%; }

/* ---------- Mission ---------- */
.mission { position: relative; padding: clamp(80px, 9vw, 136px) 0 var(--section-y); }
.mission__statement {
	max-width: 980px; margin: 0 auto; text-align: center;
	font-size: clamp(1.75rem, 1rem + 2vw, 2.9rem);
	line-height: 1.2; letter-spacing: -0.028em; font-weight: 600;
}
.mission__more { text-align: center; margin-top: 28px; }

/* The life line: a heartbeat that draws as you scroll. */
.pulseline { display: block; width: 100%; height: clamp(64px, 7vw, 110px); margin: clamp(40px, 5vw, 72px) 0 clamp(32px, 4vw, 56px); overflow: visible; }
.pulseline path { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: var(--draw, 1); }
.no-js .pulseline path { stroke-dashoffset: 0; }

.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.figures__item { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 12px; padding: 26px 32px 0 0; border-top: 1px solid var(--line-strong); }
.figures__item + .figures__item { padding-left: 32px; border-left: 1px solid var(--line); }
.figures__value { font-family: var(--font-display); font-weight: 700; font-size: clamp(3rem, 2rem + 3vw, 4.6rem); line-height: 0.95; letter-spacing: -0.05em; color: var(--ink); font-variant-numeric: tabular-nums; }
.figures__label { color: var(--muted); font-size: 0.9375rem; max-width: 32ch; }

/* ---------- Services index: a tidy list with a photo preview ---------- */
.index { padding-top: clamp(32px, 4vw, 64px); }
.index__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin-bottom: clamp(28px, 3.5vw, 48px); }
.index__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.index__items { border-top: 1px solid var(--line-strong); }
.index__row { border-bottom: 1px solid var(--line); }
.index__item {
	display: grid; grid-template-columns: 14px minmax(0, 1fr) auto 20px; align-items: center; gap: 16px;
	padding: 17px 6px; color: var(--ink-2);
	transition: color 0.25s, background-color 0.3s, padding 0.45s var(--ease-out);
}
.index__item::before {
	content: ""; width: 11px; height: 14px; background: var(--accent);
	-webkit-mask: var(--drop-mask) center / contain no-repeat; mask: var(--drop-mask) center / contain no-repeat;
	transform: scale(0); transition: transform 0.4s var(--ease-out);
}
.index__thumb { display: none; }
.index__name { font-family: var(--font-display); font-weight: 650; font-size: clamp(1.15rem, 0.85rem + 0.75vw, 1.55rem); letter-spacing: -0.02em; line-height: 1.2; }
.index__focus { color: var(--muted); font-size: 0.875rem; white-space: nowrap; }
.index__arrow { width: 20px; height: 20px; color: var(--muted); transition: transform 0.4s var(--ease-out), color 0.25s; }
.index__item.is-active, .index__item:hover, .index__item:focus-visible { color: var(--ink); padding-left: 12px; }
.index__item.is-active::before { transform: scale(1); }
.index__item.is-active .index__arrow, .index__item:hover .index__arrow { color: var(--accent); transform: translate(2px, -2px); }

.index__stage { position: sticky; top: calc(var(--header-h) + 32px); display: grid; gap: 18px; }
.index__frame { position: relative; aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden; background: var(--tint); box-shadow: var(--shadow-1); }
.index__img, .dropcycle__img {
	position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
	opacity: 0; transform: scale(1.05); transition: opacity 0.55s var(--ease-out), transform 1.2s var(--ease-out);
}
.index__img.is-on, .dropcycle__img.is-on { opacity: 1; transform: none; }
.index__fact { min-height: 96px; }
.index__fact-item { display: grid; justify-items: start; gap: 12px; animation: fact-in 0.45s var(--ease-out); }
@keyframes fact-in { from { opacity: 0; transform: translateY(6px); } }
.index__tagline { font-size: 1.0625rem; color: var(--ink-2); max-width: 36ch; }
.index__open { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: var(--r-pill); background: var(--ink); color: #fff; font-weight: 650; font-size: 0.9375rem; transition: background-color 0.2s, transform 0.2s var(--ease-out); }
.index__open:hover { background: var(--accent); }
.index__open:active { transform: scale(0.97); }
.index__open .icon { width: 17px; height: 17px; }

/* ---------- Emergency blood: copy and the blood group matcher ---------- */
.lifeblood__inner { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); align-items: center; }
.lifeblood .lead { margin: 22px 0 30px; }
.match { padding: clamp(24px, 2.8vw, 36px); border-radius: var(--r-lg); background: var(--night-2); border: 1px solid var(--night-line); display: grid; gap: 20px; }
.match__q { font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 1.3rem; letter-spacing: -0.015em; }
.match__groups { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.match__group {
	min-height: 46px; border-radius: 12px; background: rgba(255, 236, 236, 0.06); color: var(--on-night);
	font-family: var(--font-display); font-weight: 700; font-size: 1rem;
	transition: background-color 0.2s, color 0.2s, transform 0.25s var(--ease-out);
}
.match__group:hover { background: rgba(255, 236, 236, 0.12); }
.match__group.is-on { background: var(--accent); color: #fff; }
.match__group:active { transform: scale(0.95); }
.match__result { display: grid; gap: 12px; padding: 16px 0; border-block: 1px solid var(--night-line); }
.match__row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; align-items: center; }
.match__label { color: var(--on-night-2); font-size: 0.9375rem; }
.match__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.match__chip { display: inline-grid; place-items: center; min-width: 44px; height: 32px; padding: 0 10px; border-radius: var(--r-pill); background: rgba(255, 236, 236, 0.09); color: #fff; font-weight: 700; font-size: 0.875rem; animation: chip-in 0.35s var(--ease-out) backwards; }
.match__chip.is-self { background: #fff; color: var(--accent-deep); }
@keyframes chip-in { from { opacity: 0; transform: scale(0.7); } }
.match__note { color: #fff; font-weight: 600; }
.match__fine { color: var(--on-night-2); font-size: 0.8125rem; }
.match .btn { justify-self: start; }
.match .btn .icon { color: var(--accent); }

/* ---------- Photo frames that change their picture ---------- */
.dropcycle { position: relative; margin: 0; width: 100%; max-width: 460px; justify-self: center; display: grid; gap: 14px; }
.give__visual.dropcycle { aspect-ratio: auto; max-width: 480px; }
.dropcycle__frame { position: relative; aspect-ratio: 4 / 5; border-radius: 24px; overflow: hidden; background: var(--tint); box-shadow: var(--shadow-1); cursor: pointer; }
.dropcycle__caption { font-size: 0.9375rem; font-weight: 600; color: var(--muted); min-height: 1.5em; transition: opacity 0.3s; }
.dropcycle__caption.is-swapping { opacity: 0; }
.page-hero--split .dropcycle { max-width: 400px; justify-self: end; }
.page-hero__actions { margin-top: 32px; }

/* ---------- Join band ---------- */
.join { position: relative; overflow: hidden; padding-block: clamp(72px, 8vw, 120px) clamp(80px, 8vw, 120px); }
.join__title { font-size: clamp(2.2rem, 1.2rem + 3vw, 4rem); line-height: 1.02; letter-spacing: -0.04em; }
.join__ecg { position: absolute; left: 0; right: 0; bottom: 14px; width: 100%; height: 64px; pointer-events: none; }
.join__ecg path { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 120 880; stroke-dashoffset: 1000; opacity: 0.7; animation: ecg 5s linear infinite; }

/* ---------- About: who we are ---------- */
.who2 { padding: var(--section-y) clamp(10px, 1.4vw, 20px); }
.who2__panel {
	position: relative; overflow: hidden;
	max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto;
	display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 80px); align-items: start;
	padding: clamp(32px, 4.4vw, 64px);
	border-radius: var(--r-lg); background: var(--night); color: var(--on-night-2);
}
.who2__left { display: grid; gap: 36px; }
.who2__title { color: #fff; font-size: clamp(2.4rem, 1.4rem + 2.8vw, 3.8rem); line-height: 1; letter-spacing: -0.04em; font-weight: 750; }
.who2__photo { width: min(100%, 440px); aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden; }
.who2__photo img { width: 100%; height: 100%; object-fit: cover; }
.who2__right { display: grid; align-content: start; gap: clamp(28px, 3vw, 40px); padding-top: 8px; }
.who2__block { display: grid; gap: 10px; padding-bottom: clamp(24px, 2.6vw, 36px); border-bottom: 1px solid var(--night-line); }
.who2__block h3 { color: #fff; font-size: clamp(1.2rem, 1.05rem + 0.45vw, 1.45rem); letter-spacing: -0.02em; }
.who2__block p { font-size: 1.0625rem; line-height: 1.65; color: var(--on-night-2); }
.prose--light, .prose--light strong { color: var(--on-night-2); }
.prose--light h2, .prose--light h3 { color: #fff; }

/* ---------- Impact wall: gentler angle ---------- */
.wall__inner { transform: rotateX(10deg) rotateY(-10deg) rotateZ(3deg); }

/* ---------- Cursor badge over photos that open a gallery ---------- */
.cursor-badge { position: fixed; left: 0; top: 0; z-index: 1400; pointer-events: none; will-change: transform; }
.cursor-badge__dot {
	display: grid; place-items: center; width: 78px; height: 78px; margin: -39px 0 0 -39px; border-radius: 50%;
	background: var(--accent); color: #fff; font-weight: 700; font-size: 0.8125rem; text-align: center; line-height: 1.15;
	transform: scale(0); transition: transform 0.3s var(--ease-out);
}
.cursor-badge.is-on .cursor-badge__dot { transform: scale(1); }
.cursor-badge .icon { width: 16px; height: 16px; margin: 0 auto 2px; display: block; }

/* Magnetic buttons settle back smoothly. */
[data-magnetic] { transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.3s var(--ease-out), transform 0.5s var(--ease-out); }
[data-magnetic].is-pulled { transition: background-color 0.2s, transform 0.12s linear; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.hero__inner { grid-template-columns: 1fr; }
	.hero__copy { max-width: 640px; position: relative; z-index: 2; }
	.index__grid { grid-template-columns: 1fr; }
	.index__stage { display: none; }
	.index__item { grid-template-columns: 52px minmax(0, 1fr) 20px; padding: 12px 0; color: var(--ink); }
	.index__item::before, .index__focus { display: none; }
	.index__item.is-active, .index__item:hover { padding-left: 0; }
	.index__thumb { display: block; width: 52px; height: 52px; border-radius: 12px; overflow: hidden; }
	.index__thumb img { width: 100%; height: 100%; object-fit: cover; }
	.lifeblood__inner { grid-template-columns: 1fr; }
	.who2__panel { grid-template-columns: 1fr; }
	.who2__left { display: contents; }
	.who2__title { order: 1; }
	.who2__right { order: 2; }
	.who2__photo { order: 3; width: min(100%, 420px); }
	.page-hero--split .dropcycle { justify-self: start; max-width: 360px; }
}

@media (max-width: 760px) {
	.hero__title { font-size: 9.4vw; }
	.mission__statement { text-align: left; font-size: clamp(1.45rem, 1rem + 2.4vw, 1.9rem); }
	.mission__more { text-align: left; }
	.figures { grid-template-columns: 1fr; }
	.figures__item, .figures__item + .figures__item { padding: 20px 0; border-left: 0; }
	.figures__item:last-child { border-bottom: 1px solid var(--line-strong); }
	.match__groups { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.match__row { grid-template-columns: 1fr; gap: 8px; }
	.dropcycle, .give__visual.dropcycle { max-width: 100%; }
	.join__title { font-size: clamp(2rem, 1rem + 4.6vw, 2.6rem); }
}

@media (prefers-reduced-motion: reduce) {
	.pulseline path { stroke-dashoffset: 0; }
	.cells, .cursor-badge, .join__ecg { display: none; }
}

/* Small screens: the drop sits below the call to action, clear of the headline. */
@media (max-width: 1024px) {
	.hero__visual { top: auto; bottom: 2%; right: -8%; width: 46%; opacity: 0.6; }
}
@media (max-width: 760px) {
	.hero__visual { bottom: 1%; right: -16%; width: 62%; opacity: 0.55; }
}
