/* Bergschule Lindenkar, Zugspitze durchs Reintal. Seitenstil.
   Die Engine-Klassen bleiben unangetastet; hier stehen Marke, Tafeln,
   Höhenmesser und Gipfelbuch. */
:root {
  --sc-canvas:     #E8EAE7;
  --sc-surface:    #F5F5F1;
  --sc-ink:        #1D2124;
  --sc-ink-soft:   #4C575D;
  --sc-accent:     #E2551F;
  --sc-accent-ink: #1D2124;
  --sc-font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --sc-font-text:    "Figtree", system-ui, sans-serif;
  --sc-font-mono:    "Figtree", system-ui, sans-serif;
  --sc-shadow-color: 200 12% 18%;
  --messer-h: 104px;
  color-scheme: light;
}
html { background: var(--sc-canvas); scrollbar-color: #A9B0AE var(--sc-canvas); }
body { font-family: var(--sc-font-text); color: var(--sc-ink); background: var(--sc-canvas); }
::selection { background: var(--sc-accent); color: #fff; }
:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 3px; border-radius: 4px; }
input, select { caret-color: var(--sc-accent); }

.anzeige {
  font-family: var(--sc-font-display);
  font-variation-settings: "opsz" 96, "wdth" 82;
  font-weight: 700; letter-spacing: -0.025em; line-height: .98; margin: 0;
  text-wrap: balance;
}
.anzeige--xl { font-size: clamp(2.7rem, 1.4rem + 5.4vw, 6.4rem); }
.anzeige--lg { font-size: clamp(1.6rem, 1.1rem + 1.7vw, 2.5rem); line-height: 1.04; }

/* ---------- Kopf ---------- */
.kopf {
  position: fixed; inset: 0 0 auto 0; z-index: var(--sc-z-chrome);
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--sc-gutter); pointer-events: none;
}
.kopf a { pointer-events: auto; }
.wortmarke {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--sc-ink);
  font: 700 21px/1 var(--sc-font-display); font-variation-settings: "opsz" 40, "wdth" 85; letter-spacing: -.01em;
  padding: 8px 12px 8px 10px; border-radius: 4px; background: color-mix(in oklab, var(--sc-surface) 82%, transparent);
  backdrop-filter: blur(6px);
}
.wortmarke svg { width: 28px; height: 18px; }
.kopf__link {
  color: var(--sc-ink); font-weight: 600; font-size: var(--sc-t-sm);
  padding: 10px 14px; border-radius: 4px; background: color-mix(in oklab, var(--sc-surface) 82%, transparent); backdrop-filter: blur(6px);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; text-decoration-color: var(--sc-accent);
}

/* ---------- Knopf ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 24px;
  border-radius: 4px; white-space: nowrap; text-decoration: none; cursor: pointer;
  font: 700 1rem/1 var(--sc-font-text); color: var(--sc-ink); background: transparent;
  border: 1.5px solid var(--sc-ink);
  transition: transform 140ms var(--sc-ease-out), background-color 160ms var(--sc-ease-out), color 160ms var(--sc-ease-out);
}
.knopf:active { transform: translateY(1px); }
@media (hover: hover) and (pointer: fine) { .knopf:hover { background: var(--sc-ink); color: var(--sc-surface); } }
.knopf--voll { position: relative; overflow: hidden; isolation: isolate; background: var(--sc-accent); border-color: var(--sc-accent); color: var(--sc-accent-ink); }
.knopf--voll::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(105deg, transparent 35%, rgb(255 255 255 / .34) 50%, transparent 65%) -200% 0 / 200% 100% no-repeat,
    repeating-linear-gradient(90deg, rgb(0 0 0 / .06) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(0deg, rgb(0 0 0 / .06) 0 1px, transparent 1px 6px);
  animation: streif 4.8s var(--sc-ease-in-out) infinite;
}
@keyframes streif { 0%, 55% { background-position: -200% 0, 0 0, 0 0; } 100% { background-position: 200% 0, 0 0, 0 0; } }
@media (hover: hover) and (pointer: fine) { .knopf--voll:hover { background: #EC6A37; color: var(--sc-ink); } }

/* ---------- Nebel: Abschirmung nur wo Text steht ---------- */
.nebel {
  background:
    radial-gradient(95% 115% at 0% 0%, rgb(232 234 231 / var(--nebel-held, .9)) 0%, rgb(232 234 231 / calc(var(--nebel-held, .9) * .9)) 50%, rgb(232 234 231 / calc(var(--nebel-held, .9) * .45)) 68%, transparent 86%),
    linear-gradient(to top, rgb(232 234 231 / .92) 0, rgb(232 234 231 / .55) calc(var(--messer-h) + 10px), transparent calc(var(--messer-h) + 90px));
}

/* ---------- Hero ---------- */
.held { top: clamp(6rem, 15vh, 9rem); left: var(--sc-gutter); max-width: min(48rem, 80vw); }
.held h1 { max-width: 11ch; }
.held__sub { margin-top: var(--sc-5); max-width: 34ch; font-size: var(--sc-t-lg); line-height: 1.5; color: #2E373C; font-weight: 500; }
.held__knopf { inset: auto; left: var(--sc-gutter); top: calc(clamp(6rem, 15vh, 9rem) + var(--held-h, 21rem)); max-width: none; background: rgb(245 245 241 / .92); }
@media (hover: hover) and (pointer: fine) { .held__knopf:hover { background: var(--sc-ink); } }

/* ---------- Tafeln: eine Karte je Station ---------- */
.tafel {
  top: auto; bottom: calc(var(--messer-h) + 28px); left: var(--sc-gutter); right: auto;
  width: min(30rem, calc(100vw - 2 * var(--sc-gutter)));
  padding: 22px 24px 24px; border-radius: 6px;
  background: rgb(245 245 241 / .95);
  box-shadow: inset 0 1px 0 #fff, var(--sc-e3);
  isolation: isolate; overflow: hidden;
}
.tafel--rechts { left: auto; right: var(--sc-gutter); }
.tafel::before { /* Höhenlinien im Papier, nach unten links ausgeblendet */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-radial-gradient(ellipse 120% 90% at 92% 8%, transparent 0 13px, rgb(29 33 36 / .06) 13px 14px);
  mask-image: radial-gradient(90% 90% at 100% 0%, #000 20%, transparent 75%);
}
.tafel::after { /* eine langsam wandernde Helligkeit */
  content: ""; position: absolute; z-index: -1; width: 60%; height: 140%; top: -20%; left: -30%; pointer-events: none;
  background: radial-gradient(closest-side, rgb(255 255 255 / .55), transparent);
  animation: licht 11s var(--sc-ease-in-out) infinite alternate;
}
@keyframes licht { to { transform: translateX(150%); } }
.tafel__ort {
  display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 12px;
  font: 700 var(--sc-t-xs)/1.2 var(--sc-font-text); letter-spacing: .12em; text-transform: uppercase; color: #B8401A;
}
.tafel__ort span { color: var(--sc-ink); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.tafel p:last-child { margin: 14px 0 0; color: var(--sc-ink-soft); font-size: 1.04rem; line-height: 1.58; text-wrap: pretty; }

/* ---------- Höhenmesser ---------- */
.messer {
  position: fixed; z-index: var(--sc-z-chrome); left: var(--sc-gutter); right: var(--sc-gutter); bottom: 14px;
  height: var(--messer-h); display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: stretch;
  padding: 12px 16px 10px; border-radius: 6px;
  background: color-mix(in oklab, var(--sc-surface) 90%, transparent);
  box-shadow: inset 0 1px 0 #fff, var(--sc-e2); backdrop-filter: blur(8px);
  transition: opacity 260ms var(--sc-ease-out), translate 260ms var(--sc-ease-out);
}
.messer.ist-weg { opacity: 0; translate: 0 16px; pointer-events: none; }
.messer__werte { min-height: 0; overflow: hidden; display: grid; align-content: center; gap: 4px; min-width: 9.5rem; padding-right: 18px; border-right: 1px solid rgb(29 33 36 / .12); }
.messer p { margin: 0; }
.messer__hoehe { display: flex; align-items: baseline; gap: 4px; }
.messer__hoehe b { font: 700 2.3rem/1 var(--sc-font-display); font-variation-settings: "opsz" 60, "wdth" 78; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.messer__hoehe span { font-weight: 600; color: var(--sc-ink-soft); }
.messer__klein { display: flex; gap: 14px; font-size: 13px; color: var(--sc-ink-soft); }
.messer__klein b { color: var(--sc-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.messer__profil { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; overflow: hidden; }
.messer__profil svg { width: 100%; height: 100%; min-height: 0; overflow: visible; padding: 6px 0; }
.profil__flaeche { fill: rgb(29 33 36 / .07); }
.profil__linie { fill: none; stroke: rgb(29 33 36 / .35); stroke-width: 1.5; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.profil__gegangen { fill: none; stroke: var(--sc-accent); stroke-width: 3; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.profil__punkt { fill: var(--sc-accent); stroke: #fff; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.messer__stationen { display: grid; grid-template-columns: repeat(6, 1fr); list-style: none; margin: 4px 0 0; padding: 0; }
.messer__stationen a {
  display: block; padding: 4px 2px; font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--sc-ink-soft);
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-top: 2px solid transparent; transition: color 160ms var(--sc-ease-out), border-color 160ms var(--sc-ease-out);
}
.messer__stationen a i { font-style: normal; font-weight: 500; opacity: .8; font-variant-numeric: tabular-nums; }
.messer__stationen a[aria-current="true"] { color: var(--sc-ink); border-top-color: var(--sc-accent); }
@media (hover: hover) and (pointer: fine) { .messer__stationen a:hover { color: var(--sc-ink); } }

/* ---------- Finale: Gipfel und Gipfelbuch ---------- */
.finale__kopf {
  inset: auto; left: var(--sc-gutter); top: clamp(5rem, 11vh, 7rem); width: min(32rem, 44vw);
  isolation: isolate; overflow: hidden; max-width: 32rem; padding: 22px 24px 24px; border-radius: 6px;
  background: rgb(245 245 241 / .95); box-shadow: inset 0 1px 0 #fff, var(--sc-e3);
}
.finale__kopf p:last-child { margin: 16px 0 0; color: var(--sc-ink-soft); font-size: 1.04rem; line-height: 1.58; }
.buch {
  inset: auto; right: var(--sc-gutter); top: clamp(5rem, 11vh, 7rem); width: min(27rem, 40vw); max-width: none; padding: 22px 24px; border-radius: 3px;
  background: #FBF8F0; color: var(--sc-ink);
  box-shadow: 0 1px 0 #fff inset, 0 2px 4px rgb(40 34 20 / .18), 0 22px 48px -16px rgb(40 34 20 / .45);
  rotate: -1.2deg;
}
.buch::before { /* liniertes Papier */
  content: ""; position: absolute; inset: 58px 0 auto 0; height: 96px; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 31px, rgb(60 90 140 / .22) 31px 32px);
}
.buch__titel { margin: 0 0 14px; font: 700 13px/1 var(--sc-font-text); letter-spacing: .16em; text-transform: uppercase; color: var(--sc-ink-soft); }
.buch__zeilen { position: relative; list-style: none; margin: 0 0 18px; padding: 0; min-height: 96px; }
.buch__zeilen li { display: flex; justify-content: space-between; align-items: end; gap: 1rem; height: 32px; }
.hand { font: 500 1.6rem/1 "Caveat", cursive; color: #22407A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buch__datum { font-size: 12px; color: var(--sc-ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.buch__leer span { font-size: 13px; color: var(--sc-ink-soft); font-style: italic; }
.feld { display: grid; gap: 5px; margin-bottom: 12px; }
.feld label { font-size: 13px; font-weight: 600; }
.feld input, .feld select {
  height: 44px; padding: 0 12px; border-radius: 4px; font: 500 1rem var(--sc-font-text); color: var(--sc-ink);
  background: #fff; border: 1px solid #8F9894; transition: border-color 160ms var(--sc-ease-out);
}
.feld input:focus, .feld select:focus { outline: none; border-color: var(--sc-accent); box-shadow: 0 0 0 3px rgb(226 85 31 / .22); }
.feld__fehler { color: #A3321B; font-size: 12px; }
.check { display: flex; gap: 10px; align-items: start; margin: 2px 0 14px; font-size: 14px; line-height: 1.4; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--sc-accent); flex: none; }
.buch .knopf { width: 100%; }
.buch__hinweis { margin: 10px 0 0; font-size: 12px; color: var(--sc-ink-soft); }
.buch.ist-eingetragen .buch__hinweis { color: #B8401A; font-weight: 600; }
.fussnote {
  inset: auto; left: var(--sc-gutter); bottom: 16px; max-width: min(60rem, 60vw); margin: 0; padding: 8px 12px; border-radius: 4px;
  font-size: 11.5px; line-height: 1.5; color: var(--sc-ink-soft); background: rgb(245 245 241 / .9);
}

/* ---------- Handy ---------- */
@media (max-width: 860px) {
  :root { --messer-h: 74px; }
  .held { top: 5.4rem; max-width: none; }
  .held h1 { max-width: 9ch; }
  .held__sub { font-size: 1.06rem; max-width: 30ch; }
  .anzeige--xl { font-size: clamp(2.6rem, 1.4rem + 6vw, 3.6rem); }
  .anzeige--lg { font-size: 1.55rem; }
  .tafel, .tafel--rechts { left: var(--sc-gutter); right: var(--sc-gutter); width: auto; padding: 16px 18px 18px; bottom: calc(var(--messer-h) + 22px); }
  .tafel p:last-child { font-size: .98rem; margin-top: 10px; }
  .messer { left: 10px; right: 10px; bottom: 10px; gap: 12px; padding: 8px 10px; grid-template-columns: auto 1fr; }
  .messer__werte { min-width: 6.6rem; padding-right: 10px; }
  .messer__hoehe b { font-size: 1.7rem; }
  .messer__klein { flex-direction: column; gap: 0; font-size: 11px; }
  .messer__stationen a { font-size: 0; padding: 0; height: 10px; }
  .messer__stationen a[aria-current="true"] { font-size: 11px; height: auto; padding-top: 2px; overflow: visible; }
  .messer__stationen a i { display: none; }
  .finale__kopf { left: var(--sc-gutter); right: var(--sc-gutter); width: auto; top: 4.6rem; padding: 12px 16px; }
  .buch { left: var(--sc-gutter); right: var(--sc-gutter); width: auto; top: 8.6rem; }
  .finale__kopf p:last-child, .finale__kopf .anzeige--xl { display: none; }
  .finale__kopf .tafel__ort { margin: 0; }
  .buch { padding: 14px 16px; rotate: 0deg; }
  .buch::before { inset: 42px 0 auto 0; height: 32px; }
  .buch__zeilen { min-height: 32px; margin-bottom: 10px; }
  .feld { margin-bottom: 8px; }
  .feld input, .feld select { height: 40px; }
  .check { margin-bottom: 10px; font-size: 13px; }
  .fussnote { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .knopf--voll::before, .tafel::after { animation: none; }
}

/* Handy: der Hero steht über die ganze Breite, also Nebel als Band von oben */
@media (max-width: 860px) {
  .nebel {
    background:
      linear-gradient(to bottom, rgb(232 234 231 / var(--nebel-held, .9)) 0, rgb(232 234 231 / calc(var(--nebel-held, .9) * .95)) 46%, rgb(232 234 231 / calc(var(--nebel-held, .9) * .5)) 60%, transparent 72%),
      linear-gradient(to top, rgb(232 234 231 / .92) 0, rgb(232 234 231 / .55) calc(var(--messer-h) + 10px), transparent calc(var(--messer-h) + 90px));
  }
}
@media (max-width: 860px) { .held__knopf { top: calc(5.4rem + var(--held-h, 18rem)); } }
