/* Overheard Books: the house style (shared with HQ and Support).
   Warm off-white with a dot grid, white blocks with a black outline and a hard offset shadow,
   Archivo for headings, Manrope for text. Text always sits on a solid colour
   (tests/test_readability.py checks WCAG AA contrast). */
@font-face { font-family: "Archivo"; src: url("fonts/archivo-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --paper: #f5f2ea;      /* page */
  --dots: rgba(0, 0, 0, .06);
  --card: #ffffff;       /* blocks */
  --soft: #ecece9;       /* quiet fills: badges, labels */
  --ink: #0f0f0f;        /* text, outlines, buttons */
  --muted: #55554f;      /* secondary text: 7:1 on white */
  --on-ink: #ffffff;
  --on-ink-muted: #d9d6cc;
  --note: #fff3c4;       /* example bar */
  --edge: 1px solid var(--ink);
  --shadow: 2px 2px 0 0 var(--ink);
  --shadow-up: 4px 4px 0 0 var(--ink);
  --radius: 16px;
  --display: "Archivo", "Arial Black", system-ui, sans-serif;
  --font: "Manrope", "Avenir Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bounce: cubic-bezier(.175, .885, .32, 1.275);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background-color: var(--paper); background-image: radial-gradient(var(--dots) 1.5px, transparent 1.6px); background-size: 32px 32px; color: var(--ink); font: 500 17px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 0; text-wrap: balance; }
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
main { flex: 1; padding-top: 8px; padding-bottom: 64px; }
main:focus { outline: none; }

/* Affiliate disclosure (top) */
.disclosure { background: var(--ink); color: var(--on-ink-muted); font-size: 12px; text-align: center; padding: 8px 16px; }

/* Header */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.brand { font-family: var(--display); font-weight: 900; font-size: 19px; letter-spacing: -.03em; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.top-links { display: flex; gap: 8px; }
.top-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; font-weight: 700; font-size: 14px; text-decoration: none; background: var(--card); border: var(--edge); border-radius: 12px; box-shadow: var(--shadow); }
.top-links a:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 0 var(--ink); }
.top-links a[aria-current="page"] { background: var(--ink); color: var(--on-ink); }

/* Page heading */
.page-head:empty { display: none; }
.hero { padding-block: 36px 32px; }
.hero h1 { font-size: clamp(42px, 8vw, 88px); font-weight: 900; letter-spacing: -.05em; line-height: 1; }
.hero .lede { max-width: 46ch; color: var(--muted); font-size: clamp(17px, 2.2vw, 21px); margin: 16px 0 0; }
.hero.compact { text-align: center; padding-block: 28px 28px; }
.creator-name { font-size: clamp(48px, 11vw, 120px) !important; line-height: .95 !important; }
.notice { max-width: 54ch; margin: 16px auto 0; color: var(--muted); font-size: 15px; }

/* Blocks: white, outlined, hard shadow */
.card, .creator-card, .pitch, .info, .example-bar, dialog { background: var(--card); border: var(--edge); border-radius: var(--radius); box-shadow: var(--shadow); }
.section h2, .pitch h2 { font-size: clamp(24px, 3.4vw, 34px); margin-bottom: 16px; }

/* Example bar on demo pages */
.example-bar { background: var(--note); margin-bottom: 22px; padding: 10px 14px; font-weight: 800; font-size: 14px; text-align: center; }

/* Home: example creators and the pitch */
.creator-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.creator-card { display: flex; flex-direction: column; gap: 4px; padding: 20px; text-decoration: none; min-height: 44px; transition: transform .2s var(--bounce), box-shadow .2s var(--bounce); }
.creator-card:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-up); }
.creator-card:active { transform: translate(2px, 2px); box-shadow: none; }
.creator-card b { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -.03em; }
.creator-card span:last-child { color: var(--muted); font-size: 14px; }
.badge { align-self: flex-start; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--soft); color: var(--ink); border: var(--edge); border-radius: 999px; padding: 1px 10px; }
.pitch { margin-top: 44px; padding: clamp(20px, 4vw, 36px); }
.pitch p { color: var(--muted); max-width: 60ch; margin: 0 0 22px; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 12px; background: var(--ink); color: var(--on-ink); border: var(--edge); font-weight: 800; text-decoration: none; box-shadow: var(--shadow-up); transition: transform .2s var(--bounce), box-shadow .2s; }
.pill:hover { transform: translate(2px, 2px); box-shadow: var(--shadow); }

/* Book tiles */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 18px; }
/* A tile is the book (a button that opens the book panel) with a direct Amazon link underneath. */
.card { display: flex; flex-direction: column; transition: transform .2s var(--bounce), box-shadow .2s var(--bounce); }
.card:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-up); }
.card-open { appearance: none; flex: 1; background: none; border: 0; border-radius: var(--radius) var(--radius) 0 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 18px 14px 14px; }
.card-open:focus-visible { outline-offset: -5px; }
.tile-buy { display: flex; align-items: center; justify-content: center; min-height: 44px; border-top: var(--edge); border-radius: 0 0 var(--radius) var(--radius); font-weight: 800; font-size: 14px; text-decoration: none; }
.tile-buy:hover { background: var(--ink); color: var(--on-ink); }
.tile-buy:focus-visible { outline-offset: -5px; }
.card h3 { font-size: 16px; letter-spacing: -.02em; margin-top: 6px; }
.genre { align-self: flex-start; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: var(--soft); border: var(--edge); border-radius: 999px; padding: 0 8px; }
.card .by, .card .heard { color: var(--muted); }
.card .by { font-size: 14px; }
.card .heard { font-size: 12px; margin-top: 10px; }

/* 3D books: per-book --spine, --spine-text and --thickness are set by app.js */
.b3d-stage { display: block; width: 62%; margin: 4px auto 20px; perspective: 1100px; container-type: inline-size; position: relative; }
.b3d-stage::after { content: ""; position: absolute; left: 8%; right: 2%; bottom: -14px; height: 18px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .22), transparent); filter: blur(2px); z-index: -1; }
.b3d { --t: clamp(9cqw, var(--thickness, 12cqw), 20cqw); position: relative; display: block; aspect-ratio: 2 / 3; transform-style: preserve-3d; transform: rotateX(4deg) rotateY(28deg); transition: transform .45s cubic-bezier(.22, 1, .36, 1); }
.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: 2px 5px 5px 2px; box-shadow: inset 4px 0 8px -2px rgba(0, 0, 0, .35); transform: translateZ(calc(var(--t) / 2)); backface-visibility: hidden; object-fit: cover; }
.b3d-spine, .b3d-pages, .b3d-back { position: absolute; top: 0; height: 100%; display: block; }
.b3d-spine { left: 0; width: var(--t); background: var(--spine); transform-origin: left center; transform: translateZ(calc(var(--t) / -2)) rotateY(-90deg); border-radius: 3px 0 0 3px; overflow: hidden; box-shadow: inset -3px 0 6px rgba(0, 0, 0, .25); }
.b3d-spine b { position: absolute; inset: 6% 0; writing-mode: vertical-rl; display: flex; align-items: center; justify-content: center; font: 800 clamp(6px, 4.6cqw, 11px)/1 var(--display); color: var(--spine-text); white-space: nowrap; overflow: hidden; }
.b3d-pages { left: 100%; top: 1.2%; height: 97.6%; width: calc(var(--t) - 2px); transform-origin: left center; transform: translateZ(calc(var(--t) / 2 - 1px)) rotateY(90deg); background: repeating-linear-gradient(90deg, #f7f3ea 0 1px, #e4dccb 1px 2px); }
.b3d-back { left: 0; width: 100%; background: var(--spine); transform: translateZ(calc(var(--t) / -2)) rotateY(180deg); border-radius: 5px 2px 2px 5px; }
.card:hover .b3d, .card-open:focus-visible .b3d { transform: rotateX(2deg) rotateY(8deg) translateZ(10px); }

/* Book panel */
dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; color: var(--ink); box-shadow: 6px 6px 0 0 var(--ink); }
dialog::backdrop { background: rgba(15, 15, 15, .55); }
.panel-body { position: relative; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.panel-head { display: flex; gap: 20px; align-items: flex-end; }
.panel-head .b3d-stage { width: 140px; flex: 0 0 140px; margin: 0 0 12px; }
.panel-head h2 { font-size: 28px; font-weight: 900; padding-right: 40px; }
.panel-head .by { color: var(--muted); margin: 6px 0 0; }
.why h3 { font-family: var(--font); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.why p { margin: 0; }
.why .post { display: inline-flex; align-items: center; min-height: 44px; font-weight: 800; }
.why .when { color: var(--muted); font-size: 13px; }
.cta { display: flex; align-items: center; justify-content: center; min-height: 54px; border-radius: 12px; background: var(--ink); color: var(--on-ink); border: var(--edge); font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.02em; text-decoration: none; box-shadow: 4px 4px 0 0 #9a9a93; transition: transform .2s var(--bounce), box-shadow .2s; }
.cta:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 0 #9a9a93; }
.formats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: -4px; }
.format { display: flex; align-items: center; justify-content: center; min-height: 44px; border: var(--edge); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); font-weight: 800; font-size: 15px; text-decoration: none; }
.format:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 0 var(--ink); }
.trial { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: -8px; font-weight: 800; font-size: 15px; text-align: center; }
.in-app-hint { margin: 0; padding: 10px 12px; background: var(--note); border: var(--edge); border-radius: 12px; font-size: 14px; }
.report { align-self: center; display: inline-flex; align-items: center; min-height: 44px; margin-top: -10px; font-size: 13px; color: var(--muted); }
.pitch-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.pitch-links .more { display: inline-flex; align-items: center; min-height: 44px; font-weight: 800; }
.info ol li { margin-bottom: 8px; }
.fine { margin: -4px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.close { position: absolute; z-index: 2; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 12px; border: var(--edge); background: var(--card); color: var(--ink); font-size: 18px; font-weight: 800; cursor: pointer; box-shadow: var(--shadow); }
.close:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 0 var(--ink); }
@media (max-width: 560px) {
  .panel-head { flex-direction: column; align-items: flex-start; }
  .panel-head .b3d-stage { width: 120px; flex-basis: auto; }
}

/* Info pages */
.info { margin-top: 20px; padding: clamp(20px, 4vw, 40px); max-width: 760px; }
.info h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 900; letter-spacing: -.04em; margin-bottom: 14px; }
.info h2 { font-size: 21px; margin: 28px 0 8px; }
.info .updated { font-size: 14px; color: var(--muted); margin: -6px 0 18px; }
.info .lede { font-size: 19px; color: var(--muted); }
.info li { margin-bottom: 8px; }
.info b { font-weight: 800; }
/* Contact form */
.contact-form { display: flex; flex-direction: column; gap: 6px; margin: 24px 0 8px; }
.contact-form .field, .roles legend { font-weight: 800; font-size: 15px; margin-top: 10px; }
.contact-form input:not([type="radio"]), .contact-form textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--card); border: var(--edge); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; min-height: 48px; width: 100%; }
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form select { font: inherit; font-size: 16px; color: var(--ink); background: var(--card); border: var(--edge); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; min-height: 48px; width: 100%; }
.contact-form select:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.answer { margin: 8px 0 4px; padding: 12px 14px; background: var(--note); border: var(--edge); border-radius: 12px; font-size: 15px; }
.answer a { font-weight: 800; }
.answer p, .answer ul { margin: 0 0 8px; }
.answer ul { padding-left: 20px; }
.answer li { margin-bottom: 6px; }
.answer > :last-child, .answer li:last-child { margin-bottom: 0; }
.contact-form input:focus-visible, .contact-form textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.roles { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.roles legend { padding: 0; margin-bottom: 8px; }
.roles label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; background: var(--card); border: var(--edge); border-radius: 12px; box-shadow: var(--shadow); font-weight: 700; cursor: pointer; }
.roles label:has(input:checked) { background: var(--ink); color: var(--on-ink); }
.roles input { accent-color: var(--ink); width: 18px; height: 18px; margin: 0; }
.contact-form .hint { margin: 0; font-size: 13px; color: var(--muted); }
.extra { display: flex; flex-direction: column; gap: 6px; }
.extra[hidden], .answer[hidden], .contact-form[hidden], .form-done[hidden], .form-error[hidden] { display: none; }
.hp { display: none; } /* honeypot: people never see it; bots that fill it are dropped by Netlify */
/* A note under a field that is missing or wrong (the page checks the form itself) */
.field-note { margin: 0; padding: 6px 10px; background: var(--note); border: var(--edge); border-radius: 10px; font-size: 14px; font-weight: 700; }
.field-note[hidden] { display: none; }
/* A field with a problem gets a thicker dashed border (the solid 3px outline is kept for focus only,
   so a keyboard user can still tell which field they are on) */
.contact-form [aria-invalid="true"]:not([type="radio"]) { border: 2px dashed var(--ink); }
.form-error { margin: 8px 0 0; padding: 10px 12px; background: var(--note); border: var(--edge); border-radius: 12px; font-weight: 700; }
.contact-form .send { align-self: flex-start; margin-top: 14px; cursor: pointer; font: inherit; font-weight: 800; }
.contact-form .send:disabled { opacity: .6; cursor: progress; }
.form-done { margin: 24px 0 8px; padding: 18px; background: #dcefe2; border: var(--edge); border-radius: 12px; box-shadow: var(--shadow); font-weight: 700; }
.form-done:focus { outline: none; }
.not-found .links { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }

/* Footer */
.site-foot { background: var(--ink); color: var(--on-ink-muted); font-size: 12px; padding-block: 22px 32px; }
.site-foot .wrap { display: flex; flex-direction: column; gap: 6px; }
.site-foot b { color: var(--on-ink); font-family: var(--display); font-weight: 800; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px; margin-left: -10px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--on-ink); font-weight: 700; font-size: 14px; text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.site-foot a:focus-visible { outline-color: var(--on-ink); }

@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .card-open { padding: 14px 10px 10px; }
  .card h3 { font-size: 14px; }
  .site-head { flex-wrap: wrap; }
  .top-links { width: 100%; }
  .top-links a { flex: 1; justify-content: center; padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .b3d, .card, .creator-card, .pill, .cta { transition: none; }
  .card:hover, .format:hover { transform: none; }
}
