/* bobandotto.com — one page, the books' own palette and type */
:root {
  --paper: #F6EFE3; --paper-2: #EFE6D4; --paper-3: #E8DDC7;
  --ink: #2B2623; --mute: #6B6152; --line: rgba(43, 38, 35, .14);
  --red: #E2543A; --red-d: #C9432B; --moss: #6E8F5E; --moss-d: #587A4A;
  --yellow: #E9B44C; --yellow-d: #D9A23A; --blue: #4E7CA6; --ground: #E3E7CB;
  --night: #39435A; --night-2: #2F3849; --night-ink: #EDE3D4; --night-mute: #B9C0CE;
  --display: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --hand: 'Delius', 'Nunito', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wrap: 1120px; --r: 18px; --shadow: 0 10px 30px rgba(43, 38, 35, .10), 0 2px 6px rgba(43, 38, 35, .06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.6; overflow-x: hidden; }
img, svg { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
section, .book, .book-end, .pick, .free-done { scroll-margin-top: 76px; }
a { color: var(--moss-d); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--red-d); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.08; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
em { font-family: var(--hand); font-style: normal; }
.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }
.center { text-align: center; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: .5rem 1rem; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.eyebrow { font-family: var(--body); font-weight: 700; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin-bottom: 1rem; }
.eyebrow.light { color: var(--night-mute); }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.25rem); max-width: 34em; }
.fine { font-size: .9rem; color: var(--mute); }
.fine.light { color: var(--night-mute); }
.hint { text-align: center; color: var(--mute); font-size: .9rem; margin-top: 1rem; }
.c-bob { color: var(--red); } .c-otto { color: var(--moss); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 48px; padding: .7rem 1.4rem; border-radius: 999px; border: 2px solid var(--ink); background: var(--ink); color: #fff; font: 700 1rem/1.2 var(--body); text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease; }
.btn:hover { background: var(--red); border-color: var(--red); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn em { display: contents; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); }
.btn-ghost-light { background: transparent; color: var(--night-ink); border-color: var(--night-ink); }
.btn-ghost-light:hover { background: var(--night-ink); color: var(--night); border-color: var(--night-ink); }
.btn-yellow { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.btn-yellow:hover { background: var(--yellow-d); border-color: var(--yellow-d); color: var(--ink); }
.btn-sm { min-height: 42px; padding: .5rem 1.05rem; font-size: .95rem; }
.btn-wide { width: 100%; }
.btn-link { background: none; border-color: transparent; color: var(--mute); text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { background: none; border-color: transparent; color: var(--red-d); transform: none; }
.btn[disabled], .btn.is-soon { background: var(--paper-3); border-color: var(--paper-3); color: var(--mute); cursor: default; transform: none; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0 1rem; }
.cta-row.center { justify-content: center; }

/* nav */
.nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 1rem; padding: .55rem 1.25rem; background: rgba(246, 239, 227, .86); backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.45rem; letter-spacing: .01em; text-decoration: none; color: var(--ink); display: inline-flex; gap: .3em; align-items: baseline; line-height: 1; }
.brand .amp { font-size: .9em; }
.nav-links { display: none; gap: 1.4rem; margin-left: auto; margin-right: .5rem; }
.nav-links a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; padding: .35rem 0; border-bottom: 2px solid transparent; }
.nav-links a:hover, .nav-links a.on { border-bottom-color: var(--red); color: var(--ink); }
.nav-links .ext { font-size: .8em; margin-left: .15em; color: var(--mute); }
.nav .btn { margin-left: auto; }
@media (min-width: 900px) { .nav-links { display: flex; } .nav .btn { margin-left: 0; } .nav { padding-inline: 2rem; } }

/* hero */
.hero { padding: clamp(2rem, 6vw, 5rem) 0 0; overflow: hidden; }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.hero-copy { max-width: 40rem; }
.hero-art { margin-inline: -1.25rem; border-radius: 0; }
.hero-art svg { width: 100%; height: auto; display: block; }
@media (min-width: 900px) {
  .hero { padding-bottom: 2rem; }
  .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 3rem; }
  .hero-art { margin-inline: 0; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
}
/* the swing swings — the group's origin is the knot on the branch (445, 300 in the drawing) */
#swing { transform-box: view-box; transform-origin: 445px 300px; animation: swing 2.8s cubic-bezier(.45, 0, .55, 1) infinite alternate; }
@keyframes swing { from { transform: rotate(-7deg); } to { transform: rotate(30deg); } }

/* sections */
section { padding: clamp(3rem, 7vw, 6rem) 0; }
.section-head { max-width: 40rem; margin-bottom: 2rem; }
.section-head p { color: var(--mute); font-size: 1.1rem; }
.why { background: var(--paper-2); }
.two-col { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1.1fr 1fr; gap: 4rem; align-items: start; } }
.prose p.big { font-family: var(--hand); font-size: 1.35rem; line-height: 1.4; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.facts li { display: flex; gap: 1rem; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem; }
.fact-mark { flex: 0 0 52px; height: 52px; border-radius: 14px; background: var(--ground); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.2rem; color: var(--moss-d); }
.fact-mark.fact-bird img { width: 40px; height: auto; }
.facts strong { display: block; font-family: var(--display); font-weight: 800; font-size: 1.05rem; margin-bottom: .1rem; }

/* the reader */
.reader { position: relative; }
.pick { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; max-width: 720px; margin: 0 auto; }
.pick-card { appearance: none; border: 0; background: none; padding: 0; cursor: pointer; display: grid; gap: .75rem; justify-items: center; color: var(--ink); font: inherit; border-radius: 14px; }
.pick-card img { width: 100%; max-width: 250px; border-radius: 8px; box-shadow: var(--shadow); transition: transform .2s ease; }
.pick-card:hover img, .pick-card:focus-visible img { transform: translateY(-4px) rotate(-1deg); }
.pick-label { display: grid; text-align: center; }
.pick-label strong { font-family: var(--display); font-size: 1.15rem; font-weight: 800; }
.pick-label span { color: var(--mute); font-size: .9rem; }
.pick-or { font-family: var(--hand); color: var(--mute); font-size: 1.1rem; }
@media (max-width: 480px) { .pick { gap: .5rem; } .pick-label span { display: none; } }

.book { max-width: 920px; margin: 0 auto; }
.book-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .6rem; }
.book-way { margin: 0; color: var(--mute); font-size: .95rem; }
.book-way b { color: var(--ink); }
.book-count { margin: 0; color: var(--mute); font-size: .9rem; font-variant-numeric: tabular-nums; }
.spread-wrap { position: relative; container-type: inline-size; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); background: var(--paper); transition: transform .5s ease; }
.spread-wrap.flip { animation: turnover .7s ease; }
@keyframes turnover { 0% { transform: perspective(1400px) rotateY(0); } 50% { transform: perspective(1400px) rotateY(90deg) scale(.96); } 100% { transform: perspective(1400px) rotateY(0); } }
.spread-img { width: 100%; height: auto; display: block; }
/* the words sit on the picture, top-left of each page, as in the book */
.lines { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; pointer-events: none; }
.line { position: relative; padding: 5cqw 5cqw 0 5cqw; opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s ease; }
.line.show { opacity: 1; transform: none; }
.line p { margin: 0; font-family: var(--hand); font-size: 3.4cqw; line-height: 1.34; color: var(--ink); max-width: 14em; }
.line .who { display: none; }
.badge { position: absolute; top: 1.4cqw; left: 1.4cqw; width: 3cqw; height: 3cqw; min-width: 18px; min-height: 18px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 .7rem/1 var(--body); display: grid; place-items: center; opacity: .0; transition: opacity .3s; }
.line.show .badge { opacity: .85; }
.line.first .badge { background: var(--red); }
.spread-wrap[data-first="r"] .line.r .badge, .spread-wrap[data-first="l"] .line.l .badge { background: var(--red); }
/* the page read first gets a soft edge */
.spread-wrap::after { content: ''; position: absolute; inset: 0; width: 50%; border: 3px solid var(--red); border-radius: var(--r) 0 0 var(--r); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; }
.spread-wrap[data-first="r"]::after { transform: translateX(100%); border-radius: 0 var(--r) var(--r) 0; }
.spread-wrap.mark::after { opacity: .45; }
/* the spine */
.spread-wrap::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(43, 38, 35, .09); pointer-events: none; }
@media (max-width: 639px) {
  .spread-wrap::before { bottom: auto; height: 0; }
  .line p br { display: none; }
  .lines { position: static; display: grid; grid-template-columns: 1fr; gap: .5rem; padding: .75rem; background: var(--paper); pointer-events: auto; }
  .line { padding: .6rem .8rem .6rem 3rem; border-radius: 12px; background: var(--paper-2); border-left: 4px solid var(--red); }
  .line.r { border-left-color: var(--moss); }
  .line p { font-size: 1.05rem; max-width: none; }
  .line .who { display: block; position: absolute; left: 3rem; top: .15rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
  .line p { padding-top: .6rem; }
  .badge { top: .85rem; left: .8rem; width: 24px; height: 24px; }
  .spread-wrap[data-first="r"] .line.r { order: -1; }
  .spread-wrap::after { display: none; }
}
.book-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.dots { display: flex; gap: .5rem; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: block; }
.dots i.on { background: var(--ink); }
.book-end { max-width: 640px; margin: 0 auto; text-align: center; }
.end-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(1.5rem, 4vw, 2.5rem); animation: pop .35s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.end-kicker { font-family: var(--hand); color: var(--mute); margin-bottom: .25rem; font-size: 1.1rem; }
.end-kicker.light { color: var(--night-mute); }

/* the books */
.books { background: var(--paper-2); }
.book-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
@media (max-width: 699px) {
  /* on a phone the shelf scrolls sideways, one book at a time */
  .book-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 1rem; margin-inline: -1.25rem; padding: .25rem 1.25rem 1rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .book-grid::-webkit-scrollbar { display: none; }
  .book-card { flex: 0 0 min(78vw, 320px); scroll-snap-align: center; }
  .shelf-hint { display: block; }
}
.shelf-hint { display: none; text-align: center; color: var(--mute); font-size: .85rem; margin: -.25rem 0 1rem; }
.book-card { display: grid; gap: .75rem; align-content: start; min-width: 0; }
.flip { position: relative; aspect-ratio: 1; perspective: 1200px; appearance: none; border: 0; background: none; padding: 0; cursor: pointer; width: 100%; border-radius: 12px; }
.flip-inner { position: absolute; inset: 0; transition: transform .6s cubic-bezier(.2, .7, .2, 1); transform-style: preserve-3d; border-radius: 12px; box-shadow: var(--shadow); }
.flip.is-back .flip-inner, .flip:hover .flip-inner { transform: rotateY(180deg); }
.flip img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 12px; backface-visibility: hidden; -webkit-backface-visibility: hidden; object-fit: cover; }
.flip img.back { transform: rotateY(180deg); }
.flip-hint { position: absolute; right: 8px; bottom: 8px; font: 700 .7rem/1 var(--body); letter-spacing: .04em; text-transform: uppercase; background: rgba(43, 38, 35, .75); color: #fff; padding: .35rem .5rem; border-radius: 999px; pointer-events: none; transition: opacity .2s; }
.flip:hover .flip-hint, .flip.is-back .flip-hint { opacity: 0; }
.book-n { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 0; }
.book-card h3 { margin: 0; font-size: 1.25rem; }
.book-hook { font-family: var(--hand); margin: 0; color: var(--ink); }
.book-blurb { margin: 0; font-size: .95rem; color: var(--mute); }
.book-links { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .5rem; margin-top: .25rem; }
.book-links .btn { min-height: 40px; padding: .35rem .4rem; font-size: .82rem; line-height: 1.15; text-align: center; }
.book-es { font-size: .85rem; color: var(--mute); margin: 0; }

/* the cast */
.cast { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); align-items: start; }
@media (max-width: 599px) { .cast { grid-template-columns: 1fr 1fr; gap: .75rem; } .cast-btn { padding: 1rem .75rem .6rem; } .cast-btn img { height: 130px !important; } .cast-card.sparrow .cast-btn img { height: 64px !important; margin: 33px 0; } .cast-name { font-size: 1.15rem; } .cast-tag { font-size: .8rem; } .cast-lines { padding: 0 .75rem 1rem; } .cast-lines li { font-size: .95rem; } }
.cast-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cast-btn { appearance: none; border: 0; background: none; padding: 1.25rem 1.25rem .75rem; width: 100%; cursor: pointer; color: var(--ink); font: inherit; text-align: center; display: grid; justify-items: center; gap: .5rem; }
.cast-btn img { height: 180px; width: auto; transition: transform .25s ease; }
.cast-btn:hover img { transform: translateY(-4px); }
.cast-card.bob .cast-btn img { animation-delay: .2s; }
.cast-name { font-family: var(--display); font-weight: 800; font-size: 1.35rem; line-height: 1; }
.cast-tag { color: var(--mute); font-size: .9rem; }
.cast-more { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--moss-d); }
.cast-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease; }
.cast-card.open .cast-body { grid-template-rows: 1fr; }
.cast-body > div { overflow: hidden; }
.cast-lines { list-style: none; margin: 0; padding: 0 1.25rem 1.25rem; display: grid; gap: .45rem; }
.cast-lines li { font-family: var(--hand); font-size: 1.05rem; line-height: 1.35; padding-left: 1rem; border-left: 3px solid var(--red); }
.cast-card.otto .cast-lines li { border-left-color: var(--moss); }
.cast-card.anna .cast-lines li { border-left-color: #8B6BB5; }
.cast-card.sparrow .cast-lines li { border-left-color: #9C7A55; }
.cast-card.sparrow .cast-btn img { height: 90px; margin: 45px 0; }

/* the free mini book */
.free { background: var(--night); color: var(--night-ink); }
.free a { color: var(--night-ink); }
.free h2, .free h3 { color: #fff; }
.free-grid { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .free-grid { grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; } }
.free-list { padding-left: 1.2rem; color: var(--night-mute); margin: 0; }
.free-list li { margin: .3rem 0; }
.free-form-wrap { background: var(--night-2); border: 1px solid rgba(237, 227, 212, .15); border-radius: var(--r); padding: clamp(1.25rem, 3vw, 2rem); }
.free-form { display: grid; gap: 1rem; }
.zine-preview { display: flex; gap: .75rem; justify-content: center; margin-bottom: .5rem; }
.zine-preview img { width: 34%; max-width: 150px; border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.zine-preview img:first-child { transform: rotate(-4deg); }
.zine-preview img:last-child { transform: rotate(4deg); }
.field { display: grid; gap: .35rem; }
.field span { font-weight: 700; font-size: .9rem; }
.field small { font-weight: 400; color: var(--night-mute); }
.field input { width: 100%; min-height: 50px; padding: .6rem .9rem; border-radius: 12px; border: 2px solid rgba(237, 227, 212, .25); background: rgba(255, 255, 255, .06); color: #fff; font: inherit; font-size: 1.05rem; }
.field input::placeholder { color: rgba(237, 227, 212, .45); }
.field input:focus { outline: none; border-color: var(--yellow); background: rgba(255, 255, 255, .1); }
.field input[aria-invalid="true"] { border-color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { margin: -.25rem 0 0; color: #FFB3A6; font-weight: 700; font-size: .95rem; }
.free-form .fine { margin: 0; }
.free-done h3 { margin-top: 0; }
.dl-row { display: grid; gap: .75rem; margin: 1rem 0 1.5rem; }
.dl-row .btn { width: 100%; }
.fold summary { cursor: pointer; font-weight: 700; padding: .5rem 0; list-style: none; display: flex; align-items: center; gap: .5rem; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::before { content: '›'; display: inline-block; transition: transform .2s; font-size: 1.3rem; line-height: 1; }
.fold[open] summary::before { transform: rotate(90deg); }
.fold-body { display: grid; gap: 1rem; padding-top: .5rem; }
.fold-diagram { width: 100%; max-width: 380px; border-radius: 10px; }
.fold-steps { margin: 0; padding-left: 1.2rem; color: var(--night-mute); font-size: .95rem; display: grid; gap: .4rem; }
@media (min-width: 640px) { .fold-body { grid-template-columns: 1fr 1.2fr; align-items: start; } }

/* grown-ups */
.steps { list-style: none; margin: 0 0 3rem; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); counter-reset: step; }
.steps li { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); padding: 1.5rem; }
.steps h3 { margin: .5rem 0 .35rem; font-size: 1.2rem; }
.steps p { margin: 0; color: var(--mute); }
.step-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--yellow); color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 1.2rem; }
.author { display: grid; gap: 1.5rem; align-items: center; background: var(--ground); border-radius: var(--r); padding: clamp(1.25rem, 3vw, 2.5rem); }
.author img { width: 200px; margin-inline: auto; }
.author h3 { margin-top: 0; }
.author p:last-child { margin-bottom: 0; }
@media (min-width: 760px) { .author { grid-template-columns: 240px 1fr; gap: 2.5rem; } }

/* footer */
.foot { background: var(--night-2); color: var(--night-mute); padding: 2.5rem 0; }
.foot a { color: var(--night-ink); }
.foot-grid { display: grid; gap: .75rem; justify-items: center; text-align: center; }
.foot-logo img { width: 150px; }
.foot p { margin: 0; }
.foot .fine { color: rgba(237, 227, 212, .55); }
