/* ==========================================================================
   Change is Possible — Design System / Base
   Brand extracted from changeispossible.co.uk
   Mint #39F8BD · Teal #21957D · Green #33CC66 · Mint soft #ADEBC2 · Ink #2D2A2A
   Typeface: Montserrat 400/500/600/700/800
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Brand greens */
  --mint-050: #f0fdf7;
  --mint-100: #d6f9e8;
  --mint-200: #adebc2;   /* kit accent */
  --mint-300: #7df0cd;
  --mint-400: #39f8bd;   /* signature bright mint */
  --mint-500: #22e3a6;
  --mint-600: #12c08c;
  --teal-700: #21957d;   /* deep teal used across page */
  --teal-800: #16705e;
  --teal-900: #0e4c40;
  --green-500: #33cc66;  /* kit primary */

  /* Neutrals */
  --ink-900: #07100d;
  --ink-850: #0b1512;
  --ink-800: #101a16;
  --ink-700: #1b2622;
  --ink-600: #2d2a2a;    /* kit secondary */
  --slate-600: #46564f;
  --slate-500: #5b6b65;
  --slate-400: #8a9995;
  --slate-300: #b9c5c0;
  --paper: #ffffff;
  --paper-2: #f7fbf9;
  --paper-3: #eef6f2;

  --line: rgba(7, 16, 13, 0.1);
  --line-strong: rgba(7, 16, 13, 0.16);
  --line-dark: rgba(255, 255, 255, 0.12);

  /* Semantic */
  --bg: var(--paper);
  --fg: var(--ink-600);
  --fg-muted: var(--slate-500);
  --brand: var(--teal-700);
  --brand-bright: var(--mint-400);

  /* Gradients */
  --grad-brand: linear-gradient(135deg, var(--mint-400) 0%, var(--teal-700) 100%);
  --grad-brand-soft: linear-gradient(135deg, var(--mint-100) 0%, var(--mint-200) 100%);
  --grad-dark: linear-gradient(165deg, #0d1a16 0%, var(--ink-900) 100%);
  --grad-text: linear-gradient(100deg, var(--mint-400), var(--green-500) 45%, var(--teal-700));
  --grad-sheen: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%);

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 36px;
  --r-pill: 999px;

  /* Shadows */
  --sh-xs: 0 1px 2px rgba(7, 16, 13, 0.06);
  --sh-sm: 0 2px 8px rgba(7, 16, 13, 0.06), 0 1px 2px rgba(7, 16, 13, 0.04);
  --sh-md: 0 8px 24px -6px rgba(7, 16, 13, 0.12), 0 2px 6px rgba(7, 16, 13, 0.05);
  --sh-lg: 0 22px 50px -14px rgba(7, 16, 13, 0.2), 0 6px 16px -6px rgba(7, 16, 13, 0.08);
  --sh-xl: 0 40px 80px -24px rgba(7, 16, 13, 0.28);
  --sh-glow: 0 0 0 1px rgba(57, 248, 189, 0.5), 0 10px 40px -8px rgba(34, 227, 166, 0.45);
  --sh-inset: inset 0 1px 0 rgba(255, 255, 255, 0.7);

  /* Layout */
  --container: 1180px;
  --container-wide: 1360px;
  --container-narrow: 800px;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);
  --nav-h: 72px;

  /* Type scale (fluid) */
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: clamp(0.975rem, 0.94rem + 0.18vw, 1.0625rem);
  --fs-md: clamp(1.0625rem, 1rem + 0.28vw, 1.1875rem);
  --fs-lg: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);
  --fs-xl: clamp(1.375rem, 1.24rem + 0.6vw, 1.75rem);
  --fs-h4: clamp(1.25rem, 1.13rem + 0.55vw, 1.5rem);
  --fs-h3: clamp(1.5rem, 1.28rem + 1vw, 2.125rem);
  --fs-h2: clamp(1.9rem, 1.5rem + 1.9vw, 3.1rem);
  --fs-h1: clamp(2.5rem, 1.75rem + 3.9vw, 5.1rem);
  --fs-display: clamp(3rem, 2rem + 5.5vw, 6.5rem);

  /* Motion */
  --e-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --e-in-out: cubic-bezier(0.65, 0.05, 0.36, 1);
  --e-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 160ms;
  --t: 280ms;
  --t-slow: 560ms;

  --section-y: clamp(4rem, 8vw, 7.5rem);
}

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  font-family: "Montserrat", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.68;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { background: none; border: 0; cursor: pointer; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; padding: 0; }

table { border-collapse: collapse; width: 100%; }

:focus-visible {
  outline: 3px solid var(--mint-500);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--mint-400);
  color: var(--ink-900);
}

/* Custom scrollbar */
@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar { width: 11px; height: 11px; }
  ::-webkit-scrollbar-track { background: var(--paper-3); }
  ::-webkit-scrollbar-thumb {
    background: var(--teal-700);
    border-radius: var(--r-pill);
    border: 3px solid var(--paper-3);
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--mint-600); }
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.022em;
  color: var(--ink-900);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -0.03em; }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); line-height: 1.22; }
h5 { font-size: var(--fs-lg); line-height: 1.3; }

p { text-wrap: pretty; }
p + p { margin-top: 0.9em; }

strong, b { font-weight: 700; color: var(--ink-900); }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: var(--container-narrow); }

/* `clip` (not `hidden`) so ambient blobs and offset decorations never widen the
   document, without turning every section into a scroll container. */
.section { padding-block: var(--section-y); position: relative; overflow-x: clip; }
.section--tight { padding-block: clamp(2.75rem, 5vw, 4.5rem); }
.section--flush-top { padding-top: 0; }

.stack > * + * { margin-top: var(--stack-gap, 1rem); }

.center { text-align: center; }
.mx-auto { margin-inline: auto; }

.grid { display: grid; gap: var(--grid-gap, clamp(1rem, 2.2vw, 1.75rem)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }

@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 940px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Text utilities ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-700);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 3px;
  border-radius: var(--r-pill);
  background: var(--grad-brand);
  flex: none;
}
.eyebrow--center { justify-content: center; }
.eyebrow--light { color: var(--mint-400); }

.lead {
  font-size: var(--fs-md);
  color: var(--slate-500);
  line-height: 1.72;
  max-width: 62ch;
}
.lead--center { margin-inline: auto; }

.muted { color: var(--fg-muted); }
.tiny { font-size: var(--fs-sm); line-height: 1.55; }

/* Gradient / highlight text */
.grad-text {
  background: var(--grad-text);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: grad-pan 9s ease-in-out infinite;
}
@keyframes grad-pan {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.ital-mint {
  font-style: italic;
  color: var(--mint-500);
}

/* Hand-drawn underline sweep */
.underline-sweep {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.underline-sweep::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  /* Sits clear of descenders so it reads as an underline, not a strikethrough. */
  bottom: -0.1em;
  height: 0.16em;
  background: var(--mint-400);
  border-radius: var(--r-pill);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 900ms var(--e-out);
}
.is-visible .underline-sweep::after,
.underline-sweep.is-visible::after { transform: scaleX(1); }

/* Highlighter block */
.mark {
  background: linear-gradient(to top, var(--mint-200) 0%, var(--mint-200) 42%, transparent 42%);
  padding-inline: 0.12em;
}

.section-head {
  max-width: 46rem;
  margin-inline: auto;
  text-align: center;
  margin-bottom: clamp(2.25rem, 4.5vw, 3.75rem);
  --stack-gap: 1rem;
}
.section-head p { margin-inline: auto; }

/* ---------- Surfaces ---------- */
.surface-dark {
  background: var(--grad-dark);
  color: rgba(255, 255, 255, 0.82);
  position: relative;
  isolation: isolate;
}
.surface-dark h1, .surface-dark h2, .surface-dark h3,
.surface-dark h4, .surface-dark h5, .surface-dark strong { color: #fff; }
.surface-dark .lead, .surface-dark .muted { color: rgba(255, 255, 255, 0.7); }

.surface-soft { background: var(--paper-2); }
.surface-mint { background: linear-gradient(180deg, var(--mint-050), #fff); }

/* Ambient blobs */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}
.blob--mint { background: radial-gradient(circle, var(--mint-400), transparent 68%); }
.blob--teal { background: radial-gradient(circle, var(--teal-700), transparent 68%); }

/* Grain overlay */
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
  z-index: 0;
}

/* Dot / grid backdrops */
.bg-dots {
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
  background-size: 22px 22px;
}
.bg-grid {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
}

/* Divider: brand line asset from the original site */
.rule-brand {
  width: 190px;
  height: 20px;
  background: url("../img/line_horisontal.png") center / contain no-repeat;
  margin-inline: auto;
  opacity: 0.9;
}

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition:
    opacity 760ms var(--e-out),
    transform 760ms var(--e-out),
    filter 760ms var(--e-out);
  filter: blur(5px);
  will-change: opacity, transform;
}
[data-reveal="left"] { transform: translate3d(-34px, 0, 0); }
[data-reveal="right"] { transform: translate3d(34px, 0, 0); }
[data-reveal="scale"] { transform: scale(0.94); }
[data-reveal="clip"] {
  transform: none;
  filter: none;
  clip-path: inset(0 0 100% 0);
  opacity: 1;
  transition: clip-path 1s var(--e-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
  filter: blur(0);
  clip-path: inset(0 0 0 0);
}

/* stagger children */
[data-stagger] > * {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition: opacity 640ms var(--e-out), transform 640ms var(--e-out);
}
[data-stagger].is-visible > * { opacity: 1; transform: none; }
[data-stagger].is-visible > *:nth-child(1) { transition-delay: 40ms; }
[data-stagger].is-visible > *:nth-child(2) { transition-delay: 110ms; }
[data-stagger].is-visible > *:nth-child(3) { transition-delay: 180ms; }
[data-stagger].is-visible > *:nth-child(4) { transition-delay: 250ms; }
[data-stagger].is-visible > *:nth-child(5) { transition-delay: 320ms; }
[data-stagger].is-visible > *:nth-child(6) { transition-delay: 390ms; }
[data-stagger].is-visible > *:nth-child(7) { transition-delay: 460ms; }
[data-stagger].is-visible > *:nth-child(8) { transition-delay: 530ms; }

/* ---------- Keyframes ---------- */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@keyframes float-y-sm {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(-9px) rotate(var(--rot, 0deg)); }
}
@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.7; }
  70% { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
/* The track holds its content twice (duplicated by JS). Shifting by exactly
   -50% lands half a gap short of one full period, so compensate for it. */
@keyframes marquee-x {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(calc(-50% - (var(--mq-gap, 1.25rem) / 2)), 0, 0); }
}
@keyframes sheen {
  0% { transform: translateX(-120%) skewX(-18deg); }
  100% { transform: translateX(220%) skewX(-18deg); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes blink-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
@keyframes draw-line { to { stroke-dashoffset: 0; } }

.float { animation: float-y 6.5s ease-in-out infinite; }
.spin-slow { animation: spin-slow 26s linear infinite; }

/* ---------- Accessibility ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2000;
  padding: 0.7rem 1.15rem;
  background: var(--ink-900);
  color: #fff;
  border-radius: var(--r-sm);
  font-weight: 700;
  font-size: var(--fs-sm);
  transform: translateY(-160%);
  transition: transform var(--t) var(--e-out);
}
.skip-link:focus { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal], [data-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
  }
  .underline-sweep::after { transform: scaleX(1) !important; }
}

@media print {
  .site-nav, .announce, .to-top, .cta-dock { display: none !important; }
  body { color: #000; }
}
