/* Schriften liegen selbst gehostet im Ordner fonts/ (SIL OFL 1.1), kein Abruf von Dritten. */
@font-face { font-family: "Fraunces"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/fraunces-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/fraunces-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/geist-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/geist-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/geist-mono-latin-400-normal.woff2") format("woff2"); }

:root {
  --bg: #ffffff;
  --box: #fafafa;
  --surface: #f2f2f2;
  --text: #2b2b2b;
  --text-2: #6b6b6b;
  --line: #e4e4e4;
  --line-strong: #bdbdbd;
  --ink: #006370;
  --ring: #0090a3;
  --btn-bg: #2b2b2b;
  --btn-text: #ffffff;
  --btn-hover: #006370;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Geist Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --section: 72px;
  --gutter: 16px;
}

@media (min-width: 735px) {
  :root { --section: 120px; --gutter: 24px; }
}

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

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

::selection { background: #00b2ca; color: #2b2b2b; }

.wrap {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.22em; }

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

p { margin: 0 0 1em; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  text-wrap: balance;
}

code, pre { font-family: var(--mono); letter-spacing: 0; font-variant-ligatures: none; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 4px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); text-decoration: none; }

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

/* Kopfzeile ------------------------------------------------------- */
.topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  color: var(--text-2);
}

.topline a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; }

/* Hero ------------------------------------------------------------ */
.hero { padding-top: 40px; }

h1 {
  max-width: 13ch;
  font-size: clamp(2.5rem, 1.2rem + 6vw, 5rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
}

.hero-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  margin-top: 40px;
}

.lead {
  margin: 0;
  max-width: 36ch;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--text-2);
}

@media (min-width: 1024px) {
  .hero { padding-top: 56px; }
  .hero-aside { margin: 96px 0 0 auto; max-width: 38ch; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 4px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
}

.btn:hover { background: var(--btn-hover); color: var(--btn-text); text-decoration: none; }

.jump { display: flex; flex-wrap: wrap; gap: 0 28px; margin-top: -8px; }
.jump a { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.9375rem; font-weight: 500; }

/* Abschnitte ------------------------------------------------------ */
section.block { margin-top: var(--section); }

h2 {
  font-size: clamp(2rem, 1.3rem + 2.9vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.b-heading, .more h2 {
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Schritte: drei Spalten (Startseite) oder untereinander (Einträge) */
.steps {
  display: grid;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: schritt;
}

.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  align-content: start;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  counter-increment: schritt;
}

.steps li::before {
  content: counter(schritt, decimal-leading-zero);
  padding-top: 0.3em;
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--ink);
}

.steps strong {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.steps .body { grid-column: 1 / -1; margin-top: 12px; color: var(--text-2); }

@media (min-width: 900px) {
  .steps:not(.steps--stack) { grid-template-columns: repeat(3, 1fr); }
  .steps:not(.steps--stack) li { padding: 24px 32px 8px 32px; border-left: 1px solid var(--line); }
  .steps:not(.steps--stack) li:first-child { padding-left: 0; border-left: 0; }
}

.steps--stack { margin-top: 0; }
.steps--stack li { padding-bottom: 24px; }

.note {
  margin: 48px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  max-width: 44rem;
}

/* Übersicht: Suche, Filter, Liste --------------------------------- */
.tools { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: 32px; }

.tools input {
  flex: 1 1 16rem;
  max-width: 24rem;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.tools input::placeholder { color: var(--text-2); opacity: 1; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }

.filters button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.filters button:hover { border-color: var(--text); }
.filters button[aria-pressed="true"] { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-text); }

.list { margin: 40px 0 0; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }

.list li {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: 8px;
  row-gap: 4px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.list .idx { padding-top: 0.55em; font-family: var(--mono); font-size: 0.875rem; color: var(--text-2); }

.list h3 { font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.01em; }
.list h3 a { color: var(--text); }
.list h3 a:hover { text-decoration: none; }
.list h3 a::after { content: ""; position: absolute; inset: 0; }
.list h3 a:focus-visible { outline: none; }
.list h3 a:focus-visible::after { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
.list li:hover h3 a { color: var(--ink); }

.list p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 64ch;
  margin: 8px 0 0;
  color: var(--text-2);
}

.list .kind { grid-column: 2; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.02em; color: var(--text-2); }

@media (min-width: 735px) {
  .list li { grid-template-columns: 56px 1fr 120px; align-items: baseline; padding: 32px 0; }
  .list .kind { grid-column: auto; text-align: right; }
}

.empty { margin: 32px 0 0; color: var(--text-2); }

/* Eintragsseite --------------------------------------------------- */
.entry { margin-top: 32px; }

.entry-grid { display: grid; gap: 48px; }

@media (min-width: 900px) {
  .entry { margin-top: 56px; }
  .entry-grid { grid-template-columns: 5fr 7fr; gap: 80px; align-items: start; }
  .entry-head { position: sticky; top: 32px; }
}

.eyebrow { margin: 0 0 12px; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.02em; color: var(--text-2); }

.entry-head h1 {
  max-width: none;
  margin-bottom: 24px;
  font-size: clamp(2.25rem, 1.3rem + 3.4vw, 3.25rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.desc { max-width: 40ch; margin: 0 0 1.25em; font-size: 1.125rem; line-height: 1.55; color: var(--text-2); }
.meta { margin: 0; font-size: 0.875rem; letter-spacing: 0.01em; color: var(--text-2); }

.links { display: flex; flex-direction: column; align-items: flex-start; margin: 24px 0 0; }
.links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; text-decoration: underline; text-underline-offset: 0.22em; text-decoration-color: var(--line-strong); }
.links a:hover { text-decoration-color: currentColor; }

/* Bausteine */
.blocks > * { margin: 0; }
.blocks > * + * { margin-top: 32px; }
.blocks > .b-heading, .blocks > .more { margin-top: 56px; }
.blocks > .b-heading + * { margin-top: 16px; }
.blocks > .b-command + .b-command { margin-top: 32px; }
.blocks > :first-child { margin-top: 0; }

.b-text p { margin: 0 0 1em; }
.b-text p:last-child { margin-bottom: 0; }

.b-text code, .hint code, ul.know code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface);
  font-size: 0.875em;
  color: var(--text);
}

.blocks .note { margin: 0; padding-top: 24px; max-width: none; }
.blocks > .note { margin-top: 48px; }
.blocks .repo { margin: 0; }
.blocks .repo a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; }

.b-image { margin: 0; }
.b-image img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; }
.b-image figcaption { margin-top: 8px; font-size: 0.875rem; color: var(--text-2); }

.cmd-label { margin: 0 0 10px; font-size: 0.9375rem; font-weight: 500; letter-spacing: 0.01em; }

.cmd {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 18px;
  background: var(--box);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.cmd pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.copy {
  flex: none;
  min-width: 96px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.copy:hover { border-color: var(--text); }
.copy[data-state="ok"] { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-text); }

.hint { margin: 12px 0 0; font-size: 0.9375rem; color: var(--text-2); }

.more h2 { margin-bottom: 16px; }

ul.know { margin: 0; padding: 0; list-style: none; }
ul.know li { padding: 14px 0; border-top: 1px solid var(--line); }
ul.know li:last-child { border-bottom: 1px solid var(--line); }

@media (max-width: 520px) {
  .cmd { flex-direction: column; align-items: stretch; gap: 4px; padding: 14px 6px 6px 14px; }
  .cmd pre { padding-right: 8px; }
  .copy { align-self: flex-end; }
}

/* Fuß ------------------------------------------------------------- */
footer {
  margin-top: var(--section);
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--text-2);
}

footer p { max-width: 56rem; margin-bottom: 8px; }
footer nav { display: flex; flex-wrap: wrap; gap: 0 24px; }
footer nav a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; }

/* Bewegung: nur Hover und Kopier-Bestätigung ---------------------- */
@media (prefers-reduced-motion: no-preference) {
  .btn, .copy, .filters button, .list h3 a {
    transition: background-color 0.3s cubic-bezier(0.23, 1, 0.32, 1), color 0.3s cubic-bezier(0.23, 1, 0.32, 1), border-color 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  }
}
