/* ============================================================
   Kai L. Fuchs — Shu-Ha-Ri
   Ein Buch, das mit KI entstand. Statisch, leicht, ohne CMS.
   Ästhetik: Washi-Papier, Sumi-Tinte, Zinnober (朱色).
   ============================================================ */

/* ---------- Fonts ---------- */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..900;1,9..144,300..900&family=Newsreader:ital,opsz,wght@0,6..72,300..600;1,6..72,300..600&family=Noto+Serif+JP:wght@400;600&display=swap");

/* ---------- Tokens ---------- */
:root {
  --paper:      #f5f0e6;
  --paper-deep: #ece4d3;
  --ink:        #221b13;
  --ink-2:      #5d5344;
  --ink-3:      #8c8070;
  --shu:        #b93c1c;
  --shu-deep:   #8f2a10;
  --line:       rgba(34, 27, 19, 0.16);
  --line-strong: rgba(34, 27, 19, 0.45);

  --font-display: "Fraunces", "Georgia", serif;
  --font-body:    "Newsreader", "Georgia", serif;
  --font-jp:      "Noto Serif JP", serif;

  --w-page: 68rem;
  --w-wide: 78rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.1875rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

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

/* Papierkorn über allem, ganz dezent */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--shu); color: var(--paper); }

/* ---------- Layout-Helfer ---------- */
.wrap {
  width: min(var(--w-page), 100% - 3rem);
  margin-inline: auto;
}
.wrap--wide { width: min(var(--w-wide), 100% - 3rem); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
  z-index: 10000;
}
.skip-link:focus { left: 0; }

/* ---------- Kopfzeile ---------- */
.site-header {
  border-bottom: 1px solid var(--line-strong);
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
}

.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-seal {
  width: 0.85em;
  height: 0.85em;
  background: var(--shu);
  display: inline-block;
  transform: translateY(0.06em);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  gap: 1.6rem;
  flex-wrap: wrap;
}

.site-nav a,
.footer-links a {
  font-size: 0.98rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-2);
  padding-block: 0.15rem;
  background: linear-gradient(var(--shu), var(--shu)) left bottom / 0% 2px no-repeat;
  transition: background-size 0.35s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s;
}
.site-nav a:hover,
.footer-links a:hover {
  color: var(--shu-deep);
  background-size: 100% 2px;
}

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(2.5rem, 6vw, 4.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 1.6rem;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--shu-deep);
}
.kicker::after {
  content: "";
  width: clamp(2rem, 8vw, 5rem);
  height: 1px;
  background: var(--line-strong);
}

.hero h1 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 380;
  font-variation-settings: "opsz" 144, "SOFT" 40, "WONK" 1;
  font-size: clamp(4rem, 12vw, 8.5rem);
  line-height: 0.94;
  letter-spacing: -0.015em;
}

.hero h1 em {
  font-style: italic;
  font-weight: 480;
  color: var(--shu);
}

.hero-sub {
  margin: 0.6rem 0 1.8rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 380;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  color: var(--ink-2);
}

.hero-lead {
  max-width: 34rem;
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.55;
}

.hero-lead strong { color: var(--shu-deep); font-weight: 500; }

/* Vertikale Kanji-Spalte */
.kanji-col {
  writing-mode: vertical-rl;
  font-family: var(--font-jp);
  font-weight: 600;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0.32em;
  color: var(--ink);
  padding-block-start: 0.4rem;
  user-select: none;
}
.kanji-col span { display: inline-block; }
.kanji-col span + span { margin-block-start: 1.1em; }
.kanji-col .ha { color: var(--shu); }

/* Buchcover */
.book {
  position: relative;
  width: clamp(11rem, 24vw, 17rem);
  justify-self: end;
}

.book::before {
  content: "";
  position: absolute;
  inset: 1rem -1rem -1rem 1rem;
  border: 1.5px solid var(--shu);
  z-index: 0;
}

.book img {
  position: relative;
  z-index: 1;
  box-shadow:
    14px 18px 0 -4px var(--paper-deep),
    16px 20px 38px rgba(34, 27, 19, 0.35);
  transform: rotate(-1.6deg);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.book:hover img {
  transform: rotate(-0.4deg) translateY(-6px);
  box-shadow:
    14px 26px 0 -4px var(--paper-deep),
    18px 30px 46px rgba(34, 27, 19, 0.4);
}

.book figcaption {
  position: relative;
  z-index: 1;
  margin-top: 1.6rem;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Meta-Leiste unter dem Hero */
.meta-strip {
  margin-top: clamp(3rem, 7vw, 5rem);
  border-block: 1px solid var(--line-strong);
  padding-block: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2.6rem;
}

.meta-strip div { display: flex; gap: 0.55rem; align-items: baseline; }
.meta-strip dt {
  order: 2;
  font-size: 0.92rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.meta-strip dd {
  order: 1;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 520;
  font-size: 1.02rem;
}

/* ---------- Abschnitte ---------- */
.section {
  padding-block: clamp(3.2rem, 8vw, 6.5rem);
}

.section + .section { border-top: 1px solid var(--line); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  margin-bottom: 2.2rem;
}

.section-no {
  font-family: var(--font-jp);
  font-size: 1.05rem;
  color: var(--paper);
  background: var(--shu);
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transform: rotate(3deg);
  align-self: center;
  box-shadow: 3px 3px 0 rgba(143, 42, 16, 0.35);
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 430;
  font-variation-settings: "opsz" 100;
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.prose {
  max-width: 40rem;
}
.prose p { margin: 0 0 1.3rem; }
.prose p:last-child { margin-bottom: 0; }

.prose a:not(.btn) {
  color: var(--shu-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(185, 60, 28, 0.45);
  transition: text-decoration-color 0.2s;
}
.prose a:not(.btn):hover { text-decoration-color: currentColor; }

/* Drei Phasen: Shu · Ha · Ri */
.phases {
  list-style: none;
  margin: 2.6rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.phase {
  border-top: 3px solid var(--ink);
  padding-top: 1.2rem;
  position: relative;
}

.phase:nth-child(2) { border-top-color: var(--shu); }
.phase:nth-child(3) { border-top-color: var(--line-strong); }

.phase-kanji {
  font-family: var(--font-jp);
  font-weight: 600;
  font-size: 3rem;
  line-height: 1;
  display: block;
  margin-bottom: 0.7rem;
}
.phase:nth-child(2) .phase-kanji { color: var(--shu); }

.phase h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-weight: 540;
  font-size: 1.3rem;
}
.phase .phase-romaji {
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: block;
  margin-bottom: 0.8rem;
}
.phase p { margin: 0; font-size: 1.05rem; line-height: 1.55; color: var(--ink-2); }

/* Für wen? */
.audience {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 44rem;
}

.audience li {
  position: relative;
  padding: 1.4rem 0 1.4rem 3.2rem;
  font-size: 1.22rem;
  line-height: 1.5;
}
.audience li + li { border-top: 1px solid var(--line); }

.audience li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.75rem;
  width: 1.15rem;
  height: 1.15rem;
  background: var(--shu);
  transform: rotate(45deg);
}

.audience-note {
  margin-top: 1.6rem;
  font-style: italic;
  color: var(--ink-2);
}

/* ---------- Buch-Sektion (dunkel) ---------- */
.section--book {
  background: linear-gradient(160deg, #241c12, #17110a 70%);
  color: #efe8da;
}
.section--book ::selection { background: var(--shu); color: #efe8da; }

.section--book .section-head h2 { color: #f5efe3; }

.book-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.book-grid .book { width: clamp(11rem, 20vw, 15rem); }

.book-grid .book::before { inset: 1rem -0.8rem -0.8rem 0.8rem; border-color: rgba(239, 232, 218, 0.5); }

.book-details {
  margin: 0 0 1.8rem;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 2.4rem;
  font-size: 1.02rem;
}
.book-details li {
  break-inside: avoid;
  padding-block: 0.45rem;
  border-bottom: 1px solid rgba(239, 232, 218, 0.14);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.book-details dt { color: rgba(239, 232, 218, 0.55); letter-spacing: 0.06em; font-size: 0.88rem; text-transform: uppercase; align-self: baseline; }
.book-details dd { margin: 0; text-align: right; }
.book-details a { color: inherit; }

.section--book p { color: rgba(239, 232, 218, 0.82); max-width: 36rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.6rem;
  padding: 0.85rem 1.7rem;
  background: var(--shu);
  color: #fdf8ee;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 5px 5px 0 rgba(185, 60, 28, 0.28);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s, background 0.25s;
}
.btn:hover {
  background: var(--shu-deep);
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(185, 60, 28, 0.32);
}
.btn:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 rgba(185, 60, 28, 0.3); }
.btn .arr { transition: translate 0.25s; }
.btn:hover .arr { translate: 4px 0; }

/* ---------- Inhalt (Verzeichnis) ---------- */
.toc {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 44rem;
  counter-reset: toc;
}

.toc > li {
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 530;
  font-size: 1.12rem;
  counter-increment: toc;
}

.toc > li::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--shu);
  margin-right: 1rem;
}

.toc ul {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
}
.toc ul li {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  color: var(--ink-2);
  padding-left: 2.9rem;
  padding-block: 0.18rem;
}
.toc ul li::before { content: "·"; color: var(--ink-3); margin-right: 0.7rem; }

.toc-note {
  margin-top: 1.4rem;
  font-style: italic;
  color: var(--ink-2);
  font-size: 1rem;
}

/* ---------- Kontakt ---------- */
.contact-line {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.5vw, 2.6rem);
  font-weight: 400;
  overflow-wrap: anywhere;
}
.contact-line a {
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(var(--shu), var(--shu)) left 88% / 0% 3px no-repeat;
  transition: background-size 0.4s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s;
}
.contact-line a:hover { color: var(--shu-deep); background-size: 100% 3px; }

/* ---------- Fußzeile ---------- */
.site-footer {
  border-top: 1px solid var(--line-strong);
  padding-block: 2.2rem;
  margin-top: 2rem;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem 2.5rem;
  flex-wrap: wrap;
}

.copyright { font-size: 0.95rem; color: var(--ink-2); }

.footer-links { display: flex; gap: 1.6rem; }

/* ---------- Unterseiten ---------- */
.page-hero { padding-block: clamp(3rem, 8vw, 6rem) 0; }

.page-hero h1 {
  margin: 0 0 2.6rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 40, "WONK" 1;
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.015em;
}
.page-hero h1 em { font-style: italic; color: var(--shu); }

.page-body {
  padding-block: 1rem clamp(3rem, 7vw, 5rem);
}

/* ---------- Eingangsanimation (nur Hero, rein CSS) ---------- */
@keyframes rise {
  from { opacity: 0; translate: 0 22px; }
  to   { opacity: 1; translate: 0 0; }
}

@keyframes stamp {
  0%   { opacity: 0; scale: 1.6; rotate: 14deg; }
  70%  { opacity: 1; }
  100% { opacity: 1; scale: 1; rotate: 3deg; }
}

.hero .kicker,
.hero h1,
.hero-sub,
.hero-lead,
.meta-strip { animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both; }
.hero h1       { animation-delay: 0.08s; }
.hero-sub      { animation-delay: 0.16s; }
.hero-lead     { animation-delay: 0.24s; }
.meta-strip    { animation-delay: 0.4s; }

.kanji-col span { animation: rise 1s cubic-bezier(0.22, 1, 0.36, 1) both; }
.kanji-col span:nth-child(2) { animation-delay: 0.25s; }
.kanji-col span:nth-child(3) { animation-delay: 0.4s; }

.book img  { animation: rise 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both; }
.book figcaption { animation: rise 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both; }
.brand-seal { animation: stamp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both; }

/* Scroll-Reveals als Progressive Enhancement (kein JS nötig) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .section .section-head,
    .section .prose,
    .phases .phase,
    .audience li,
    .toc,
    .contact-line {
      animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
      animation-timeline: view();
      animation-range: entry 0% entry 45%;
    }
    .phases .phase:nth-child(2),
    .audience li:nth-child(2) { animation-range: entry 8% entry 53%; }
    .phases .phase:nth-child(3) { animation-range: entry 16% entry 61%; }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------- Responsiv ---------- */
@media (max-width: 56rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .book { grid-column: 2; }
}

@media (max-width: 44rem) {
  body { font-size: 1.1rem; }

  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .kanji-col {
    writing-mode: horizontal-tb;
    letter-spacing: 0.4em;
    font-size: 2.2rem;
    order: 3;
    padding-block-start: 0;
  }
  .kanji-col span + span { margin-block-start: 0; }
  .book {
    grid-column: 1;
    justify-self: start;
    margin-top: 2.2rem;
  }

  .phases { grid-template-columns: 1fr; gap: 2rem; }

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

  .site-header .wrap { align-items: center; }
  .site-nav { gap: 1.1rem; }
}
