/* =========================================================================
   Gibbon Conservation Alliance — base.css
   Design-Tokens, Reset, Typografie, Hilfsklassen
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&display=swap');

:root {
  /* --- Farben ------------------------------------------------------------
     Basis bleibt das Vereinsgrün. Ergänzt um warmes Papierweiss statt
     klinischem Weiss, eine sehr dunkle Waldstufe für Kontrastflächen und
     ein Lehmrot, das ausschliesslich Gefährdungsstufen markiert.          */
  --paper:        #f7f5ed;
  --paper-alt:    #ece7d9;
  --paper-deep:   #ddd7c4;
  --white:        #ffffff;

  --ink:          #15190f;
  --ink-soft:     #4d5545;
  --ink-faint:    #7a8371;

  --forest:       #0d3d05;   /* Primärgrün, aus #015100 abgeleitet    */
  --forest-mid:   #2c6413;
  --forest-deep:  #06210a;   /* dunkle Flächen                        */
  --forest-tint:  #e3e9d8;

  --lime:         #c8d400;   /* Akzent der Marke                      */
  --lime-deep:    #96a300;
  --clay:         #b0501f;   /* nur für Gefährdung / Warnung          */
  --clay-soft:    #e2b79a;

  --rule:         #d5cfbc;
  --rule-dark:    rgba(247, 245, 237, 0.16);

  /* --- Typografie ------------------------------------------------------ */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body:    'Archivo', 'Helvetica Neue', Arial, sans-serif;

  --fs-2xs:  0.75rem;
  --fs-xs:   clamp(0.8125rem, 0.79rem + 0.12vw, 0.875rem);
  --fs-sm:   clamp(0.9375rem, 0.91rem + 0.14vw, 1rem);
  --fs-base: clamp(1.0625rem, 1.02rem + 0.22vw, 1.1875rem);
  --fs-md:   clamp(1.1875rem, 1.11rem + 0.4vw, 1.4375rem);
  --fs-lg:   clamp(1.5rem, 1.3rem + 1vw, 2.125rem);
  --fs-xl:   clamp(2rem, 1.6rem + 1.9vw, 3.125rem);
  --fs-2xl:  clamp(2.6rem, 1.9rem + 3.3vw, 5rem);
  --fs-3xl:  clamp(3.2rem, 2rem + 5.4vw, 7rem);

  /* --- Raster & Abstände ----------------------------------------------- */
  --sp-3xs: 0.25rem;
  --sp-2xs: 0.5rem;
  --sp-xs:  0.875rem;
  --sp-sm:  1.375rem;
  --sp-md:  2.25rem;
  --sp-lg:  3.5rem;
  --sp-xl:  clamp(4rem, 3rem + 4vw, 7rem);
  --sp-2xl: clamp(5.5rem, 4rem + 6vw, 10rem);

  --wrap:        1180px;
  --wrap-wide:   1440px;
  --wrap-narrow: 720px;

  --radius-sm: 3px;
  --radius:    8px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(13, 61, 5, 0.07), 0 2px 8px rgba(13, 61, 5, 0.05);
  --shadow:    0 2px 6px rgba(13, 61, 5, 0.07), 0 12px 32px rgba(13, 61, 5, 0.09);
  --shadow-lg: 0 24px 64px rgba(6, 33, 10, 0.18);

  --ease:      220ms cubic-bezier(0.32, 0.72, 0, 1);
  --ease-slow: 640ms cubic-bezier(0.32, 0.72, 0, 1);

  --nav-h: 68px;
}

/* --- Reset --------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

ul, ol { padding-left: 1.35em; }
li + li { margin-top: 0.3em; }

/* --- Typografie ---------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.018em;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: var(--fs-2xl); font-variation-settings: 'opsz' 120; }
h2 { font-size: var(--fs-xl);  font-variation-settings: 'opsz' 80; }
h3 { font-size: var(--fs-lg);  font-variation-settings: 'opsz' 40; letter-spacing: -0.01em; }
h4 { font-size: var(--fs-md);  font-variation-settings: 'opsz' 24; letter-spacing: -0.005em; }

p { max-width: 68ch; }
p + p { margin-top: 0.9em; }

strong, b { font-weight: 600; }
em, i { font-style: italic; }

a {
  color: var(--forest);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: rgba(13, 61, 5, 0.32);
  transition: color var(--ease), text-decoration-color var(--ease);
}
a:hover { color: var(--forest-mid); text-decoration-color: var(--lime-deep); }

:focus-visible {
  outline: 2px solid var(--forest-mid);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--lime); color: var(--forest-deep); }

/* Der Sinnabschnitt-Trenner: eine feine Linie mit Limepunkt */
hr {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: var(--sp-lg) 0;
}

/* --- Wiederkehrende Text-Bausteine ---------------------------------------- */

/* Kleine Kapitälchen-Marke über Überschriften */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--forest-mid);
  margin-bottom: var(--sp-xs);
}
.eyebrow::before {
  content: '';
  width: 1.6em;
  height: 2px;
  background: var(--lime);
  flex: none;
}
.eyebrow--light { color: var(--lime); }
.eyebrow--light::before { background: var(--lime); opacity: 0.7; }

/* Einleitungsabsatz, etwas grösser gesetzt */
.lead {
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 42ch;
}

.prose > * + * { margin-top: 1em; }
.prose h3 { margin-top: 1.8em; }
.prose ul, .prose ol { max-width: 66ch; }

.small { font-size: var(--fs-sm); color: var(--ink-soft); }
.muted { color: var(--ink-soft); }

/* --- Layout-Hilfen -------------------------------------------------------- */

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}
.wrap--wide   { width: min(100% - 2.5rem, var(--wrap-wide)); }
.wrap--narrow { width: min(100% - 2.5rem, var(--wrap-narrow)); }

.section { padding-block: var(--sp-xl); }
.section--tight { padding-block: var(--sp-lg); }
.section--alt  { background: var(--paper-alt); }
.section--tint { background: var(--forest-tint); }

.stack-sm > * + * { margin-top: var(--sp-sm); }
.stack-md > * + * { margin-top: var(--sp-md); }

.center { text-align: center; }
.center p, .center .lead { margin-inline: auto; }

.grid { display: grid; gap: var(--sp-md); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

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

.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: absolute; top: -100px; left: var(--sp-sm); z-index: 200;
  background: var(--forest); color: var(--paper);
  padding: 0.75em 1.25em; border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 0; color: var(--paper); }

/* --- Bilder --------------------------------------------------------------- */

.figure { position: relative; }
.figure img { width: 100%; object-fit: cover; }

.ratio-43  { aspect-ratio: 4 / 3;  overflow: hidden; }
.ratio-11  { aspect-ratio: 1 / 1;  overflow: hidden; }
.ratio-32  { aspect-ratio: 3 / 2;  overflow: hidden; }
.ratio-169 { aspect-ratio: 16 / 9; overflow: hidden; }
.ratio-43 img, .ratio-11 img, .ratio-32 img, .ratio-169 img {
  width: 100%; height: 100%; object-fit: cover;
}

/* Fotonachweis, dezent an der Bildkante */
.credit {
  position: absolute;
  right: 0.7rem;
  bottom: 0.6rem;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(6, 33, 10, 0.42);
  backdrop-filter: blur(4px);
  padding: 0.25em 0.6em;
  border-radius: 100px;
  pointer-events: none;
}

/* --- Körnung für dunkle Flächen ------------------------------------------- */
/* Gibt den grossen Farbflächen Tiefe, damit nichts nach Vorlage aussieht.   */
.grain { position: relative; isolation: isolate; }
.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.42;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.grain > * { position: relative; z-index: 2; }

/* --- Scroll-Reveal -------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--ease-slow), transform var(--ease-slow);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal-1 { transition-delay: 90ms; }
.reveal-2 { transition-delay: 180ms; }
.reveal-3 { transition-delay: 270ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Druck ---------------------------------------------------------------- */
@media print {
  .site-nav, .site-footer, .songline, .to-top { display: none !important; }
  body { background: #fff; }
  .reveal { opacity: 1; transform: none; }
}
