:root {
  --bg: #f5ecd8;
  --bg-deep: #ead8b1;
  --paper: rgba(255, 250, 239, 0.88);
  --panel: rgba(122, 74, 46, 0.08);
  --ink: #2f241c;
  --muted: #6d5a4a;
  --accent: #9a4e2e;
  --accent-dark: #71351b;
  --gold: #b98939;
  --forest: #2d5f3d;
  --forest-soft: #51745e;
  --border: rgba(58, 34, 19, 0.15);
  --shadow: 0 24px 80px rgba(68, 40, 19, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(255, 244, 214, 0.9), transparent 38%),
    linear-gradient(180deg, #efe3c1 0%, #f8f1e1 45%, #efdfbb 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 75%);
}

.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  text-align: center;
  padding: 20px 20px 34px;
}

.hero__brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding: 14px 18px;
  border-radius: 28px;
  background: rgba(255, 250, 239, 0.72);
  border: 1px solid rgba(58, 34, 19, 0.12);
  box-shadow: 0 18px 45px rgba(68, 40, 19, 0.08);
}

.hero__logo {
  width: 92px;
  height: auto;
  object-fit: contain;
}

.hero__brand-copy {
  text-align: left;
}

.hero__brand-name,
.hero__brand-tag {
  margin: 0;
}

.hero__brand-name {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--forest);
}

.hero__brand-tag {
  margin-top: 2px;
  color: var(--forest-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  font-weight: 800;
}

.hero__badge,
.section-heading__eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 250, 239, 0.72);
  color: var(--accent-dark);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 700;
}

.hero h1,
.section-heading h2,
.prescription-card__title {
  margin: 14px 0 10px;
  font-family: "Cormorant Garamond", serif;
}

.hero h1 {
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 600;
  line-height: 0.95;
}

.hero__copy {
  width: min(760px, 100%);
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--paper);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  padding: 28px;
}

.panel::after {
  content: "";
  position: absolute;
  inset: auto -80px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(185, 137, 57, 0.18), transparent 70%);
}

.section-heading {
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
}

.section-heading h2 {
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.02;
  margin: 12px 0 0;
}

.panel--result .section-heading h2 {
  font-size: clamp(2rem, 3.2vw, 2.8rem);
}

.quiz-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(88, 54, 32, 0.18);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.92);
  padding: 15px 16px;
  font: inherit;
  color: var(--ink);
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(154, 78, 46, 0.5);
  box-shadow: 0 0 0 4px rgba(154, 78, 46, 0.12);
  transform: translateY(-1px);
}

.form-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.cta,
.buy-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, #c06a40 100%);
  color: #fff9f1;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  padding: 0 22px;
  box-shadow: 0 14px 30px rgba(154, 78, 46, 0.24);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.cta:disabled {
  cursor: wait;
  opacity: 0.82;
  transform: none;
  box-shadow: 0 10px 20px rgba(154, 78, 46, 0.18);
}

.cta:hover,
.buy-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(154, 78, 46, 0.28);
  filter: saturate(1.05);
}

.prescription-card {
  min-height: 360px;
  border-radius: 24px;
  border: 1px dashed rgba(90, 55, 31, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 251, 242, 0.95), rgba(246, 236, 215, 0.95)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath fill='none' stroke='rgba(122,74,46,0.08)' stroke-width='1' d='M20 40c12-10 28-10 40 0s28 10 40 0 28-10 40 0'/%3E%3Cpath fill='none' stroke='rgba(122,74,46,0.08)' stroke-width='1' d='M20 80c12-10 28-10 40 0s28 10 40 0 28-10 40 0'/%3E%3Cpath fill='none' stroke='rgba(122,74,46,0.08)' stroke-width='1' d='M20 120c12-10 28-10 40 0s28 10 40 0 28-10 40 0'/%3E%3C/svg%3E");
  padding: 28px;
  display: grid;
  align-content: start;
  gap: 20px;
}

.prescription-card--empty {
  place-items: center;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.message-card {
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 250, 239, 0.74);
  border: 1px solid rgba(90, 55, 31, 0.12);
}

.message-card p {
  margin: 0;
  line-height: 1.7;
}

.message-card--loading {
  background: rgba(185, 137, 57, 0.12);
}

.message-card--error {
  background: rgba(154, 78, 46, 0.1);
  border-color: rgba(154, 78, 46, 0.24);
}

.prescription-card__hero {
  display: grid;
  grid-template-columns: minmax(124px, 164px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.prescription-card__cover-wrap {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(91, 58, 33, 0.12), rgba(255, 251, 242, 0.35)),
    rgba(255, 250, 239, 0.85);
  border: 1px solid rgba(90, 55, 31, 0.14);
  box-shadow: 0 20px 36px rgba(68, 40, 19, 0.12);
}

.prescription-card__cover-wrap--hidden {
  display: none;
}

.prescription-card__cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prescription-card__main {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.prescription-card__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.prescription-card__title-block {
  min-width: 0;
}

.rx-stamp {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1px solid rgba(154, 78, 46, 0.26);
  color: var(--accent);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.9rem;
  font-weight: 700;
}

.prescription-card__title {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 600;
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.prescription-card__author {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

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

.prescription-grid__item {
  border: 1px solid rgba(90, 55, 31, 0.12);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 250, 239, 0.7);
}

.prescription-grid__item h3 {
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.prescription-grid__item p,
.prescription-note,
.ritual,
.signature {
  margin: 0;
  line-height: 1.7;
}

.prescription-note {
  font-size: 1.05rem;
}

.ritual {
  padding: 16px 18px;
  border-left: 4px solid var(--gold);
  background: rgba(185, 137, 57, 0.08);
  border-radius: 0 16px 16px 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.bookshop-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.signature {
  color: var(--accent-dark);
  font-weight: 700;
}

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

  .panel {
    padding: 22px;
  }

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

  .prescription-card__cover-wrap {
    max-width: 190px;
  }
}

@media (max-width: 540px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .hero {
    padding-inline: 8px;
  }

  .hero__brand {
    width: 100%;
    flex-direction: column;
    text-align: center;
  }

  .hero__brand-copy {
    text-align: center;
  }

  .hero__logo {
    width: 84px;
  }

  .prescription-card {
    padding: 20px;
  }

  .prescription-card__header {
    flex-direction: column;
  }
}
