:root {
  --plum: #3B1F2B;
  --wine: #5C2A3A;
  --blush: #F2D9D9;
  --gold: #C9A15A;
  --cream: #FAF3EA;
  --sage: #7A8B6F;
  --ink: #2A1A1F;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background-color: var(--cream);
  background-image:
    radial-gradient(circle, rgba(122, 139, 111, 0.10) 1px, transparent 1.4px),
    radial-gradient(circle, rgba(201, 161, 90, 0.08) 1px, transparent 1.4px);
  background-size: 34px 34px, 52px 52px;
  background-position: 0 0, 17px 26px;
  color: var(--ink);
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  min-height: 100vh;
}

h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  color: var(--plum);
  line-height: 1.15;
}

.eyebrow {
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--wine);
  margin: 0 0 0.6rem;
}

a { color: var(--wine); }

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 3px;
}

.btn-primary {
  display: inline-block;
  background: var(--wine);
  color: var(--cream);
  border: none;
  border-radius: 999px;
  padding: 0.85rem 2.1rem;
  font-family: 'Jost', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn-primary:hover { background: var(--plum); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: default; transform: none; }

.strike-price {
  opacity: 0.6;
  font-size: 0.85em;
  text-decoration-color: rgba(250, 243, 234, 0.85);
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--wine);
  border: 1px solid var(--wine);
  border-radius: 999px;
  padding: 0.7rem 1.7rem;
  font-family: 'Jost', sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  margin-top: 1.6rem;
  transition: background 0.2s ease, color 0.2s ease;
}
.btn-secondary:hover { background: var(--blush); }
.btn-secondary:disabled { opacity: 0.6; cursor: default; }

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 1.6rem;
}
.action-row .btn-secondary { margin-top: 0; }

/* ---------- landing ---------- */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  position: relative;
  overflow-x: hidden;
}

.corner {
  position: fixed;
  width: 140px;
  height: 140px;
  opacity: 0.7;
}
.corner-tl { top: 0; left: 0; }
.corner-tr { top: 0; right: 0; transform: scaleX(1); }

.landing-card {
  max-width: 560px;
  text-align: center;
}

.landing-card h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 1rem;
}

.sub {
  font-size: 1rem;
  color: var(--ink);
  opacity: 0.75;
  max-width: 440px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.genre-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.genre-chip {
  font-family: 'Jost', sans-serif;
  font-size: 0.88rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--wine);
  background: transparent;
  color: var(--wine);
  cursor: pointer;
  transition: all 0.15s ease;
}
.genre-chip:hover { background: var(--blush); }
.genre-chip.selected {
  background: var(--wine);
  color: var(--cream);
  border-color: var(--wine);
}

.error-msg {
  color: var(--wine);
  font-size: 0.85rem;
  margin: -1rem 0 1rem;
}

.footnote {
  position: fixed;
  bottom: 1.2rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--sage);
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
}

/* ---------- bouquet page ---------- */
.bouquet-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1rem 1rem;
}

.bouquet-header { text-align: center; margin-bottom: 1rem; }
.bouquet-header h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 0.4rem; }
.bouquet-header .sub { margin-bottom: 0; }

.bouquet-stage {
  position: relative;
  width: 100%;
  max-width: 640px;
  height: 460px;
  margin: 0 auto;
}

.stems-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stem { display: none; } /* legacy, unused now */

.book-cover {
  position: absolute;
  transform: translate(-50%, -55%) rotate(var(--rot, 0deg));
  border-radius: 3px 3px 2px 2px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(59, 31, 43, 0.3);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: bloom 0.5s ease backwards;
  animation-delay: var(--delay, 0ms);
  border: 2px solid var(--cream);
}

.book-cover:hover {
  transform: translate(-50%, -100%) rotate(var(--rot, 0deg)) scale(1.08);
  box-shadow: 0 10px 22px rgba(59, 31, 43, 0.38);
  z-index: 5;
}

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

@keyframes bloom {
  from { opacity: 0; transform: translate(-50%, -40%) rotate(var(--rot, 0deg)) scale(0.6); }
  to   { opacity: 1; transform: translate(-50%, -55%) rotate(var(--rot, 0deg)) scale(1); }
}

.empty-state {
  margin-top: 3rem;
  font-size: 1rem;
  color: var(--wine);
  text-align: center;
}

/* ---------- reveal page ---------- */
.reveal-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1.25rem 3rem;
}

.back-link {
  align-self: flex-start;
  max-width: 760px;
  width: 100%;
  margin: 0 auto 1.5rem;
  text-decoration: none;
  font-size: 0.88rem;
  color: var(--wine);
}

.reveal-card {
  display: flex;
  gap: 2.5rem;
  max-width: 760px;
  width: 100%;
  align-items: flex-start;
  background: #fff;
  border-radius: 14px;
  padding: 2.2rem;
  box-shadow: 0 14px 40px rgba(59, 31, 43, 0.12);
}

.reveal-cover {
  width: 190px;
  min-width: 190px;
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(59, 31, 43, 0.25);
}

.reveal-text h1 {
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  margin: 0 0 0.3rem;
}

.reveal-author {
  margin: 0 0 1rem;
  color: var(--sage);
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
}

.reveal-why {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--wine);
  margin: 0 0 1.1rem;
  line-height: 1.5;
}

.reveal-blurb {
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--ink);
  opacity: 0.85;
  margin: 0 0 1.6rem;
}

#revealUnlockable.locked {
  filter: blur(9px);
  user-select: none;
  pointer-events: none;
}

.lock-overlay {
  margin: -0.6rem 0 1.6rem;
  padding: 1.1rem 1.3rem;
  border: 1px dashed var(--gold);
  border-radius: 12px;
  background: rgba(242, 217, 217, 0.3);
}

.lock-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--wine);
  margin: 0 0 0.8rem;
}

.unlock-input {
  display: block;
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--sage);
  border-radius: 8px;
  margin-bottom: 0.8rem;
  font-family: 'Jost', sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
  background: #fff;
}
.unlock-input:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }

#pdfLockOverlay {
  max-width: 380px;
  width: 100%;
  margin: 1.2rem auto 0;
  text-align: left;
}

.new-bouquet-prompt {
  margin-top: 1.6rem;
  text-align: center;
}
.new-bouquet-prompt p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--wine);
  margin: 0 0 0.7rem;
}

@media (max-width: 640px) {
  .reveal-card { flex-direction: column; align-items: center; text-align: center; }
  .reveal-cover { width: 160px; min-width: 160px; }
  .bouquet-stage { height: 420px; }
  .book-cover { box-shadow: 0 4px 10px rgba(59, 31, 43, 0.25); }
}

@media (prefers-reduced-motion: reduce) {
  .book-cover { animation: none; }
  .btn-primary, .book-cover { transition: none; }
}