/* Kris Herbert Books - white page, near-black ink, one pop at a time. See layer-1-context/clients/kris-herbert-books/brand.md */
:root {
  --paper: #ffffff;
  --ink: #15141a;
  --muted: #5b5960;
  --line: #e7e5e2;
  --blue: #1b4de0;
  --coral: #f0532d;
  --gold: #f2a71b;
  --coral-deep: #cf3d18; /* button coral, dark enough for white text */
  --dot-red: #e15f5c; --dot-pink: #f3b9ab; --dot-blush: #f9dcd2; --dot-grey: #b3b2b8; --dot-clay: #b65a48;
  --hand: "Caveat", "Bradley Hand", "Comic Sans MS", cursive;
  --serif: "Big Caslon", "Libre Caslon Text", "Iowan Old Style", Georgia, serif;
  --sans: "Avenir Next", "Avenir", "Segoe UI", system-ui, -apple-system, sans-serif;
  --wrap: 1100px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); font-synthesis: none; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--line); }
.muted { color: var(--muted); }
.pop { color: var(--coral); }

/* header */
.site-head { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; text-decoration: none; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { text-decoration: none; font-size: .95rem; }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.cart-btn { background: none; border: 1px solid var(--ink); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.cart-btn b { display: inline-block; min-width: 1.2em; }
.menu-btn { display: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 6px; }
@media (max-width: 720px) {
  .menu-btn { display: block; }
  .nav { position: absolute; top: 64px; left: 0; right: 0; background: var(--paper); flex-direction: column; align-items: flex-start; gap: 0; border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 14px 20px; width: 100%; border-top: 1px solid var(--line); }
}

/* buttons */
.btn { display: inline-block; background: var(--coral-deep); color: #fff; border: 0; border-radius: 999px; padding: 13px 24px; font: 600 1rem var(--sans); text-decoration: none; cursor: pointer; transition: transform .15s; }
.btn:hover { animation: wobble .5s ease; }
.btn:active { transform: translateY(2px); }
@keyframes wobble { 25% { transform: rotate(-3deg) scale(1.05); } 50% { transform: rotate(2deg) scale(1.05); } 75% { transform: rotate(-1deg) scale(1.02); } }
.btn.ghost { background: none; color: var(--ink); border: 1.5px solid var(--ink); }
.btn[disabled] { opacity: .5; cursor: wait; }

/* hero */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
/* Portrait photo cropped to a circle, centred on Kris's face */
.hero img { width: 100%; max-width: 460px; aspect-ratio: 1; object-fit: cover; object-position: 50% 22%; border-radius: 50%; justify-self: center; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; } .hero img { max-width: 420px; } }

/* praise */
.praise { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.praise blockquote { margin: 0; font-family: var(--serif); font-size: 1.3rem; line-height: 1.4; }
.praise cite { display: block; margin-top: 10px; font: .95rem var(--sans); color: var(--muted); font-style: normal; }
.awards { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: .95rem; }
.awards li::before { content: "★ "; color: var(--gold); }
@media (max-width: 700px) { .praise { grid-template-columns: 1fr; } }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 32px 24px; }
.card { text-decoration: none; display: block; }
.card .thumb { aspect-ratio: 1; overflow: hidden; background: #f6f5f3; border-radius: 4px; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .thumb img { transform: scale(1.03); }
.card h3 { font-size: 1.1rem; margin: 12px 0 4px; }
.price { font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.chip { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .9rem; cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* product page */
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.gallery .main { aspect-ratio: 1; background: #f6f5f3; border-radius: 4px; overflow: hidden; }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.thumbs button { width: 64px; height: 64px; padding: 0; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; cursor: pointer; background: none; }
.thumbs button.on { border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.buy { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; margin: 20px 0; }
.buy label { display: block; font-size: .9rem; margin-bottom: 6px; }
.amount { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.amount input { width: 120px; padding: 10px; font: inherit; border: 1px solid var(--muted); border-radius: 6px; }
.video { aspect-ratio: 16/9; margin-top: 28px; }
.video iframe { width: 100%; height: 100%; border: 0; border-radius: 4px; }
@media (max-width: 800px) { .product { grid-template-columns: 1fr; gap: 24px; } }

/* notes */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 32px; }
.post-card { text-decoration: none; }
.post-card img { aspect-ratio: 4/3; object-fit: cover; border-radius: 4px; margin-bottom: 12px; }
.meta { font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.article { max-width: 680px; margin: 0 auto; }
.article img { margin: 0 0 28px; border-radius: 4px; }
.article p, .article li { font-size: 1.08rem; }

/* forms */
.form { display: grid; gap: 14px; max-width: 560px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form input, .form textarea { width: 100%; padding: 12px; font: inherit; border: 1px solid var(--muted); border-radius: 6px; }
.form textarea { min-height: 140px; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }

/* newsletter */
.signup { display: flex; gap: 8px; flex-wrap: wrap; max-width: 440px; }
.signup .note { flex-basis: 100%; margin: 4px 0 0; }
.signup .note .btn { margin-top: 8px; }
.site-foot .cols > * { min-width: 0; }
.signup input[type=email] { min-width: 0; flex: 1 1 200px; padding: 12px; font: inherit; border: 1px solid var(--muted); border-radius: 6px; }

/* free activity book */
.freebie { display: grid; grid-template-columns: .8fr 1.2fr; gap: 48px; align-items: center; }
.freebie-pics { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 12px; }
.freebie-pics img { border-radius: 4px; background: #fff; box-shadow: 0 6px 24px rgba(21,20,26,.14); transition: transform .3s; position: relative; }
.freebie-pics img:nth-child(1) { transform: rotate(-4deg); }
.freebie-pics img:nth-child(2) { transform: rotate(3deg) translateY(10px); }
.freebie-pics img:nth-child(3) { transform: rotate(2deg) translateY(-4px); }
.freebie-pics img:nth-child(4) { transform: rotate(-3deg) translateY(8px); }
.freebie-pics img:hover { transform: rotate(0) scale(1.08); z-index: 2; }
.freebie ul { padding-left: 1.1em; margin: 0 0 20px; }
@media (max-width: 800px) { .freebie { grid-template-columns: 1fr; gap: 28px; } .freebie-pics { max-width: 420px; } }

/* reviews: full-width band, one quote at a time, cross-fade. All quotes share one grid cell so the band never jumps in height. */
.quotes { padding: 80px 0 64px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.quotes-label { font: 600 .8rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 32px; }
.quote-stage { display: grid; max-width: 900px; margin: 0 auto; }
.quote { grid-area: 1 / 1; margin: 0; opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility 0s .9s; display: flex; flex-direction: column; justify-content: center; }
.quote.on { opacity: 1; visibility: visible; transition: opacity .9s ease; }
.quote blockquote { margin: 0 0 24px; font: 500 clamp(1.5rem, 3.6vw, 2.6rem)/1.3 var(--serif); letter-spacing: -.005em; }
.quote blockquote::before { content: "“"; display: block; color: var(--coral); font-size: 2.2em; line-height: .6; margin-bottom: 14px; }
.quote figcaption { color: var(--muted); font-size: .95rem; }
.quote figcaption a { color: inherit; }
.stars { color: var(--gold); letter-spacing: .2em; margin-bottom: 14px; }
.quote-dots { display: flex; justify-content: center; gap: 12px; margin: 36px 0 28px; }
.quote-dots button { width: 12px; height: 12px; padding: 0; border-radius: 50%; border: 1.5px solid var(--ink); background: none; cursor: pointer; transition: background .3s, transform .3s; }
.quote-dots button[aria-current] { background: var(--ink); transform: scale(1.25); }
.quotes-foot { max-width: 680px; margin: 0 auto; font-size: .9rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .quote, .quote.on { transition: none; } }

/* footer */
.site-foot { background: #f6f5f3; padding: 48px 0 36px; margin-top: 48px; }
.site-foot .cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }
.site-foot a { text-underline-offset: 3px; }
.social { display: flex; gap: 18px; margin-top: 10px; }
.legal { margin-top: 32px; font-size: .85rem; color: var(--muted); }
@media (max-width: 700px) { .site-foot .cols { grid-template-columns: 1fr; } }

/* cart drawer */
.scrim { position: fixed; inset: 0; background: rgba(21,20,26,.4); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 100%); background: var(--paper); z-index: 50; transform: translateX(100%); transition: transform .25s; display: flex; flex-direction: column; }
.cart-open .scrim { opacity: 1; pointer-events: auto; }
.cart-open .drawer { transform: none; }
.drawer header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer header h2 { font-size: 1.4rem; margin: 0; }
.drawer .x { background: none; border: 0; font-size: 1.6rem; cursor: pointer; line-height: 1; }
.lines { flex: 1; overflow-y: auto; padding: 8px 20px; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.line img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; }
.line .name { font-weight: 600; font-size: .95rem; line-height: 1.3; }
.qty { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .9rem; }
.qty button { width: 28px; height: 28px; border: 1px solid var(--line); background: none; border-radius: 4px; cursor: pointer; font: inherit; }
.remove { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: .85rem; padding: 0; margin-top: 6px; }
.drawer footer { padding: 18px 20px; border-top: 1px solid var(--line); }
.total { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 12px; }
.drawer footer .btn { width: 100%; }
.note { font-size: .85rem; color: var(--muted); margin: 10px 0 0; }
.test-banner { background: var(--gold); color: var(--ink); text-align: center; font-size: .85rem; padding: 6px 12px; }
.error { color: #b3261e; font-size: .9rem; }

/* ---- fun layer (29 Oct 2026) ---- */

/* squiggly underline under section headings */
.section h2::after { content: ""; display: block; width: 110px; height: 10px; margin-top: 10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 110 10'%3E%3Cpath d='M2 6 Q 9 1 16 6 T 30 6 T 44 6 T 58 6 T 72 6 T 86 6 T 100 6 T 108 5' fill='none' stroke='%23e15f5c' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat; }
.drawer h2::after, .quotes-label::after { content: none; }

/* dots from the Spot the Dot cover, sprinkled round the edges of [data-dots] areas by site.js */
[data-dots] { position: relative; isolation: isolate; overflow: hidden; }
.dot { position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; animation: bob 7s ease-in-out infinite alternate; }
.dot.spots { background-image: radial-gradient(circle at 30% 35%, rgba(255,255,255,.55) 0 12%, transparent 13%), radial-gradient(circle at 68% 62%, rgba(255,255,255,.55) 0 15%, transparent 16%), radial-gradient(circle at 40% 75%, rgba(255,255,255,.45) 0 8%, transparent 9%); }
@keyframes bob { to { transform: translateY(-14px) rotate(8deg); } }

/* "it's free!" scribble pointing at the activity book button */
.scribble { display: flex; align-items: flex-end; gap: 2px; margin: 0 0 4px 230px; font: 700 1.5rem/1 var(--hand); color: var(--dot-red); transform: rotate(-4deg); width: max-content; }
.scribble svg { width: 46px; height: 40px; margin-bottom: -18px; }
@media (max-width: 480px) { .scribble { margin-left: 150px; } }

/* the smiling dot peeking in at the side of the activity book section */
#activity-book { position: relative; overflow: hidden; }
.peeker { position: absolute; top: 18px; right: -34px; width: 110px; height: 110px; transform: translateX(80px) rotate(-14deg); transition: transform .8s cubic-bezier(.3,1.6,.5,1); }
.peeker.in { transform: translateX(0) rotate(-14deg); }
@media (max-width: 700px) { .peeker { width: 72px; height: 72px; top: 8px; right: -22px; } }

/* kea flying across the home page, once */
.kea-fly { position: fixed; left: 0; top: 30vh; width: clamp(160px, 22vw, 280px); z-index: 30; pointer-events: none; animation: kea-across 5s linear forwards; }
.kea-fly img { animation: kea-flap .45s ease-in-out infinite alternate; transform-origin: 60% 60%; }
@keyframes kea-across { from { transform: translate(-320px, 40px) rotate(4deg); } 50% { transform: translate(50vw, -50px) rotate(-6deg); } to { transform: translate(110vw, -10px) rotate(2deg); } }
@keyframes kea-flap { to { transform: scaleY(.9) translateY(6px); } }

/* 404 */
.lost { text-align: center; padding: 96px 0 72px; }
.lost .roller { width: 120px; height: 120px; margin: 0 auto 28px; animation: roll 3s ease-in-out infinite alternate; }
@keyframes roll { from { transform: translateX(-60px) rotate(-200deg); } to { transform: translateX(60px) rotate(0); } }

@media (prefers-reduced-motion: reduce) {
  .dot, .btn:hover, .lost .roller { animation: none; }
  .peeker { transition: none; }
}

/* Instagram row (home page). Posts picked by hand: swap images in img/ig/ and the links in index.html. */
.insta-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.insta-grid a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 8px; }
.insta-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.insta-grid a:hover img { transform: scale(1.06) rotate(-1deg); }
.insta-follow { display: flex !important; align-items: center; justify-content: center; text-align: center; background: var(--dot-red); color: #fff; text-decoration: none; font: 700 1.35rem/1.15 var(--hand); padding: 10px; border-radius: 50% !important; }
.insta-follow:hover { animation: wobble .5s ease; }
@media (max-width: 800px) {
  /* Phones: 2 x 2 photos, then "Follow @krisherbertwrites" as a full-width pill on one line */
  .insta-grid { grid-template-columns: repeat(2, 1fr); }
  .insta-grid a:nth-child(5) { display: none; }
  .insta-follow { grid-column: 1 / -1; aspect-ratio: auto !important; border-radius: 999px !important; padding: 12px 16px; font-size: clamp(1.05rem, 5.4vw, 1.35rem); white-space: nowrap; }
  .insta-follow br { display: none; }
}

/* small thank-you line under the activity book sign-up */
.credit { font-size: .8rem; color: var(--muted); margin: 14px 0 0; }
.credit a { color: inherit; }

/* very small phones: keep logo, Cart and menu on one row */
@media (max-width: 360px) { .brand { font-size: 1.15rem; } .cart-btn { padding: 5px 10px; } }

/* ---- audio sample (31 Oct 2026) ---- */
.sample { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 8px 14px 8px 8px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); max-width: 380px; }
.sample-play { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--coral-deep); color: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; transition: transform .15s; }
.sample-play:hover { transform: scale(1.08) rotate(-4deg); }
.sample-play:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sample-play svg { width: 20px; height: 20px; fill: currentColor; }
.sample .i-pause, .sample.on .i-play { display: none; }
.sample.on .i-pause { display: inline; }
.sample-body { flex: 1; min-width: 0; }
.sample-label { display: block; font-size: .85rem; font-weight: 600; line-height: 1.3; }
.sample-bar { height: 4px; margin-top: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.sample-bar i { display: block; height: 100%; width: 0; background: var(--coral); transition: width .25s linear; }
.sample-time { flex: none; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-with-sample .sample { margin-top: 10px; padding: 6px 12px 6px 6px; gap: 10px; }
.card-with-sample .sample-play { width: 38px; height: 38px; }
.card-with-sample .sample-label { font-size: .8rem; }
.product .sample { margin: 6px 0 4px; }
