:root {
  --ink: #1d1d22;
  --muted: #5a5a63;
  --red: #c8252c;
  --red-dark: #a51d23;
  --blue: #1f4e8c;
  --sky: #e9eff8;
  --cream: #fbf8f2;
  --line: #e6e2d9;
  --white: #fff;
  --radius: 16px;
  --shadow: 0 2px 4px rgba(29, 29, 34, .06), 0 18px 40px rgba(29, 29, 34, .12);
  --script: "Yellowtail", cursive;
  --serif: "Lora", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--white); color: var(--ink); font: 18px/1.7 var(--serif); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 740px; }
p { margin: 0 0 16px; }

/* Flag stripe */
.flag { height: 6px; background: repeating-linear-gradient(90deg, var(--red) 0 40px, var(--white) 40px 52px, var(--blue) 52px 92px, var(--white) 92px 104px); }

h1, h2 { font-family: var(--script); font-weight: 400; line-height: 1.1; margin: 0 0 20px; }
h1 { font-size: clamp(48px, 8vw, 84px); }
h2 { font-size: clamp(40px, 5.5vw, 58px); }
h3 { font: 700 21px/1.35 var(--serif); margin: 0 0 8px; }
.eyebrow { font: 700 13px/1.4 var(--serif); letter-spacing: .16em; text-transform: uppercase; color: var(--blue); margin: 0 0 10px; }
.lede { font-size: 20px; color: var(--muted); }

/* Buttons */
.button {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 16px/1 var(--serif); text-decoration: none;
  padding: 16px 28px; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--white); color: var(--ink); cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.button:hover { transform: translateY(-1px); background: var(--ink); color: var(--white); }
.button.primary { background: var(--red); border-color: var(--red); color: var(--white); }
.button.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.brand { font: 32px/1 var(--script); text-decoration: none; }
.nav { display: flex; align-items: center; gap: 6px 26px; font-size: 16px; }
.nav a { text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--red); }
.nav .button { padding: 11px 20px; font-size: 15px; border-bottom: 2px solid var(--red); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink); }
.nav-toggle span { display: block; width: 24px; height: 2px; background: currentColor; margin: 5px 0; }
@media (max-width: 820px) {
  .brand { font-size: 28px; }
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 76px; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--line); flex-direction: column; align-items: flex-start; padding: 12px 24px 24px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
}

/* Sections */
section { padding: 88px 0; }
[id] { scroll-margin-top: 90px; }
.cream { background: var(--cream); }
.sky { background: var(--sky); }
.center { text-align: center; }
.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }

/* Hero */
.hero { background: linear-gradient(180deg, var(--sky), var(--cream)); padding: 72px 0 88px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.hero .lede { max-width: 480px; margin-bottom: 32px; }
.byline { font-size: 20px; font-style: italic; color: var(--muted); margin: -8px 0 20px; }
@media (max-width: 860px) {
  .hero { padding-top: 48px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero .lede { margin-left: auto; margin-right: auto; }
  .hero .actions { justify-content: center; }
}

/* Book covers */
.book { position: relative; display: block; }
.book img { border-radius: 4px 10px 10px 4px; box-shadow: var(--shadow), inset 0 0 0 1px rgba(0,0,0,.04); background: var(--white); }
.badge { position: absolute; top: -12px; right: -12px; background: var(--red); color: var(--white); font: 700 13px/1 var(--serif); letter-spacing: .12em; text-transform: uppercase; padding: 10px 14px; border-radius: 999px; box-shadow: 0 4px 12px rgba(200, 37, 44, .35); transform: rotate(6deg); }

.shelf { position: relative; height: 440px; max-width: 520px; width: 100%; margin: 0 auto; }
.shelf .book { position: absolute; transition: transform .25s ease; }
.shelf .back { width: 58%; left: 0; top: 96px; transform: rotate(-5deg); }
.shelf .front { width: 44%; right: 2%; top: 0; transform: rotate(3deg); z-index: 1; }
.shelf .book:hover { transform: rotate(0) translateY(-6px); z-index: 2; }
@media (max-width: 520px) { .shelf { height: 300px; } }

/* Home: one full-screen panel per book */
:root { --header-h: 77px; }
.panel { position: relative; }
.book-stage { display: grid; grid-template-columns: minmax(220px, 0.8fr) 1.25fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.book-stage > .book { justify-self: center; }
.book-stage > .book img { max-height: min(64vh, 560px); width: auto; }
.book-info h2 { font-size: clamp(38px, 5vh, 54px); margin-bottom: 6px; }
.book-info .byline { margin: 0 0 14px; }
.book-info > p { max-width: 560px; }
.peek { margin-top: 28px; }
.peek-label { font: 700 13px/1.4 var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--blue); margin: 0 0 12px; }
.peek-label span { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }
.hint-touch { display: none; }
@media (hover: none) { .hint-mouse { display: none; } .hint-touch { display: inline; } }
.book-panel .gallery { grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 640px; }

.author-panel { background: var(--blue); color: var(--white); }
.author-panel blockquote { margin: 0 auto 48px; font: italic 400 clamp(22px, 3vw, 30px)/1.45 var(--serif); }
.author-panel .eyebrow { color: #c9d8ee; }
.author-panel .lede { color: #e3ebf6; }
.author-panel .button { border-color: var(--white); background: transparent; color: var(--white); }
.author-panel .button:hover { background: var(--white); color: var(--ink); }
.author-panel .button.primary { background: var(--red); border-color: var(--red); }

.scroll-cue { display: none; }

/* Section dots (desktop) */
.dots { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 15; display: none; flex-direction: column; gap: 14px; }
.dots a { position: relative; display: block; width: 12px; height: 12px; border-radius: 50%; background: rgba(29, 29, 34, .25); box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); transition: background .2s, transform .2s; }
.dots a[aria-current="true"] { background: var(--red); transform: scale(1.25); }
.dots span { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 13px; background: var(--ink); color: var(--white); padding: 4px 10px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.dots a:hover span, .dots a:focus-visible span { opacity: 1; }

/* Desktop and laptop: each panel fills the window; site.js moves one panel per scroll */
@media (min-width: 900px) and (min-height: 620px) {
  html.snap { scroll-padding-top: var(--header-h); }
  html.snap .panel { min-height: calc(100vh - var(--header-h)); display: flex; align-items: center; padding: 40px 0; }
  html.snap .panel > .wrap { width: 100%; }
  html.snap .dots { display: flex; }
  .scroll-cue { display: grid; place-items: center; position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(29,29,34,.25); text-decoration: none; font-size: 20px; color: var(--muted); animation: nudge 2s ease-in-out infinite; }
}
@media (min-width: 900px) and (max-height: 760px) {
  .book-stage > .book img { max-height: 58vh; }
  .book-info h2 { font-size: 40px; }
  .peek { margin-top: 18px; }
  .book-panel .gallery { max-width: 520px; }
}
@media (min-width: 1400px) and (min-height: 900px) {
  html.snap .panel > .wrap { max-width: 1320px; }
  html.snap .panel > .wrap.narrow { max-width: 860px; }
  .book-stage > .book img { max-height: min(66vh, 720px); }
  .book-info h2 { font-size: 64px; }
  .book-info > p { font-size: 20px; max-width: 620px; }
  .book-panel .gallery { max-width: 780px; gap: 18px; }
  .hero h1 { font-size: 96px; }
  .shelf { max-width: 640px; height: 540px; }
}
@keyframes nudge { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }

/* Panels ease in as they arrive (desktop only; phones show content immediately) */
@media (min-width: 900px) {
  html.js .panel .wrap > * { opacity: 0; transform: translateY(24px); transition: opacity .55s ease, transform .55s ease; }
  html.js .panel .wrap > *:nth-child(2) { transition-delay: .12s; }
  html.js .panel.in-view .wrap > * { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html.js .panel .wrap > * { opacity: 1; transform: none; transition: none; }
  .scroll-cue { animation: none; }
}

/* Phones and tablets: stack and keep it compact */
@media (max-width: 899px) {
  .book-panel { padding: 56px 0; }
  .book-stage { grid-template-columns: 1fr; gap: 28px; text-align: center; }
  .book-stage > .book { max-width: 220px; }
  .book-info > p { margin-left: auto; margin-right: auto; }
  .book-info .actions { justify-content: center; }
  .book-panel .gallery { margin: 0 auto; }
  .author-panel { padding: 72px 0; }
}
@media (max-width: 520px) { .book-panel .gallery { grid-template-columns: repeat(2, 1fr); } }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 860px) { .gallery { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (max-width: 520px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
.gallery button { padding: 0; border: 0; background: var(--white); border-radius: 12px; overflow: hidden; cursor: zoom-in; box-shadow: 0 1px 3px rgba(0,0,0,.08); transition: transform .2s ease, box-shadow .2s ease; }
.gallery button:hover { transform: translateY(-4px) rotate(-.5deg); box-shadow: var(--shadow); }
.gallery img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.gallery.pages img { aspect-ratio: 3 / 4; object-fit: contain; padding: 10px; background: var(--white); }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh; overflow: hidden; }
.lightbox::backdrop { background: rgba(15, 18, 28, .88); }
.lightbox img { max-width: 92vw; max-height: 80vh; width: auto; margin: 0 auto; border-radius: 10px; }
.lightbox .controls { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 14px; color: var(--white); font-size: 15px; }
.lightbox .controls button { font: 700 15px var(--serif); padding: 10px 20px; border: 0; border-radius: 999px; background: var(--white); cursor: pointer; }

/* Quote band */
.quote-band { background: var(--blue); color: var(--white); text-align: center; padding: 72px 0; }
.quote-band blockquote { margin: 0 auto 18px; max-width: 820px; font: italic 400 clamp(22px, 3vw, 30px)/1.45 var(--serif); }
.quote-band cite { font-style: normal; font-size: 16px; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }

/* About */
.prose p { margin-bottom: 18px; }
.prose .drop::first-letter { float: left; font: 400 72px/0.85 var(--script); color: var(--red); padding: 8px 10px 0 0; }
.author { display: grid; grid-template-columns: 250px minmax(0, 700px); gap: 56px; align-items: start; justify-content: center; }
.author aside { position: sticky; top: 110px; }
.author aside .card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; font-size: 16px; }
.author aside h3 { font: 34px/1.1 var(--script); font-weight: 400; margin-bottom: 12px; }
.author aside ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; overflow-wrap: anywhere; }
.author aside li span { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 760px) { .author { grid-template-columns: 1fr; gap: 28px; } .author aside { position: static; } }

/* Contact */
.contact-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow); }
.contact-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 18px; }
.contact-list li { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding-top: 18px; border-top: 1px solid var(--line); }
.contact-list span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
@media (max-width: 520px) { .contact-card { padding: 28px 22px; } .contact-list li { grid-template-columns: 1fr; gap: 2px; } }

/* CTA band */
.cta { text-align: center; }
.cta .actions { justify-content: center; }

/* Footer */
.site-footer { background: var(--ink); color: #c9c9d1; font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding-top: 40px; padding-bottom: 40px; }
.site-footer .brand { color: var(--white); font-size: 30px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: #f1f1f4; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.copyright { border-top: 1px solid #33333b; padding: 18px 24px; text-align: center; font-size: 13px; color: #8d8d96; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* Contact: tap-to-call */
.call-list { display: flex; flex-wrap: wrap; gap: 10px; }
.call { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; padding: 10px 16px; border: 2px solid var(--line); border-radius: 999px; }
.call::before { content: "\260E"; color: var(--red); }
.call:hover { border-color: var(--ink); }

/* Sticky buy bar (phones only, shown while a book is on screen) */
.buy-bar { display: none; }

/* ---------- Phones and small tablets ---------- */
@media (max-width: 899px) {
  html { -webkit-tap-highlight-color: transparent; }
  body { font-size: 17px; }
  .wrap { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
  .button { padding: 15px 22px; touch-action: manipulation; }

  /* Header and menu sheet */
  .site-header .wrap { min-height: 64px; }
  .brand { font-size: 27px; }
  .nav-toggle { width: 44px; height: 44px; margin-right: -8px; display: grid; place-content: center; gap: 6px; }
  .nav-toggle span { margin: 0; transition: transform .2s ease, opacity .2s ease; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .nav { top: 64px; padding: 4px 20px 24px; gap: 0; height: calc(100dvh - 64px); align-items: stretch; overflow-y: auto; box-shadow: none; }
  .nav a:not(.button) { font-size: 21px; padding: 16px 2px; border-bottom: 1px solid var(--line); }
  .nav a[aria-current="page"] { color: var(--red); border-bottom-color: var(--line); }
  .nav .button { margin-top: 24px; justify-content: center; padding: 17px; font-size: 17px; }
  html.menu-open { overflow: hidden; }

  /* Hero: everything above the fold */
  .hero { padding: 24px 0 40px; }
  .hero .wrap { gap: 18px; }
  .shelf { height: 262px; max-width: 340px; }
  .shelf .back { top: 70px; }
  .badge { font-size: 11px; padding: 8px 11px; top: -10px; right: -8px; }
  .hero h1 { font-size: clamp(38px, 11vw, 46px); margin-bottom: 12px; }
  .hero .lede { font-size: 17px; margin-bottom: 22px; }
  .hero .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero .actions .button { justify-content: center; padding: 15px 10px; font-size: 15px; }

  /* Book sections: compact header (cover beside title), then blurb, buy, swipeable comics */
  .book-panel { padding: 40px 0 44px; }
  .book-stage { display: grid; grid-template-columns: 112px 1fr; grid-template-areas: "cover eyebrow" "cover title" "cover byline" "blurb blurb" "buy buy" "peek peek"; column-gap: 18px; row-gap: 0; text-align: left; align-items: end; }
  .book-stage > .book { grid-area: cover; max-width: none; width: 112px; align-self: center; }
  .book-stage > .book img { max-height: none; width: 100%; }
  .book-stage .badge { top: -8px; right: -10px; }
  .book-info { display: contents; }
  .book-info > .eyebrow { grid-area: eyebrow; font-size: 11px; margin: 0 0 4px; }
  .book-info h2 { grid-area: title; font-size: 34px; line-height: 1.05; margin: 0 0 4px; }
  .book-info .byline { grid-area: byline; font-size: 16px; margin: 0; align-self: start; }
  .book-info > p:not(.eyebrow):not(.byline) { grid-area: blurb; margin: 22px 0 18px; max-width: none; }
  .book-info .actions { grid-area: buy; }
  .book-info .actions .button { width: 100%; justify-content: center; }
  .book-info .peek { grid-area: peek; margin-top: 28px; min-width: 0; }

  .book-panel .gallery {
    display: flex; gap: 12px; max-width: none; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding: 0 20px; scrollbar-width: none;
    margin: 0 -20px; padding: 4px 20px 12px;
  }
  .book-panel .gallery::-webkit-scrollbar { display: none; }
  .book-panel .gallery button { flex: 0 0 56%; scroll-snap-align: start; }
  .book-panel .gallery button:hover { transform: none; }
  .book-panel .gallery:not(.pages) button { flex-basis: 62%; }

  /* Author */
  .author-panel { padding: 56px 0 64px; }
  .author-panel blockquote { font-size: 20px; margin-bottom: 36px; }
  .author-panel .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .author-panel .actions .button { justify-content: center; }

  /* Other pages */
  section { padding: 56px 0; }
  .prose, .prose p { text-align: left; }
  .contact-card { box-shadow: none; text-align: left; padding: 28px 22px; }
  .contact-card h1 { text-align: left; }
  .call-list { flex-direction: column; }
  .call { justify-content: center; padding: 14px 16px; font-size: 18px; }
  .cta .actions { display: grid; gap: 10px; justify-content: stretch; }
  .cta .actions .button { justify-content: center; }

  /* Footer */
  .site-footer .wrap { flex-direction: column; text-align: center; gap: 16px; padding-top: 32px; padding-bottom: 28px; }
  .site-footer nav { flex-direction: column; gap: 4px; }
  .site-footer nav a { padding: 8px; }
  .copyright { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }

  /* Buy bar */
  .buy-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 18;
    padding: 10px 10px 10px 18px; border-radius: 999px; background: rgba(29, 29, 34, .94); color: var(--white);
    box-shadow: 0 10px 30px rgba(0,0,0,.25); backdrop-filter: blur(8px);
    transform: translateY(140%); transition: transform .3s ease;
  }
  .buy-bar.show { transform: none; }
  .buy-bar-title { font: 19px/1.1 var(--script); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .buy-bar .button { padding: 12px 18px; font-size: 15px; flex-shrink: 0; }

  /* Lightbox: full width, big controls, swipe to change */
  .lightbox { max-width: 100vw; max-height: 100dvh; width: 100vw; }
  .lightbox img { max-width: calc(100vw - 24px); max-height: calc(100dvh - 120px); border-radius: 6px; }
  .lightbox .controls { gap: 8px; margin-top: 16px; }
  .lightbox .controls button { min-height: 46px; padding: 0 18px; }
}
@media (max-width: 360px) {
  .book-stage { grid-template-columns: 96px 1fr; }
  .book-stage > .book { width: 96px; }
  .book-info h2 { font-size: 29px; }
  .hero .actions .button { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .buy-bar { transition: none; } }
