/* ============================================================
   ToadiwiBooks — site styles (redesign)
   ============================================================ */

:root {
  --paper:      #fbf8f2;
  --surface:    #ffffff;
  --sand:       #f3ede2;
  --line:       #e6dfd2;
  --ink:        #1e2b2c;
  --muted:      #5c6a6b;
  --brand:      #0596ad;
  --brand-ink:  #05687a;
  --brand-soft: #dff5f8;
  --accent:     #f26b2a;
  --sun:        #ffc93c;
  --night:      #2a3550;
  --primary:    var(--brand); /* used by script.js inline styles */

  --serif: 'Montserrat', system-ui, sans-serif;
  --sans:  'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 16px;
  --shadow: 0 1px 2px rgba(30,43,44,.06), 0 8px 24px rgba(30,43,44,.08);
  --wrap: 1140px;
}

body.dark {
  --paper:      #141a1b;
  --surface:    #1c2425;
  --sand:       #1f2829;
  --line:       #2e3a3b;
  --ink:        #ece8e1;
  --muted:      #a3afb0;
  --brand:      #4fc0cf;
  --brand-ink:  #8ad6e0;
  --brand-soft: #1d3336;
  --accent:     #ec8a63;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--brand-ink); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
}

p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: .9rem;
}

.lede { font-size: 1.15rem; color: var(--muted); max-width: 36em; }

/* ── Buttons ── */
button, .btn {
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
button:hover, .btn:hover { background: var(--brand-ink); }
body.dark button, body.dark .btn { color: #0f1516; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--sand); color: var(--ink); }
body.dark .btn-ghost { color: var(--ink); }

.btn-quiet { background: var(--sand); color: var(--ink); }
.btn-quiet:hover { background: var(--line); }
body.dark .btn-quiet { color: var(--ink); }

.btn-block { width: 100%; }

.text-link {
  font-weight: 600;
  text-decoration: none;
  color: var(--brand-ink);
  cursor: pointer;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Header / Nav ── */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex; align-items: center; gap: 24px;
  height: 68px;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif);
  font-size: 1.35rem; font-weight: 600;
  color: var(--ink); text-decoration: none; cursor: pointer;
  margin-right: auto;
}
.brand img { height: 40px; width: auto; border-radius: 8px; object-fit: contain; }

nav#main-nav { display: flex; align-items: center; gap: 4px; }

nav#main-nav a {
  font-size: .93rem; font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
nav#main-nav a:hover { color: var(--ink); background: var(--sand); }
nav#main-nav a.active { color: var(--ink); }
nav#main-nav a.active::after {
  content: ""; display: block; height: 2px; margin-top: 3px;
  background: var(--brand); border-radius: 2px;
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.cart-btn {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 14px;
}
.cart-btn:hover { background: var(--sand); }
body.dark .cart-btn { color: var(--ink); }
.cart-btn .cart-count {
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px;
  background: var(--brand); color: #fff;
  font-size: .75rem; line-height: 20px; text-align: center;
}
body.dark .cart-btn .cart-count { color: #0f1516; }

.menu-btn { display: none; background: transparent; color: var(--ink); padding: 8px; border-radius: 8px; }
.menu-btn:hover { background: var(--sand); }

/* ── Pages ── */
.page-section { display: none; }
.page-section.active { display: block; }

.page-head { padding: 64px 0 32px; }
.page-head h1 { font-size: clamp(2.2rem, 4vw, 3rem); }
.page-body { padding-bottom: 96px; }

.band { padding: 88px 0; }
.band-sand { background: var(--sand); }
.band-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.band-head h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 0; }

/* ── Hero ── */
.hero { padding: 72px 0 88px; overflow-x: clip; }
.hero .wrap {
  display: grid; grid-template-columns: 1.1fr 1fr;
  gap: 56px; align-items: center;
}
.hero h1 {
  font-size: clamp(2.6rem, 5.4vw, 4.2rem);
  font-weight: 500;
  margin-bottom: 1.25rem;
}
.hero h1 em { font-style: italic; color: var(--brand); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 2rem; }

.hero-covers {
  position: relative;
  height: 460px;
}
.hero-covers img {
  position: absolute;
  width: 58%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 24px 48px rgba(30,43,44,.22);
}
.hero-covers img:nth-child(1) { left: 0;   top: 40px;  transform: rotate(-5deg); }
.hero-covers img:nth-child(2) { right: 0;  top: 0;     transform: rotate(4deg); z-index: 2; }
.hero-covers img:nth-child(3) { left: 22%; bottom: -10px; width: 52%; z-index: 3; transform: rotate(-1deg); }

.trust {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.trust ul {
  list-style: none; margin: 0; padding: 22px 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.trust li { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: .95rem; }
.trust strong { font-family: var(--serif); font-size: 1.05rem; color: var(--ink); font-weight: 600; white-space: nowrap; }

/* ── Book of the Month ── */
.feature {
  display: grid; grid-template-columns: 300px 1fr;
  gap: 56px; align-items: center;
}
.feature img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.feature h2 { font-size: clamp(2rem, 3.4vw, 2.8rem); margin-bottom: .25em; }
.feature .byline { color: var(--muted); font-style: italic; margin-bottom: 1.25em; }
.feature .blurb { font-size: 1.12rem; max-width: 34em; }

/* ── Books ── */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 40px 28px;
}

.book-card { display: flex; flex-direction: column; }
.book-card .cover {
  position: relative;
  background: var(--sand);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.book-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform .3s ease;
}
.book-card .cover:hover img { transform: scale(1.03); }
.book-card h3 { font-size: 1.3rem; margin: 0 0 .2em; }
.book-card .meta { font-size: .85rem; color: var(--muted); margin-bottom: .5em; }
.book-card p { color: var(--muted); font-size: .95rem; flex: 1; }
.book-card .buy { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.book-card .price, .merch-card .price { font-weight: 600; font-size: 1.05rem; }

.tag {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--surface); color: var(--ink);
  font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

.add-btn { padding: 9px 16px; font-size: .88rem; }
.cart-controls { display: flex; align-items: center; }

/* Landscape covers (Everglen): keep the title in frame */
img[alt="Everglen"] { object-position: 8% center; }

/* Home collection preview is a lighter version of the grid */
.collection .book-card .buy,
.collection .book-card p { display: none; }

/* ── Merch ── */
.merch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 32px;
}
.merch-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 20px;
  display: flex; flex-direction: column;
}
.merch-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; margin-bottom: 16px; background: var(--sand); }
.merch-card h3 { font-size: 1.2rem; margin-bottom: .3em; }
.merch-card p { color: var(--muted); font-size: .95rem; flex: 1; }
.merch-card .buy { display: flex; align-items: center; justify-content: space-between; }

/* ── Publishing teaser (home) ── */
.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px; align-items: start; }
.split h2 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 0; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 48px 1fr; gap: 18px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--brand);
  line-height: 1.3;
}
.steps h3 { font-size: 1.15rem; margin: 0 0 .25em; }
.steps p { margin: 0; color: var(--muted); }

/* ── Newsletter ── */
.newsletter {
  background: var(--brand-ink);
  color: #fff;
  border-radius: 16px;
  padding: 56px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center;
}
body.dark .newsletter { background: var(--brand-soft); color: var(--ink); }
.newsletter h2 { font-size: clamp(1.7rem, 2.8vw, 2.2rem); margin-bottom: .3em; }
.newsletter p { margin: 0; opacity: .85; }
.newsletter form { display: flex; gap: 10px; }
.newsletter input {
  flex: 1; margin: 0;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
}
.newsletter input::placeholder { color: rgba(255,255,255,.7); }
body.dark .newsletter input { background: var(--surface); border-color: var(--line); color: var(--ink); }
body.dark .newsletter input::placeholder { color: var(--muted); }
.newsletter button { background: #fff; color: var(--brand-ink); }
.newsletter button:hover { background: var(--sand); }
body.dark .newsletter button { background: var(--brand); color: #0f1516; }

/* ── About / Team ── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 32px 24px;
}
.team-member { cursor: pointer; }
.team-member img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius);
  background: var(--sand);
  margin-bottom: 12px;
  filter: saturate(.95);
  transition: filter .2s;
}
.team-member:hover img { filter: saturate(1.1) brightness(1.03); }
.team-member h4 { font-size: 1.1rem; margin: 0; }

/* ── Publishing page ── */
.pub-grid { display: grid; grid-template-columns: 1fr 420px; gap: 64px; align-items: start; }
.pub-form-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  position: sticky; top: 96px;
}
.pub-form-box h2 { font-size: 1.5rem; }

.faq { margin-top: 56px; }
.faq h2 { font-size: 1.6rem; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: .6em 0 0; color: var(--muted); }

.file-pick { display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; }
.file-pick label { margin: 0; }
#pdf-label { font-size: .88rem; color: var(--muted); font-weight: 400; }
#uploadStatus { margin-top: 12px; font-weight: 600; color: var(--brand-ink); }

/* ── Contact ── */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 64px; }
.contact-info dl { margin: 0; }
.contact-info dt { font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 24px; }
.contact-info dd { margin: 4px 0 0; font-size: 1.05rem; }
.contact-info .social-row { display: flex; gap: 18px; flex-wrap: wrap; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Forms ── */
input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  margin: 6px 0 4px;
  font: inherit; font-size: .95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
input:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
label { display: block; font-size: .88rem; font-weight: 600; margin-top: 14px; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--line);
  padding: 64px 0 40px;
  margin-top: 0;
  font-size: .93rem;
  color: var(--muted);
}
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
footer h4 { font-family: var(--sans); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); margin-bottom: 14px; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
footer a { color: var(--muted); text-decoration: none; cursor: pointer; }
footer a:hover { color: var(--ink); }
footer .brand { margin-bottom: 12px; }
.footer-base {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: .85rem;
}
.socials { display: flex; gap: 16px; }
.socials a { display: inline-flex; color: var(--muted); }
.socials a:hover { color: var(--brand); }

#dark-toggle {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line);
  padding: 6px 12px; font-size: .82rem; font-weight: 500;
}
#dark-toggle:hover { background: var(--sand); color: var(--ink); }

/* ── Modals ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000; display: none;
  background: rgba(20,26,27,.55);
  backdrop-filter: blur(3px);
}
.modal {
  position: fixed; top: 50%; left: 50%; z-index: 2100; display: none;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px); max-width: 460px; max-height: 88vh; overflow-y: auto;
  background: var(--surface); color: var(--ink);
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 24px 64px rgba(0,0,0,.25);
  text-align: center;
}
#cart-modal, #shipping-modal { text-align: left; }
.modal h3 { font-size: 1.5rem; }
.modal hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.modal .row { display: flex; gap: 8px; }
.modal .row input { margin: 0; flex: 1; }
.modal .stack { display: grid; gap: 8px; margin-top: 16px; }
#team-modal img { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; margin: 0 auto 16px; }
#square-pay-btn { background: #111; color: #fff; }
#square-pay-btn:disabled { opacity: .5; cursor: not-allowed; }
.venmo-btn { background: #008cff; color: #fff; }
.venmo-btn:hover { background: #0074d4; }
.or { text-align: center; margin: 14px 0; color: var(--muted); font-size: .85rem; }
.modal .icon-mark { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; }

/* ── Playful layer: cards floating over the artwork ── */
body {
  background: var(--night) url('https://lh3.googleusercontent.com/pw/AP1GczMSQpsEJoyQ_Xfgwb6_bRo9BO-rSqvr2x7xos3JpKx2wQFEccdAYLkG_-L8Tb1mfi2yfYuM7bo9LuuQ_8FUT3PWHbmxOdDOEuFU5lofUfmI1i-2o3pQtnZkPhK_3jaz_kj8yt8-eftmjz4MSloRiEEs=w1024-h1536-s-no-gm?authuser=0') center / cover fixed;
}
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; }

/* Cyan header with pill links, like the original site */
.site-header {
  background: linear-gradient(135deg, #04c8e6, #0096b4);
  border-bottom: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.site-header .brand { color: #fff; }
.site-header .brand img { background: #fff; padding: 3px 5px; }
nav#main-nav a { color: rgba(255,255,255,.92); font-weight: 600; border-radius: 999px; padding: 8px 14px; }
nav#main-nav a:hover { background: rgba(255,255,255,.2); color: #fff; }
nav#main-nav a.active { background: #fff; color: var(--brand-ink); }
nav#main-nav a.active::after { display: none; }
.cart-btn { background: #fff; border-color: #fff; color: var(--ink); }
.cart-btn:hover { background: var(--sun); }
.menu-btn { color: #fff; }
.menu-btn:hover { background: rgba(255,255,255,.2); }


main { padding: 32px 16px 8px; }
.card {
  max-width: 1100px;
  margin: 0 auto 24px;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: 0 6px 20px rgba(0,0,0,.22);
}
.card.wrap { padding: 40px 48px; }
.card > .wrap { padding-left: 48px; padding-right: 48px; }
.page-head.card { margin-bottom: 20px; }
.page-head h1 { margin-bottom: .3em; }
.page-body.card { padding-bottom: 48px; }

button, .btn { border-radius: 10px; }
.hero-actions { align-items: center; gap: 18px; }

/* Hero: headline, then the actual books on a shelf */
.hero.card { padding: 52px 0 44px; }
.hero .wrap { display: block; }
.hero-text { max-width: 640px; }
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.4rem); margin-bottom: .5rem; }
.shelf {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px;
  margin-top: 44px; padding-bottom: 18px;
  border-bottom: 10px solid #c98d5b;
  border-radius: 0 0 4px 4px;
}
.shelf-book { text-decoration: none; color: var(--ink); cursor: pointer; text-align: center; }
.shelf-book img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border: 4px solid #fff; border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,.2);
  transition: transform .2s ease;
}
.shelf-book:nth-child(1) img { transform: rotate(-3deg); }
.shelf-book:nth-child(2) img { transform: rotate(2deg); }
.shelf-book:nth-child(3) img { transform: rotate(-1deg); }
.shelf-book:nth-child(4) img { transform: rotate(3deg); }
.shelf-book:hover img { transform: rotate(0) translateY(-6px); }
.shelf-book span { display: block; margin-top: 12px; font-family: var(--serif); font-weight: 700; }

/* Book of the Month + publishing pitch side by side */
.duo { max-width: 1100px; margin: 0 auto 24px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; }
.duo .card { margin: 0; padding: 36px; }
.card-sky  { background: #e4f5fb; }
.card-mint { background: #e3f5e6; }
body.dark .card-sky, body.dark .card-mint { background: var(--surface); }
.botm { display: grid; grid-template-columns: 150px 1fr; gap: 28px; align-items: center; }
.botm img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 4px solid #fff; border-radius: 8px; transform: rotate(-2deg); box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.botm-label { font-weight: 600; color: var(--brand-ink); margin-bottom: .3em; }
.botm h2, .pitch h2 { font-size: 1.7rem; }
.botm .byline { color: var(--muted); font-style: italic; margin-top: -.3em; }
.pitch p { color: var(--ink); }

.newsletter {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 24px 36px; color: #fff;
  background: #0aa3bf;
}
.newsletter p { margin: 0; font-size: 1.1rem; opacity: 1; }
.newsletter form { flex: 1; max-width: 440px; }
.newsletter button { background: var(--sun); color: var(--ink); }
.newsletter button:hover { background: #ffd866; }
body.dark .newsletter { background: var(--brand-soft); }

/* Covers on the Books page */
.book-card .cover { border-radius: 10px; border: 4px solid #fff; transition: transform .2s ease; }
.book-card:nth-child(odd)  .cover:hover { transform: rotate(-2deg) translateY(-4px); }
.book-card:nth-child(even) .cover:hover { transform: rotate(2deg) translateY(-4px); }
.book-card .cover:hover img { transform: none; }
.tag { background: var(--sun); color: var(--ink); transform: rotate(-4deg); }
.team-member img { border: 4px solid #fff; box-shadow: var(--shadow); }

/* Plain numbered steps */
.steps li::before { content: counter(step) "."; font-family: var(--serif); font-weight: 800; color: var(--brand); }

/* Footer: one row of links */
footer.card { padding: 28px 0 20px; border: 0; margin-bottom: 32px; }
footer.card > .wrap { padding: 0 36px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 24px; font-weight: 600; }
.footer-links a { color: var(--ink); }
.footer-base { margin-top: 20px; padding-top: 16px; }

/* ── Covers keep their real shape (no cropping or stretching) ── */
.shelf { align-items: end; }
.shelf-book img, .shelf-book:nth-child(n) img {
  width: auto; height: auto; max-width: 100%; max-height: 260px;
  aspect-ratio: auto; object-fit: contain; margin: 0 auto;
}
.book-card .cover {
  height: 300px; display: flex; align-items: flex-end; justify-content: center;
  background: none; border: 0; box-shadow: none; overflow: visible;
}
.book-card .cover img {
  width: auto; height: auto; max-width: 100%; max-height: 100%;
  aspect-ratio: auto; object-fit: contain;
  border: 4px solid #fff; border-radius: 8px; box-shadow: 0 6px 16px rgba(0,0,0,.2);
}
.botm img { aspect-ratio: auto; height: auto; }
.merch-card img { object-fit: contain; background: #fff; }

/* ── About: polaroids pinned to a board ── */
.team-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px 28px; padding: 8px 4px; }
.polaroid {
  display: block; width: 100%; padding: 10px 10px 14px;
  background: #fff; color: var(--ink); border: 0; border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  font: inherit; cursor: pointer; transition: transform .2s ease;
}
.polaroid:nth-child(4n+1) { transform: rotate(-3deg); }
.polaroid:nth-child(4n+2) { transform: rotate(2deg); }
.polaroid:nth-child(4n+3) { transform: rotate(-1deg); }
.polaroid:nth-child(4n+4) { transform: rotate(3deg); }
.polaroid:hover { transform: rotate(0) scale(1.04); background: #fff; }
.polaroid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 25%; background: var(--sand); border-radius: 2px; }
.polaroid span { display: block; margin-top: 10px; font-family: var(--serif); font-weight: 800; font-size: 1.15rem; }

.field-hint { font-size: .85rem; color: var(--muted); margin: 2px 0 0; }

/* ── Creators page (merged from the old /creator hub) ── */
.creators-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.hero-stats { color: var(--muted); font-size: .95rem; }
.hero-stats b { color: var(--ink); }
.who { background: var(--sand); color: var(--ink); border: 1px solid var(--line); box-shadow: none; white-space: nowrap; }
.who:hover { background: var(--line); }
.who.on { background: #e3f5e6; border-color: #34c759; color: #1d6b33; }
.creator-view { display: none; }
.creator-view.active { display: block; }
.creator-view h2 { font-size: 1.7rem; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--sand); border-radius: 12px; }
.seg-btn { background: none; color: var(--muted); box-shadow: none; padding: 8px 16px; border-radius: 9px; font-weight: 600; }
.seg-btn:hover { background: rgba(255,255,255,.6); color: var(--ink); }
.seg-btn[aria-pressed=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg.tabs { margin-bottom: 28px; }
.listbar { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; }
.check { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.legend { margin: 14px 0 18px; color: var(--muted); font-size: .95rem; }
.jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.job {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 28px; align-items: center;
  padding: 20px 24px; background: #fff8e3; border-radius: 16px; border: 2px solid #ffe3a3;
}
.job.pick { background: #e4f5fb; border-color: #bfe6f3; }
.job.taken { opacity: .55; }
.job h3 { font-size: 1.3rem; margin: 8px 0 4px; }
.job p { color: var(--muted); margin: 0; }
.job-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: .88rem; color: var(--muted); }
.job-meta .soon { color: var(--accent); font-weight: 700; }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--sun); color: var(--ink); }
.pick .badge { background: #9be3ee; }
.taken .badge { background: var(--line); }
.job-side { display: grid; gap: 10px; justify-items: end; text-align: right; }
.pay { font-family: var(--serif); font-weight: 800; font-size: 1.8rem; }
.empty { padding: 32px; border: 2px dashed var(--line); border-radius: 16px; color: var(--muted); text-align: center; }
.empty b { display: block; color: var(--ink); font-family: var(--serif); font-size: 1.2rem; margin-bottom: 4px; }
#page-creators label { display: grid; gap: 4px; }
#page-creators label input, #page-creators label select, #page-creators label textarea { margin: 0; }
#page-creators form { display: grid; gap: 4px; }
.form-msg { font-size: .9rem; color: #c0392b; margin: 6px 0 0; }
.form-msg:empty { display: none; }
.done p { color: var(--muted); }
.idchip { display: inline-block; background: var(--sun); color: var(--ink); border-radius: 8px; padding: 1px 10px; font-weight: 800; letter-spacing: .05em; user-select: all; }
.btn-danger { background: #c0392b; }
.btn-danger:hover { background: #a93226; }

dialog {
  width: min(540px, calc(100vw - 28px)); max-height: calc(100vh - 40px); overflow: auto;
  background: var(--surface); color: var(--ink); border: 0; border-radius: 20px;
  padding: 32px; box-shadow: 0 24px 64px rgba(0,0,0,.3);
}
dialog::backdrop { background: rgba(20,26,27,.55); backdrop-filter: blur(3px); }
.dlg-x { position: absolute; top: 12px; right: 12px; display: block; }
.icon-btn { width: 38px; height: 38px; padding: 0; border-radius: 50%; background: var(--sand); color: var(--ink); font-size: 22px; box-shadow: none; }
.icon-btn:hover { background: var(--line); }
#dlgBody { display: grid; gap: 12px; padding-right: 24px; }
#dlgBody h3 { font-size: 1.4rem; margin: 0; }
#dlgBody p { color: var(--muted); margin: 0; }
#dlgBody form { display: grid; gap: 4px; }
#dlgBody label { display: grid; gap: 4px; }
.dlg-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); }
.dlg-facts b { color: var(--ink); }
.dlg-acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 8px; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 3000; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 36px)); }
.toast { background: var(--ink); color: var(--paper); border-radius: 12px; padding: 12px 16px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.toast.err { background: #c0392b; color: #fff; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .hero .wrap, .split, .pub-grid, .contact-grid { grid-template-columns: 1fr; }
  .duo { grid-template-columns: 1fr; }
  .hero-covers { height: 380px; max-width: 460px; }
  .feature { grid-template-columns: 220px 1fr; gap: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .pub-form-box { position: static; }
  .newsletter { padding: 40px 32px; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .menu-btn { display: inline-flex; }
  nav#main-nav {
    display: none;
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px;
  }
  nav#main-nav.open { display: flex; }
  nav#main-nav a { padding: 12px; }
  nav#main-nav a.active::after { display: none; }
  nav#main-nav a.active { background: var(--sand); }
  .hero { padding: 40px 0 56px; }
  .hero-covers { height: 300px; width: 88%; margin: 0 auto; }
  .trust li { flex-direction: column; gap: 2px; }
  .trust ul { grid-template-columns: 1fr; gap: 12px; }
  .band { padding: 64px 0; }
  .feature { grid-template-columns: 1fr; }
  .feature img { max-width: 240px; }
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
  .newsletter form, .form-row { flex-direction: column; grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .modal { padding: 24px; }
  main { padding: 16px 10px 4px; }
  .card { border-radius: 18px; margin-bottom: 16px; }
  .card.wrap { padding-left: 20px; padding-right: 20px; }
  .card > .wrap, footer.card > .wrap { padding-left: 20px; padding-right: 20px; }
  .hero.card { padding: 32px 0 28px; }
  .shelf { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .duo { grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px; }
  .duo .card { padding: 24px 20px; }
  .botm { grid-template-columns: 110px 1fr; gap: 18px; }
  .newsletter { padding: 22px 20px; }
  footer.card { margin: 0 10px 16px; }
  .team-board { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }
  .book-card .cover { height: 220px; }
  .shelf-book img, .shelf-book:nth-child(n) img { max-height: 200px; }
  .creators-head { flex-direction: column; }
  .job { grid-template-columns: 1fr; }
  .job-side { justify-items: start; text-align: left; grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .newsletter form { flex-direction: row; }
  body { background-attachment: scroll; background-size: 100% auto; background-repeat: repeat-y; }
  nav#main-nav { background: #0096b4; border: 0; }
  nav#main-nav a.active { background: #fff; }
}

#page-creators label.check { display: flex; }
/* Covers sit at the bottom of their box, so pin the sticker to the bottom too */
.book-card .cover .tag { top: auto; bottom: -8px; left: -6px; }

/* ── Accounts, signing, store extras ── */
.acct-btn { background: rgba(255,255,255,.18); color: #fff; box-shadow: none; padding: 8px 14px; border: 1px solid rgba(255,255,255,.45); white-space: nowrap; }
.acct-btn:hover { background: rgba(255,255,255,.3); }
.acct-btn.on { background: #fff; color: var(--brand-ink); }
body.dark .acct-btn { color: #fff; }
body.dark .acct-btn.on { color: #0f1516; }
.gate { background: var(--brand-soft); border-radius: 14px; padding: 18px 20px; }
.gate p { margin: 0 0 12px; }
.narrow { max-width: 440px; }
.acct-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; color: var(--muted); }
.acct-bar b { color: var(--ink); }
.acct-view { display: none; }
.acct-view.active { display: block; }
.acct-view h2 { font-size: 1.4rem; margin-top: 0; }
.acct-view h3 { margin-bottom: 6px; }
.alert { border-radius: 12px; padding: 12px 16px; margin: 0 0 12px; background: #fff6dc; border: 1px solid #f3d27a; }
.alert.ok { background: #e3f5e6; border-color: #9fd8ab; }
.alert button { margin-left: 8px; padding: 6px 12px; font-size: .9rem; }
body.dark .alert { background: #3a3220; border-color: #6b5a2a; }
body.dark .alert.ok { background: #1f3324; border-color: #3c6b46; }
.radio-list { display: grid; gap: 8px; margin-top: 8px; }
.radio-list label { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-weight: 500; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.radio-list input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); }
.radio-list small { display: block; color: var(--muted); }
.items { display: grid; gap: 12px; }
.item { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.item-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.item-head h3 { margin: 0; font-size: 1.15rem; }
.chip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 700; background: var(--sand); color: var(--ink); }
.chip.go { background: #e3f5e6; color: #1d6b33; }
.chip.wait { background: #fff1cc; color: #7a5600; }
.chip.stop { background: #fde2df; color: #9b2c22; }
.track { display: flex; gap: 4px; margin: 12px 0 6px; }
.track span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.track span.on { background: var(--brand); }
.timeline { list-style: none; padding: 0; margin: 8px 0 0; font-size: .88rem; color: var(--muted); }
.timeline li { margin: 2px 0; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.acts button, .acts a.btn { padding: 8px 14px; font-size: .92rem; }
.money-big { font-family: var(--serif); font-size: 2.2rem; font-weight: 800; margin: 0; }
table.ledger { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 10px; }
table.ledger td, table.ledger th { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.ledger td.num, table.ledger th.num { text-align: right; white-space: nowrap; }
.contract-text { border: 1px solid var(--line); border-radius: 12px; padding: 6px 22px 16px; max-height: 60vh; overflow: auto; background: var(--paper); }
.contract-text h1 { font-size: 1.6rem; }
.contract-text h2 { font-size: 1.1rem; margin: 18px 0 4px; }
.sign-box { margin-top: 18px; max-width: 480px; }
.sign-box .check { color: var(--ink); margin: 12px 0; }
.sigs { color: var(--muted); font-size: .9rem; }
.prose h2 { font-size: 1.2rem; margin: 22px 0 6px; }
.prose h2:first-child { margin-top: 0; }
.breakdown { font-size: .92rem; color: var(--muted); }
.breakdown div { display: flex; justify-content: space-between; margin: 3px 0; }
.size-pick { margin: 0 0 8px; padding: 6px 10px; width: auto; }
.sold-out { opacity: .6; }
.few-left { font-size: .82rem; color: var(--accent); font-weight: 700; }
#page-account form label, #page-sign form label { margin-top: 12px; }
@media (max-width: 760px) {
  .acct-btn { padding: 6px 10px; font-size: .85rem; }
}
