@import url("tokens.css");

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  background:
    radial-gradient(circle at 12% 8%, rgba(229, 239, 223, 0.9), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(255, 241, 212, 0.95), transparent 46%),
    linear-gradient(165deg, var(--color-garden-soft) 0%, var(--color-warm-cream) 45%, var(--color-buttercream) 100%);
}

main {
  flex: 1 0 auto;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

a:hover,
a:focus-visible {
  color: var(--color-link-hover);
}

:focus-visible {
  outline: 3px solid var(--color-teal-accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--color-teal-dark);
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: 0.75rem;
  z-index: 1000;
  min-height: var(--touch);
}

.skip-link:focus {
  top: 1rem;
}

/* Development-only. Shown on local preview hosts via site.js; hidden in
   public/production presentation. */
.local-banner {
  display: none;
  background: var(--color-warning);
  color: #fff;
  text-align: center;
  padding: 0.4rem var(--pad-inline);
  font-size: 0.88rem;
  font-weight: 700;
}

body.is-local-preview .local-banner {
  display: block;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(255, 248, 233, 0.94);
  border-bottom: 1px solid var(--color-border);
}

.header-inner,
.section-inner,
.footer-inner {
  width: min(100% - (var(--pad-inline) * 2), var(--max));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
}

.brand-lockup {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.brand-mark {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  flex: 0 0 auto;
  background: var(--color-warm-cream);
  border: 2px solid rgba(7, 93, 102, 0.2);
}

.brand-text {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.brand-lockup strong {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  color: var(--color-series-ink);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-lockup span {
  font-size: 0.72rem;
  color: var(--color-teal-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 18rem;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--color-border);
  background: var(--color-panel);
  border-radius: 0.75rem;
  min-height: var(--touch);
  min-width: var(--touch);
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-weight: 700;
  color: var(--color-ink);
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.15rem 1rem;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  color: var(--color-ink);
  font-weight: 700;
  padding: 0.45rem 0.05rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-size: 0.9rem;
}

.site-nav a[aria-current="page"],
.site-nav a:hover,
.site-nav a:focus-visible {
  border-bottom-color: var(--color-teal-dark);
  color: var(--color-teal-dark);
}

/* Bright storybook hero — no dark overlay */
.hero {
  background:
    linear-gradient(105deg, var(--color-warm-cream) 0%, var(--color-panel) 48%, var(--color-garden-soft) 100%);
  border-bottom: 1px solid var(--color-border);
}

.hero-inner {
  width: min(100% - (var(--pad-inline) * 2), var(--max));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
  padding: clamp(1.75rem, 4vw, 3rem) 0;
}

.hero-copy {
  color: var(--color-ink);
}

.eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.65rem;
  color: var(--color-teal-dark);
  font-weight: 700;
}

.hero h1,
.page-hero h1,
.section h2 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.18;
  margin: 0 0 0.7rem;
  color: var(--color-series-ink);
}

.hero h1 {
  font-size: clamp(1.85rem, 4vw, 3rem);
  max-width: 16ch;
}

.hero p,
.lede {
  font-size: clamp(1.02rem, 1.8vw, 1.18rem);
  max-width: var(--max-measure);
  margin: 0;
}

.hero-art {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-garden-soft);
  box-shadow: 0 10px 28px var(--color-shadow);
  border: 1px solid var(--color-border);
}

.hero-art img {
  width: 100%;
  height: auto;
  max-height: 28rem;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 72%;
  background: var(--color-warm-cream);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.button {
  appearance: none;
  border: none;
  border-radius: 0.85rem;
  min-height: var(--touch);
  padding: 0.75rem 1.25rem;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button-primary,
.button-dark {
  background: var(--color-button);
  color: var(--color-button-text);
  box-shadow: 0 6px 16px rgba(7, 93, 102, 0.22);
}

.button-primary:hover,
.button-primary:focus-visible,
.button-dark:hover,
.button-dark:focus-visible {
  background: var(--color-teal-accent);
  color: #fff;
}

.button-secondary,
.button-ghost {
  background: transparent;
  color: var(--color-teal-dark);
  border: 1.5px solid rgba(7, 93, 102, 0.35);
  box-shadow: none;
}

.button-secondary:hover,
.button-secondary:focus-visible,
.button-ghost:hover,
.button-ghost:focus-visible {
  background: rgba(7, 93, 102, 0.08);
  color: var(--color-teal-dark);
}

.button[disabled],
.button.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.section {
  padding: var(--space-section) 0;
}

.section-tight {
  padding-top: var(--space-group);
  padding-bottom: var(--space-group);
}

.section-cream {
  background: rgba(255, 248, 233, 0.72);
}

.section-garden {
  background: rgba(229, 239, 223, 0.75);
}

.page-hero {
  padding: clamp(1.25rem, 2.5vw, 1.85rem) 0 0.25rem;
}

.page-hero h1 {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
}

.breadcrumbs {
  font-size: 0.92rem;
  margin: 0 0 0.7rem;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: var(--color-ink-soft);
}

.grid-3,
.grid-2 {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.character-grid {
  align-items: stretch;
}

.character-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.character-card .body {
  flex: 1 1 auto;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.character-card,
.soft-panel,
.feature-panel,
.form-panel {
  background: var(--color-panel);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px var(--color-shadow);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.character-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 18%;
  background: var(--color-garden-soft);
}

.character-card .body,
.soft-panel,
.feature-panel,
.form-panel {
  padding: var(--pad-card);
}

.character-card h3,
.soft-panel h2,
.feature-panel h2,
.form-panel h2 {
  font-family: var(--font-display);
  margin: 0 0 0.45rem;
  color: var(--color-series-ink);
}

.featured-book {
  display: grid;
  grid-template-columns: minmax(11rem, 16rem) 1fr;
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: center;
  background: var(--color-panel);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 22px var(--color-shadow);
  padding: var(--pad-card);
}

.featured-book .cover {
  border-radius: 0.55rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 18px var(--color-shadow);
}

.featured-book .cover img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
}

.book-title-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.book-title-link:hover,
.book-title-link:focus-visible {
  border-bottom-color: var(--color-teal-dark);
  color: var(--color-teal-dark);
}

.meta-line {
  color: var(--color-ink-soft);
  font-size: 0.98rem;
  margin: 0.35rem 0 0.8rem;
}

.book-layout {
  display: grid;
  /* Fixed-ish cover track keeps the illustration prominent without a
     wide empty gutter between cover and copy at desktop widths. */
  grid-template-columns: minmax(15rem, 22rem) minmax(0, 1fr);
  gap: clamp(1.1rem, 2.5vw, 1.75rem);
  align-items: start;
  justify-items: stretch;
  background: var(--color-panel);
  border-radius: var(--radius);
  border: 1px solid rgba(7, 93, 102, 0.12);
  box-shadow: 0 6px 18px var(--color-shadow);
  padding: var(--pad-card);
  overflow-x: clip;
}

.book-cover {
  width: 100%;
  max-width: 22rem;
  justify-self: start;
  border-radius: 0.55rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 16px var(--color-shadow);
}

.book-cover img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.book-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.checklist li {
  position: relative;
  padding-left: 1.4rem;
  margin: 0.4rem 0;
}

.checklist li::before {
  content: "•";
  position: absolute;
  left: 0.25rem;
  color: var(--color-teal-dark);
  font-weight: 700;
}

.faq details {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  margin: 0.6rem 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--color-series-ink);
  min-height: var(--touch);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--color-teal-dark);
  border-bottom: 2px solid var(--color-teal-dark);
  transform: rotate(45deg);
  transition: transform 160ms ease;
  margin-right: 0.2rem;
}

.faq details[open] summary::after {
  transform: rotate(225deg);
  margin-top: 0.35rem;
}

.faq details[open] summary {
  margin-bottom: 0.45rem;
}

.pack-preview-card {
  background: linear-gradient(160deg, var(--color-warm-cream), var(--color-garden-soft));
  border: 1px dashed rgba(7, 93, 102, 0.35);
  border-radius: var(--radius);
  padding: clamp(1rem, 2.5vw, 1.5rem);
  min-height: 14rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0.75rem;
  box-shadow: 0 8px 22px var(--color-shadow);
}

.pack-preview-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-series-ink);
  font-weight: 700;
}

.pack-preview-card p {
  margin: 0;
  color: var(--color-ink-soft);
}

.pack-preview-card img,
.illustrated-band .pack-preview-card img {
  /* Portrait pack page: fill the card column so the preview is the
     dominant visual, without letterboxing or cropping artwork.
     Higher specificity beats .illustrated-band img when nested. */
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 600 / 849;
  margin-inline: auto;
  object-fit: contain;
  object-position: center;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 14px rgba(7, 93, 102, 0.12);
  background: #fff;
}

.club-join-wrap {
  display: grid;
  justify-items: center;
}

.club-join-wrap .form-panel {
  width: min(100%, 36rem);
}

/* Authoritative hide for Club inactive panel vs MailerLite mount.
   Do not rely on the HTML hidden attribute alone: .coming-soon uses
   display:inline-flex and can confuse partial/cached renders. */
.ls-hidden {
  display: none !important;
}

.club-mailerlite-mount {
  margin-top: 1.25rem;
  width: 100%;
  min-height: 2rem;
}

.club-mailerlite-mount:not(.ls-hidden) {
  display: block !important;
}

.club-mailerlite-mount .ml-embedded {
  width: 100%;
  max-width: 100%;
}

.club-mailerlite-mount iframe,
.club-mailerlite-mount form {
  max-width: 100%;
}

.club-form-preview-banner:not(.ls-hidden) {
  display: inline-flex !important;
}

.club-local-preview-tip:not(.ls-hidden) {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--color-teal-dark);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
}

.club-local-preview-tip .cta-row {
  margin: 0.75rem 0;
}

.illustrated-band {
  display: grid;
  /* Image track sized to the art so cream gutters do not open beside a
     centred square that is smaller than its grid cell. */
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 22rem);
  gap: clamp(1.1rem, 2.5vw, 1.75rem);
  align-items: start;
}

.illustrated-band img {
  display: block;
  width: 100%;
  max-width: 22rem;
  height: auto;
  aspect-ratio: 1 / 1;
  margin-inline: 0;
  justify-self: stretch;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 22px var(--color-shadow);
  object-fit: cover;
  object-position: center bottom;
  background: transparent;
}

/* Full-card illustration: art fills the rounded card; no inset pale frame. */
.illustrated-frame {
  margin: 0;
  width: 100%;
  max-width: 22rem;
  justify-self: stretch;
  box-sizing: border-box;
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 22px var(--color-shadow);
  background: transparent;
  overflow: hidden;
  line-height: 0;
}

.illustrated-frame img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  object-fit: cover;
  /* Bias left so the owl/snail grouping sits toward viewer-left. */
  object-position: left bottom;
  background: transparent;
}

.coming-soon {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(7, 93, 102, 0.1);
  color: var(--color-teal-dark);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.form-panel {
  background: var(--color-garden-soft);
}

.form-panel label {
  display: block;
  font-weight: 700;
  margin: 0.85rem 0 0.35rem;
}

.form-panel input[type="email"] {
  width: 100%;
  min-height: var(--touch);
  padding: 0.7rem 0.95rem;
  border-radius: 0.75rem;
  border: 1px solid var(--color-border);
  font: inherit;
  background: #fff;
  color: var(--color-ink);
}

.consent-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  margin: 1rem 0;
}

.consent-row input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
}

.legal-note {
  font-size: 0.9rem;
  color: var(--color-ink-soft);
}

.site-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 2.25rem 0 1.75rem;
  background: var(--color-footer);
  color: var(--color-footer-text);
}

.site-footer a {
  color: #d7f3ef;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 1.5rem;
  align-items: start;
}

.footer-links {
  display: grid;
  gap: 0.45rem;
}

.social-links {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.social-link {
  width: var(--touch);
  height: var(--touch);
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 248, 233, 0.12);
  border: 1px solid rgba(255, 248, 233, 0.28);
  color: var(--color-footer-text);
}

.social-link svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.social-link.is-pending {
  opacity: 0.55;
  cursor: not-allowed;
}

.footer-copy {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 248, 233, 0.18);
  font-size: 0.9rem;
  opacity: 0.92;
}

.privacy-prose {
  max-width: 44rem;
  background: var(--color-panel);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: var(--pad-card);
  box-shadow: 0 6px 16px var(--color-shadow);
}

.privacy-prose h2 {
  margin-top: 1.4rem;
  font-size: 1.2rem;
}

.privacy-prose h2:first-child {
  margin-top: 0;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.preview-grid figure {
  margin: 0;
  background: var(--color-panel);
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
}

.preview-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  background: transparent;
  display: block;
  flex: 0 0 auto;
}

.preview-grid .peek-frame {
  overflow: hidden;
}

.preview-grid .peek-frame img {
  border-radius: 0;
  object-fit: cover;
  object-position: center;
}

.preview-grid figcaption {
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
}

.club-welcome {
  background: var(--color-warm-cream);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: var(--pad-card);
  box-shadow: 0 8px 22px var(--color-shadow);
}

@media (max-width: 1320px) {
  /* Hide tagline earlier so primary nav items stay fully visible at
     common desktop widths without horizontal overflow. */
  .brand-lockup span {
    display: none;
  }

  .site-nav a {
    font-size: 0.88rem;
  }
}

@media (max-width: 900px) {
  .grid-3,
  .grid-2,
  .book-layout,
  .featured-book,
  .footer-grid,
  .hero-inner,
  .illustrated-band,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    width: 100%;
  }

  .site-nav.is-open {
    display: block;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .site-nav ul {
    flex-direction: column;
    flex-wrap: wrap;
    align-items: stretch;
    padding: 0.35rem 0 0.6rem;
    gap: 0.15rem;
  }

  .site-nav a {
    display: block;
    padding: 0.7rem 0.2rem;
    white-space: normal;
  }

  .hero-art img {
    max-height: 18rem;
    object-position: center 30%;
  }

  .illustrated-band .illustrated-frame,
  .illustrated-band img {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    justify-self: center;
  }

  .illustrated-band img {
    object-fit: cover;
    object-position: center bottom;
  }

  .pack-preview-card img,
  .illustrated-band .pack-preview-card img {
    width: min(100%, 20rem);
    max-width: 100%;
    aspect-ratio: 600 / 849;
    object-fit: contain;
    object-position: center;
  }

  .brand-lockup strong {
    white-space: normal;
  }
}

@media (max-width: 480px) {
  .cta-row .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
