:root {
  --bg: #f8fff9;
  --panel: rgba(255, 255, 255, 0.74);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --text: #183128;
  --muted: #537267;
  --line: rgba(108, 215, 145, 0.28);
  --line-strong: rgba(41, 176, 88, 0.45);
  --accent: #2ebf6d;
  --accent-soft: #8de2a8;
  --accent-deep: #0d8e47;
  --shadow: 0 20px 70px rgba(46, 112, 70, 0.13);
  --radius: 26px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(141, 226, 168, 0.35), transparent 30%),
    radial-gradient(circle at top right, rgba(46, 191, 109, 0.16), transparent 25%),
    linear-gradient(180deg, #ffffff 0%, #f5fff7 45%, #effbf2 100%);
  overflow-x: hidden;
}

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

button,
input,
select {
  font: inherit;
}

.ambient {
  position: fixed;
  inset: auto;
  width: 40vw;
  height: 40vw;
  pointer-events: none;
  filter: blur(30px);
  opacity: 0.45;
  z-index: 0;
}

.ambient-left {
  top: -10vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(121, 228, 154, 0.5), transparent 60%);
  animation: drift 9s ease-in-out infinite;
}

.ambient-right {
  right: -10vw;
  top: 12vh;
  background: radial-gradient(circle, rgba(105, 201, 131, 0.33), transparent 62%);
  animation: drift 11s ease-in-out infinite reverse;
}

.grid-lines {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(43, 188, 97, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 188, 97, 0.06) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 88%);
  pointer-events: none;
  z-index: 0;
}

.topbar,
.shell,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 20px 12px;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-wrap {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(190, 247, 208, 0.8));
  border: 1px solid rgba(74, 182, 108, 0.24);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-fallback {
  display: none;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-deep);
}

.logo-fallback-visible .logo-fallback {
  display: inline;
}

.eyebrow,
.section-tag,
.panel-label {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  color: var(--accent-deep);
}

.brand-name {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1;
  position: relative;
  color: #11281f;
  text-shadow: 0 0 14px rgba(101, 220, 136, 0.28);
  display: inline-flex;
  gap: 0.01em;
  perspective: 800px;
  animation: pulseGlow 3.5s ease-in-out 1s infinite;
}

.brand-name::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform-origin: left;
  animation: scanLine 2.8s linear infinite;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mini-chip {
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(78, 189, 111, 0.18);
  color: var(--muted);
  box-shadow: var(--shadow);
}

.mini-chip-strong {
  background: linear-gradient(135deg, #d5f8df, #87e0a3);
  color: #0c4d28;
  font-weight: 600;
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 20px 60px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: stretch;
}

.hero-minimal {
  margin-top: 4px;
}

.hero-copy,
.toolbar,
.book-card,
.footer {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-copy {
  border-radius: calc(var(--radius) + 4px);
  padding: 32px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(222, 252, 230, 0.9);
  color: #f84545;
  font-weight: 600;
}

.status-pill::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1fc764;
  box-shadow: 0 0 0 8px rgba(31, 199, 100, 0.11);
  animation: blink 1.6s ease-in-out infinite;
}

.results-count,
.footer p {
  color: var(--muted);
}

.toolbar {
  margin-top: 24px;
  padding: 18px;
  border-radius: var(--radius);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.search-box {
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  min-height: 62px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(98, 191, 126, 0.2);
}

.search-icon {
  font-size: 1.2rem;
  color: var(--accent-deep);
}

.search-box input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text);
}

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filters select {
  min-height: 54px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid rgba(91, 194, 122, 0.2);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  outline: none;
}

.catalog-head {
  margin-top: 30px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
}

.catalog-head h3,
.footer h4,
.modal-copy h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.book-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.brand-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px) rotateX(-70deg) scale(0.86);
  filter: blur(8px);
}

.brand-name.is-animated .brand-char {
  animation: titleCharReveal 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.book-card {
  border-radius: 28px;
  padding: 18px;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(42px) scale(0.94);
  will-change: transform, opacity;
}

.book-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -30%;
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #39ff88, #0d8e47, transparent);
  box-shadow: 0 0 14px rgba(57, 255, 136, 0.7);
  animation: cardScan 3.4s linear infinite;
}

.book-card:hover {
  transform: translateY(-8px) scale(1);
  border-color: var(--line-strong);
  box-shadow: 0 24px 80px rgba(37, 110, 63, 0.18);
}

.book-card.is-visible {
  animation: cardEnter 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.book-cover {
  height: 250px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(13, 142, 71, 0.98), rgba(162, 243, 184, 0.9));
  position: relative;
  overflow: hidden;
  padding: 0;
  display: flex;
  align-items: flex-end;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  background: linear-gradient(160deg, rgba(13, 142, 71, 0.98), rgba(162, 243, 184, 0.9));
}

.cover-glow,
.book-cover::after {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 18px;
  pointer-events: none;
}

.book-cover::after {
  content: "";
  inset: auto 0 0 0;
  height: 45%;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, transparent, rgba(8, 26, 17, 0.68));
}

.cover-title {
  position: relative;
  z-index: 1;
  color: white;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  max-width: 12ch;
}

.discount-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff5f5f, #d81d1d);
  color: white;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(176, 22, 22, 0.28);
  z-index: 2;
}

.discount-badge::before {
  content: "🏷";
  margin-right: 6px;
}

.book-meta {
  padding: 18px 4px 6px;
}

.book-category {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: #0f6e37;
  background: rgba(207, 250, 220, 0.95);
}

.book-meta h4 {
  margin: 14px 0 12px;
  font-size: 1.28rem;
}

.book-meta p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.price-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}

.price-new {
  font-size: 1.45rem;
  font-weight: 800;
  color: #133224;
}

.price-old {
  text-decoration: line-through;
  color: #88a89b;
}

.book-actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn {
  min-height: 52px;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-preview {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border: 1px solid rgba(97, 186, 122, 0.2);
}

.btn-buy {
  background: linear-gradient(135deg, #1ca956, #80de9f);
  color: white;
  box-shadow: 0 14px 30px rgba(28, 169, 86, 0.26);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 48px 20px;
  text-align: center;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px dashed rgba(84, 184, 110, 0.28);
}

.footer {
  max-width: 1240px;
  margin: 0 auto 28px;
  padding: 28px 24px;
  border-radius: 28px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
}

.footer-brand p {
  max-width: 40ch;
  margin: 10px 0 0;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col h5,
.footer-bottom span {
  margin: 0;
  font-size: 0.95rem;
  color: #16372a;
}

.footer-col a,
.footer-bottom a {
  color: var(--muted);
}

.footer-bottom {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid rgba(91, 194, 122, 0.14);
}

.policy-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  position: relative;
  z-index: 1;
}

.policy-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  border-radius: 28px;
  padding: 32px;
}

.policy-card h2 {
  margin: 10px 0 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
}

.policy-card h3 {
  margin: 26px 0 10px;
  font-family: "Space Grotesk", sans-serif;
}

.policy-card p,
.policy-card li {
  color: var(--muted);
  line-height: 1.7;
}

.policy-card ul {
  padding-left: 20px;
}

.policy-back {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(78, 189, 111, 0.18);
  color: var(--text);
}


@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(24px, 18px, 0) scale(1.06); }
}

@keyframes scanLine {
  0% { transform: scaleX(0.1); opacity: 0.2; }
  50% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(0.1); opacity: 0.2; }
}

@keyframes pulseGlow {
  0%, 100% { text-shadow: 0 0 14px rgba(101, 220, 136, 0.2); }
  50% { text-shadow: 0 0 24px rgba(68, 191, 104, 0.45); }
}

@keyframes titleReveal {
  0% {
    opacity: 0;
    transform: translateY(18px);
    letter-spacing: 0.08em;
    filter: blur(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    letter-spacing: 0;
    filter: blur(0);
  }
}

@keyframes titleCharReveal {
  0% {
    opacity: 0;
    transform: translateY(28px) rotateX(-70deg) scale(0.86);
    filter: blur(8px);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0) scale(1);
    filter: blur(0);
  }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes cardScan {
  0% { transform: translateX(0); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateX(260%); opacity: 0; }
}

@keyframes cardEnter {
  0% {
    opacity: 0;
    transform: translateY(42px) scale(0.94);
  }
  60% {
    opacity: 1;
    transform: translateY(-6px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1040px) {
  .book-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .topbar,
  .catalog-head,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .book-grid,
  .book-actions {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .footer {
    padding: 22px;
  }

  .footer,
  .footer-columns {
    grid-template-columns: 1fr;
  }

  .brand {
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
