/* ==========================================================================
   dnsherold.com – Basis: Schriften, Reset, Typografie, gemeinsame Bausteine
   ========================================================================== */

/* Schriften: lokal gehostet, beim Seitenaufruf werden keine fremden Server geladen */
@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-var-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Switzer";
  src: url("../assets/fonts/switzer-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Switzer";
  src: url("../assets/fonts/switzer-var-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  hanging-punctuation: first last;
}

body {
  min-height: 100svh;
  background-color: var(--sand);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.6;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  text-wrap: balance;
  overflow-wrap: break-word;
}

p {
  text-wrap: pretty;
  overflow-wrap: break-word;
}

a {
  color: inherit;
}

/* Farbwelten */
.theme-sea,
.theme-sand,
.theme-paper {
  color: var(--fg);
}

.theme-sea {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Tastaturfokus: immer sichtbar, Farbe passend zum Untergrund */
:focus-visible {
  outline: 2px solid var(--focus, var(--sea));
  outline-offset: 4px;
}

::selection {
  background-color: var(--brass);
  color: var(--ink);
}

main:focus {
  outline: none;
}

.skip-link {
  position: absolute;
  top: 0;
  left: var(--gutter);
  z-index: 100;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-touch);
  background-color: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transform: translateY(-120%);
  transition: transform var(--dur-base) var(--ease-out);
}

/* :focus statt :focus-visible, damit der Link bei jeder Art von Fokus erscheint */
.skip-link:focus {
  transform: translateY(1rem);
}

/* Raster */
.wrap {
  width: min(100% - 2 * var(--gutter), var(--page-max));
  margin-inline: auto;
}

/* Kapitel: jede Sektion öffnet mit der Horizontlinie aus dem Hero */
.chapter {
  background-color: var(--bg);
  /* damit ein Ankersprung nicht unter der festen Leiste landet */
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}

.chapter__rule {
  height: 1px;
  background-color: var(--rule);
  transform-origin: left center;
}

.chapter__inner {
  padding-block: var(--section-pad);
}

/* Buttons: rund wie ein Kiesel, weil anfassbar */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.85rem 1.7rem;
  border: 0;
  border-radius: var(--radius-touch);
  font-family: var(--font-text);
  font-size: var(--step-0);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--dur-base) var(--ease-out),
    transform var(--dur-quick) var(--ease-out);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background-color: var(--btn-bg);
  color: var(--btn-fg);
}

.btn--primary:hover {
  background-color: var(--btn-bg-hover);
}

/* Zweite Wahl: gleiche Form, nur umrissen. Gedrückt wird sie gefüllt. */
.btn--quiet {
  background-color: transparent;
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn--quiet:hover {
  box-shadow: inset 0 0 0 1px var(--fg);
}

.btn--quiet[aria-pressed="true"] {
  background-color: var(--btn-bg);
  color: var(--btn-fg);
  box-shadow: none;
}

/* Seeblaue Kapitel tragen dasselbe feine Korn wie der Hero */
.chapter.theme-sea {
  background: var(--grain) 0 0 / 240px 240px, var(--bg);
}

/* Leiser Textlink mit Messing-Unterstrich */
.link-quiet {
  color: var(--fg);
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
  transition: text-underline-offset var(--dur-base) var(--ease-out);
}

.link-quiet:hover {
  text-underline-offset: 0.5em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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