/* ==========================================================================
   base.css – Schriften, Farb-Tokens, Reset, Typografie, Layout-Helfer
   Thema: Alpine Topografie (Granit, Nadelwald, Schnee, Gletscherblau)
   ========================================================================== */

@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 300 700; font-display: swap; src: url('../fonts/fraunces.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 300 700; font-display: swap; src: url('../fonts/fraunces-italic.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('../fonts/archivo.woff2') format('woff2'); }
@font-face { font-family: 'Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/plex-mono-400.woff2') format('woff2'); }
@font-face { font-family: 'Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/plex-mono-500.woff2') format('woff2'); }

:root {
  /* Schnee & Papier */
  --snow: #f4f2ec;
  --snow-2: #ebe7dc;
  --snow-3: #e0dbcd;
  --white: #fbfaf7;
  /* Granit */
  --granite-950: #161b1e;
  --granite-900: #1e2529;
  --granite-800: #2a3338;
  --granite-700: #3a454b;
  --granite-600: #55616a;
  --granite-500: #64707a;
  --granite-300: #aab2b6;
  --granite-200: #c9ced0;
  /* Nadelwald */
  --pine-950: #0f1f17;
  --pine-900: #15281e;
  --pine-800: #1c3528;
  --pine-700: #24473a;
  --pine-500: #3f6d58;
  --pine-300: #8db3a0;
  /* Gletscher */
  --glacier-50: #eef6f8;
  --glacier-100: #dcecf1;
  --glacier-200: #bcdbe5;
  --glacier-300: #9fcbd8;
  --glacier-500: #4f94ab;
  --glacier-600: #3b7d95;
  --glacier-700: #2b6479;
  /* Kartenfarben */
  --contour: #a9764a;
  --contour-soft: rgba(169, 118, 74, 0.32);
  --contour-text: #8a5a32; /* Kartenbraun für kleine Schrift (Kontrast ≥ 4.5:1 auf Schnee) */
  --alpenglow: #e29a6b;
  --alpenglow-deep: #b8643a;

  --ink: var(--granite-900);
  --ink-soft: var(--granite-600);
  --line: rgba(30, 37, 41, 0.14);
  --line-strong: rgba(30, 37, 41, 0.28);

  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-body: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --wrap: 1200px;
  --radius: 14px;
  --radius-lg: 22px;
  --header-h: 68px;
  --shadow-1: 0 1px 2px rgba(22, 27, 30, 0.06), 0 8px 24px -12px rgba(22, 27, 30, 0.18);
  --shadow-2: 0 2px 4px rgba(22, 27, 30, 0.06), 0 24px 60px -24px rgba(22, 27, 30, 0.35);
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--snow);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.62;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--glacier-500);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-dark :focus-visible, .on-dark:focus-visible { outline-color: var(--glacier-300); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--pine-900); color: var(--snow); padding: 10px 16px; border-radius: 10px;
  text-decoration: none; font-weight: 600; transition: top .2s;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Typografie ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 420;
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin: 0 0 .5em;
  hyphens: auto;
  overflow-wrap: break-word;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 5.4vw + .6rem, 5.4rem); font-weight: 380; letter-spacing: -0.025em; }
h2 { font-size: clamp(2rem, 3vw + .9rem, 3.4rem); }
h3 { font-size: clamp(1.25rem, .6vw + 1.05rem, 1.55rem); line-height: 1.2; letter-spacing: -0.005em; }
h1 em, h2 em { font-style: italic; font-weight: 340; color: var(--glacier-700); }
.on-dark h1 em, .on-dark h2 em { color: var(--glacier-300); }

.lead { font-size: clamp(1.08rem, .4vw + 1rem, 1.28rem); line-height: 1.55; color: var(--ink-soft); max-width: 62ch; }
.on-dark .lead { color: rgba(244, 242, 236, 0.78); }
.small { font-size: .9rem; }
.muted { color: var(--ink-soft); }
.mono { font-family: var(--font-mono); }
strong { font-weight: 650; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .6em; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: .74rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--contour-text);
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: ''; width: 11px; height: 10px; flex: none;
  background: currentColor; clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.eyebrow .alt { color: var(--granite-500); letter-spacing: .08em; }
.on-dark .eyebrow { color: var(--alpenglow); }
.on-dark .eyebrow .alt { color: var(--granite-300); }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.section { position: relative; padding-block: clamp(72px, 9vw, 128px); }
.section--tight { padding-block: clamp(56px, 6vw, 88px); }
.section--paper2 { background: var(--snow-2); }
.section--dark { background: var(--pine-900); color: var(--snow); }
.section--granite { background: var(--granite-900); color: var(--snow); }
.section--glacier { background: linear-gradient(180deg, var(--glacier-50), var(--glacier-100)); }

.sec-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 60px); }
.sec-head--center { margin-inline: auto; text-align: center; }
.sec-head--center .eyebrow { justify-content: center; }
.sec-head--split { max-width: none; display: grid; gap: 20px 60px; align-items: end; }
@media (min-width: 900px) { .sec-head--split { grid-template-columns: 1.1fr 1fr; } .sec-head--split .lead { margin-bottom: .3em; } }

.grid { display: grid; gap: clamp(16px, 2.4vw, 28px); }
@media (min-width: 700px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } .grid--4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 640px) and (max-width: 999px) { .grid--4 { grid-template-columns: repeat(2, 1fr); } }

/* Kartenrahmen: alternierende Balken wie am Rand eines Kartenblatts */
.neatline {
  position: absolute; left: 0; right: 0; top: 0; height: 6px;
  background:
    repeating-linear-gradient(90deg, var(--granite-900) 0 48px, transparent 48px 96px) top / 100% 3px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) 0 5px / 100% 1px no-repeat;
  opacity: .55;
}
.on-dark .neatline, .section--dark .neatline, .section--granite .neatline {
  background:
    repeating-linear-gradient(90deg, var(--snow) 0 48px, transparent 48px 96px) top / 100% 3px no-repeat,
    linear-gradient(rgba(244,242,236,.25), rgba(244,242,236,.25)) 0 5px / 100% 1px no-repeat;
  opacity: .35;
}
.coord-ticks {
  position: absolute; top: 14px; left: var(--gutter); right: var(--gutter);
  display: flex; justify-content: space-between; pointer-events: none;
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .08em; color: var(--granite-500); opacity: .8;
}
.on-dark .coord-ticks, .section--dark .coord-ticks, .section--granite .coord-ticks { color: var(--granite-300); }
@media (max-width: 699px) { .coord-ticks span:nth-child(n+3) { display: none; } }

/* Topo-Hintergrund (Canvas, prozedural) */
.topo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.topo-host { position: relative; isolation: isolate; }
.topo-host > .topo { z-index: -1; }

/* ---------- Scroll-Reveal ----------
   Inhalte sind im HTML vorhanden; nur mit JS (Klasse .js) und ohne reduzierte Bewegung
   wird kurz ausgeblendet und beim Einblenden animiert. */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html:focus-within { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
