/* Shared site styles: nav, landing page, footer. */

:root {
  --ink: #1f2a3a;
  --muted: #5c6672;
  --green: #57a05a;
  --green-dark: #4a8c4d;
  --orange: #ef8632;
  --orange-dark: #db7420;
  --amazon: #c2680f;
  --amazon-dark: #a8570c;
  --cream: #f7f1e2;
  --paper: #fdfbf6;
  --font-display: "Fredoka", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Retro horizontal bands, boldest first and tapering to nothing —
     used as a muted divider anchored just below the page header on
     the Books and Weekly Free pages. */
  --retro-top-stripes: linear-gradient(
    to bottom,
    rgba(140, 74, 107, 0.28) 0px, rgba(140, 74, 107, 0.28) 8px, transparent 8px, transparent 14px,
    rgba(168, 87, 12, 0.26) 14px, rgba(168, 87, 12, 0.26) 19px, transparent 19px, transparent 24px,
    rgba(194, 104, 15, 0.25) 24px, rgba(194, 104, 15, 0.25) 28px, transparent 28px, transparent 33px,
    rgba(215, 106, 92, 0.24) 33px, rgba(215, 106, 92, 0.24) 36px, transparent 36px, transparent 40px,
    rgba(226, 121, 74, 0.22) 40px, rgba(226, 121, 74, 0.22) 43px, transparent 43px, transparent 47px,
    rgba(239, 134, 50, 0.21) 47px, rgba(239, 134, 50, 0.21) 49px, transparent 49px, transparent 53px,
    rgba(245, 158, 11, 0.2) 53px, rgba(245, 158, 11, 0.2) 55px, transparent 55px, transparent 59px,
    rgba(245, 180, 49, 0.17) 59px, rgba(245, 180, 49, 0.17) 60px, transparent 60px, transparent 64px,
    rgba(251, 191, 83, 0.15) 64px, rgba(251, 191, 83, 0.15) 65px, transparent 65px, transparent 90px
  );
}

h1,
h2,
h3,
.logo,
.badge {
  font-family: var(--font-display);
}

.landing,
.books-page {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

/* ---------- Nav ---------- */

.site-nav {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
}

.landing .site-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: transparent;
}

.palette-page .site-nav,
.books-page .site-nav {
  background: var(--paper);
}

.page-header {
  position: relative;
  max-width: 1060px;
  margin: 0 auto;
  padding: 56px 40px 36px;
  text-align: center;
}

.page-header::before {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  top: 0;
  height: 90px;
  margin-left: -50vw;
  margin-right: -50vw;
  background: var(--retro-top-stripes);
  pointer-events: none;
}

.page-header > * {
  position: relative;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 800;
}

.page-header p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.site-nav .logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}

.nav-brand {
  display: flex;
  flex-direction: column;
}

.nav-subtitle {
  display: none;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.85;
}

.nav-links a:hover,
.nav-links a.current {
  opacity: 1;
}

.nav-toggle-checkbox {
  display: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 110px 24px;
  background:
    url("art/retro-waves.svg") no-repeat bottom center / 100% 220px,
    linear-gradient(
      160deg,
      #fbdcdc 0%,
      #fdf3d8 18%,
      #fdfbf2 36%,
      #d8e8f7 52%,
      #f3fbee 68%,
      #d9f0dc 84%,
      #fdf6e8 100%
    );
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% -20%;
  background:
    radial-gradient(ellipse 60% 30% at 20% 20%, rgba(255, 255, 255, 0.75), transparent 70%),
    radial-gradient(ellipse 70% 35% at 80% 45%, rgba(255, 255, 255, 0.7), transparent 70%),
    radial-gradient(ellipse 65% 30% at 35% 80%, rgba(255, 255, 255, 0.65), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.hero-content {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.hero-art {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

.hero h1 {
  margin: 0;
  max-width: 560px;
  font-size: clamp(38px, 5vw, 54px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.accent-underline {
  border-bottom: 4px solid var(--orange);
}

.text-accent {
  color: var(--orange);
}

.hero-sub {
  margin: 26px 0 0;
  max-width: 480px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.hero-cta {
  display: flex;
  justify-content: flex-start;
  gap: 16px;
  margin-top: 36px;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12), 0 6px 16px rgba(31, 42, 58, 0.12);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.12), 0 10px 22px rgba(31, 42, 58, 0.16);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12), 0 4px 10px rgba(31, 42, 58, 0.14);
}

.btn-green { background: var(--green); }
.btn-green:hover { background: var(--green-dark); }
.btn-orange { background: var(--orange); }
.btn-orange:hover { background: var(--orange-dark); }
.btn-amazon { background: var(--amazon); }
.btn-amazon:hover { background: var(--amazon-dark); }

/* Buttons carrying the Etsy/Amazon badge look left-heavy with
   symmetric padding since the badge already reads as leading
   whitespace; ease off the left side to rebalance. */
.btn:has(.icon-etsy),
.btn:has(.icon-amazon) {
  padding-left: 20px;
}

.cover-btn:has(.icon-etsy),
.cover-btn:has(.icon-amazon) {
  padding-left: 14px;
}

/* ---------- Icons ---------- */
/* Single-color SVGs applied via mask so they inherit the button/link's
   text color instead of carrying their own baked-in fill. */

.btn-icon {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 6px;
  vertical-align: -3px;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.icon-lock-locked { -webkit-mask-image: url("icons/lock-locked.svg"); mask-image: url("icons/lock-locked.svg"); }
.icon-lock-unlocked { -webkit-mask-image: url("icons/lock-unlocked.svg"); mask-image: url("icons/lock-unlocked.svg"); }
.icon-book-open { -webkit-mask-image: url("icons/book-open.svg"); mask-image: url("icons/book-open.svg"); }
.icon-gift { -webkit-mask-image: url("icons/gift.svg"); mask-image: url("icons/gift.svg"); }
.icon-palette { -webkit-mask-image: url("icons/palette.svg"); mask-image: url("icons/palette.svg"); }
.icon-download { -webkit-mask-image: url("icons/download.svg"); mask-image: url("icons/download.svg"); }
.icon-arrow-back { -webkit-mask-image: url("icons/arrow-back.svg"); mask-image: url("icons/arrow-back.svg"); }
.icon-arrow-next { -webkit-mask-image: url("icons/arrow-next.svg"); mask-image: url("icons/arrow-next.svg"); }

.nav-links a .btn-icon {
  width: 15px;
  height: 15px;
  vertical-align: -3px;
}

.cover-btn .btn-icon,
.footer-links a .btn-icon {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
}

/* Etsy/Amazon icons already come as full-color circular badges, so
   they're drawn as a plain background image (not a currentColor
   mask like the other icons) to keep their own colors intact. */
.icon-etsy,
.icon-amazon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  vertical-align: -5px;
  background-color: transparent;
  -webkit-mask-image: none;
  mask-image: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.icon-etsy { background-image: url("icons/etsy.svg"); }
.icon-amazon { background-image: url("icons/amazon.svg"); }

.cover-btn .icon-etsy,
.cover-btn .icon-amazon,
.footer-links a .icon-etsy,
.footer-links a .icon-amazon {
  width: 16px;
  height: 16px;
  vertical-align: -4px;
}

/* ---------- Featured collections ---------- */

.collections {
  background: var(--cream);
  padding: 90px 40px 100px;
}

.books-page .collections {
  background: var(--paper);
  padding-top: 40px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  max-width: 1060px;
  margin: 0 auto 36px;
  gap: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.view-all-btn {
  flex-shrink: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 1060px;
  margin: 0 auto;
}

.card {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(31, 42, 58, 0.06);
}

.cover-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

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

.cover-actions {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(31, 42, 58, 0.55);
  opacity: 0;
  transition: opacity 0.18s;
}

.cover-wrap:hover .cover-actions,
.cover-wrap:focus-within .cover-actions {
  opacity: 1;
}

@media (hover: none) {
  .cover-actions {
    opacity: 1;
    background: transparent;
  }
}

.cover-btn {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s, background 0.15s;
}

.cover-btn:hover {
  transform: translateY(-2px);
}

.cover-btn-etsy {
  background: var(--green);
}

.cover-btn-etsy:hover {
  background: var(--green-dark);
}

.cover-btn-amazon {
  background: var(--amazon);
}

.cover-btn-amazon:hover {
  background: var(--amazon-dark);
}

.card-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 10px 14px 12px;
  background: var(--accent, #fff);
  box-shadow: 0 -6px 14px rgba(31, 42, 58, 0.12);
}

.card-body h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
}

.card-body p {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- Book cards (All Books page) ---------- */
/* Richer than the compact Featured cards: cover plus name,
   description, price, and buy/sample actions. */

.book-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 1060px;
  margin: 0 auto;
}

.book-card {
  display: flex;
  gap: 16px;
  min-width: 0;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(31, 42, 58, 0.06);
}

.book-card-cover {
  flex-shrink: 0;
  align-self: flex-start;
  width: 120px;
  border-radius: 10px;
  overflow: hidden;
}

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

.book-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.book-card-body h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.book-card-desc {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.book-card-prices {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 10px 0 0;
  font-size: 13px;
}

.book-card-prices .price-store {
  font-weight: 700;
  color: var(--ink);
}

.book-card-prices .price-was {
  color: var(--muted);
  text-decoration: line-through;
  margin-left: 4px;
}

.book-card-prices .price-now {
  font-weight: 800;
  color: var(--accent, var(--ink));
  margin-left: 4px;
}

.book-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
  min-width: 0;
}

.book-card-actions .cover-btn {
  box-shadow: none;
  padding: 7px 9px;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

.book-card-actions .cover-btn .btn-icon {
  margin-right: 3px;
}

.cover-btn-sample {
  background: var(--accent, var(--ink));
}

.cover-btn-sample:hover {
  filter: brightness(0.9);
}

/* ---------- Sample preview modal ---------- */

.sample-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.sample-modal[hidden] {
  display: none;
}

.sample-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 42, 58, 0.7);
}

.sample-modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.sample-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f0f0f0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}

.sample-modal-close:hover {
  background: #e5e5e5;
}

.sample-modal-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 16px;
}

/* ---------- Palette generator CTA ---------- */

.tool-cta {
  padding: 90px 40px;
  background:
    linear-gradient(
      175deg,
      var(--paper) 0%,
      var(--paper) 55%,
      #fbe9df 75%,
      #e5eef9 90%,
      #eaf6e6 100%
    );
}

.tool-card {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(31, 42, 58, 0.07);
  text-align: center;
  padding: 64px 40px;
}

.mascot-hero {
  width: 460px;
  max-width: 42vw;
  height: auto;
  pointer-events: none;
}

.badge {
  display: inline-block;
  background: #fde4d3;
  color: #c25f14;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
}

.tool-card h2 {
  margin: 20px 0 0;
  font-size: 34px;
  font-weight: 800;
}

.tool-card p {
  margin: 14px auto 0;
  max-width: 440px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

.tool-card .btn {
  margin-top: 30px;
}

/* ---------- Weekly free page ---------- */

.weekly-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 8px 40px 0;
  background: var(--paper);
}

.weekly-feature-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 640px;
}

.weekly-page-frame {
  width: 100%;
  max-width: 640px;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 32px rgba(31, 42, 58, 0.14);
}

.weekly-page-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.weekly-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 999px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1), 0 3px 10px rgba(31, 42, 58, 0.12);
}

.weekly-download-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.weekly-source {
  background: var(--paper);
  padding: 40px 40px 90px;
}

.weekly-source-card {
  max-width: 700px;
  margin: 0 auto;
  background: var(--accent, var(--cream));
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(31, 42, 58, 0.16);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
  transition: background 0.2s;
}

.weekly-cover {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(31, 42, 58, 0.25);
  flex-shrink: 0;
}

.weekly-source-info {
  flex: 1;
  min-width: 0;
}

.weekly-source-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.weekly-source-info h2 {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.weekly-source-info > p {
  margin: 4px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.weekly-source-info .hero-cta {
  justify-content: flex-start;
  gap: 10px;
  margin-top: 16px;
}

.weekly-source-info .hero-cta .btn {
  padding: 10px 18px;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.weekly-source-info .hero-cta .btn:has(.icon-etsy),
.weekly-source-info .hero-cta .btn:has(.icon-amazon) {
  padding-left: 14px;
}

.weekly-next {
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--paper);
  border-top: 1px solid #eee7d8;
  padding: 48px 40px 56px;
}

.footer-inner {
  max-width: 1060px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.footer-brand .logo {
  font-size: 17px;
  font-weight: 800;
}

.footer-brand p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.8;
}

.footer-links a:hover {
  opacity: 1;
}

.copyright {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

/* ---------- Responsive ---------- */

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

  .book-cards {
    grid-template-columns: 1fr;
    max-width: 480px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }

  .copyright {
    text-align: center;
  }
}

@media (max-width: 640px) {
  .site-nav {
    padding: 14px 20px;
  }

  .nav-subtitle {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    margin-top: 2px;
  }

  .book-card {
    flex-direction: column;
  }

  .book-card-cover {
    align-self: stretch;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
  }

  .book-card-cover img {
    height: 100%;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    left: 20px;
    right: 20px;
    z-index: 100;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    max-height: 0;
    overflow: hidden;
    background: #fff;
    border-radius: 16px;
    padding: 0 8px;
    box-shadow: 0 16px 32px rgba(31, 42, 58, 0.18);
    opacity: 0;
    transform: translateY(-6px);
    transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.2s ease, padding 0.25s ease;
  }

  .nav-toggle-checkbox:checked ~ .nav-links {
    max-height: 260px;
    padding: 8px;
    opacity: 1;
    transform: translateY(0);
  }

  .nav-links a {
    padding: 12px 14px;
    border-radius: 10px;
    opacity: 1;
    transition: background 0.15s;
  }

  .nav-links a:hover {
    background: var(--cream);
  }

  .nav-links a.current {
    background: var(--cream);
    color: var(--orange-dark);
  }

  .hero {
    padding: 90px 20px 60px;
  }

  .hero-inner {
    flex-direction: column-reverse;
    gap: 28px;
  }

  .hero-content {
    text-align: center;
  }

  .hero h1 {
    margin: 0 auto;
  }

  .hero-sub {
    margin: 20px auto 0;
  }

  .hero-cta {
    justify-content: center;
  }

  .mascot-hero {
    width: 210px;
    max-width: 58vw;
  }

  .collections,
  .tool-cta {
    padding-left: 20px;
    padding-right: 20px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .weekly-feature {
    padding: 8px 20px 0;
  }

  .weekly-source {
    padding: 32px 20px 64px;
  }

  .weekly-source-card {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 24px;
  }

  .weekly-cover {
    align-self: center;
  }

  .weekly-source-info .hero-cta {
    justify-content: flex-start;
  }
}
