/* ============================================================
   Grizer Children's Books — Master Stylesheet

   Table of Contents
   -----------------
   1.  Theme Tokens
   2.  Base Reset & Typography
   3.  Header & Navigation
   4.  Hero (shared base + subpage variant)
   5.  Buttons (parchment 9-slice)
   6.  Footer
   7.  Books Page
       7a. Books Grid & Cards
       7b. Cart Icon & Panel
   8.  Authors Page
       8a. Authors Grid
       8b. Flip Cards
   9.  Contact Page
   10. Thank You / Receipt Page
   11. Reduced Motion
   12. Responsive (Mobile)
   ============================================================ */


/* ============================================================
   1. Theme Tokens
   ============================================================ */
:root{
  --paper:        #e6d2a4;          /* parchment */
  --paper-deep:   #d7b56c;          /* deeper parchment */
  --paper-light:  #fff6de;          /* cream highlight */
  --ink:          #1a1208;          /* warm dark ink */
  --ink-soft:     #3d2a14;          /* softer ink for body */
  --accent:       #7e5321;          /* wood/border accent */
  --accent-soft:  rgba(126,83,33,.35);
  --shadow:       rgba(0,0,0,.28);
  --shadow-deep:  rgba(0,0,0,.4);

  --maxw:         1200px;

  /* Typography stack */
  --font-display: "IM Fell English", "IM Fell English SC", Georgia, serif;
  --font-body:    'Nunito', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}


/* ============================================================
   2. Base Reset & Typography
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255,255,255,.45), transparent 70%),
    var(--paper);
}

h1, h2, h3{
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: .3px;
  margin: 0 0 .5rem;
  color: var(--ink);
}

a { color: var(--accent); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.hidden { display: none; }


/* ============================================================
   3. Header & Navigation
   ============================================================ */
header { position: relative; z-index: 1000; }

nav {
  display: flex;
  justify-content: center;
  padding: 1rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  margin: 0;
  padding: 0;
}

nav li { position: relative; }

nav a {
  --biw: 18px;
  --slice: 128;

  display: inline-grid;
  place-items: center;
  height: 70px;
  min-width: 160px;
  padding: 0 1rem;

  border: var(--biw) solid transparent;
  border-image-source: url('assets/button.png');
  border-image-slice: var(--slice) fill;
  border-image-width: var(--biw);
  border-image-repeat: stretch;

  background: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255,255,255,.55);

  filter: drop-shadow(0 4px 6px var(--shadow));
  transition: transform .2s ease, filter .2s ease;
}

nav a:hover {
  transform: translateY(-2px) scale(1.02);
  filter: drop-shadow(0 6px 10px var(--shadow));
}

nav a:active { transform: translateY(0) scale(.98); }

/* Mobile burger toggle */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 12px; top: 12px;
  width: 54px; height: 46px;

  border: 14px solid transparent;
  border-image-source: url('assets/button.png');
  border-image-slice: 128 fill;
  border-image-width: 14px;
  border-image-repeat: stretch;

  background: none;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  filter: drop-shadow(0 4px 6px var(--shadow));
  z-index: 1100;
}


/* ============================================================
   4. Hero (shared base + subpage variant)
   ============================================================ */
.hero{
  position: relative;
  min-height: 88vh;
  display: grid;
  place-items: center;
  color: var(--ink);
  overflow: clip;
  background: var(--paper);
  isolation: isolate;
}

.hero__bg{
  position: absolute; inset: 0;
  background: url('assets/hero.png') center/cover no-repeat;
  filter: saturate(.95) contrast(.95);
  z-index: -2;
}

.hero::before{
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.22) 0%,
    rgba(0,0,0,.30) 45%,
    rgba(0,0,0,.36) 100%
  );
  z-index: -1;
}

.hero__content{
  width: min(92vw, var(--maxw));
  padding: clamp(16px, 4vw, 32px);
  text-shadow: 0 1px 0 rgba(255,255,255,.35), 0 2px 6px var(--shadow);
}

.hero__headline{
  display: flex;
  align-items: flex-end;
  gap: clamp(8px, 1.2vw, 16px);
  margin: 0 0 .5rem 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: .5px;
  line-height: .95;
  font-size: clamp(2.25rem, 6.5vw, 4.5rem);
}

.dropcap{
  width: clamp(64px, 10vw, 140px);
  height: auto;
  flex: 0 0 auto;
  display: block;
}

.headline-rest{
  display: inline-block;
  transform: translateY(4%);
}

.hero__tag{
  margin: 0 0 .4rem 0;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255,255,255,.55);
}

.hero__copy{
  max-width: 68ch;
  line-height: 1.6;
  font-size: clamp(1rem, 2.2vw, 1.1rem);
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.hero__copy p { margin: 0 0 .9rem; }
.hero__copy p:last-child { margin-bottom: 0; }

.hero__panel{
  position: relative;
  z-index: 2;
  display: inline-block;
  margin-top: .5rem;
  padding: clamp(14px, 2.8vw, 22px) clamp(18px, 3.4vw, 30px);
  border-radius: 18px;
  background: rgba(215,181,108,.92);
  border: 1px solid rgba(120,84,35,.38);
  box-shadow:
    0 10px 18px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -2px 6px rgba(0,0,0,.12);
  backdrop-filter: blur(.8px);
}

.hero__cta{
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-top: 1.25rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
}
.hero__cta img{
  width: clamp(180px, 32vw, 260px);
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 10px var(--shadow));
  transition: transform .25s ease, filter .25s ease;
}
.hero__cta span{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.hero__cta:hover img{ transform: translateY(-2px) scale(1.02); }
.hero__cta:active img{ transform: translateY(0) scale(.99); }

.hero__gabe{
  position: absolute;
  right: clamp(3vw, 40px, 80px);
  bottom: 0;
  width: clamp(180px, 26vw, 420px);
  height: auto;
  translate: 0 40px;
  opacity: 0;
  animation: gabeIn .9s .35s ease-out forwards;
  filter: drop-shadow(0 10px 16px var(--shadow));
}
@keyframes gabeIn{
  to { translate: 0 0; opacity: 1; }
}

/* Subpage hero variant — shorter, no photo background */
.hero.hero--sub{
  min-height: 0;
  height: 32vh;
  display: grid; place-items: center; text-align: center;
  background:
    radial-gradient(60% 80% at 50% 30%, rgba(255,255,255,.45), rgba(255,255,255,.15) 60%, transparent 100%),
    var(--paper-deep);
  border-bottom: 1px solid var(--accent-soft);
  box-shadow: 0 10px 20px var(--shadow);
}
.hero.hero--sub::before { display: none; }
.hero--sub .hero-text h1{
  font-size: clamp(2.25rem, 5.5vw, 3.25rem);
  text-shadow: 0 1px 0 rgba(255,255,255,.55), 0 2px 6px var(--shadow);
}


/* ============================================================
   5. Buttons (parchment 9-slice)
   ============================================================ */
.btn,
a.button,
.add-to-cart,
#checkout-btn,
button.btn-parchment{
  --biw: 28px;
  --slice: 140;

  position: relative;
  display: inline-grid;
  place-items: center;

  padding: 0.7rem 1.4rem;
  min-height: 56px;
  border: var(--biw) solid transparent;
  border-image-source: url('assets/button.png');
  border-image-slice: var(--slice) fill;
  border-image-width: var(--biw);
  border-image-repeat: stretch;

  background: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(255,255,255,.55);
  filter: drop-shadow(0 5px 8px var(--shadow));
  transition: transform .2s ease, filter .2s ease;
}

.btn:hover, a.button:hover, .add-to-cart:hover,
#checkout-btn:hover, button.btn-parchment:hover{
  transform: translateY(-2px) scale(1.02);
  filter: drop-shadow(0 7px 11px var(--shadow));
}

.btn:active, a.button:active, .add-to-cart:active,
#checkout-btn:active, button.btn-parchment:active{
  transform: translateY(0) scale(.98);
}


/* ============================================================
   6. Footer
   ============================================================ */
footer{
  margin-top: 3rem;
  padding: 1.5rem 1rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink-soft);
  background:
    linear-gradient(180deg, transparent, rgba(126,83,33,.08)),
    var(--paper);
  border-top: 1px solid var(--accent-soft);
}


/* ============================================================
   7. Books Page
   ============================================================ */

/* 7a. Books Grid & Cards */
.books-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
  padding: clamp(20px, 3vw, 36px);
  margin: clamp(20px, 3vw, 32px) auto;
  max-width: var(--maxw);
  background:
    radial-gradient(50% 100% at 50% 0%, rgba(255,255,255,.35), rgba(255,255,255,0) 70%),
    var(--paper-light);
  border: 1px solid rgba(126,83,33,.25);
  border-radius: 18px;
  box-shadow: 0 10px 20px var(--shadow), inset 0 1px 0 rgba(255,255,255,.6);
}

.book-card{
  background:
    linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.92)),
    var(--paper);
  border: 1px solid var(--accent-soft);
  border-radius: 14px;
  padding: 1.4rem 1.1rem 1.5rem;
  text-align: center;
  box-shadow:
    0 6px 14px var(--shadow),
    inset 0 1px 0 rgba(255,255,255,.6);
  transition: transform .3s ease, box-shadow .3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
}

.book-card:hover{
  transform: translateY(-6px) rotate(-.4deg);
  box-shadow: 0 14px 24px var(--shadow-deep);
}

.book-card img{
  width: 100%;
  max-width: 200px;
  height: auto;
  border-radius: 6px;
  border: 2px solid rgba(126,83,33,.45);
  box-shadow:
    0 8px 16px var(--shadow),
    0 2px 4px rgba(0,0,0,.15);
  margin-bottom: .4rem;
  transition: transform .3s ease;
}

.book-card:hover img{ transform: scale(1.03); }

.book-card h2{
  font-size: 1.5rem;
  margin: .2rem 0 .1rem;
  color: var(--ink);
}

.book-card p{
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}

.book-card p.price{
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--accent);
  margin: .2rem 0 .6rem;
}

.book-card .add-to-cart{
  margin-top: auto;
}

/* 7b. Cart Icon & Panel */
#cart-icon{
  position: fixed;
  top: 1rem; right: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-width: 64px;
  height: 56px;
  padding: 0 1rem;

  border: 18px solid transparent;
  border-image-source: url('assets/button.png');
  border-image-slice: 128 fill;
  border-image-width: 18px;
  border-image-repeat: stretch;

  background: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  filter: drop-shadow(0 4px 8px var(--shadow));
  transition: transform .2s ease, filter .2s ease;
  z-index: 1000;
  user-select: none;
}

#cart-icon:hover{
  transform: translateY(-2px) scale(1.04);
  filter: drop-shadow(0 6px 10px var(--shadow));
}

#cart-icon .cart-glyph {
  font-size: 1.2rem;
}

#cart-panel{
  position: fixed;
  top: 0; right: 0;
  width: min(92vw, 360px);
  height: 100%;
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.96)),
    var(--paper);
  border-left: 1px solid var(--accent-soft);
  box-shadow: -8px 0 20px rgba(0,0,0,.28);
  padding: 1.25rem;
  transform: translateX(100%);
  transition: transform .3s ease;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
#cart-panel.visible{ transform: translateX(0); }

#cart-panel h3{
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: .5px;
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: .5rem;
}

#cart-items{
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

#cart-items li{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  padding: .65rem 0;
  border-bottom: 1px dashed rgba(126,83,33,.25);
  font-size: 1rem;
  color: var(--ink);
}
#cart-items li:last-child { border-bottom: none; }

#cart-items .item-info { flex: 1; }
#cart-items .item-name { display: block; font-weight: 600; }
#cart-items .item-line { display: block; font-size: .9rem; color: var(--ink-soft); }
#cart-items .item-total { display: block; font-weight: 700; margin-top: .1rem; }

.remove-item {
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: .85rem;
  color: var(--accent);
  text-decoration: underline;
  padding: .25rem .15rem;
}
.remove-item:hover { color: var(--ink); }

.cart-total{
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--ink);
  text-align: right;
  padding-top: .5rem;
  border-top: 1px solid var(--accent-soft);
}

#checkout-btn{ width: 100%; }

.cart-empty{
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
  padding: 1.5rem 0;
}


/* ============================================================
   8. Authors Page
   ============================================================ */

/* 8a. Authors Grid */
.authors-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
  padding: clamp(20px, 3vw, 36px);
  margin: clamp(20px, 3vw, 32px) auto;
  max-width: var(--maxw);
  background:
    radial-gradient(50% 100% at 50% 0%, rgba(255,255,255,.35), rgba(255,255,255,0) 70%),
    var(--paper-light);
  border: 1px solid rgba(126,83,33,.25);
  border-radius: 18px;
  box-shadow: 0 10px 20px var(--shadow), inset 0 1px 0 rgba(255,255,255,.6);
}

/* 8b. Flip Cards */
.author-card{
  perspective: 1100px;
  width: 100%;
  max-width: 320px;
  height: 440px;
  margin: auto;
  position: relative;
  transition: max-width .4s ease;
  isolation: isolate;
  cursor: pointer;
}

.card-inner{
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .8s ease;
}

.author-card.flipped .card-inner{ transform: rotateY(180deg); }

@media (min-width: 760px){
  .author-card.flipped{ max-width: 620px; }
}

.card-front, .card-back{
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border: 1px solid var(--accent-soft);
  border-radius: 14px;
  box-shadow: 0 6px 14px var(--shadow), inset 0 1px 0 rgba(255,255,255,.6);
  overflow: hidden;
}

.card-front{
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.25rem; text-align: center; color: #fff;
  background-size: cover; background-position: center top;
  background-repeat: no-repeat;
}

.card-front::before{
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 45%;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, rgba(0,0,0,0) 100%);
  z-index: 1;
}

.card-front h2{
  position: relative; z-index: 2;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.85rem;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.85);
}

.card-front .flip-hint{
  position: relative; z-index: 2;
  display: block;
  margin-top: .35rem;
  font-family: var(--font-body);
  font-size: .85rem;
  font-style: italic;
  color: rgba(255,255,255,.85);
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
}

.card-back{
  transform: rotateY(180deg);
  padding: 1.4rem 1.5rem;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.92)),
    var(--paper);
  display: flex;
  flex-direction: column;
}

.card-back h2{
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
  margin: 0 0 .6rem;
  flex: 0 0 auto;
}

.card-back .bio{
  flex: 1;
  overflow-y: auto;
  padding-right: 6px;
}

.card-back p{
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
  max-width: 56ch;
  text-align: left;
  hyphens: auto;
}

.card-back .flip-back{
  flex: 0 0 auto;
  margin-top: .75rem;
  font-family: var(--font-body);
  font-size: .85rem;
  font-style: italic;
  color: var(--accent);
}

/* Author-specific portraits — add one rule per author */
.author-rebecca .card-front{ background-image: url('assets/rebecca.png'); }
/* .author-john .card-front{ background-image: url('assets/john.jpg'); } */


/* ============================================================
   9. Contact Page
   ============================================================ */
.contact-section {
  background:
    radial-gradient(50% 100% at 50% 0%, rgba(255,255,255,.35), rgba(255,255,255,0) 70%),
    var(--paper-light);
  border: 1px solid rgba(126,83,33,.25);
  border-radius: 18px;
  box-shadow: 0 10px 20px var(--shadow), inset 0 1px 0 rgba(255,255,255,.6);
  padding: clamp(20px, 3.5vw, 38px);
  margin: clamp(20px, 4vw, 40px) auto;
  max-width: 720px;
}

.contact-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: .5rem;
  text-align: center;
}

.contact-section > p {
  text-align: center;
  margin: 0 0 2rem;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

label {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: -.4rem;
}

input, textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: .85rem 1rem;
  color: var(--ink);
  border: 2px solid var(--accent-soft);
  border-radius: .6rem;
  background-color: rgba(255,255,255,.9);
  resize: vertical;
  box-shadow: inset 0 2px 4px rgba(126,83,33,.08);
  transition: border-color .2s ease, box-shadow .2s ease;
}

input:focus, textarea:focus{
  outline: none;
  border-color: var(--accent);
  box-shadow:
    inset 0 2px 4px rgba(126,83,33,.08),
    0 0 0 3px rgba(126,83,33,.18);
}

form button[type="submit"]{
  align-self: center;
  margin-top: .5rem;
}

#form-response {
  margin-top: 1.5rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ink);
  background-color: rgba(255,255,255,.85);
  border: 2px solid var(--paper-deep);
  padding: 1rem;
  border-radius: .75rem;
}


/* ============================================================
   10. Thank You / Receipt Page
   ============================================================ */
main.receipt-wrap{
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 60px) 1rem;
}

.receipt {
  width: 100%;
  max-width: 640px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.92)),
    var(--paper);
  border: 1px solid var(--accent-soft);
  border-radius: 16px;
  padding: clamp(20px, 4vw, 40px);
  box-shadow:
    0 12px 24px var(--shadow),
    inset 0 1px 0 rgba(255,255,255,.6);
  position: relative;
}

.receipt::before{
  content: "";
  position: absolute;
  top: -1px; left: 50%;
  transform: translateX(-50%);
  width: 80px; height: 6px;
  background: var(--accent);
  border-radius: 0 0 6px 6px;
  opacity: .5;
}

.receipt-header {
  text-align: center;
  border-bottom: 1px dashed var(--accent-soft);
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
}

.receipt-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--ink);
  margin: 0 0 .3rem;
}

#receipt-date,
#billing-name {
  font-size: .95rem;
  color: var(--ink-soft);
  margin: .2rem 0;
}

.receipt h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.5vw, 2.4rem);
  color: var(--accent);
  text-align: center;
  margin: 0 0 .5rem;
}

.receipt > p {
  text-align: center;
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
}

.receipt ul {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.receipt li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  background-color: rgba(255,255,255,.6);
  border: 1px solid var(--accent-soft);
  padding: .75rem 1rem;
  border-radius: .5rem;
  margin-bottom: .5rem;
  font-size: 1rem;
  color: var(--ink);
}

.receipt li .item-name { flex: 1; }
.receipt li .item-amount { font-weight: 700; }

.total {
  text-align: right;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--ink);
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid var(--accent-soft);
}

.receipt .btn {
  display: inline-grid;
  margin: 2rem auto 0;
}

.receipt-actions{
  text-align: center;
}

@media print {
  body { background: white; }
  .receipt { box-shadow: none; border: none; }
  .btn, header, footer { display: none !important; }
}


/* ============================================================
   11. Reduced Motion
   ============================================================ */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero__gabe { translate: 0 0; opacity: 1; }
}


/* ============================================================
   12. Responsive (Mobile)
   ============================================================ */
@media (max-width: 820px){
  .nav-toggle { display: inline-grid; }

  header nav{
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: linear-gradient(rgba(215,181,108,.97), rgba(215,181,108,.95));
    border-bottom: 1px solid rgba(120,84,35,.35);
    box-shadow: 0 12px 18px var(--shadow);
    padding: 0;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .18s ease, opacity .18s ease, visibility 0s linear .18s;
  }

  header nav ul{
    flex-direction: column;
    gap: .5rem;
    margin: 0;
    padding: .75rem;
  }

  header nav a{
    width: 100%;
    min-width: 0;
    height: 52px;
    padding: 0 .75rem;
    font-size: 1.15rem;
  }

  header.nav-open nav{
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  body.no-scroll { overflow: hidden; }
}

@media (max-width: 700px){
  .author-card{
    height: 540px;
    max-width: 100%;
  }
  .author-card.flipped{ max-width: 100%; }
  .card-back{ padding: 1.2rem 1.2rem; }

  /* Scroll fade — subtle gradient at the bottom of the bio
     so it's obvious there's more content to scroll to. */
  .card-back{
    position: relative;
  }
  .card-back .bio{
    mask-image: linear-gradient(to bottom,
      black 0,
      black calc(100% - 24px),
      transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom,
      black 0,
      black calc(100% - 24px),
      transparent 100%);
  }
  .card-back .flip-back{
    margin-top: .5rem;
  }
}

@media (max-width: 600px){
  body { font-size: 16px; }
  .hero__gabe { width: clamp(140px, 38vw, 220px); }
  .hero { padding-bottom: 80px; }

  /* Hero headline — stack drop-cap above text on phones,
     center everything so it reads as one unified title. */
  .hero__headline{
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .25rem;
  }
  .dropcap{
    width: clamp(80px, 22vw, 120px);
  }
  .headline-rest{
    transform: none;
    line-height: 1.05;
  }

  /* Subpage heros — push heading down so burger doesn't overlap it */
  .hero.hero--sub{
    padding-top: 4.5rem;
    height: auto;
    min-height: 28vh;
  }

  .books-grid{ gap: 1.1rem; padding: 1rem; }
  .book-card img{ max-width: 160px; }
  .book-card h2{ font-size: 1.3rem; }

  /* Cart icon — smaller and reliably docked bottom-right */
  #cart-icon{
    top: auto;
    bottom: 1rem;
    right: 1rem;
    min-width: 0;
    height: 48px;
    padding: 0 .75rem;
    font-size: 1rem;
    border-width: 14px;
    border-image-width: 14px;
  }

  /* Cart panel — sit above the burger so it's clearly modal */
  #cart-panel{ z-index: 1200; }

  .contact-section { padding: 1.25rem; }
  form { gap: .9rem; }

  .receipt { padding: 1.25rem; }
  .receipt h1 { font-size: 1.6rem; }
  main.receipt-wrap{ padding-top: 5rem; } /* clear the burger */
}