/* =======================================================================
   Wolf Marbach – Autorenseite
   Ruhige, editoriale Gestaltung mit klarer Führung und leichteren Bildern.
   ======================================================================= */

/* ---------------------------------------------------------------------
   Design-Tokens
   --------------------------------------------------------------------- */
:root {
  --paper: #f7f5ef;
  --paper-alt: #eef2ed;
  --surface: #fffdfa;
  --surface-soft: #f5f1ea;
  --ink: #191a1c;
  --ink-soft: #3f4642;
  --muted: #68726c;
  --rule: rgba(25, 26, 28, 0.14);
  --accent: #2f5d50;
  --accent-strong: #21483e;
  --accent-warm: #8b4f5f;
  --tone-roman: #2f5d50;
  --tone-memory: #7f4655;
  --tone-child: #4c6f8b;
  --tone-language: #6b6435;
  --shadow: rgba(25, 26, 28, 0.13);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --container: 1080px;
  --measure: 64ch;
  --space: clamp(2.5rem, 6vw, 5rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

:where(#ueber, #buecher, #inhalt, [id]) { scroll-margin-top: 92px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 900px) {
  body { font-size: 1.1rem; }
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent-strong);
  text-decoration-color: rgba(33, 72, 62, 0.4);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--accent-warm); }

h1, h2, h3 {
  line-height: 1.14;
  font-weight: 650;
  letter-spacing: 0;
}

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

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

.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; border-radius: 4px;
  z-index: 100; transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; color: var(--paper); }

/* ---------------------------------------------------------------------
   Kopfzeile + Navigation
   --------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 245, 239, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-scrolled {
  background: rgba(247, 245, 239, 0.96);
  box-shadow: 0 10px 24px rgba(25, 26, 28, 0.08);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  min-height: 68px;
  padding: 0.65rem clamp(1rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
  min-width: 0;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: contain;
  background: var(--surface);
  padding: 5px;
  border: 1px solid var(--rule);
  flex: 0 0 auto;
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: 0;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  font-family: var(--sans);
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent-strong);
  background: rgba(47, 93, 80, 0.09);
}

/* ---------------------------------------------------------------------
   Layout-Hilfen
   --------------------------------------------------------------------- */
main { display: block; }

.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space) clamp(1rem, 4vw, 2rem);
}

.section-head { margin-bottom: 2rem; }

.section-title {
  font-size: 1.9rem;
  margin: 0;
}

.section-intro {
  max-width: 58ch;
  color: var(--ink-soft);
  margin: 0.8rem 0 0;
}

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-strong);
  margin: 0 0 0.75rem;
}

@media (min-width: 760px) {
  .section-title { font-size: 2.25rem; }
}

/* ---------------------------------------------------------------------
   Hero / Über den Autor
   --------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  padding-top: 3.25rem;
}

.hero h1 {
  font-size: 2.75rem;
  margin: 0 0 1rem;
}

.hero .lead {
  max-width: var(--measure);
  color: var(--ink-soft);
  margin: 0;
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.6rem 0 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-family: var(--sans);
  font-size: 0.94rem;
  font-weight: 650;
  letter-spacing: 0;
  text-decoration: none;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.button-primary {
  background: var(--accent-strong);
  color: var(--surface);
  border-color: var(--accent-strong);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--accent);
  color: var(--surface);
  transform: translateY(-1px);
}

.button-secondary {
  background: transparent;
  color: var(--accent-strong);
  border-color: rgba(33, 72, 62, 0.34);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  background: rgba(47, 93, 80, 0.09);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.hero-topics,
.about-focus {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.35rem 0 0;
  padding: 0;
  list-style: none;
}

.hero-topics li,
.about-focus span {
  font-family: var(--sans);
  font-size: 0.84rem;
  color: var(--ink-soft);
  background: rgba(255, 253, 250, 0.8);
  border: 1px solid rgba(47, 93, 80, 0.16);
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  box-shadow: 0 8px 18px rgba(25, 26, 28, 0.04);
}

.hero-portrait img {
  width: 100%;
  max-width: 280px;
  border-radius: 8px;
  box-shadow: 0 18px 40px var(--shadow);
}

@media (min-width: 820px) {
  .hero {
    grid-template-columns: 1.35fr 0.8fr;
    gap: 4rem;
    padding-top: 5.25rem;
  }
  .hero h1 { font-size: 4rem; }
  .hero .lead { font-size: 1.18rem; }
  .hero-portrait { justify-self: end; }
}

@media (max-width: 520px) {
  .hero {
    gap: 1.45rem;
    padding-top: 2.5rem;
  }
  .hero h1 { font-size: 2.45rem; }
  .hero .lead {
    font-size: 1.03rem;
    line-height: 1.64;
  }
  .hero-actions {
    gap: 0.55rem;
    margin-top: 1.25rem;
  }
  .button {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0.58rem 0.78rem;
  }
  .hero-topics { margin-top: 1rem; }
  .hero-portrait img { max-width: 190px; }
}

.about-inner { max-width: var(--measure); margin: 0 auto; }
.about-content { color: var(--ink-soft); }
.about-inner .bio { margin: 0; }

/* ---------------------------------------------------------------------
   Bücher
   --------------------------------------------------------------------- */
.books { background: var(--paper-alt); }

.books-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space) clamp(1rem, 4vw, 2rem);
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem;
  margin-top: 2rem;
}

@media (max-width: 940px) {
  .books-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .books-grid {
    grid-template-columns: 1fr;
    max-width: 380px;
    margin-inline: auto;
  }
}

.book {
  --book-accent: var(--accent);
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgba(255, 253, 250, 0.72);
  border: 1px solid rgba(25, 26, 28, 0.11);
  border-top: 4px solid color-mix(in srgb, var(--book-accent), transparent 18%);
  border-radius: 8px;
  padding: 1.2rem;
  box-shadow: 0 10px 28px rgba(25, 26, 28, 0.06);
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.book:nth-child(1) { --book-accent: var(--tone-roman); }
.book:nth-child(2) { --book-accent: var(--tone-memory); }
.book:nth-child(3),
.book:nth-child(4) { --book-accent: var(--tone-child); }
.book:nth-child(5),
.book:nth-child(6) { --book-accent: var(--tone-language); }

.book-cover {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 300px;
  margin-bottom: 1.35rem;
}

.book-cover img {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 12px 24px var(--shadow);
  transition: transform 0.35s ease, box-shadow 0.35s ease, filter 0.35s ease;
}

.book-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.book-tag {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.72rem;
  font-weight: 750;
  color: var(--book-accent);
  margin: 0 0 0.5rem;
}

.book-title {
  font-size: 1.2rem;
  margin: 0 0 0.7rem;
}

.book-text {
  color: var(--ink-soft);
  margin: 0 0 1.15rem;
  flex: 1 1 auto;
}

.book-link {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  color: var(--accent-strong);
  position: relative;
}

.book-link .arrow {
  display: inline-block;
  transition: transform 0.25s ease;
}

.book-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 1.1rem;
  bottom: -0.18rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.book-link:hover .arrow,
.book-link:focus-visible .arrow {
  transform: translateX(4px);
}

.book:hover .book-cover img,
.book:focus-within .book-cover img {
  transform: translateY(-6px) rotate(-0.7deg);
  box-shadow: 0 18px 34px var(--shadow);
  filter: saturate(1.03) contrast(1.02);
}

.book:hover,
.book:focus-within {
  background: rgba(255, 253, 250, 0.9);
  border-color: color-mix(in srgb, var(--book-accent), transparent 58%);
  box-shadow: 0 18px 38px rgba(25, 26, 28, 0.09);
  transform: translateY(-2px);
}

.book-link:hover::after,
.book-link:focus-visible::after {
  transform: scaleX(1);
}

/* ---------------------------------------------------------------------
   Impressum / generische Prosa
   --------------------------------------------------------------------- */
.prose { max-width: var(--measure); }
.prose h1 {
  font-size: 2rem;
  margin: 0 0 1.5rem;
}
.prose h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.6rem;
}
.prose p { margin: 0 0 1rem; }
.prose img {
  margin: 0.5rem 0;
  border-radius: 8px;
  box-shadow: 0 10px 24px var(--shadow);
}

@media (min-width: 760px) {
  .prose h1 { font-size: 2.35rem; }
}

/* ---------------------------------------------------------------------
   Fußzeile
   --------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: var(--space);
  background: var(--surface-soft);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.6rem clamp(1rem, 4vw, 2rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--muted);
}

.footer-inner a {
  color: var(--ink-soft);
  text-decoration: none;
}
.footer-inner a:hover { color: var(--accent-strong); }

/* ---------------------------------------------------------------------
   Effekte – Progressive Enhancement
   --------------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}

.js .reveal.is-visible { opacity: 1; transform: none; }

.js .books-grid .book:nth-child(2) { transition-delay: 0.04s; }
.js .books-grid .book:nth-child(3) { transition-delay: 0.08s; }
.js .books-grid .book:nth-child(4) { transition-delay: 0.02s; }
.js .books-grid .book:nth-child(5) { transition-delay: 0.06s; }
.js .books-grid .book:nth-child(6) { transition-delay: 0.1s; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .book-cover img,
  .book-link .arrow,
  .book-link::after,
  .book,
  .button,
  .skip-link,
  .site-header,
  .site-nav a {
    transition: none !important;
  }
  .book:hover .book-cover img,
  .book:focus-within .book-cover img {
    transform: none !important;
  }
  .book:hover,
  .book:focus-within,
  .button:hover,
  .button:focus-visible {
    transform: none !important;
  }
}
