/* ============================================
   Safer Chemistry — shared site styles
   Used by all pages except home and donate
   (which have their inline-CSS variants)
   ============================================ */

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: #1a1a1a;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ===== Tokens ===== */
:root {
  --green: #16a34a;
  --green-bright: #22c55e;
  --green-dark: #0f3a23;
  --green-darkest: #07241a;
  --green-light: #dcfce7;
  --ink: #0a0a0a;
  --text: #1a1a1a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #ffffff;
  --bg-soft: #f5f5f5;
  --bg-tint: #f9fafb;
  --radius: 24px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5 {
  font-family: 'Hanken Grotesk', sans-serif;
  color: var(--green-darkest);
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-weight: 700;
}
.display { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.04; }
.h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); letter-spacing: -0.025em; line-height: 1.06; font-weight: 700; }
.h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.06; }
.h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 700; }
.lead { font-size: 1.125rem; color: var(--muted); line-height: 1.6; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--radius-pill);
  background: white; border: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  font-size: 0.875rem; font-weight: 600; color: var(--green);
}
.eyebrow svg { width: 16px; height: 16px; }
.accent { color: var(--green-bright); }

/* ===== Layout ===== */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.prose { max-width: 720px; margin: 0 auto; }
.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }
.section-tint { background: var(--bg-tint); }
.section-soft { background: var(--bg-soft); }

/* ===== Header ===== */
header {
  position: fixed; top: 16px; left: 0; right: 0;
  z-index: 100; pointer-events: none;
}
.nav-wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.nav-pill {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-radius: var(--radius-pill);
  padding: 10px 12px 10px 24px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  pointer-events: auto;
  transition: box-shadow 0.4s var(--ease-out-quart), background 0.4s ease;
}
.nav-pill.scrolled { background: rgba(255,255,255,0.96); box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--green-dark); }
.logo img { height: 60px; width: auto; }
.nav-links { display: flex; gap: 36px; align-items: center; }
.nav-links a { font-size: 15px; font-weight: 500; color: #1a1a1a; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--green); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 15px;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}
.btn-primary { background: var(--green); color: white; }
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(22,163,74,0.3); }
.btn-white { background: white; color: var(--green-darkest); }
.btn-white:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.btn-ghost-dark { background: transparent; color: var(--green-darkest); border: 1.5px solid var(--green-darkest); }
.btn-ghost-dark:hover { background: var(--green-darkest); color: white; }
.btn-ghost-light { background: transparent; color: white; border: 1.5px solid rgba(255,255,255,0.7); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.1); border-color: white; }
.btn-lg { padding: 16px 28px; font-size: 1rem; }
.btn .arrow { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.5; fill: none; }

/* ===== Page hero (compact, dark) ===== */
.page-hero {
  position: relative;
  margin: 0 16px;
  padding: 160px 0 80px;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  color: white;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 75% 25%, rgba(74,222,128,0.3), transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(34,197,94,0.35), transparent 55%),
    linear-gradient(135deg, #07241a 0%, #0f3a23 50%, #16a34a 100%);
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.6;
}
.page-hero.has-image {
  background-image:
    linear-gradient(180deg, rgba(7,36,26,0.45) 0%, rgba(7,36,26,0.82) 100%),
    var(--hero-img, none);
  background-size: cover;
  background-position: center;
}
.page-hero.has-image::before { opacity: 0.25; }

/* ===== Video embeds ===== */
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #07241a;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.video-frame iframe,
.video-frame video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
  display: block;
}
.video-lite {
  cursor: pointer;
  background-size: cover;
  background-position: center;
}
.video-lite::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.45) 100%);
}
.video-lite::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 84px; height: 84px;
  margin: -42px 0 0 -42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2316a34a'><path d='M8 5v14l11-7z'/></svg>") center/40px no-repeat;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  transition: transform 0.25s var(--ease-out-quart);
}
.video-lite:hover::after { transform: scale(1.06); }
.video-caption {
  margin-top: 14px;
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
}
.page-hero-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.page-hero .tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(8px);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 24px;
}
.page-hero .tag .dot {
  width: 8px; height: 8px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(74,222,128,0.3);
  animation: pulseDot 2s ease-out infinite;
}
.page-hero h1 {
  color: white;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 880px;
  margin-bottom: 18px;
}
.page-hero p {
  color: rgba(255,255,255,0.9);
  font-size: 1.125rem;
  max-width: 700px;
  line-height: 1.6;
}
.page-hero .crumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 18px;
}
.page-hero .crumbs a { color: rgba(255,255,255,0.85); }
.page-hero .crumbs a:hover { color: white; text-decoration: underline; }
.page-hero .crumbs svg { width: 12px; height: 12px; opacity: 0.6; }

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0.6); }
  50% { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
}

/* ===== Prose / long-form ===== */
.long-prose {
  max-width: 720px;
  margin: 0 auto;
}
.long-prose h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-top: 56px;
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}
.long-prose h2:first-child { margin-top: 0; }
.long-prose h3 {
  font-size: 1.25rem;
  margin-top: 36px;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.long-prose p {
  margin-bottom: 18px;
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.7;
}
.long-prose p.lead {
  font-size: 1.25rem;
  color: var(--green-darkest);
  font-weight: 500;
  margin-bottom: 28px;
  line-height: 1.5;
}
.long-prose ul, .long-prose ol { margin: 0 0 22px 24px; }
.long-prose li { margin-bottom: 10px; line-height: 1.7; color: var(--text); }
.long-prose blockquote {
  margin: 32px 0;
  padding: 24px 28px;
  background: var(--bg-tint);
  border-left: 3px solid var(--green);
  border-radius: 12px;
  font-size: 1.125rem;
  color: var(--green-darkest);
  font-style: italic;
  line-height: 1.55;
}
.long-prose blockquote cite { display: block; margin-top: 12px; font-size: 0.95rem; color: var(--muted); font-style: normal; }
.long-prose a { color: var(--green); font-weight: 500; border-bottom: 1px solid rgba(22,163,74,0.3); transition: border-color 0.2s; }
.long-prose a:hover { border-bottom-color: var(--green); }
.long-prose a.btn { border-bottom: none; font-weight: 600; }
.long-prose a.btn:hover { border-bottom: none; }
.long-prose a.btn-primary, .long-prose a.btn-primary:hover { color: white; }
.long-prose a.btn-white, .long-prose a.btn-white:hover { color: var(--green-darkest); }
.long-prose strong { color: var(--green-darkest); font-weight: 700; }
.long-prose hr { border: none; height: 1px; background: var(--line); margin: 56px 0; }

/* ===== Cards ===== */
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.card-link { color: var(--green); font-weight: 600; font-size: 0.95rem; display: inline-flex; align-items: center; gap: 6px; transition: gap 0.25s; }
.card:hover .card-link { gap: 10px; }

/* ===== Pillar / project teaser cards ===== */
.pillar {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  isolation: isolate;
  cursor: pointer;
  display: block;
  transition: transform 0.4s ease;
}
.pillar:hover { transform: translateY(-4px); }
.pillar .bg { position: absolute; inset: 0; z-index: -2; }
.pillar.p1 .bg { background: linear-gradient(135deg, #052e16 0%, #14532d 50%, #16a34a 100%); }
.pillar.p2 .bg { background: linear-gradient(135deg, #1f2937 0%, #374151 50%, #6b7280 100%); }
.pillar.p3 .bg { background: linear-gradient(135deg, #134e4a 0%, #0f766e 50%, #14b8a6 100%); }
.pillar.p4 .bg { background: linear-gradient(135deg, #4a2706 0%, #92400e 50%, #d97706 100%); }
.pillar::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.85) 100%);
  z-index: -1;
}
.pillar-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 28px; color: white; }
.pillar-content h3 { color: white; font-size: 1.5rem; margin-bottom: 8px; }
.pillar-content p { font-size: 0.95rem; opacity: 0.9; line-height: 1.5; margin-bottom: 16px; }
.pillar-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-pill);
  background: white; color: var(--green-darkest);
  font-size: 0.9rem; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transition: gap 0.3s var(--ease-out-quart), background 0.25s, color 0.25s;
}
.pillar-link svg { width: 14px; height: 14px; transition: transform 0.3s var(--ease-out-quart); stroke: currentColor; stroke-width: 2.5; fill: none; }
.pillar:hover .pillar-link { background: var(--green); color: white; gap: 12px; }
.pillar:hover .pillar-link svg { transform: translateX(2px); }

/* ===== CTA bands ===== */
.cta-green {
  position: relative;
  border-radius: var(--radius);
  padding: 56px 48px;
  color: white;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 60%, #4ade80 100%);
}
.cta-green::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(255,255,255,0.12) 1.5px, transparent 1.5px);
  background-size: 36px 36px;
  opacity: 0.7;
}
.cta-green::after {
  content: '';
  position: absolute;
  bottom: -40px; right: -40px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(255,255,255,0.2), transparent 60%);
  z-index: -1;
}
.cta-green h2 { color: white; max-width: 480px; font-size: clamp(1.75rem, 3.5vw, 2.5rem); margin-bottom: 14px; }
.cta-green p { max-width: 520px; opacity: 0.95; margin-bottom: 28px; font-size: 1.02rem; }

/* ===== Footer ===== */
footer {
  background: var(--green-darkest);
  color: rgba(255,255,255,0.75);
  padding: 80px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 48px; margin-bottom: 56px;
}
.footer-brand .logo { margin-bottom: 18px; }
.footer-brand p { color: rgba(255,255,255,0.65); font-size: 0.95rem; max-width: 260px; margin-bottom: 20px; }
.newsletter {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-pill);
  padding: 6px 6px 6px 20px;
  display: flex; align-items: center; gap: 8px;
  max-width: 340px;
  transition: border-color 0.2s, background 0.2s;
}
.newsletter:focus-within { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.12); }
.newsletter input {
  border: none; outline: none; flex: 1;
  font-family: inherit; font-size: 14px; padding: 8px 0;
  background: transparent; color: white;
}
.newsletter input::placeholder { color: rgba(255,255,255,0.5); }
.newsletter button {
  background: var(--green); color: white;
  padding: 10px 20px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 14px; transition: background 0.2s;
}
.newsletter button:hover { background: var(--green-bright); }
.footer-col h5 { font-size: 14px; color: white; margin-bottom: 18px; font-weight: 700; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: rgba(255,255,255,0.7); font-size: 14px; transition: color 0.2s; }
.footer-col a:hover { color: var(--green-bright); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; align-items: center;
  font-size: 13px; color: rgba(255,255,255,0.55);
}
.socials { display: flex; gap: 12px; }
.socials a {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.06);
  transition: color 0.2s, background 0.2s, transform 0.2s;
}
.socials a:hover { color: white; background: var(--green); transform: translateY(-2px); }

/* ===== Animations ===== */
.anim { opacity: 0; transform: translateY(40px); will-change: opacity, transform; }
.anim-fade { opacity: 0; }
.anim-left { opacity: 0; transform: translateX(-40px); }
.anim-right { opacity: 0; transform: translateX(40px); }
.anim.in, .anim-fade.in, .anim-left.in, .anim-right.in {
  opacity: 1;
  transform: translate(0);
  transition: opacity 1.1s var(--ease-out-expo), transform 1.1s var(--ease-out-expo);
}
.d-1 { transition-delay: 0.08s !important; }
.d-2 { transition-delay: 0.16s !important; }
.d-3 { transition-delay: 0.24s !important; }
.d-4 { transition-delay: 0.32s !important; }
.d-5 { transition-delay: 0.40s !important; }

@keyframes navDrop { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes heroFadeUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
.nav-pill { animation: navDrop 0.9s var(--ease-out-expo) both; animation-delay: 0.1s; }
.page-hero .tag { animation: heroFadeUp 1s var(--ease-out-expo) both; animation-delay: 0.2s; }
.page-hero h1 { animation: heroFadeUp 1.1s var(--ease-out-expo) both; animation-delay: 0.35s; }
.page-hero p { animation: heroFadeUp 1.1s var(--ease-out-expo) both; animation-delay: 0.5s; }
.page-hero .crumbs { animation: heroFadeUp 0.9s var(--ease-out-expo) both; animation-delay: 0.1s; }

@media (prefers-reduced-motion: reduce) {
  .anim, .anim-fade, .anim-left, .anim-right { opacity: 1 !important; transform: none !important; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===== Forms ===== */
.input-text {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  background: white;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-text:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
}
textarea.input-text { min-height: 140px; resize: vertical; line-height: 1.55; }
select.input-text { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; background-size: 16px; padding-right: 44px; }
label.field {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-darkest);
  letter-spacing: -0.01em;
}
.field-group { margin-bottom: 18px; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .nav-links { display: none; }
}
@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .page-hero { padding: 130px 0 60px; margin: 0 8px; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-green { padding: 40px 28px; }
}
