@import url("https://fonts.googleapis.com/css2?family=Lobster&display=swap&subset=cyrillic");

:root {
  --poem-border: #e7e7e7;
  --muted: #777;
  --title-font: "Lobster", "Palatino Linotype", "Book Antiqua", "Palatino", "Garamond", "Georgia", serif;
  --hover-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

body {
  background: #fafafa;
  position: relative;
}

.home .container {
  padding: 0;
}

.home .grid-books {
  padding: 0 1rem;
}

.home,
html.home {
  scroll-snap-type: y mandatory;
  scroll-snap-stop: always;
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
  overflow-x: clip;
}

@supports not (overflow: clip) {
  .home,
  html.home {
    overflow-x: hidden;
  }
}

.home.snap-off,
html.home.snap-off {
  scroll-snap-type: none;
}


.home .hero-cover {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-radius: 0;
  background-size: calc(100% + var(--hero-zoom, 8%));
  background-position: var(--hero-x, 50%) var(--hero-y, 40%);
}

@supports (width: 100svw) {
  .home .hero-cover {
    width: 100svw;
    margin-left: calc(50% - 50svw);
    margin-right: calc(50% - 50svw);
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(250, 250, 250, 0.3);
  padding: 0.75rem 0;
  margin: 0 1rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@supports (backdrop-filter: blur(6px)) {
  .site-header {
    background: rgba(250, 250, 250, 0.3);
    backdrop-filter: blur(3px);
  }
}

.breadcrumb {
  font-size: 0.95rem;
}

.header-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-link {
  text-decoration: none;
  font-size: 0.85rem;
  color: var(--muted);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 0;
}

.icon-link,
.icon-toggle,
.switch.icon-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  vertical-align: middle;
  border: 1px solid var(--poem-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.35);
  box-sizing: border-box;
}

@supports (backdrop-filter: blur(6px)) {
  .icon-link,
  .icon-toggle {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
  }
}

.icon-link img,
.icon-toggle img {
  width: 24px;
  height: 24px;
  display: block;
}

.icon-down {
  transform: rotate(180deg);
}

.icon-toggle,
.switch.icon-toggle {
  cursor: pointer;
  gap: 0;
  padding: 0;
}

.icon-toggle input {
  display: none;
}

.images-only .icon-toggle img {
  opacity: 0.5;
}

.switch input {
  accent-color: #111;
}

.images-only .poem-content {
  display: none;
}

.images-only .poem-body {
  grid-template-columns: 1fr;
}

.images-only .poem {
  display: inline-block;
  padding: 0.75rem;
  width: auto;
}

.images-only .poems {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.images-only .poem-image img {
  border: none;
}

.hero {
  margin-bottom: 0;
}

.hero-cover {
  min-height: 60svh;
  max-height: 70svh;
  border-radius: 10px;
  position: relative;
  background: transparent;
  z-index: 0;
  background-size: cover;
  background-position: top center;
  background-attachment: fixed;
  scroll-snap-align: start;
}


.hero-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: none;
  pointer-events: none;
  border-radius: 10px;
}


.hero-inner {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 100vh;
  z-index: 1;
  padding: 0 1.25rem;
  pointer-events: none;
  clip-path: inset(var(--hero-clip-top, 0px) 0 var(--hero-clip-bottom, 0px) 0);
  padding-top: calc(var(--hero-bottom, 0px) - var(--hero-snippet-height, 0px) - 1.25rem);
}

.hero-title {
  display: inline-block;
  font-size: 2rem;
  font-weight: 700;
  color: #0b0b0b;
  text-decoration: none;
  text-shadow:
    0 1px 2px rgba(255, 255, 255, 0.9),
    0 0 18px rgba(255, 255, 255, 0.9),
    0 0 6px rgba(255, 255, 255, 0.7),
    0 0 3px rgba(0, 0, 0, 0.25);
}

.hero-snippet {
  display: inline-block;
  max-width: min(46ch, 82vw);
  padding: 0;
  color: #111;
  font-size: clamp(1.8rem, 3.6vw, 3.2rem);
  line-height: 1.3;
  font-family: var(--title-font);
  white-space: pre;
  text-shadow:
    0 2px 4px rgba(255, 255, 255, 1),
    0 0 18px rgba(255, 255, 255, 1),
    0 0 40px rgba(255, 255, 255, 1),
    0 0 70px rgba(255, 255, 255, 1);
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
}

.hero-snippet:hover {
  text-decoration: underline;
}


.grid-books {
  position: relative;
  z-index: 3;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.home .grid-books {
  padding-top: 1.5rem;
  background: #fafafa;
}

.home-footer {
  margin: 1.5rem 0 0;
  height: 120px;
  border-radius: 0;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background-size: cover;
  background-position: center bottom;
  position: relative;
  overflow: hidden;
  scroll-snap-align: end;
  scroll-snap-stop: always;
}

@supports (width: 100svw) {
  .home-footer {
    width: 100svw;
    margin-left: calc(50% - 50svw);
    margin-right: calc(50% - 50svw);
  }
}

.home-footer::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.9)),
    linear-gradient(0deg, rgba(255, 255, 255, 0.3), rgba(0, 0, 0, 0));
  backdrop-filter: blur(12px);
}

.home-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.22);
}

.footer-icons {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-icon {
  width: 28px;
  height: 28px;
  border-radius: 0;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111;
  background: transparent;
  text-decoration: none;
}

.footer-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.footer-icon img {
  width: 24px;
  height: 24px;
  display: block;
}



.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.card {
  display: block;
  padding: 1rem;
  border: 1px solid var(--poem-border);
  border-radius: 6px;
  text-decoration: none;
  min-height: 140px;
  background-size: cover;
  background-position: center;
  color: #111;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.7));
}

.card-title {
  position: relative;
  z-index: 1;
}

.card {
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--hover-shadow);
}

.card:hover::after {
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.5));
}

.card-title {
  font-weight: 600;
}

.book-link {
  font-size: 0.85rem;
  color: var(--muted);
  word-break: break-all;
}

.poems {
  display: grid;
  gap: 1.5rem;
}

.poem {
  position: relative;
  border: 1px solid var(--poem-border);
  padding: 1.25rem;
  border-radius: 8px;
  background: #fff;
}


.poem-body {
  display: grid;
  grid-template-columns: minmax(120px, 280px) 1fr;
  gap: 1rem;
  align-items: start;
}

.poem-anchor {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.55);
}

@supports (backdrop-filter: blur(6px)) {
  .poem-anchor {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(6px);
  }
}

.poem-anchor:hover {
  color: #111;
  background: rgba(255, 255, 255, 0.85);
}

.images-only .poem-anchor {
  display: none;
}

.poem-image img {
  width: auto;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--poem-border);
  display: block;
  margin-bottom: 0.75rem;
  max-width: 100%;
  cursor: pointer;
}

.poem-image img:last-child {
  margin-bottom: 0;
}

.poem-content {
  min-width: 0;
}

.poem-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.poem-text {
  font-family: "Courier New", Courier, monospace;
  white-space: pre-wrap;
  color: #111;
}

.poem-text .emoji {
  margin: 0 0.25em;
}

.poem-line {
  line-height: 1.4;
}

.poem-author {
  font-style: italic;
  color: var(--muted);
  margin-top: 0.75rem;
  text-align: right;
}

.poem-note {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid #c8c8c8;
  background: #f6f6f6;
  color: #444;
  font-size: 0.9rem;
  font-style: italic;
}

.muted {
  color: var(--muted);
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.back-top {
  margin: 2rem 0;
  text-align: center;
}

.back-top a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}

@media (max-width: 800px) {
  .poem-body {
    grid-template-columns: 1fr;
  }
}
