/* =========================================================
   めぐる ― 北海道 鳥獣共生プロジェクト
   共通スタイル v2
   Design: 自然・信頼 / 深緑 × アースカラー × アイヌ文様の赤・藍
   動き: 時間経過の色変化 / パララックス / 3D / パーティクル / ページ遷移
   ========================================================= */

:root {
  /* Colors */
  --forest-900: #16281f;
  --forest-800: #1e3a2f;
  --forest-700: #2f5d46;
  --forest-500: #4f7a5e;
  --moss-400: #6b8f71;
  --moss-200: #b9cbb4;
  --amber-600: #b85c38;
  --amber-500: #c2703d;
  --amber-200: #e8c9a8;
  /* アイヌ文様にインスパイアした差し色 */
  --ainu-red: #a8322d;
  --ainu-indigo: #1d2b45;
  --ainu-cream: #f3ece0;
  --cream-100: #f7f4ec;
  --cream-200: #efeadd;
  --paper: #fffdf8;
  --ink-900: #23291f;
  --ink-700: #414a3a;
  --ink-500: #6a7263;
  --line: #e2ddcd;
  --white: #ffffff;

  --font-serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --font-sans: "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Noto Sans JP", system-ui, sans-serif;

  --maxw: 1120px;
  --radius: 14px;
  --shadow-sm: 0 2px 8px rgba(22, 40, 31, 0.06);
  --shadow-md: 0 10px 30px rgba(22, 40, 31, 0.10);
  --shadow-lg: 0 24px 60px rgba(22, 40, 31, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-900);
  background: var(--cream-100);
  line-height: 1.85;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--forest-700); text-decoration: none; transition: color .2s; }
a:hover { color: var(--amber-600); }
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.4; color: var(--forest-900); font-weight: 700; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; position: relative; }
.section { padding: 88px 0; position: relative; }
.section--tight { padding: 56px 0; }
.section--cream { background: var(--cream-200); }
.section--forest { background: var(--forest-800); color: var(--cream-100); }
.section--forest h1, .section--forest h2, .section--forest h3 { color: var(--paper); }
.center { text-align: center; }
.lead { font-size: 1.12rem; color: var(--ink-700); max-width: 720px; }
.center .lead { margin-left: auto; margin-right: auto; }

.eyebrow {
  display: inline-block; font-size: .8rem; letter-spacing: .22em; font-weight: 700;
  color: var(--amber-600); text-transform: uppercase; margin-bottom: 14px;
}
.section--forest .eyebrow { color: var(--amber-200); }

.section-title { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: 0 0 18px; }
.section-title--line::after {
  content: ""; display: block; width: 56px; height: 3px;
  background: linear-gradient(90deg, var(--amber-500), var(--ainu-red));
  margin: 18px 0 0; border-radius: 3px;
}
.center .section-title--line::after { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: 14px 28px; border-radius: 999px; font-weight: 700; font-family: var(--font-sans);
  cursor: pointer; border: 2px solid transparent; font-size: .98rem;
  transition: transform .18s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
  position: relative; overflow: hidden;
}
.btn::after {
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); transition: left .6s ease;
}
.btn:hover::after { left: 130%; }
.btn:hover { transform: translateY(-3px); }
.btn--primary { background: var(--amber-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--amber-500); color: #fff; box-shadow: var(--shadow-md); }
.btn--ghost { background: transparent; border-color: var(--moss-200); color: var(--forest-700); }
.btn--ghost:hover { border-color: var(--forest-700); color: var(--forest-700); }
.btn--light { background: var(--cream-100); color: var(--forest-800); }
.btn--light:hover { background: #fff; color: var(--forest-800); }

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--amber-500), var(--ainu-red), var(--moss-400));
  z-index: 200; transition: width .1s linear;
}

/* ---------- Page transition overlay ---------- */
.page-transition {
  position: fixed; inset: 0; z-index: 300; pointer-events: none;
  background: var(--forest-900);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform .42s cubic-bezier(.76,0,.24,1);
  display: grid; place-items: center;
}
.page-transition.is-leaving { transform: scaleY(1); transform-origin: bottom; pointer-events: all; }
.page-transition.is-entering { transform: scaleY(1); transform-origin: top; }
.page-transition.is-done { transform: scaleY(0); transform-origin: top; }
.page-transition__mark { opacity: 0; transition: opacity .3s ease; }
.page-transition.is-leaving .page-transition__mark,
.page-transition.is-entering .page-transition__mark { opacity: 1; }
.page-transition__mark svg { width: 56px; height: 56px; animation: spin 1.2s linear infinite; }

/* ---------- Particle canvas ---------- */
.fx-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1; opacity: .5;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 244, 236, .8);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
  transition: background .3s ease, box-shadow .3s ease;
}
.site-header.is-scrolled { background: rgba(247,244,236,.96); box-shadow: var(--shadow-sm); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark { width: 38px; height: 38px; flex: 0 0 38px; transition: transform .5s cubic-bezier(.34,1.56,.64,1); }
.brand:hover .brand__mark { transform: rotate(-12deg) scale(1.08); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-family: var(--font-serif); font-weight: 700; font-size: 1.18rem; color: var(--forest-900); letter-spacing: .04em; }
.brand__sub { font-size: .64rem; letter-spacing: .12em; color: var(--ink-500); }

.nav__links { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav__links > li > a {
  display: inline-block; padding: 10px 14px; border-radius: 8px;
  font-size: .92rem; font-weight: 600; color: var(--ink-700); position: relative;
}
.nav__links > li > a:not(.btn)::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 2px;
  background: var(--amber-500); transform: scaleX(0); transform-origin: left; transition: transform .28s ease;
}
.nav__links > li > a:not(.btn):hover::after { transform: scaleX(1); }
.nav__links a.is-active { color: var(--amber-600); }
.nav__links a.is-active::after { transform: scaleX(1); }
.nav__cta { margin-left: 8px; }

.nav__toggle { display: none; width: 44px; height: 44px; border: none; background: transparent; cursor: pointer; padding: 10px; border-radius: 8px; }
.nav__toggle span { display: block; height: 2px; background: var(--forest-800); border-radius: 2px; transition: .25s; }
.nav__toggle span + span { margin-top: 6px; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: var(--cream-100); overflow: hidden;
  background: var(--forest-900);
}
.hero__bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero__bg img {
  width: 100%; height: 120%; object-fit: cover;
  transform: scale(1.12); animation: kenburns 24s ease-in-out infinite alternate;
  will-change: transform;
}
.hero__veil {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(22,40,31,.78), rgba(30,58,47,.86)),
    radial-gradient(1000px 460px at 78% -10%, rgba(107,143,113,.45), transparent 60%);
  animation: hue-drift 16s ease-in-out infinite alternate;
}
.hero__topo { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .22; pointer-events: none; z-index: 2; }
.hero__topo path { stroke-dasharray: 2000; animation: dash 40s linear infinite; }
.hero__inner { position: relative; z-index: 3; padding: 112px 0 100px; max-width: 780px; }
.hero h1 { color: #fff; font-size: clamp(2rem, 5.2vw, 3.5rem); margin: 0 0 22px; letter-spacing: .01em; }
.hero__accent {
  background: linear-gradient(100deg, var(--amber-200), #fff 40%, var(--amber-200));
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s linear infinite;
}
.hero p { font-size: 1.12rem; color: rgba(247,244,236,.94); margin: 0 0 32px; max-width: 620px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__stats { display: flex; gap: 40px; margin-top: 56px; flex-wrap: wrap; }
.hero__stat b { display: block; font-family: var(--font-serif); font-size: 2rem; color: var(--amber-200); }
.hero__stat b small { font-size: 1rem; }
.hero__stat span { font-size: .82rem; color: rgba(247,244,236,.82); }

.hero__scroll {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 3;
  color: rgba(247,244,236,.7); font-size: .72rem; letter-spacing: .2em; text-align: center;
}
.hero__scroll::after {
  content: ""; display: block; width: 1px; height: 40px; margin: 8px auto 0;
  background: linear-gradient(var(--amber-200), transparent); animation: scrolldot 2s ease-in-out infinite;
}

/* ---------- Grid / Cards ---------- */
.grid { display: grid; gap: 26px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.card__icon {
  width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
  background: var(--cream-200); color: var(--forest-700); margin-bottom: 18px;
  transition: background .3s ease, color .3s ease, transform .3s ease;
}
.card:hover .card__icon { background: var(--forest-700); color: var(--amber-200); transform: rotate(-6deg); }
.card__icon svg { width: 28px; height: 28px; }
.card h3 { margin: 0 0 10px; font-size: 1.22rem; }
.card p { margin: 0; color: var(--ink-700); font-size: .96rem; }
.card__num { font-family: var(--font-serif); font-size: 1rem; color: var(--amber-600); font-weight: 700; }

.pillar { position: relative; padding-top: 60px; overflow: hidden; }
.pillar__tag {
  position: absolute; top: 22px; left: 30px; background: var(--forest-700); color: #fff;
  font-size: .74rem; font-weight: 700; letter-spacing: .1em; padding: 6px 14px; border-radius: 999px;
  animation: float-y 5s ease-in-out infinite;
}
.pillar::before {
  content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(184,92,56,.14), transparent 70%); transition: transform .5s ease;
}
.pillar:hover::before { transform: scale(1.7); }

/* ---------- 3D tilt ---------- */
.grid { perspective: 1300px; }
.tilt { transform-style: preserve-3d; transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s ease; will-change: transform; }
.tilt .card__icon, .tilt h3, .tilt p, .tilt .pillar__tag, .tilt .card__num { transition: transform .35s cubic-bezier(.22,1,.36,1); }
.tilt:hover { box-shadow: var(--shadow-lg); }
.tilt:hover .card__icon { transform: translateZ(58px) rotate(-6deg); }
.tilt:hover .pillar__tag { transform: translateZ(66px); }
.tilt:hover h3 { transform: translateZ(38px); }
.tilt:hover .card__num { transform: translateZ(30px); }
.tilt:hover p { transform: translateZ(18px); }
/* 3Dで浮く画像フレーム */
.media-frame.tilt { transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s ease; }
.media-frame.tilt:hover { box-shadow: var(--shadow-lg); }
.media-frame.tilt .media-frame__tag { transition: transform .35s cubic-bezier(.22,1,.36,1); }
.media-frame.tilt:hover .media-frame__tag { transform: translateZ(50px); }
.media-frame.tilt:hover .media-frame__cap { transform: translateZ(26px); }

/* ---------- Media frames (images) ---------- */
.media-frame { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); background: var(--forest-700); }
.media-frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.22,1,.36,1); }
.media-frame:hover img { transform: scale(1.06); }
.media-frame--tall { aspect-ratio: 4 / 5; }
.media-frame--wide { aspect-ratio: 16 / 10; }
.media-frame--square { aspect-ratio: 1 / 1; }
.media-frame__cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 18px; color: #fff; font-size: .82rem;
  background: linear-gradient(transparent, rgba(22,40,31,.82));
}
.media-frame__tag {
  position: absolute; top: 14px; left: 14px; background: rgba(168,50,45,.92); color: #fff;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; padding: 5px 12px; border-radius: 999px;
}

/* image parallax layer */
.parallax-img { will-change: transform; }

/* ---------- Stat band ---------- */
.stat-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat { text-align: center; padding: 10px; }
.stat b { display: block; font-family: var(--font-serif); font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--amber-200); }
.stat span { font-size: .86rem; color: rgba(247,244,236,.85); }

/* ---------- Flow ---------- */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.flow__item { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px; position: relative; transition: transform .25s ease, box-shadow .25s ease; }
.flow__item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.flow__item::before {
  counter-increment: step; content: counter(step); display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%; background: var(--amber-600); color: #fff;
  font-family: var(--font-serif); font-weight: 700; margin-bottom: 14px;
}
.flow__item h4 { margin: 0 0 8px; font-size: 1.05rem; }
.flow__item p { margin: 0; font-size: .9rem; color: var(--ink-700); }

/* ---------- Split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; perspective: 1300px; }
.split--reverse .split__media { order: 2; }
.split__media { border-radius: var(--radius); overflow: hidden; min-height: 340px; background: var(--forest-700); box-shadow: var(--shadow-md); display: grid; place-items: center; }
.split__media img { width: 100%; height: 100%; object-fit: cover; }
.split ul { padding-left: 0; list-style: none; margin: 22px 0 0; }
.split ul li { position: relative; padding-left: 30px; margin-bottom: 14px; color: var(--ink-700); }
.split ul li::before { content: ""; position: absolute; left: 0; top: .55em; width: 14px; height: 14px; border-radius: 50%; background: var(--moss-400); box-shadow: 0 0 0 4px rgba(107,143,113,.2); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table.data { width: 100%; border-collapse: collapse; background: var(--paper); min-width: 520px; }
table.data th, table.data td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); font-size: .95rem; }
table.data thead th { background: var(--forest-800); color: #fff; font-family: var(--font-sans); font-weight: 700; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:nth-child(even) { background: var(--cream-100); }

/* ---------- Page hero (sub pages) ---------- */
.page-hero { position: relative; color: var(--cream-100); overflow: hidden; background: var(--forest-900); }
.page-hero__bg { position: absolute; inset: 0; z-index: 0; }
.page-hero__bg img { width: 100%; height: 120%; object-fit: cover; transform: scale(1.1); animation: kenburns 26s ease-in-out infinite alternate; }
.page-hero__veil { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(22,40,31,.82), rgba(30,58,47,.9)); }
.page-hero__topo { position: absolute; inset: 0; opacity: .18; z-index: 2; }
.page-hero__inner { position: relative; z-index: 3; padding: 84px 0; }
.page-hero h1 { color: #fff; font-size: clamp(1.8rem, 4.4vw, 2.9rem); margin: 0 0 14px; }
.page-hero p { color: rgba(247,244,236,.92); margin: 0; max-width: 640px; }
.breadcrumb { font-size: .82rem; color: rgba(247,244,236,.72); margin-bottom: 18px; }
.breadcrumb a { color: var(--amber-200); }

/* ---------- Ainu-inspired decorative band ---------- */
.ainu-band { height: 26px; width: 100%; background-repeat: repeat-x; background-size: auto 26px; opacity: .9; }
.ainu-divider { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 6px 0; }
.ainu-divider svg { height: 30px; width: auto; }
.ainu-accent { position: relative; }
.ainu-accent::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 8px;
  background-repeat: repeat-x; background-size: auto 8px; opacity: .85;
}
/* アイヌ文様の帯（CSSのみで全ページの該当セクションへ付与） */
.section--cream, .cta-band, .section--forest { position: relative; }
.section--cream::before, .cta-band::after, .section--forest::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 22px;
  background-repeat: repeat-x; background-size: auto 22px; pointer-events: none; z-index: 2;
}
/* 生成りのセクション → 藍＋赤の紋様 */
.section--cream::before {
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='120'%20height='22'%20viewBox='0%200%20120%2022'%3E%3Cg%20fill='none'%20stroke='%231d2b45'%20stroke-width='2'%20stroke-linecap='round'%3E%3Cpath%20d='M6%2011c0-7%2014-7%2014%200s14%207%2014%200'/%3E%3Cpath%20d='M60%203l8%208-8%208-8-8z'/%3E%3Cpath%20d='M80%2011c0-7%2014-7%2014%200s14%207%2014%200'/%3E%3C/g%3E%3Cpath%20d='M60%207l4%204-4%204-4-4z'%20fill='%23a8322d'/%3E%3C/svg%3E");
}
/* 濃色のセクション → 生成り＋赤の紋様 */
.cta-band::after, .section--forest::after {
  opacity: .6;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='120'%20height='22'%20viewBox='0%200%20120%2022'%3E%3Cg%20fill='none'%20stroke='%23e8c9a8'%20stroke-width='2'%20stroke-linecap='round'%3E%3Cpath%20d='M6%2011c0-7%2014-7%2014%200s14%207%2014%200'/%3E%3Cpath%20d='M60%203l8%208-8%208-8-8z'/%3E%3Cpath%20d='M80%2011c0-7%2014-7%2014%200s14%207%2014%200'/%3E%3C/g%3E%3Cpath%20d='M60%207l4%204-4%204-4-4z'%20fill='%23a8322d'/%3E%3C/svg%3E");
}

/* ---------- Callout / Note ---------- */
.callout { background: var(--cream-200); border-left: 4px solid var(--ainu-red); border-radius: 10px; padding: 20px 24px; color: var(--ink-700); font-size: .95rem; }
.note { font-size: .82rem; color: var(--ink-500); }

/* ---------- CTA band ---------- */
.cta-band { position: relative; background: var(--amber-600); color: #fff; text-align: center; overflow: hidden; }
.cta-band::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 300px at 20% 0%, rgba(255,255,255,.18), transparent 60%),
              radial-gradient(600px 300px at 90% 100%, rgba(168,50,45,.4), transparent 60%);
  animation: hue-drift 12s ease-in-out infinite alternate;
}
.cta-band .container { position: relative; z-index: 1; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.94); max-width: 620px; margin: 0 auto 28px; }

/* ---------- Donut chart (fixed) ---------- */
.donut { width: 100%; max-width: 340px; margin: 0 auto; display: block; }
.donut__track { fill: none; stroke: rgba(255,255,255,.22); }
.donut__arc { fill: none; stroke: var(--cream-100); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 120px 120px; stroke-dasharray: 565.49; stroke-dashoffset: 565.49; transition: stroke-dashoffset 1.6s cubic-bezier(.22,1,.36,1); }
.donut.is-visible .donut__arc { stroke-dashoffset: 486.3; } /* 14% filled */
.donut__num { font-family: var(--font-serif); font-weight: 700; fill: var(--cream-100); }
.donut__label { fill: rgba(255,255,255,.85); font-family: var(--font-sans); }

/* ---------- Forms ---------- */
.form { max-width: 720px; margin: 0 auto; }
.form__row { margin-bottom: 22px; }
.form__row--2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.form label { display: block; font-weight: 700; margin-bottom: 8px; font-size: .94rem; color: var(--forest-900); }
.form .req { color: var(--amber-600); font-size: .8rem; margin-left: 6px; }
.form input, .form select, .form textarea { width: 100%; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 1rem; background: var(--paper); color: var(--ink-900); transition: border-color .2s, box-shadow .2s; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--forest-500); box-shadow: 0 0 0 3px rgba(79,122,94,.15); }
.form textarea { min-height: 150px; resize: vertical; }
.form .error-msg { color: var(--amber-600); font-size: .82rem; margin-top: 6px; display: none; }
.form .is-invalid { border-color: var(--amber-600); }
.form .is-invalid + .error-msg { display: block; }
.form__check { display: flex; align-items: flex-start; gap: 10px; }
.form__check input { width: auto; margin-top: 6px; }
.form__note { font-size: .84rem; color: var(--ink-500); }
.form__success { display: none; background: #eaf3ec; border: 1px solid var(--moss-400); color: var(--forest-800); padding: 18px 22px; border-radius: 10px; margin-bottom: 24px; font-weight: 600; }
.form__success.is-visible { display: block; animation: pop .4s ease; }

/* ---------- Legal / Prose ---------- */
.prose { max-width: 820px; }
.prose h2 { font-size: 1.4rem; margin: 40px 0 12px; padding-top: 8px; }
.prose h3 { font-size: 1.12rem; margin: 26px 0 8px; }
.prose p, .prose li { color: var(--ink-700); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose .toc { background: var(--cream-200); border-radius: var(--radius); padding: 22px 26px; }
.prose .toc ol { margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--forest-900); color: rgba(247,244,236,.8); padding: 0 0 28px; position: relative; }
.site-footer .footer__inner { padding: 64px 0 0; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer__brand .brand__name { color: #fff; }
.footer__brand p { font-size: .9rem; margin: 16px 0 0; max-width: 320px; }
.footer h4 { color: #fff; font-size: .95rem; margin: 0 0 16px; font-family: var(--font-sans); letter-spacing: .05em; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer ul li { margin-bottom: 10px; }
.footer ul a { color: rgba(247,244,236,.78); font-size: .9rem; }
.footer ul a:hover { color: var(--amber-200); }
.footer__bottom { border-top: 1px solid rgba(247,244,236,.15); padding-top: 22px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: .82rem; color: rgba(247,244,236,.6); }

/* ---------- Reveal animations ---------- */
.reveal, .reveal-left, .reveal-right, .reveal-scale { opacity: 0; transition: opacity .8s cubic-bezier(.22,1,.36,1), transform .8s cubic-bezier(.22,1,.36,1); }
.reveal { transform: translateY(30px); }
.reveal-left { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal-scale { transform: scale(.92); }
.reveal.is-visible, .reveal-left.is-visible, .reveal-right.is-visible, .reveal-scale.is-visible { opacity: 1; transform: none; }
/* stagger */
[data-delay="1"] { transition-delay: .08s; }
[data-delay="2"] { transition-delay: .16s; }
[data-delay="3"] { transition-delay: .24s; }
[data-delay="4"] { transition-delay: .32s; }

/* ---------- Keyframes ---------- */
@keyframes kenburns { from { transform: scale(1.12) translateY(0); } to { transform: scale(1.22) translateY(-2%); } }
@keyframes hue-drift { 0% { filter: hue-rotate(0deg) saturate(1); } 100% { filter: hue-rotate(-14deg) saturate(1.15); } }
@keyframes shimmer { to { background-position: 200% center; } }
@keyframes dash { to { stroke-dashoffset: -2000; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scrolldot { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.96); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes float-y { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid--3, .grid--4, .stat-band, .flow { grid-template-columns: repeat(2, 1fr); }
  .split, .footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .split--reverse .split__media { order: 0; }
  .form__row--2 { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .section { padding: 60px 0; }
  .nav__links {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--cream-100); border-bottom: 1px solid var(--line); padding: 12px 20px 20px; gap: 2px;
    box-shadow: var(--shadow-md); transform: translateY(-140%); transition: transform .35s cubic-bezier(.76,0,.24,1); z-index: 90;
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__links > li > a { padding: 14px 12px; border-radius: 8px; }
  .nav__cta { margin: 8px 0 0; }
  .nav__toggle { display: block; }
  .grid--3, .grid--4, .stat-band, .flow { grid-template-columns: 1fr; }
  .hero__stats { gap: 26px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal, .reveal-left, .reveal-right, .reveal-scale { opacity: 1; transform: none; }
  .fx-canvas { display: none; }
}
