/*
 * Produktseite von Portolan (#414), Marke Kursbesteck. Farben und Schrift nur aus /marke/tokens.css, hell und dunkel
 * folgen dem System. Das Raster gehört dem Kartentisch und liegt nie unter Text.
 *
 * Archivo in drei Breiten: breit (125 %) für die Wortmarke, halbbreit (112 %) für Überschriften, normal für Text,
 * schmal (75 %) für die Beschriftung des Kurses wie auf einer Seekarte.
 */

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

:root {
  --rand: clamp(20px, 4vw, 48px);
  --breite: 1240px;
  --schmal: 75%;
}

html {
  background: var(--kb-grund);
  color: var(--kb-tinte);
  font-family: var(--kb-schrift);
  font-weight: var(--kb-text-gewicht);
  font-stretch: var(--kb-text-breite);
  font-size: 106.25%; /* 17 px */
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
}

a {
  color: var(--kb-akzent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--kb-akzent);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.1;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

.leise {
  color: var(--kb-leise);
}

.klein {
  font-size: 0.8235rem; /* 14 px */
  line-height: 1.5;
}

.sprung {
  position: absolute;
  left: var(--rand);
  top: -100px;
  padding: 8px 12px;
  background: var(--kb-flaeche);
  border: 1px solid var(--kb-linie);
}

.sprung:focus {
  top: 12px;
}

/* ---------- Knöpfe ---------- */

.knopf {
  display: inline-block;
  padding: 12px 20px;
  border: 2px solid var(--kb-akzent);
  background: var(--kb-akzent);
  color: var(--kb-flaeche);
  font: inherit;
  font-weight: 650;
  font-stretch: 112%;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.knopf:hover {
  text-decoration: none;
  background: var(--kb-tinte);
  border-color: var(--kb-tinte);
}

.knopf-leer {
  background: transparent;
  color: var(--kb-akzent);
  padding: 8px 14px;
}

.knopf-leer:hover {
  background: transparent;
  color: var(--kb-tinte);
}

/* ---------- Kopf und Fuß ---------- */

.kopf,
.fuss {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
  max-width: var(--breite);
  margin: 0 auto;
  padding: 18px var(--rand);
}

.kopf {
  border-bottom: 1px solid var(--kb-linie);
}

.wortmarke {
  display: inline-flex;
  align-items: center;
  gap: 7px; /* ein Viertel des Zeichens */
  color: var(--kb-tinte);
  text-decoration: none;
  font-weight: var(--kb-wortmarke-gewicht);
  font-stretch: var(--kb-wortmarke-breite);
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.wortmarke img {
  display: block;
}

.fuss {
  border-top: 1px solid var(--kb-linie);
  color: var(--kb-leise);
  font-size: 0.8235rem;
  padding-block: 28px 40px;
}

.fuss nav {
  display: flex;
  gap: 24px;
}

/* ---------- Held: Text und Kartentisch ---------- */

.held {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: start;
  max-width: var(--breite);
  margin: 0 auto;
  padding: 64px var(--rand) 72px;
}

.held-text {
  padding-top: 12px;
}

.held h1 {
  font-size: clamp(2.35rem, 4.6vw, 3.6rem);
  font-stretch: 112%;
  letter-spacing: -0.022em;
  line-height: 1.02;
  margin-bottom: 28px;
}

.held p {
  max-width: 36em;
  margin-bottom: 16px;
  color: var(--kb-leise);
}

.held .vorspann {
  font-size: 1.18rem;
  line-height: 1.5;
  color: var(--kb-tinte);
  margin-bottom: 18px;
}

.held .knopf {
  margin-top: 16px;
}

.tisch {
  margin: 0;
  background: var(--kb-flaeche);
  border: 1px solid var(--kb-linie);
}

.tisch-kopf {
  display: flex;
  justify-content: space-between;
  gap: 4px 20px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--kb-linie);
  font-size: 0.8235rem;
  color: var(--kb-leise);
}

.tisch-kopf b {
  color: var(--kb-tinte);
  font-weight: 650;
}

.tisch figcaption {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--kb-linie);
  font-size: 0.8235rem;
  color: var(--kb-leise);
}

/* Der Kurs. Maße in Einheiten des Rasters: eine Zelle = 24. */

.kurs {
  display: block;
  width: 100%;
  height: auto;
}

.kurs .raster {
  fill: none;
  stroke: var(--kb-raster);
  stroke-width: 1;
}

.kurs .schenkel {
  stroke: var(--kb-akzent);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.kurs .schenkel.geplant {
  stroke-width: 2;
  stroke-dasharray: 0.12 0.09;
  stroke-linecap: butt;
}

.kurs text {
  font-family: var(--kb-schrift);
  font-stretch: var(--schmal);
  font-variant-numeric: tabular-nums;
  paint-order: stroke;
  stroke: var(--kb-flaeche);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.kurs .peilung {
  font-size: 11px;
  fill: var(--kb-leise);
  letter-spacing: 0.02em;
}

.kurs .nr {
  font-size: 13px;
  font-weight: 650;
  fill: var(--kb-tinte);
}

.kurs .marke.voll {
  fill: var(--kb-tinte);
}

.kurs .marke.leer {
  fill: var(--kb-flaeche);
  stroke: var(--kb-tinte);
  stroke-width: 2;
}

.kurs .art-eingang .marke {
  fill: var(--kb-akzent);
}

.kurs .art-ticket .marke.leer {
  stroke: var(--kb-akzent);
}

/* Der eine Moment: Der Kurs fährt sich beim Laden selbst, Schenkel für Schenkel. */
@media (prefers-reduced-motion: no-preference) {
  .kurs .schenkel:not(.geplant) {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: fahren 0.42s cubic-bezier(0.3, 0, 0.4, 1) forwards;
  }

  .kurs .schenkel.geplant,
  .kurs .peilung,
  .kurs .punkt {
    opacity: 0;
    animation: auftauchen 0.4s ease-out forwards;
  }

  .kurs line:nth-of-type(2) { animation-delay: 0.3s; }
  .kurs line:nth-of-type(3) { animation-delay: 0.6s; }
  .kurs line:nth-of-type(4) { animation-delay: 0.9s; }
  .kurs line:nth-of-type(5) { animation-delay: 1.2s; }
  .kurs line:nth-of-type(6) { animation-delay: 1.5s; }
  .kurs line:nth-of-type(7) { animation-delay: 1.8s; }
  .kurs line:nth-of-type(n + 8) { animation-delay: 2.1s; }

  .kurs .punkt,
  .kurs .peilung {
    animation-delay: 0.15s;
  }
  .kurs .schenkel-alle .peilung,
  .kurs .punkte .punkt:nth-child(n + 6) {
    animation-delay: 1.2s;
  }
  .kurs .punkte .punkt:nth-child(n + 9) {
    animation-delay: 2.1s;
  }
}

@keyframes fahren {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes auftauchen {
  to {
    opacity: 1;
  }
}

/* ---------- Etappen mit Logbuch ---------- */

.etappen {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: var(--breite);
  margin: 0 auto;
  padding: 0 var(--rand);
}

.etappen-kopf {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: end;
  padding: 0 0 28px;
  border-bottom: 2px solid var(--kb-tinte);
}

.etappen-kopf h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-stretch: 112%;
  letter-spacing: -0.015em;
}

.etappen-kopf p {
  color: var(--kb-leise);
  max-width: 40em;
}

.etappe {
  padding: 28px 32px 48px 0;
}

.etappe + .etappe {
  padding-left: 32px;
  border-left: 1px solid var(--kb-linie);
}

.etappe h3 {
  font-size: 1.4rem;
  font-stretch: 112%;
  margin-bottom: 10px;
}

.etappe > p {
  color: var(--kb-leise);
  margin-bottom: 22px;
  max-width: 34em;
}

/* Das Logbuch: Nummern wie am Kurs, davor die Marke des Wegpunkts. */
.logbuch {
  list-style: none;
  margin: 0;
  padding: 0;
}

.logbuch li {
  display: grid;
  grid-template-columns: 2.1em 16px minmax(0, 1fr);
  gap: 0 10px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid var(--kb-linie);
  font-size: 0.9412rem; /* 16 px */
  line-height: 1.45;
}

.logbuch li::before {
  content: attr(value);
  grid-column: 1;
  font-stretch: var(--schmal);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.logbuch li::after {
  content: "";
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  width: 9px;
  height: 9px;
  background: var(--kb-tinte);
  transform: translateY(-1px);
}

.logbuch li.art-entscheidung::after {
  transform: translateY(-1px) rotate(45deg);
}

.logbuch li.art-eingang::after {
  background: var(--kb-akzent);
  border-radius: 50%;
}

.logbuch li.art-karte::after,
.logbuch li.art-freigabe::after {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.logbuch li.art-frage::after,
.logbuch li.art-spec::after {
  background: transparent;
  border: 2px solid var(--kb-tinte);
  border-radius: 50%;
}

.logbuch li.art-ticket::after {
  background: transparent;
  border: 2px solid var(--kb-akzent);
}

.logbuch li > span {
  grid-column: 3;
  grid-row: 1;
}

/* ---------- Einladung ---------- */

.einladung {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  max-width: var(--breite);
  margin: 0 auto;
  padding: 72px var(--rand) 88px;
  scroll-margin-top: 16px;
}

.einladung-text h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-stretch: 112%;
  letter-spacing: -0.015em;
  margin-bottom: 18px;
}

.einladung-text p {
  max-width: 32em;
  margin-bottom: 16px;
}

.formular {
  display: grid;
  gap: 18px;
  padding: 28px 32px 30px;
  background: var(--kb-flaeche);
  border: 1px solid var(--kb-linie);
  border-top: 3px solid var(--kb-akzent);
}

.formular h3 {
  font-size: 1.3rem;
  font-stretch: 112%;
  margin-bottom: 6px;
}

.feld {
  display: grid;
  gap: 6px;
}

.feld label {
  font-weight: 600;
  font-size: 0.9412rem;
}

.feld label .leise {
  font-weight: 400;
}

.feld input,
.feld textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--kb-tinte);
  background: var(--kb-grund);
  border: 1px solid var(--kb-leise);
  border-radius: 0;
}

.feld textarea {
  resize: vertical;
  min-height: 7.5em;
}

.feld input:focus-visible,
.feld textarea:focus-visible {
  outline: 2px solid var(--kb-akzent);
  outline-offset: 0;
  border-color: var(--kb-akzent);
}

.feld [aria-invalid="true"] {
  border: 2px solid var(--kb-warnung);
}

.fehler,
.meldung {
  color: var(--kb-warnung);
  font-size: 0.9412rem;
  font-weight: 600;
}

.formular .knopf {
  justify-self: start;
  margin-top: 4px;
}

.honigtopf {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Platzhalter-Seiten ---------- */

.rechtliches {
  max-width: 44rem;
  margin: 0 auto;
  padding: 56px var(--rand) 80px;
}

.rechtliches h1 {
  font-size: 2.2rem;
  font-stretch: 112%;
  margin-bottom: 20px;
}

.rechtliches p,
.rechtliches ul {
  margin: 0 0 16px;
}

.platzhalter {
  padding: 12px 16px;
  border-left: 3px solid var(--kb-warnung);
  background: var(--kb-flaeche);
}

/* ---------- Schmal ---------- */

@media (max-width: 960px) {
  .held,
  .einladung,
  .etappen-kopf {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .held {
    padding-top: 40px;
  }

  .etappen {
    grid-template-columns: minmax(0, 1fr);
  }

  .etappe,
  .etappe + .etappe {
    padding: 28px 0 32px;
    border-left: 0;
  }

  .etappe + .etappe {
    border-top: 1px solid var(--kb-linie);
  }
}

@media (max-width: 560px) {
  .kopf .knopf-leer {
    display: none;
  }

  .formular {
    padding: 22px 18px 24px;
  }

  /* Auf dem Handy wäre die Peilung zu klein: weg damit, die Nummern größer. */
  .kurs .peilung {
    display: none;
  }

  .kurs .nr {
    font-size: 19px;
  }

  .kurs text {
    stroke-width: 6px;
  }
}

/* Bestätigung und Hinweis statt Formular: oben im Kasten, nicht gestreckt. */
.formular.bestaetigung,
.formular.hinweis {
  align-self: start;
  align-content: start;
  gap: 8px;
}
