/* Base + Shared Components */

* {
  box-sizing: border-box;
}

html {
  background-color: #151c20;
  scroll-behavior: smooth;
}

@media (max-width: 860px), (hover: none), (pointer: coarse) {
  html,
  body {
    overflow-x: hidden;
  }
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background-color: transparent;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
}

body::before {
  content: "";
  position: fixed;
  inset: -8vh 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(7, 10, 14, 0.78), rgba(7, 10, 14, 0.9)),
    radial-gradient(circle at top, rgba(217, 179, 95, 0.12), transparent 35%);
  background-position: center top, center top;
  background-repeat: no-repeat, no-repeat;
  background-size: auto, auto;
}

body::after {
  /* First paint always uses the eager small map; the full map is layered on only after JS decodes it. */
  content: "";
  position: fixed;
  inset: -180px -5vw;
  z-index: -2;
  pointer-events: none;
  background-image: url("/graphics/DewatienKarte-small.webp");
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  transform: translate3d(0, var(--parallax-offset, 0px), 0);
  transform-origin: center top;
  will-change: transform;
}

@media (min-width: 1180px) {
  .site-background-full body::after {
    /* Keep the small map underneath the full map so the upgrade cannot flash through transparency/cache misses. */
    background-image:
      url("/graphics/DewatienKarte.webp"),
      url("/graphics/DewatienKarte-small.webp");
  }
}

@media (max-width: 860px), (hover: none), (pointer: coarse) {
  body::after {
    /* Mobile uses one viewport-static map: fixed, no parallax transform, and no tiling. */
    position: fixed;
    inset: 0;
    background-repeat: no-repeat;
    background-size: auto 100%;
    transform: none;
    will-change: auto;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

/* Requirement: mailto links should read as clickable without breaking the site's quiet text styling. */
a[href^="mailto:"] {
  color: rgba(235, 201, 119, 0.92);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(235, 201, 119, 0.48);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

a[href^="mailto:"]:hover,
a[href^="mailto:"]:focus-visible {
  color: #f3d99a;
  text-decoration-color: currentColor;
}

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

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header,
.site-footer,
.section,
.hero,
.checkout-layout,
.admin-shell {
  width: min(1180px, calc(100% - 2rem));
  margin-left: auto;
  margin-right: auto;
}

.site-header,
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.2rem 0;
}

.logo {
  display: inline-flex;
  align-items: center;
}

.logo-mark {
  display: block;
  width: auto;
  height: clamp(3.3rem, 5.8vw, 4.3rem);
}

.top-nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--muted);
}

.site-footer nav {
  color: rgba(195, 183, 164, 0.68);
  font-size: 0.86rem;
}

.site-footer-copyright {
  margin: 0;
  color: rgba(195, 183, 164, 0.58);
  font-size: 0.86rem;
}

.hero,
.checkout-layout,
.story-grid,
.sample-highlight,
.admin-grid {
  display: grid;
  gap: 1.5rem;
}

.hero {
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  padding: 3rem 0 2rem;
}

.hero-copy h1,
.section h1,
.section h2 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 0.96;
  margin: 0;
}

.hero-copy h1 {
  font-size: clamp(2.8rem, 6.8vw, 5.4rem);
}

.hero-slogan {
  margin: 0 0 1.2rem;
}

.hero-slogan-reveal {
  --hero-slogan-reveal-delay: 1s;
  display: inline-block;
  opacity: 0;
  color: var(--accent);
  animation: hero-slogan-reveal 1.3s ease var(--hero-slogan-reveal-delay) forwards;
}

.hero-slogan-word-bad {
  --hero-slogan-reveal-delay: 1s;
}

.hero-slogan-question {
  --hero-slogan-reveal-delay: 1.3s;
}

.hero-slogan-comma-first {
  --hero-slogan-reveal-delay: 3s;
}

.hero-slogan-comma-second {
  --hero-slogan-reveal-delay: 3.1s;
}

.hero-subtitle-reveal {
  opacity: 0;
  animation: hero-subtitle-reveal 0.82s ease 1.42s forwards;
}

.title-art {
  width: 100%;
  height: auto;
}

.title-art-hero {
  width: min(720px, 100%);
  margin: 0 0 1.2rem;
}

.title-art-section {
  width: min(520px, 100%);
  margin: 0 0 1rem;
}

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

.subtitle,
.lead {
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow,
.section-label {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  color: var(--accent);
}

.badge-row,
.cta-row,
.cards,
.order-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.badge,
.notice,
.price-card,
.feature-card,
.summary-card,
.copy-card,
.sample-panel,
.order-card,
.admin-card,
.checkout-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.badge {
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.3rem;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #1e160c;
}

.button-secondary {
  background: rgba(244, 238, 228, 0.08);
  border: 1px solid var(--line);
}

.hero-art {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(336px, 100%);
  justify-self: center;
}

.cover-tilt,
.cover-thumb {
  position: relative;
  display: block;
  container-type: inline-size;
  border-radius: 1.2rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cover-tilt {
  --cover-tilt-x: 0deg;
  --cover-tilt-y: 0deg;
  --cover-gloss-x: 50%;
  --cover-gloss-y: 14%;
  --cover-gloss-strength: 0.34;
  --cover-imperfection-opacity: 0.42;
  --cover-scroll-x: 0%;
  --cover-scroll-y: 0%;
  position: relative;
  width: 100%;
  background: #0f1419;
  transform-style: preserve-3d;
  transform:
    perspective(1040px)
    rotateX(var(--cover-tilt-x))
    rotateY(var(--cover-tilt-y));
  will-change: transform;
  box-shadow:
    0 22px 42px rgba(0, 0, 0, 0.32),
    0 5px 18px rgba(0, 0, 0, 0.24);
}

.cover-image {
  width: 100%;
}

.cover-image-placeholder,
.cover-image-full {
  display: block;
  width: 100%;
}

.cover-image-full {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
}

.cover-ebook-banner {
  position: absolute;
  top: 5%;
  right: -24%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 66%;
  min-height: 12cqw;
  padding: 1.3cqw 3cqw;
  color: #f8fff9;
  background: linear-gradient(180deg, #38c66a 0%, #15964c 100%);
  border-block: 1px solid rgba(255, 255, 255, 0.36);
  box-shadow:
    0 1.4cqw 3.2cqw rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  font-family: var(--sans);
  font-size: 5.15cqw;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.075em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.32);
  pointer-events: none;
  transform: rotate(45deg) translateZ(20px);
  transform-origin: center;
}

.cover-tilt .cover-ebook-banner,
.cover-thumb .cover-ebook-banner {
  color: #f8fff9;
}

.cover-gloss,
.cover-imperfections {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
}

.cover-gloss {
  z-index: 2;
  opacity: var(--cover-gloss-strength);
  background:
    radial-gradient(
      38% 32% at calc(var(--cover-gloss-x) + var(--cover-scroll-x)) calc(var(--cover-gloss-y) + var(--cover-scroll-y)),
      rgba(255, 255, 255, 0.94) 0%,
      rgba(255, 255, 255, 0.76) 16%,
      rgba(255, 255, 255, 0.4) 32%,
      rgba(255, 255, 255, 0.12) 50%,
      rgba(255, 255, 255, 0) 68%
    ),
    linear-gradient(
      116deg,
      rgba(255, 255, 255, 0) 36%,
      rgba(255, 255, 255, 0.12) 43%,
      rgba(255, 255, 255, 0.36) 47%,
      rgba(255, 255, 255, 0.14) 51%,
      rgba(255, 255, 255, 0) 58%
    );
  mix-blend-mode: screen;
  transform: translateZ(18px);
}

.cover-imperfections {
  z-index: 3;
  opacity: var(--cover-imperfection-opacity);
  background:
    radial-gradient(
      48% 42% at calc(var(--cover-gloss-x) + var(--cover-scroll-x)) calc(var(--cover-gloss-y) + var(--cover-scroll-y)),
      rgba(255, 255, 255, 1) 0%,
      rgba(255, 255, 255, 0.95) 18%,
      rgba(255, 255, 255, 0.58) 36%,
      rgba(255, 255, 255, 0.24) 52%,
      rgba(255, 255, 255, 0) 72%
    );
  mix-blend-mode: screen;
  -webkit-mask-image: url("/graphics/smudges_whiteOnBlack.jpg");
  mask-image: url("/graphics/smudges_whiteOnBlack.jpg");
  -webkit-mask-size: cover;
  mask-size: cover;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-mode: luminance;
  mask-mode: luminance;
  filter: contrast(430%) brightness(2.08) saturate(0);
  transform: translateZ(24px) scale(1.035);
}

.price-card,
.feature-card,
.copy-card,
.sample-panel,
.summary-card,
.order-card,
.admin-card,
.checkout-panel,
.legal-copy,
.reading-sample {
  border-radius: 1.2rem;
  padding: 1.4rem;
}

.price-card {
  position: absolute;
  right: -3%;
  bottom: -2%;
  z-index: 40;
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.45rem;
  text-align: right;
  width: max-content;
  max-width: none;
  background: rgba(20, 26, 33, 0.72);
  backdrop-filter: blur(14px);
  transition: transform 0.2s ease;
  transform: scale(1);
  transform-origin: center;
  will-change: transform;
  white-space: nowrap;
  overflow: visible;
}

.price-card:hover,
.price-card:focus-visible,
.price-card:focus-within {
  transform: scale(1.08);
}

.price-card:focus-visible {
  outline: 2px solid rgba(235, 201, 119, 0.75);
  outline-offset: 4px;
}

.price-card small {
  white-space: nowrap;
}

.price-card .format-tooltip {
  display: inline-flex;
  vertical-align: baseline;
}

.price-card .format-tooltip-trigger {
  margin-left: 0;
}

.price-card .format-tooltip-bubble {
  top: auto;
  bottom: calc(100% + 0.6rem);
  left: auto;
  right: 0;
  width: min(20rem, 82vw);
  white-space: normal;
  text-align: left;
  z-index: 1200;
}

.price-card .format-tooltip-bubble::before {
  left: auto;
  right: 1.15rem;
  top: calc(100% - 0.05rem);
  bottom: auto;
  border-left: 0;
  border-top: 0;
  border-right: 1px solid rgba(235, 201, 119, 0.22);
  border-bottom: 1px solid rgba(235, 201, 119, 0.22);
}

.price-card:focus-visible .format-tooltip-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.key-facts,
.check-list,
.faq-list {
  list-style: none;
  padding: 0;
  margin: 1.1rem 0 0;
}

.key-facts li,
.check-list li {
  padding: 0.22rem 0;
  color: var(--muted);
}

.format-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.format-tooltip-trigger {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0 0 0 0.3rem;
  font: inherit;
  color: rgba(235, 201, 119, 0.88);
  cursor: help;
  transition: color 0.2s ease;
}

.format-tooltip-label {
  display: inline-block;
  line-height: 1;
  padding-bottom: 0.02rem;
  border-bottom: 2px dotted rgba(235, 201, 119, 0.6);
  transition: border-color 0.2s ease;
}

.format-tooltip-trigger:hover,
.format-tooltip-trigger:focus-visible,
.format-tooltip:hover .format-tooltip-trigger {
  color: var(--accent-strong);
}

.format-tooltip-trigger:hover .format-tooltip-label,
.format-tooltip-trigger:focus-visible .format-tooltip-label,
.format-tooltip:hover .format-tooltip-label {
  border-bottom-color: rgba(235, 201, 119, 0.95);
}

.format-tooltip-trigger:focus-visible {
  outline: 2px solid rgba(235, 201, 119, 0.7);
  outline-offset: 5px;
  border-radius: 0.2rem;
}

.format-tooltip-bubble {
  position: absolute;
  left: 0;
  top: calc(100% + 0.75rem);
  width: min(18rem, 70vw);
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(235, 201, 119, 0.22);
  border-radius: 0.9rem;
  background: rgba(15, 20, 25, 0.96);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.2rem);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
  z-index: 20;
}

.format-tooltip-bubble::before {
  content: "";
  position: absolute;
  left: 1.15rem;
  bottom: calc(100% - 0.05rem);
  width: 0.8rem;
  height: 0.8rem;
  background: rgba(15, 20, 25, 0.96);
  border-left: 1px solid rgba(235, 201, 119, 0.22);
  border-top: 1px solid rgba(235, 201, 119, 0.22);
  transform: rotate(45deg);
}

.format-tooltip:hover .format-tooltip-bubble,
.format-tooltip:focus-within .format-tooltip-bubble,
.format-tooltip.is-tooltip-open .format-tooltip-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 860px), (hover: none), (pointer: coarse) {
  .format-tooltip-bubble {
    width: min(20rem, calc(100vw - 2rem));
  }

  .price-card .format-tooltip-bubble {
    left: 50%;
    right: auto;
    width: min(20rem, calc(100vw - 2rem));
    transform: translate(-50%, -0.2rem);
  }

  .price-card .format-tooltip-bubble::before {
    left: 50%;
    right: auto;
    transform: translateX(-50%) rotate(45deg);
  }

  .price-card .format-tooltip:focus-within .format-tooltip-bubble,
  .price-card .format-tooltip.is-tooltip-open .format-tooltip-bubble {
    transform: translate(-50%, 0);
  }
}

.section {
  padding: 1rem 0 2rem;
}

.story-grid,
.sample-highlight,
.checkout-layout,
.admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.story-blurb {
  white-space: pre-line;
}

.cards {
  gap: 1.2rem;
}

.feature-card {
  flex: 1 1 220px;
}

.sample-highlight blockquote {
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1.5;
  margin: 0;
  white-space: pre-line;
}

.sample-preview {
  max-height: 23rem;
  overflow: hidden;
  margin: 0 0 1rem;
  -webkit-mask-image: linear-gradient(
    180deg,
    #000 0%,
    #000 90%,
    rgba(0, 0, 0, 0.82) 96%,
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    #000 0%,
    #000 90%,
    rgba(0, 0, 0, 0.82) 96%,
    transparent 100%
  );
}

.testimonial-band article {
  margin-bottom: 1rem;
}

.faq-list details {
  margin-bottom: 1rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(20, 26, 33, 0.052), rgba(20, 26, 33, 0.195));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}

.faq-list details:last-child {
  margin-bottom: 0;
}

.faq-list summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding: 1rem 1.15rem;
  font-weight: 700;
  list-style: none;
}

.faq-list details[open] summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::before {
  content: "▾";
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.faq-list details[open] summary::before {
  transform: rotate(180deg);
}

.faq-list summary::before {
  content: "\25BE";
}

.faq-list .faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.28s ease, opacity 0.2s ease;
}

.faq-list details[open] .faq-answer {
  grid-template-rows: 1fr;
  opacity: 1;
}

.faq-list details.is-closing .faq-answer {
  grid-template-rows: 0fr;
  opacity: 0;
}

.faq-list .faq-answer-inner {
  overflow: hidden;
}

.faq-list details.is-closing summary::before {
  transform: rotate(0deg);
}

.faq-list details p {
  margin: 0;
  padding: 0.95rem 1.15rem 1.05rem;
  color: var(--text);
}

.faq-list details p a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-color: rgba(235, 201, 119, 0.65);
  text-underline-offset: 0.12em;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.faq-list details p a:hover,
.faq-list details p a:focus-visible {
  color: #f3d99a;
  text-decoration-color: currentColor;
}

.page-narrow {
  width: min(760px, calc(100% - 2rem));
}

.sample-shell {
  width: min(1180px, calc(100% - 2rem));
}

.sample-shell-overlay-header {
  padding-top: 0;
}

body.reading-sample-page .site-header,
body.reading-sample-page .site-header .top-nav,
body.reading-sample-page .site-header .top-nav a {
  transition: color 480ms cubic-bezier(0.22, 1, 0.36, 1), text-shadow 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.reading-sample-page.reading-sample-dark-visuals .site-header .top-nav,
body.reading-sample-page.reading-sample-dark-visuals .site-header .top-nav a {
  color: rgba(247, 237, 224, 0.88);
}

body.reading-sample-page.reading-sample-dark-visuals .site-header .top-nav a[href="/kaufen"] {
  color: #fff4df;
}

body.reading-sample-header-compact .site-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: min(1180px, calc(100% - 2rem));
  padding-top: 1rem;
  padding-bottom: 1rem;
  color: #2f2114;
  text-shadow: 0 1px 10px rgba(255, 248, 236, 0.55);
  justify-content: flex-end;
}

body.reading-sample-header-compact .site-header .logo,
body.reading-sample-header-compact .site-header .top-nav a[href="/leseprobe"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  position: absolute;
}

body.reading-sample-header-compact .site-header .top-nav {
  /*
    Reading-sample sticky-header readability requirement:
    Illustration layers can get visually dense behind the compact sticky nav.
    Keep a localized plate only behind the nav links (not full header width),
    and use lightweight paint-only styles for good mobile performance.
  */
  display: inline-flex;
  gap: 1.1rem;
  padding: 0.42rem 0.8rem 0.5rem;
  border-radius: 0.9rem;
  background:
    linear-gradient(
      168deg,
      rgba(248, 240, 226, 0.84) 0%,
      rgba(241, 228, 204, 0.76) 62%,
      rgba(226, 209, 176, 0.68) 100%
    );
  border: 1px solid rgba(90, 62, 30, 0.2);
  box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.16);
  color: rgba(47, 33, 20, 0.9);
}

body.reading-sample-header-compact .site-header .top-nav a[href="/kaufen"] {
  color: #24160b;
}

body.reading-sample-header-compact.reading-sample-dark-visuals .site-header {
  color: #f6ecdd;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.76);
}

body.reading-sample-header-compact.reading-sample-dark-visuals .site-header .top-nav {
  background:
    linear-gradient(
      164deg,
      rgba(20, 15, 12, 0.72) 0%,
      rgba(25, 18, 13, 0.66) 62%,
      rgba(35, 24, 16, 0.6) 100%
    );
  border-color: rgba(255, 222, 172, 0.16);
  box-shadow: 0 0.34rem 1.1rem rgba(0, 0, 0, 0.34);
  color: rgba(246, 236, 221, 0.92);
}

body.reading-sample-header-compact.reading-sample-dark-visuals .site-header .top-nav a {
  color: rgba(246, 236, 221, 0.92);
}

body.reading-sample-header-compact.reading-sample-dark-visuals .site-header .top-nav a[href="/kaufen"] {
  color: #fff6e8;
}

