:root {
  --bg: #fbf6ee;
  --surface: #ffffff;
  --ink: #1b2340;
  --muted: #5b6382;
  --accent: #ff5d4a;
  --accent-dark: #d93f2d;
  --gold: #ffc247;
  --teal: #1fb5a3;
  --line: #e9e1d2;
  --radius: 20px;
  --shadow: 0 18px 40px -18px rgba(27, 35, 64, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11142a;
    --surface: #1b2040;
    --ink: #f6f1e7;
    --muted: #aab0d0;
    --line: #2b3260;
    --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  line-height: 1.1;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
}

a { color: inherit; }
.wrap { width: min(1120px, 92%); margin: 0 auto; }

/* Header */
header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}
.brand {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand .dot {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  transform: rotate(-6deg);
}
nav.main { display: flex; gap: 22px; align-items: center; font-weight: 600; font-size: 0.95rem; }
nav.main a { text-decoration: none; color: var(--muted); }
nav.main a:hover { color: var(--ink); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px -10px var(--accent);
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { background: var(--accent-dark); transform: translateY(-2px); }
.btn.ghost {
  background: transparent;
  color: var(--ink) !important;
  border: 2px solid var(--ink);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--ink); color: var(--bg) !important; }

/* Hero */
.hero { padding: 72px 0 56px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  background: color-mix(in srgb, var(--gold) 35%, transparent);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2.5rem, 5.5vw, 4.4rem); font-weight: 800; }
.hero h1 em { color: var(--accent); font-style: italic; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; margin-bottom: 28px; }
.hero .cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* Word search grid */
.grid-card {
  background: var(--surface);
  border-radius: 28px;
  padding: 26px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  transform: rotate(2deg);
}
.ws {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: clamp(1rem, 3vw, 1.5rem);
  text-align: center;
}
.ws span {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--muted);
}
.ws span.hit { background: var(--accent); color: #fff; }
.ws span.hit2 { background: var(--teal); color: #fff; }
.ws span.hit3 { background: var(--gold); color: #1b2340; }
.word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  font-size: 0.8rem;
  font-weight: 700;
}
.word-list b {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.word-list b.found { text-decoration: line-through; opacity: 0.55; }

/* Stats strip */
.strip { background: var(--ink); color: var(--bg); padding: 22px 0; }
@media (prefers-color-scheme: dark) { .strip { background: var(--surface); color: var(--ink); } }
.strip .wrap {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 16px;
  font-weight: 700;
  text-align: center;
}
.strip span { opacity: 0.85; font-weight: 500; display: block; font-size: 0.85rem; }

/* Sections */
section { padding: 80px 0; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }

/* Book cards */
.books {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 28px;
}
.book {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.book:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.cover {
  aspect-ratio: 3 / 4;
  border-radius: 10px 16px 16px 10px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: inset 8px 0 0 rgba(0, 0, 0, 0.18), 0 14px 24px -14px rgba(0, 0, 0, 0.5);
  margin-bottom: 18px;
}
.cover::after {
  content: "";
  position: absolute;
  inset: auto -30% -25% auto;
  width: 90%; height: 60%;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}
.cover small { text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; font-size: 0.7rem; opacity: 0.9; }
.cover strong { font-family: "Fraunces", Georgia, serif; font-size: 1.75rem; line-height: 1.05; font-weight: 800; position: relative; z-index: 1; }
.cover .tag { font-size: 0.75rem; font-weight: 600; opacity: 0.9; position: relative; z-index: 1; }
.c1 { background: linear-gradient(155deg, #2b2d42, #8d5cf6); }
.c2 { background: linear-gradient(155deg, #ff8a5c, #ff3d68); }
.c3 { background: linear-gradient(155deg, #1fb5a3, #1b6ca8); }
.c4 { background: linear-gradient(155deg, #f2a65a, #c0392b); }
.c5 { background: linear-gradient(155deg, #3a7d44, #b5c334); }
.c6 { background: linear-gradient(155deg, #4a4e69, #22223b); }
.book h3 { font-size: 1.25rem; margin-bottom: 6px; }
.book p { color: var(--muted); font-size: 0.93rem; margin: 0 0 14px; }
.book a.link { font-weight: 700; color: var(--accent); text-decoration: none; }
.book a.link:hover { text-decoration: underline; }
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 22%, transparent);
  margin-bottom: 10px;
}
.badge.soon { background: color-mix(in srgb, var(--gold) 40%, transparent); }

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
}
.feature {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.feature .ico {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
  background: color-mix(in srgb, var(--gold) 35%, transparent);
}
.feature h3 { font-size: 1.2rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.96rem; }

/* About */
.about {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.about .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.about p { color: var(--muted); font-size: 1.05rem; }
.quote {
  background: var(--accent);
  color: #fff;
  padding: 40px;
  border-radius: 28px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
  transform: rotate(-1.5deg);
  box-shadow: var(--shadow);
}
.quote small { display: block; margin-top: 16px; font-family: "Inter", sans-serif; font-size: 0.9rem; font-weight: 500; opacity: 0.9; }

/* CTA */
.cta-box {
  background: linear-gradient(135deg, var(--ink), #3b2f7a);
  color: #fff;
  border-radius: 32px;
  padding: 64px 40px;
  text-align: center;
}
.cta-box h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.cta-box p { color: rgba(255, 255, 255, 0.8); max-width: 34em; margin: 0 auto 28px; }

include-fragment { display: contents; }
.cover strong { overflow-wrap: anywhere; }
.c7 { background: linear-gradient(155deg, #ff6ec7, #7c4dff); }
.c8 { background: linear-gradient(155deg, #1a1a1a, #b3001b); }
.c9 { background: linear-gradient(155deg, #1d3b6e, #c8102e); }
.c10 { background: linear-gradient(155deg, #00c2ff, #6a00f4); }
.c11 { background: linear-gradient(155deg, #0b6e4f, #c0392b); }
.c12 { background: linear-gradient(155deg, #2a0a12, #8b0a2f); }
.c13 { background: linear-gradient(155deg, #3a0f2e, #d1366f); }
.c14 { background: linear-gradient(155deg, #2b0f14, #7a1f33); }
.c15 { background: linear-gradient(155deg, #0f0f14, #5b2a86); }
.c16 { background: linear-gradient(155deg, #101010, #a37c2c); }
.c17 { background: linear-gradient(155deg, #111111, #c1121f); }
.badge.adult { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.book .badges { display: flex; gap: 6px; flex-wrap: wrap; }

/* Product pages */
.crumbs { padding: 28px 0 0; font-size: 0.9rem; color: var(--muted); }
.crumbs a { text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--ink); }
section.product { padding: 36px 0 72px; }
.product .wrap {
  display: grid;
  grid-template-columns: minmax(240px, 380px) 1fr;
  gap: 56px;
  align-items: start;
}
.product .cover { max-width: 380px; margin-bottom: 0; padding: 30px 26px; }
.product .cover strong { font-size: 2.2rem; }
.product h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; margin-bottom: 0.3em; }
.product .sub { font-size: 1.15rem; color: var(--muted); margin: 0 0 18px; }
.facts { list-style: none; padding: 0; margin: 24px 0 32px; display: grid; gap: 12px; }
.facts li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.facts li::before {
  content: "\2713";
  flex: none;
  width: 22px; height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
}
.facts b { color: var(--ink); }
.product .actions { display: flex; gap: 14px; flex-wrap: wrap; }
section.related { padding: 56px 0 72px; background: var(--surface); border-top: 1px solid var(--line); }
.related h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 24px; }
.minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.mini {
  display: block;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mini:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.mini strong { display: block; font-family: "Fraunces", Georgia, serif; font-size: 1.1rem; margin-bottom: 4px; }
.mini span { color: var(--muted); font-size: 0.9rem; }
.fine { font-size: 0.8rem; opacity: 0.85; max-width: 60em; }
@media (max-width: 860px) {
  .product .wrap { grid-template-columns: 1fr; gap: 32px; }
  .product .cover { max-width: 300px; }
}

/* Footer */
footer.site { padding: 36px 0 48px; color: var(--muted); font-size: 0.9rem; }
footer.site .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
footer.site a { text-decoration: none; font-weight: 600; }
footer.site a:hover { color: var(--ink); }

@media (max-width: 860px) {
  .hero .wrap, .about .wrap { grid-template-columns: 1fr; }
  .grid-card { transform: none; max-width: 420px; }
  nav.main a:not(.btn) { display: none; }
  section { padding: 56px 0; }
  .hero { padding-top: 40px; }
}
