:root {
  --ink: #f4f1ff;
  --muted: #aaa7bd;
  --paper: #070812;
  --surface: #111321;
  --soft: #0d0f1d;
  --line: #292c42;
  --violet: #9d86ff;
  --violet-dark: #7355ed;
  --orange: #ff9b67;
  --white: #fff;
  --shadow: 0 20px 60px rgba(0, 0, 0, .38);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 18%, rgba(112, 82, 225, .14), transparent 25%),
    radial-gradient(circle at 90% 40%, rgba(36, 98, 153, .12), transparent 24%),
    var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

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

a:focus-visible,
.button:focus-visible {
  outline: 3px solid rgba(255, 139, 76, .6);
  outline-offset: 4px;
}

.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(64, 67, 95, .7);
  background: rgba(7, 8, 18, .88);
  backdrop-filter: blur(12px);
}

.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 21px; font-weight: 800; letter-spacing: -.03em; }

.brand-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--violet);
  font-size: 17px;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -5px 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transform: rotate(-32deg);
  opacity: .5;
}

.main-nav { display: flex; align-items: center; gap: 8px; }
.main-nav a { padding: 9px 14px; border-radius: 999px; color: var(--muted); font-weight: 650; font-size: 15px; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--white); background: #1a1d30; }

.hero { position: relative; overflow: hidden; padding: 84px 0 74px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #0b0d19 0%, #111025 100%); }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55; background-image: radial-gradient(circle, rgba(255,255,255,.58) 0 1px, transparent 1.4px); background-size: 54px 54px; mask-image: linear-gradient(90deg, #000, transparent 55%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 70px; }
.hero-copy h1, .page-intro h1 { margin: 10px 0 22px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(48px, 6.2vw, 82px); line-height: .98; letter-spacing: -.045em; font-weight: 500; }
.hero-text { max-width: 650px; margin: 0; color: var(--muted); font-size: 19px; }
.eyebrow { margin: 0; color: var(--violet); font-size: 12px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; padding: 11px 20px; border-radius: 999px; font-weight: 750; transition: transform .18s ease, background .18s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: var(--white); background: var(--violet); }
.button-primary:hover { background: var(--violet-dark); }
.button-secondary { border: 1px solid #454963; background: rgba(255,255,255,.04); }
.button-secondary:hover { border-color: var(--violet); background: rgba(157,134,255,.1); }
.button-light { color: #111321; background: var(--white); }

.hero-photo { position: relative; z-index: 1; margin: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.16); border-radius: 28px; box-shadow: var(--shadow); transform: rotate(1.5deg); }
.hero-photo img { display: block; width: 100%; min-height: 430px; object-fit: cover; }
.hero-photo::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 55%, rgba(3,4,12,.72)); }
.hero-photo figcaption { position: absolute; z-index: 2; right: 18px; bottom: 14px; color: rgba(255,255,255,.72); font-size: 11px; }
.hero-art { position: relative; min-height: 410px; }
.planet { position: absolute; top: 18px; right: 10%; width: 285px; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 28%, #ffe7b7 0 8%, var(--orange) 9% 45%, #dd5d43 78%); box-shadow: var(--shadow); }
.planet::after { content: ""; position: absolute; left: -58px; top: 118px; width: 395px; height: 58px; border: 14px solid rgba(85, 65, 199, .75); border-radius: 50%; transform: rotate(-13deg); }
.book-stack { position: absolute; right: 3%; bottom: 8px; display: flex; flex-direction: column; align-items: flex-end; filter: drop-shadow(0 20px 22px rgba(33, 27, 70, .18)); }
.book { display: flex; height: 48px; align-items: center; padding: 0 24px; border: 2px solid rgba(25, 23, 43, .9); border-radius: 5px 11px 11px 5px; color: var(--ink); font-family: Georgia, serif; font-weight: 700; }
.book-one { width: 260px; background: #f5c8d8; transform: rotate(2deg); }
.book-two { width: 310px; background: #f0d28f; transform: rotate(-2deg); }
.book-three { width: 280px; background: #b9d8cb; transform: rotate(1deg); }

.section { padding: 82px 0; }
.section-muted { background: var(--soft); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.section h2 { margin: 7px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(32px, 4vw, 48px); line-height: 1.08; font-weight: 500; letter-spacing: -.025em; }
.text-link { color: var(--violet); font-weight: 750; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.book-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 24px; }
.book-grid-featured { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.book-card { min-width: 0; }
.cover { position: relative; display: flex; width: 100%; aspect-ratio: .72; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 24px 20px; border-radius: 4px 14px 14px 4px; box-shadow: 0 15px 34px rgba(31, 27, 58, .16); transition: transform .2s ease, box-shadow .2s ease; }
.book-card:hover .cover { transform: translateY(-5px); box-shadow: 0 21px 40px rgba(31, 27, 58, .22); }
.cover::before { content: ""; position: absolute; top: 0; bottom: 0; left: 12px; width: 1px; background: rgba(255,255,255,.32); }
.cover::after { content: "✦"; position: absolute; right: 18px; bottom: 45px; font-size: 26px; opacity: .45; }
.cover span { position: relative; z-index: 1; font-family: Georgia, serif; font-size: clamp(23px, 2.5vw, 34px); line-height: 1.03; letter-spacing: -.03em; }
.cover small { position: relative; z-index: 1; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cover-violet { color: #fff; background: #654fc5; }
.cover-orange { background: #f0a263; }
.cover-blue { color: #fff; background: #276f9f; }
.cover-green { background: #88b59f; }
.cover-red { color: #fff; background: #a9444d; }
.cover-sand { background: #d6bc8d; }
.cover-pink { background: #e7a8bd; }
.cover-dark { color: #fff; background: #272642; }
.cover-orange, .cover-green, .cover-sand, .cover-pink { color: #171423; }
.book-info { padding-top: 17px; }
.book-info h2, .book-info h3 { margin: 3px 0 2px; font-family: inherit; font-size: 19px; line-height: 1.25; font-weight: 800; letter-spacing: -.02em; }
.tag { margin: 0; color: var(--violet); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.author { margin: 0; color: var(--muted); font-size: 14px; }
.price { margin: 10px 0 0; font-size: 17px; font-weight: 850; }

.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.benefits article { padding-right: 30px; }
.benefit-number { display: inline-block; margin-bottom: 42px; color: var(--violet); font-size: 13px; font-weight: 850; }
.benefits h3 { margin: 0 0 10px; font-size: 21px; }
.benefits p { margin: 0; color: var(--muted); }

.newsletter { display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 48px; border: 1px solid #494075; border-radius: var(--radius); color: var(--white); background: linear-gradient(135deg, #39266f, #182549); box-shadow: var(--shadow); }
.newsletter h2 { margin-top: 8px; }
.newsletter p { max-width: 620px; margin-bottom: 0; color: rgba(255,255,255,.76); }
.eyebrow-light { color: #d8d0ff; }

.page-intro { position: relative; overflow: hidden; padding: 72px 0 58px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #0b0d19 0%, #111025 100%); }
.page-intro-photo { min-height: 380px; display: flex; align-items: end; background-position: center; background-size: cover; }
.page-intro-photo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(3,4,12,.96) 0%, rgba(3,4,12,.78) 48%, rgba(3,4,12,.28) 100%); }
.page-intro-galaxy { background-image: url("images/whirlpool-galaxy.jpg"); background-position: 68% 46%; }
.page-intro-jupiter { background-image: url("images/jupiter.jpg"); background-position: center 50%; }
.page-intro .container { position: relative; z-index: 2; }
.page-photo-credit { position: absolute; z-index: 2; right: 22px; bottom: 15px; color: rgba(255,255,255,.62); font-size: 10px; }
.intro-grid { display: grid; grid-template-columns: .9fr 1.1fr; align-items: end; gap: 70px; }
.page-intro h1 { margin-bottom: 0; }
.intro-grid > p { max-width: 600px; margin: 0 0 9px; color: var(--muted); font-size: 18px; }
.catalog-section { padding-top: 42px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 38px; }
.filter-row span { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 14px; }
.filter-row .filter-active { border-color: var(--violet); color: #0a0b14; background: var(--violet); }
.catalog-note { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 72px; padding: 38px 42px; border: 1px solid var(--line); border-radius: var(--radius); }
.catalog-note h2 { font-size: 32px; }

.contacts-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 48px; }
.contact-list { display: grid; gap: 14px; }
.contact-card { padding: 26px 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.contact-label { margin: 0 0 7px; color: var(--violet); font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.contact-card h2 { margin: 0 0 6px; font-family: inherit; font-size: 23px; font-weight: 800; }
.contact-card p { margin: 0; color: var(--muted); }
.contact-card a:hover { color: var(--violet); }
.schedule { display: grid; grid-template-columns: 1fr auto; gap: 7px 25px; color: var(--muted); }
.schedule strong { color: var(--ink); }
.map-placeholder { position: relative; display: grid; min-height: 490px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: radial-gradient(circle at center, #24224c, #0c0e19 70%); }
.map-placeholder::before, .map-placeholder::after { content: ""; position: absolute; background: rgba(255,255,255,.65); }
.map-placeholder::before { width: 130%; height: 34px; transform: rotate(27deg); }
.map-placeholder::after { width: 34px; height: 130%; transform: rotate(18deg); }
.map-orbit { position: absolute; width: 360px; height: 190px; border: 2px solid rgba(85,65,199,.28); border-radius: 50%; transform: rotate(-20deg); }
.map-pin { position: relative; z-index: 2; display: grid; width: 74px; height: 74px; place-items: center; border: 8px solid rgba(255,255,255,.75); border-radius: 50% 50% 50% 8px; color: var(--white); background: var(--violet); font-size: 25px; font-weight: 850; transform: rotate(-45deg); box-shadow: var(--shadow); }
.map-pin span { transform: rotate(45deg); }
.map-placeholder > p { position: absolute; z-index: 3; bottom: 30px; left: 30px; margin: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(9,10,21,.88); }
.visit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center; }
.visit-grid p { margin-top: 0; color: var(--muted); }

.site-footer { padding: 48px 0; border-top: 1px solid var(--line); color: rgba(255,255,255,.62); background: #04050b; }
.footer-inner { display: grid; grid-template-columns: 1.2fr .8fr auto; align-items: end; gap: 45px; }
.brand-footer { color: var(--white); }
.footer-inner p { margin: 14px 0 0; }
.footer-links { display: grid; gap: 8px; }
.footer-links a:hover { color: var(--white); }
.copyright { white-space: nowrap; }

.section-lead { max-width: 420px; margin: 0; color: var(--muted); }
.cosmic-section { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #090a14; }
.cosmic-grid { display: grid; grid-template-columns: .72fr 1.28fr; gap: 24px; }
.cosmic-card { position: relative; min-height: 520px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #05060c; box-shadow: var(--shadow); }
.cosmic-card-wide { min-height: 520px; }
.cosmic-card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.cosmic-card-wide img { object-position: center; }
.cosmic-card:hover img { transform: scale(1.025); }
.cosmic-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 55%, rgba(2,3,9,.9)); }
.cosmic-card figcaption { position: absolute; z-index: 2; right: 22px; bottom: 20px; left: 22px; display: grid; gap: 3px; }
.cosmic-card figcaption strong { font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.cosmic-card figcaption span { color: rgba(255,255,255,.62); font-size: 11px; }

@media (max-width: 900px) {
  .hero-grid, .intro-grid, .contacts-grid, .visit-grid { grid-template-columns: 1fr; gap: 42px; }
  .hero { padding-top: 60px; }
  .hero-art { min-height: 360px; }
  .book-grid { grid-template-columns: repeat(3, 1fr); }
  .book-grid-featured { grid-template-columns: repeat(3, 1fr); }
  .benefits { grid-template-columns: 1fr; }
  .benefit-number { margin-bottom: 14px; }
  .newsletter { align-items: flex-start; flex-direction: column; }
  .footer-inner { grid-template-columns: 1fr 1fr; align-items: start; }
  .copyright { grid-column: 1 / -1; }
  .cosmic-grid { grid-template-columns: 1fr 1.2fr; }
}

@media (max-width: 680px) {
  .container { width: min(100% - 28px, 1120px); }
  .header-inner { min-height: 68px; align-items: flex-start; flex-direction: column; padding: 14px 0 12px; gap: 10px; }
  .main-nav { width: 100%; gap: 4px; }
  .main-nav a { flex: 1; padding: 7px 8px; text-align: center; }
  .hero { padding: 50px 0; }
  .hero-copy h1, .page-intro h1 { font-size: 48px; }
  .hero-text { font-size: 17px; }
  .hero-art { min-height: 300px; transform: scale(.86); transform-origin: center; }
  .hero-photo { transform: none; }
  .hero-photo img { min-height: 320px; }
  .planet { right: 3%; }
  .section { padding: 58px 0; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .book-grid, .book-grid-featured { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .cover { padding: 18px 15px; }
  .cover span { font-size: 22px; }
  .newsletter { padding: 30px 25px; }
  .catalog-note { align-items: flex-start; flex-direction: column; padding: 28px 24px; }
  .map-placeholder { min-height: 380px; }
  .footer-inner { grid-template-columns: 1fr; }
  .copyright { grid-column: auto; }
  .cosmic-grid { grid-template-columns: 1fr; }
  .cosmic-card, .cosmic-card-wide { min-height: 430px; }
  .page-intro-photo { min-height: 420px; }
}

@media (max-width: 410px) {
  .book-grid, .book-grid-featured { grid-template-columns: 1fr; }
  .cover { max-width: 270px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
