@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&display=swap");

:root {
  --bg: #090b1a;
  --bg-2: #11162e;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.14);
  --text: #f7f8fc;
  --muted: #c9d0e8;
  --accent: #6f7bff;
  --accent-2: #a86fff;
  --line: rgba(255, 255, 255, 0.16);
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #090b1a;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 20%, #1e2550 0%, transparent 40%),
    radial-gradient(circle at 90% 10%, #351f67 0%, transparent 35%),
    linear-gradient(120deg, var(--bg), var(--bg-2));
  line-height: 1.6;
  overflow-x: hidden;
  background-color: #090b1a;
}

body.modal-open {
  overflow: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  filter: blur(70px);
  z-index: -1;
  animation: drift 14s ease-in-out infinite alternate;
}

body::before {
  top: -80px;
  left: -60px;
  background: rgba(111, 123, 255, 0.42);
}

body::after {
  bottom: -110px;
  right: -80px;
  background: rgba(168, 111, 255, 0.4);
  animation-delay: 2s;
}

@keyframes drift {
  from {
    transform: translateY(0) translateX(0);
  }
  to {
    transform: translateY(30px) translateX(-25px);
  }
}

.container {
  width: min(1160px, 92%);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 12, 28, 0.7);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: clamp(0.95rem, 1.15vw, 1.06rem);
  letter-spacing: 0.07rem;
  text-transform: none;
  font-weight: 700;
  color: #f7f8ff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  position: relative;
  padding: 2px 0 7px;
  text-decoration: none;
}

.brand::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(111, 123, 255, 0.15), rgba(215, 220, 255, 0.9), rgba(168, 111, 255, 0.15));
}

.brand-emblem {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(227, 231, 255, 0.38);
  display: grid;
  place-items: center;
  font-size: 0.74rem;
  letter-spacing: 0.08rem;
  color: #f4f6ff;
  background: radial-gradient(circle at 30% 25%, rgba(160, 170, 255, 0.22), rgba(255, 255, 255, 0.04));
}

.brand-stack {
  display: grid;
  grid-template-columns: 1fr;
  line-height: 1.02;
}

.brand-line {
  text-transform: uppercase;
  letter-spacing: 0.19rem;
}

.brand-tag {
  margin-top: 2px;
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.16rem;
  text-transform: uppercase;
  color: rgba(225, 231, 255, 0.82);
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 18px;
}

.menu a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.25s ease;
}

.menu a:hover {
  color: var(--text);
}

.hero {
  min-height: 78vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: clamp(28px, 6vh, 56px) 0 34px;
}

.hero-card {
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% -30%, rgba(142, 157, 255, 0.28), transparent 55%),
    linear-gradient(138deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03));
  border-radius: 28px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.38);
  padding: clamp(24px, 3.4vw, 52px);
  max-width: 960px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -15% -55% -15%;
  height: 120px;
  background: radial-gradient(circle at 50% 0%, rgba(111, 123, 255, 0.2), transparent 72%);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d4d9ff;
  border: 1px solid rgba(212, 217, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  letter-spacing: 0.04rem;
}

.hero h1 {
  margin: 14px 0 10px;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1.06;
  max-width: 16ch;
  margin-left: auto;
  margin-right: auto;
  text-wrap: balance;
  letter-spacing: 0.02em;
}

.hero p {
  margin: 0 auto;
  max-width: 66ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.9vw, 1.2rem);
  text-wrap: pretty;
}

.hero-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.btn {
  display: inline-block;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.32);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-ghost {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

section {
  padding: 40px 0;
}

.section-title {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
}

.section-sub {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  margin-top: 16px;
}

.about-card,
.stat-card {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 18px 20px;
  transition: transform 0.3s ease, background 0.3s ease;
}

.author-profile {
  margin-bottom: 14px;
}

.author-photo {
  width: 100%;
  max-width: 290px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
}

.about-card:hover,
.stat-card:hover {
  transform: translateY(-6px);
  background: var(--surface-strong);
}

.stats {
  display: grid;
  gap: 14px;
}

.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-value {
  margin-top: 6px;
  font-size: 1.45rem;
  font-weight: 700;
}

.books-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.books-controls {
  display: flex;
  gap: 10px;
}

.nav-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.25s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.books-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 32%);
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.books-rail::-webkit-scrollbar {
  height: 8px;
}

.books-rail::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}

.book-card {
  scroll-snap-align: start;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 14px;
  min-height: 238px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}

.book-card:hover {
  transform: translateY(-7px) scale(1.01);
  border-color: rgba(168, 111, 255, 0.5);
}

.book-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}

.book-index {
  display: inline-block;
  font-size: 0.78rem;
  color: #e3e7ff;
  border: 1px solid rgba(227, 231, 255, 0.34);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 8px;
}

.book-card h3 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.book-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.book-link {
  margin-top: 12px;
  width: fit-content;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  transition: color 0.25s ease, border-color 0.25s ease;
}

.book-link:hover {
  color: #d7dcff;
  border-color: #d7dcff;
}

.book-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.book-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.book-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 20, 0.78);
  backdrop-filter: blur(4px);
}

.book-modal__panel {
  position: relative;
  width: min(980px, 92%);
  max-height: 86vh;
  margin: 7vh auto;
  overflow: auto;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(130deg, rgba(20, 24, 48, 0.96), rgba(14, 18, 36, 0.98));
  box-shadow: var(--shadow);
}

.book-modal__close {
  position: sticky;
  top: 8px;
  float: right;
  margin: 10px 10px 0 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 2;
}

.book-modal__content {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 18px;
  padding: 18px;
}

.book-modal__image {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  object-fit: cover;
  align-self: start;
}

.book-modal__title {
  margin: 10px 0 2px;
  font-size: clamp(1.55rem, 2.6vw, 2rem);
}

.book-modal__tagline {
  margin: 0 0 8px;
  color: #dfe4ff;
  font-weight: 600;
}

.book-modal__text {
  margin: 0 0 14px;
  color: var(--muted);
}

.book-modal__prices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.book-modal__price-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px 12px;
}

.book-modal__price-item span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.book-modal__price-item strong {
  display: block;
  margin-top: 4px;
  font-size: 1.1rem;
}

.book-meta {
  margin: 0 0 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.book-meta div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 9px 10px;
}

.book-meta dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.book-meta dd {
  margin: 2px 0 0;
  font-weight: 600;
}

.is-hidden {
  display: none;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.contact {
  border: 1px solid var(--line);
  background: linear-gradient(130deg, rgba(111, 123, 255, 0.2), rgba(168, 111, 255, 0.14));
  border-radius: 20px;
  padding: 24px;
  text-align: center;
}

.book-page {
  padding: 24px 0 44px;
}

.book-hero {
  padding: 10px 0 24px;
}

.book-hero-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow);
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 20px;
}

.book-hero-cover {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  object-fit: cover;
}

.book-hero-title {
  margin: 8px 0 6px;
  font-size: clamp(1.9rem, 3.7vw, 2.8rem);
}

.book-hero-tagline {
  margin: 0 0 10px;
  color: #e2e7ff;
  font-weight: 600;
}

.book-hero-text {
  margin: 0 0 14px;
  color: var(--muted);
}

footer {
  padding: 20px 0 30px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding-bottom: max(30px, env(safe-area-inset-bottom));
}

footer .container {
  min-height: 24px;
}

.floating-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(130deg, rgba(111, 123, 255, 0.92), rgba(168, 111, 255, 0.92));
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.floating-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cookie-notice {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(16px);
  width: min(560px, calc(100% - 26px));
  z-index: 45;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(11, 16, 36, 0.95);
  backdrop-filter: blur(10px);
  padding: 12px 12px 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.cookie-notice p {
  margin: 0;
  font-size: 0.92rem;
  color: #e0e5ff;
}

.cookie-notice p a {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.65);
}

.cookie-notice p a:hover {
  color: #dbe1ff;
}

.cookie-notice .btn {
  padding: 9px 14px;
  border-radius: 10px;
  white-space: nowrap;
}

.cookie-notice.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

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

  .books-rail {
    grid-auto-columns: minmax(280px, 70%);
  }
}

@media (max-width: 700px) {
  .hero {
    min-height: auto;
    padding-top: 22px;
  }

  section {
    padding: 30px 0;
  }

  .brand {
    font-size: 0.98rem;
    gap: 8px;
  }

  .brand-emblem {
    width: 31px;
    height: 31px;
    font-size: 0.68rem;
  }

  .brand-line {
    letter-spacing: 0.15rem;
  }

  .menu {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .menu a {
    font-size: 0.84rem;
  }

  .hero-card {
    border-radius: 22px;
    padding: 24px 16px;
  }

  .hero h1 {
    max-width: 12ch;
    line-height: 1.1;
    letter-spacing: 0.01em;
  }

  .hero p {
    max-width: 40ch;
    font-size: 1rem;
  }

  .hero-actions {
    width: 100%;
    gap: 10px;
  }

  .hero-actions .btn {
    flex: 1 1 170px;
    text-align: center;
  }

  .book-modal__panel {
    margin-top: 2vh;
    max-height: 92vh;
    width: min(980px, 95%);
  }

  .book-modal__content {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px;
  }

  .book-modal__image {
    max-width: 260px;
    justify-self: center;
  }

  .book-hero-card {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 14px;
  }

  .book-hero-cover {
    max-width: 280px;
    justify-self: center;
  }

  .book-modal__close {
    top: 6px;
    margin-right: 8px;
  }

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

@media (max-width: 460px) {
  .container {
    width: 94%;
  }

  .brand {
    width: auto;
    margin-bottom: 0;
    font-size: 0.9rem;
    letter-spacing: 0.08rem;
    padding-bottom: 5px;
    align-self: flex-start;
  }

  .brand-line {
    letter-spacing: 0.11rem;
  }

  .brand-tag {
    letter-spacing: 0.12rem;
  }

  .brand-emblem {
    width: 30px;
    height: 30px;
  }

  .nav {
    align-items: stretch;
    gap: 8px;
    padding: 10px 0 8px;
  }

  .menu {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .menu::-webkit-scrollbar {
    display: none;
  }

  .menu a {
    white-space: nowrap;
    font-size: 0.88rem;
  }

  .hero-card {
    border-radius: 18px;
    padding: 18px 12px;
  }

  .eyebrow {
    font-size: 0.76rem;
    padding: 5px 11px;
  }

  .hero h1 {
    max-width: 17ch;
    font-size: clamp(1.9rem, 9.4vw, 2.35rem);
    margin-top: 10px;
    margin-bottom: 8px;
    text-wrap: balance;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .hero-actions .btn {
    padding: 11px 14px;
    font-size: 0.95rem;
  }

  .books-toolbar {
    align-items: flex-start;
  }

  .nav-btn {
    width: 40px;
    height: 40px;
  }

  .books-rail {
    grid-auto-columns: minmax(230px, 90%);
  }

  .book-link {
    font-size: 0.98rem;
  }

  .book-card {
    min-height: auto;
  }

  .book-modal__title {
    font-size: 1.4rem;
  }

  .book-modal__text {
    font-size: 0.95rem;
  }

  .floating-btn {
    right: 12px;
    bottom: 12px;
    width: 42px;
    height: 42px;
  }

  .cookie-notice {
    bottom: 10px;
    width: calc(100% - 16px);
    padding: 10px;
    gap: 8px;
  }

  .cookie-notice p {
    font-size: 0.84rem;
  }

  .cookie-notice .btn {
    padding: 8px 10px;
    font-size: 0.86rem;
  }

  footer {
    padding-top: 16px;
  }
}
