* { box-sizing: border-box; }

:root {
  --paper: #16121c;
  --paper-2: #1d1826;
  --ink: #f3ece1;
  --muted: #b3a898;
  --red: #e8556d;
  --gold: #f3b84b;
  --sakura: #f7b8cb;
  --indigo: #8f79c9;
  --line: rgba(243, 236, 225, 0.14);

  /* фон и шрифты — Google Fonts, но есть системные фолбэки */
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-title: "Playfair Display", Georgia, "Times New Roman", serif;
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(232, 85, 109, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(143, 121, 201, 0.2), transparent 60%),
    var(--paper);
  overflow: hidden;
}

.deck {
  position: relative;
  height: 100vh;
  width: 100vw;
}

/* ---------- Слайды ---------- */
.slide {
  position: absolute;
  inset: 0;
  padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1.5rem, 6vw, 6rem) 5.5rem;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(0.99);
  transition: opacity .45s ease, transform .45s ease, visibility .45s;
  overflow-y: auto;
}
.slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 1rem;
  letter-spacing: .35em;
  text-transform: uppercase;
  font-size: .75rem;
  color: var(--sakura);
}

.slide__head {
  border-bottom: 1px solid var(--line);
  padding-bottom: .9rem;
  margin-bottom: clamp(1rem, 2.5vw, 2rem);
}
.slide__head h2 {
  margin: 0;
  font-family: var(--font-title);
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.1;
  background: linear-gradient(90deg, var(--ink), var(--sakura));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.slide__hint {
  margin: .4rem 0 0;
  color: var(--muted);
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ---------- Титул ---------- */
.slide--cover { justify-content: center; align-items: center; text-align: center; }
.cover { position: relative; z-index: 2; }
.cover__sun {
  position: absolute;
  top: -22vh; left: 50%;
  width: clamp(220px, 34vw, 420px);
  height: clamp(220px, 34vw, 420px);
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff8fa3, var(--red) 60%, #b8273f);
  filter: blur(.2px);
  opacity: .85;
  z-index: -1;
  box-shadow: 0 0 120px rgba(232, 85, 109, .45);
}
.cover__wave {
  position: absolute;
  left: 50%; bottom: -30vh;
  width: 160vw; height: 60vh;
  transform: translateX(-50%);
  background:
    radial-gradient(60% 100% at 50% 0%, rgba(143,121,201,.25), transparent 70%);
  z-index: -1;
}
.cover__title {
  font-family: var(--font-title);
  font-size: clamp(3rem, 11vw, 8rem);
  line-height: .95;
  margin: 0;
  letter-spacing: .01em;
}
.cover__title span {
  background: linear-gradient(90deg, var(--gold), var(--red));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cover__sub {
  color: var(--muted);
  font-size: clamp(.95rem, 1.6vw, 1.15rem);
  line-height: 1.6;
  margin: 1.4rem 0 0;
}
.cover__meta {
  display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap;
  margin-top: 2rem;
  color: var(--sakura);
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* ---------- План ---------- */
.toc {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.toc__item {
  display: flex; gap: 1rem; align-items: flex-start;
  background: linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  transition: transform .25s, border-color .25s;
}
.toc__item:hover { transform: translateY(-4px); border-color: var(--red); }
.toc__num {
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: var(--gold);
  line-height: 1;
}
.toc__item h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.toc__item p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }

/* ---------- Контент ---------- */
.cols { display: grid; grid-template-columns: 1.25fr .9fr; gap: clamp(1rem, 3vw, 2.5rem); flex: 1; align-items: center; }
.cols--split { grid-template-columns: 1.15fr .85fr; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } .col--art { display: none; } }

.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
.facts li {
  position: relative;
  padding: .85rem 1rem .85rem 2.6rem;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: 12px;
  line-height: 1.55;
  font-size: clamp(.95rem, 1.5vw, 1.05rem);
}
.facts li::before {
  content: "◆";
  position: absolute; left: 1rem; top: .95rem;
  color: var(--gold); font-size: .8rem;
}
.facts b { color: var(--sakura); }

.caption { color: var(--muted); font-size: .85rem; text-align: center; margin: .9rem 0 0; line-height: 1.5; }

/* ---------- Карточки ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.card {
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.4rem 1.2rem;
  text-align: center;
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.card__icon { font-size: 2rem; display: block; margin-bottom: .6rem; }
.card h3 { margin: 0 0 .5rem; font-family: var(--font-title); font-size: 1.25rem; color: var(--gold); }
.card p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.55; }
.card b { color: var(--ink); }

/* ---------- Цитата ---------- */
.quote {
  background: rgba(232, 85, 109, .1);
  border: 1px solid rgba(232, 85, 109, .35);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.1rem;
}
.quote p { margin: 0; line-height: 1.55; }
.quote__src { color: var(--sakura); font-size: .82rem; margin-top: .6rem !important; letter-spacing: .06em; }

/* ---------- Цветовая линейка хэйан ---------- */
.color-line { grid-column: 1 / -1; display: flex; gap: 1.4rem; flex-wrap: wrap; margin-bottom: .4rem; }
.color-line__item { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--muted); letter-spacing: .05em; }
.color-line__item span { width: 26px; height: 26px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px rgba(255,255,255,.06); }

/* ---------- Арт-блоки ---------- */
.col--art { display: flex; flex-direction: column; justify-content: center; }
.art {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #241d33, #171322);
}
.art__sun { position: absolute; top: 14%; right: 14%; width: 34%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffd9a0, var(--gold)); box-shadow: 0 0 40px rgba(243,184,75,.5); }
.art__sun--red { background: radial-gradient(circle at 35% 35%, #ff9fb0, var(--red)); box-shadow: 0 0 50px rgba(232,85,109,.6); top: 10%; right: auto; left: 12%; width: 30%; }
.art__peak { position: absolute; bottom: 26%; width: 60%; height: 55%; background: #2f2745; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.art__peak--1 { left: -6%; }
.art__peak--2 { right: -8%; height: 42%; background: #3a3057; }
.art__sea { position: absolute; inset: auto 0 0 0; height: 26%; background: linear-gradient(180deg, #2b4a6b, #1b2f47); }

/* тории */
.art--torii { display: grid; place-items: center; }
.torii { position: relative; width: 62%; height: 58%; }
.torii__top { position: absolute; top: 0; left: -6%; right: -6%; height: 14%; background: linear-gradient(180deg, var(--red), #c73d52); border-radius: 8px; transform: perspective(200px) rotateX(6deg); }
.torii__mid { position: absolute; top: 26%; left: 4%; right: 4%; height: 10%; background: #d94a5f; }
.torii__leg { position: absolute; top: 8%; bottom: 0; width: 11%; background: linear-gradient(180deg, var(--red), #a82b40); }
.torii__leg--l { left: 12%; }
.torii__leg--r { right: 12%; }

/* пагода */
.art--pagoda { display: grid; place-items: center; }
.pagoda { position: relative; width: 58%; height: 76%; }
.pagoda__roof { position: absolute; left: 0; right: 0; height: 22%; background: linear-gradient(180deg, #3b4f7d, #2b3a5c); clip-path: polygon(50% 0, 100% 78%, 84% 100%, 16% 100%, 0 78%); }
.pagoda__roof--3 { bottom: 0; }
.pagoda__roof--2 { bottom: 30%; }
.pagoda__roof--1 { bottom: 60%; }
.pagoda__pole { position: absolute; top: -4%; left: 50%; width: 6%; height: 8%; transform: translateX(-50%); background: var(--gold); border-radius: 3px; }

/* Будда */
.art--buddha { display: grid; place-items: center; }
.buddha { position: relative; width: 70%; height: 70%; display: grid; place-items: center; }
.buddha__halo { position: absolute; top: 4%; width: 66%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(243,184,75,.55), transparent 68%); }
.buddha__head { position: relative; z-index: 1; width: 34%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f7d9a4, #c99a52); }
.buddha__body { position: absolute; bottom: 0; width: 74%; height: 46%; background: linear-gradient(180deg, #d3a75f, #9b7438); border-radius: 46% 46% 18% 18% / 70% 70% 20% 20%; }

/* шлем самурая */
.art--samurai { display: grid; place-items: center; }
.helmet { position: relative; width: 58%; height: 58%; }
.helmet__dome { position: absolute; left: 12%; right: 12%; bottom: 24%; height: 52%; background: linear-gradient(180deg, #4a4160, #2c2740); border-radius: 50% 50% 40% 40%; border: 2px solid rgba(243,184,75,.5); }
.helmet__mask { position: absolute; left: 24%; right: 24%; bottom: 6%; height: 24%; background: linear-gradient(180deg, #3a3350, #241f36); border-radius: 30% 30% 46% 46%; }
.helmet__horn { position: absolute; top: 0; width: 42%; height: 40%; background: var(--gold); }
.helmet__horn--l { left: 4%; clip-path: polygon(100% 100%, 0 0, 18% 100%); transform: rotate(-8deg); }
.helmet__horn--r { right: 4%; clip-path: polygon(0 100%, 100% 0, 82% 100%); transform: rotate(8deg); }

/* ---------- HUD и навигация ---------- */
.hud {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem; justify-content: space-between;
  padding: .7rem clamp(1rem, 4vw, 2.5rem);
  background: linear-gradient(180deg, transparent, rgba(10, 8, 16, .85) 40%);
  font-size: .8rem; color: var(--muted);
}
.hud__counter { letter-spacing: .06em; }
.hud__counter b { color: var(--gold); font-family: var(--font-title); font-size: 1rem; }
.hud__keys { letter-spacing: .06em; opacity: .75; }
.dots { display: flex; gap: .45rem; flex-wrap: wrap; justify-content: center; }
.dot { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: rgba(243,236,225,.25); cursor: pointer; transition: transform .2s, background .2s; }
.dot:hover { background: var(--sakura); transform: scale(1.25); }
.dot.is-active { background: var(--red); transform: scale(1.35); }

.nav {
  position: fixed; top: 50%; z-index: 50; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(29, 24, 38, .7);
  color: var(--ink); font-size: 1.7rem; line-height: 1; cursor: pointer;
  backdrop-filter: blur(6px); transition: background .2s, transform .2s, opacity .2s;
}
.nav:hover { background: rgba(232, 85, 109, .85); transform: translateY(-50%) scale(1.08); }
.nav:disabled { opacity: .25; pointer-events: none; }
.nav--prev { left: clamp(.6rem, 2vw, 1.4rem); }
.nav--next { right: clamp(.6rem, 2vw, 1.4rem); }

@media (max-width: 700px) {
  .hud__keys { display: none; }
  .nav { width: 42px; height: 42px; font-size: 1.3rem; }
  .cards { grid-template-columns: 1fr 1fr; }
}
.art--torii { display: grid; place-items: center; }
.torii { position: relative; width: 55%; height: 55%; }
.torii span { position: absolute; background: var(--red); border-radius: 3px; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.torii__top { top: 0; left: -8%; width: 116%; height: 11%; transform: perspective(80px) rotateX(12deg); }
.torii__mid { top: 22%; left: 4%; width: 92%; height: 8%; }
.torii__leg { top: 0; width: 9%; height: 100%; }
.torii__leg--l { left: 14%; }
.torii__leg--r { right: 14%; }

/* пагода */
.art--pagoda { display: grid; place-items: center; }
.pagoda { position: relative; width: 60%; height: 75%; }
.pagoda span { position: absolute; left: 50%; transform: translateX(-50%); }
.pagoda__roof { width: 100%; height: 16%; background: linear-gradient(180deg, #4a3f6b, #342c50); clip-path: polygon(50% 0, 100% 78%, 92% 100%, 8% 100%, 0 78%); }
.pagoda__roof--1 { bottom: 0; width: 100%; }
.pagoda__roof--2 { bottom: 27%; width: 84%; }
.pagoda__roof--3 { bottom: 54%; width: 68%; }
.pagoda__pole { bottom: 76%; width: 5%; height: 22%; background: var(--gold); border-radius: 4px; }

/* будда */
.art--buddha { display: grid; place-items: center; }
.buddha { position: relative; width: 60%; height: 70%; }
.buddha span { position: absolute; left: 50%; transform: translateX(-50%); }
.buddha__halo { top: 6%; width: 62%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(243,184,75,.65), transparent 65%); }
.buddha__head { top: 18%; width: 26%; aspect-ratio: 1; border-radius: 50%; background: linear-gradient(180deg, #f0d9a8, #d8b877); z-index: 2; }
.buddha__body { bottom: 0; width: 68%; height: 52%; background: linear-gradient(180deg, #e8c88f, #b8934f); border-radius: 50% 50% 12% 12%; }

/* самурай */
.art--samurai { display: grid; place-items: center; background: linear-gradient(180deg, #2a2138, #171322); }
.helmet { position: relative; width: 62%; height: 62%; }
.helmet span { position: absolute; }
.helmet__dome { left: 50%; bottom: 18%; transform: translateX(-50%); width: 72%; height: 62%; background: linear-gradient(180deg, #5a4d7d, #372f52); border-radius: 50% 50% 40% 40%; box-shadow: inset 0 -10px 20px rgba(0,0,0,.4); }
.helmet__mask { left: 50%; bottom: 0; transform: translateX(-50%); width: 46%; height: 26%; background: #241d33; border-radius: 30% 30% 50% 50%; border-top: 3px solid var(--red); }
.helmet__horn { top: 8%; width: 34%; height: 34%; background: var(--gold); z-index: 3; }
.helmet__horn--l { left: 8%; clip-path: polygon(100% 100%, 0 0, 60% 100%); border-radius: 4px; }
.helmet__horn--r { right: 8%; clip-path: polygon(0 100%, 100% 0, 40% 100%); border-radius: 4px; }

.closing {
  text-align: center;
  margin-top: clamp(1rem, 3vw, 2rem);
  font-family: var(--font-title);
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  color: var(--sakura);
}

/* ---------- HUD и навигация ---------- */
.hud {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: .9rem clamp(1rem, 5vw, 4rem) 1.1rem;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.45));
  z-index: 5;
  pointer-events: none;
}
.hud__counter { font-family: var(--font-title); font-size: 1rem; color: var(--muted); }
.hud__counter b { color: var(--gold); font-size: 1.25rem; }
.hud__keys { color: var(--muted); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
@media (max-width: 640px) { .hud__keys { display: none; } }

.dots { display: flex; gap: .5rem; pointer-events: auto; flex-wrap: wrap; justify-content: center; }
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  border: none; padding: 0; cursor: pointer;
  background: rgba(243,236,225,.25);
  transition: transform .2s, background .2s;
}
.dot:hover { background: rgba(243,236,225,.55); }
.dot.is-active { background: var(--red); transform: scale(1.5); box-shadow: 0 0 10px rgba(232,85,109,.7); }

.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: clamp(40px, 5vw, 54px);
  height: clamp(40px, 5vw, 54px);
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(20, 16, 28, .7);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .2s, transform .2s, border-color .2s;
  display: grid; place-items: center;
}
.nav:hover { background: var(--red); border-color: var(--red); transform: translateY(-50%) scale(1.08); }
.nav:disabled { opacity: .25; cursor: default; }
.nav:disabled:hover { background: rgba(20,16,28,.7); border-color: var(--line); transform: translateY(-50%); }
.nav--prev { left: clamp(.5rem, 2vw, 1.5rem); }
.nav--next { right: clamp(.5rem, 2vw, 1.5rem); }

/* печать */
@media print {
  body { overflow: visible; background: #fff; color: #111; }
  .deck { height: auto; }
  .slide { position: relative; opacity: 1; visibility: visible; transform: none; page-break-after: always; min-height: 100vh; }
  .hud, .nav { display: none; }
}
