/* ==========================================================================
   My AI Steps - shared stylesheet
   Ported from design-export/home-v2.html + library-v2.html (visual source
   of truth), unified on brand tokens.
   ========================================================================== */

:root {
  /* Brand tokens */
  --sage: #679378;
  --sage-deep: #57806A;
  --mustard: #F5C061;
  --coral: #F08179;
  --coral-deep: #E96E66;
  --coral-text: #D95B52;
  --mint: #88C9B9;
  --charcoal: #3E3E3F;
  --cream: #FAF7F2;
  --blush: #FDECEA;
  --pale-sage: #E8EFE9;
  --pale-mustard: #FBF0DC;

  /* Derived neutrals used across the mockups */
  --ink-soft: #545455;
  --ink-mute: #6E6E70;
  --ink-faint: #9A968E;
  --paper: #FFFDF4;
  --paper-border: #EBE3CF;
  --paper-rule: #E3DAC3;
  --paper-ghost: #B9B3A6;
  --dash-border: #E8E2D7;
  --dial-track: #F3EDE2;
  --shelf: #E3C9A2;
  --shelf-shadow: #D2B588;

  --font-display: 'Baloo 2', 'Avenir Next Rounded', 'Trebuchet MS', sans-serif;
  --font-body: 'Lexend', 'Avenir Next', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

a { color: var(--sage); }
a:hover { color: var(--coral); }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--sage);
  outline-offset: 3px;
  border-radius: 8px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--charcoal);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 20px;
  border-radius: 0 0 12px 12px;
  text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus-visible { top: 0; color: #FFFFFF; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Shared: nav
   ========================================================================== */

.nav-band {
  background: #FFFFFF;
  box-shadow: 0 1px 0 rgba(62, 62, 63, 0.07);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 48px;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.brand img { display: block; width: 180px; height: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--charcoal);
  font-weight: 500;
  font-size: 15.5px;
}
.nav-links a:hover { color: var(--coral); }

.nav-cta {
  background: var(--sage);
  color: #FFFFFF !important;
  font-weight: 600;
  font-size: 15px;
  padding: 11px 22px;
  border-radius: 999px;
}
.nav-cta:hover { background: var(--sage-deep); }

/* ==========================================================================
   Shared: buttons
   ========================================================================== */

.btn {
  display: inline-block;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  border-radius: 999px;
  transition: transform .18s ease, background .18s ease;
}

.btn-primary {
  background: var(--coral);
  color: #FFFFFF;
  font-size: 18px;
  padding: 15px 30px;
}
.btn-primary:hover { background: var(--coral-deep); color: #FFFFFF; transform: translateY(-2px); }

.btn-outline {
  background: #FFFFFF;
  color: var(--sage);
  border: 2.5px solid var(--sage);
  font-size: 18px;
  padding: 12.5px 28px;
}
.btn-outline:hover { color: var(--sage); transform: translateY(-2px); }

.btn-sage {
  background: var(--sage);
  color: #FFFFFF;
  font-size: 19px;
  padding: 16px 34px;
}
.btn-sage:hover { background: var(--sage-deep); color: #FFFFFF; transform: translateY(-2px); }

/* ==========================================================================
   Shared: sections & type
   ========================================================================== */

.section { padding: 88px 48px; }

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.2;
  text-align: center;
  margin: 0 0 14px;
}

.section-lede {
  text-align: center;
  font-size: 17.5px;
  line-height: 1.65;
  font-weight: 300;
  color: var(--ink-soft);
  max-width: 36em;
  margin: 0 auto 52px;
  text-wrap: pretty;
}

/* ==========================================================================
   Background blobs
   ========================================================================== */

@keyframes blob-drift {
  from { transform: translateY(0) rotate(0deg); }
  to   { transform: translateY(-16px) rotate(3deg); }
}

.blob-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.blob-layer > div { position: absolute; }

.blob {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: blob-drift 8s ease-in-out infinite alternate;
}
.blob.rev { animation-direction: alternate-reverse; }

/* Hero blob geometry (positions/sizes from the approved mockup) */
.b1 { top: 8%; left: 4%; }
.b1 .blob { width: 130px; height: 130px; border-radius: 50%; background: var(--pale-sage); animation-duration: 7s; }
.b2 { top: 58%; left: 9%; }
.b2 .blob { width: 110px; height: 55px; border-radius: 110px 110px 0 0; background: var(--blush); animation-duration: 9s; }
.b3 { top: 12%; right: 6%; }
.b3 .blob { width: 76px; height: 76px; border-radius: 38%; background: var(--pale-mustard); transform: rotate(14deg); animation-duration: 8s; }
.b4 { bottom: 10%; right: 14%; }
.b4 .blob { width: 96px; height: 96px; border-radius: 44% 56% 52% 48% / 52% 44% 56% 48%; background: var(--pale-sage); animation-duration: 10s; }
.b5 { top: 44%; right: 3%; }
.b5 .blob { width: 44px; height: 44px; border-radius: 50%; background: var(--blush); animation-duration: 6s; }
.b6 { bottom: 4%; left: 38%; }
.b6 .blob { width: 60px; height: 30px; border-radius: 60px 60px 0 0; background: var(--pale-mustard); animation-duration: 8.5s; }

/* Library header blobs */
.lb1 { top: 14%; left: 5%; width: 90px; height: 90px; border-radius: 50%; background: var(--pale-sage); animation: blob-drift 8s ease-in-out infinite alternate; position: absolute; }
.lb2 { top: 30%; right: 6%; width: 70px; height: 35px; border-radius: 70px 70px 0 0; background: var(--blush); animation: blob-drift 9s ease-in-out infinite alternate-reverse; position: absolute; }

/* ==========================================================================
   Home: hero
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  padding: 56px 48px 96px;
}

.hero-inner {
  position: relative;
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 56px;
}

.hero-copy { flex: 1 1 480px; min-width: 320px; }

.hero-copy h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 4.6vw, 58px);
  line-height: 1.14;
  margin: 0 0 20px;
  max-width: 13em;
  text-wrap: pretty;
}
.hero-copy h1 .accent { color: var(--sage); }

.hero-copy .lede {
  font-size: 19px;
  line-height: 1.65;
  font-weight: 300;
  margin: 0 0 32px;
  max-width: 30em;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

/* Quiet credibility badge, in the spirit of "Backed by Y Combinator" rows */
.hero-badge {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin: 32px 0 0;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 500;
  color: rgba(62, 62, 63, .7);
}
.hero-badge img {
  display: block;
  width: 87px;
  height: 24px;
  opacity: .85;
  filter: saturate(.7);
}

.hero-mascot {
  flex: 0 1 500px;
  min-width: 300px;
  margin: 0 auto;
}

/* ==========================================================================
   Home: problem cards
   ========================================================================== */

.problem { background: #FFFFFF; }

.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.problem .wrap, .demo .wrap, .approach .wrap {
  max-width: 1100px;
  margin: 0 auto;
}

.problem-card {
  background: var(--cream);
  border-radius: 28px;
  padding: 34px 30px;
  transition: transform .18s ease;
}
.problem-card:hover { transform: translateY(-4px); }
.problem-card svg { display: block; margin-bottom: 18px; }
.problem-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  margin: 0 0 8px;
}
.problem-card p {
  font-size: 16px;
  line-height: 1.65;
  font-weight: 300;
  color: var(--ink-soft);
  margin: 0;
}

.problem-kicker {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 28px);
  color: var(--sage);
  margin: 56px 0 0;
}

/* ==========================================================================
   Home: demo — "Catch the AI's mistake"
   ========================================================================== */

.demo { background: var(--pale-sage); }

.demo-stage {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.demo-chatty {
  flex: 0 0 320px;
  margin-bottom: 8px;
}

.demo-card {
  flex: 1 1 auto;
  min-width: 0;
  background: #FFFFFF;
  border-radius: 30px;
  padding: 30px 34px 34px;
  box-shadow: 0 2px 0 rgba(62, 62, 63, 0.06);
}

.demo-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 2px dashed var(--dash-border);
  padding-bottom: 16px;
  margin-bottom: 22px;
}

.bot-name {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bot-name .dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--mint);
  display: inline-block;
}
.bot-name strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
}
.bot-name .hint { font-size: 12.5px; color: var(--ink-faint); }

.dial-box { text-align: center; }
.dial-needle {
  transition: transform .9s cubic-bezier(.34, 1.4, .4, 1);
  transform-origin: 46px 50px;
}
.dial-label {
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 2px;
}

.chat-row-q {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.chat-q {
  background: var(--pale-mustard);
  border-radius: 20px 20px 4px 20px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 500;
  max-width: 75%;
}

.chat-row-a {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 24px;
}
/* The large version of Chatty's mint chat bubble — the answer streams here */
.chat-a {
  position: relative;
  background: var(--mint);
  border-radius: 26px 26px 26px 6px;
  padding: 16px 20px;
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
  max-width: 88%;
  min-height: 76px;
}
/* Tail pointing left, toward Chatty at its laptop */
.chat-a::before {
  content: "";
  position: absolute;
  left: -9px;
  bottom: 10px;
  width: 0; height: 0;
  border-top: 9px solid transparent;
  border-bottom: 4px solid transparent;
  border-right: 10px solid var(--mint);
}

/* Bubble shake when the mistake is caught */
@keyframes bubble-shake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-5px) rotate(-.4deg); }
  38% { transform: translateX(4px) rotate(.3deg); }
  58% { transform: translateX(-3px); }
  78% { transform: translateX(2px); }
}
.chat-a.shaken {
  animation: bubble-shake .5s ease both;
}

.chat-a .wrong.revealed {
  background: var(--blush);
  color: var(--coral-text);
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 6px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

@keyframes stamp-in {
  0%   { opacity: 0; transform: rotate(-4deg) scale(1.8); }
  60%  { opacity: 1; transform: rotate(-4deg) scale(.92); }
  100% { opacity: 1; transform: rotate(-4deg) scale(1); }
}

.hmm-stamp {
  display: inline-block;
  border: 2.5px solid var(--coral);
  color: var(--coral);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  padding: 4px 9px 3px;
  border-radius: 8px;
  margin: 0 4px 0 8px;
  background: #FFFFFF;
  white-space: nowrap;
  animation: stamp-in .45s cubic-bezier(.2, 1.4, .4, 1) both;
}

@keyframes caret-blink {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.type-caret {
  display: inline-block;
  width: 9px; height: 18px;
  background: #FFFFFF;
  border-radius: 3px;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: caret-blink .9s steps(1) infinite;
}

.demo-actions { display: flex; justify-content: center; }

.btn-detective {
  background: var(--coral);
  color: #FFFFFF;
  font-size: 18px;
  padding: 15px 30px;
}
.btn-detective:hover { background: var(--coral-deep); transform: translateY(-2px); }

.demo-lesson {
  background: var(--pale-sage);
  border-radius: 20px;
  padding: 18px 22px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.demo-lesson:focus { outline: 3px solid var(--sage); outline-offset: 3px; }
.demo-lesson svg { flex: none; margin-top: 2px; }
.demo-lesson .correction {
  margin: 0 0 8px;
  font-size: 15.5px;
  line-height: 1.6;
  font-weight: 500;
}
.demo-lesson .moral {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  font-weight: 300;
  font-style: italic;
  color: var(--ink-soft);
}

.btn-again {
  background: #FFFFFF;
  color: var(--sage);
  border: 2.5px solid var(--sage);
  font-size: 16px;
  padding: 11px 24px;
  margin-top: 20px;
}
.btn-again:hover { transform: translateY(-2px); }

.demo-footnote {
  text-align: center;
  font-size: 14px;
  color: var(--ink-mute);
  margin: 26px 0 0;
}
.demo-footnote strong { font-weight: 600; }

[hidden] { display: none !important; }

/* ==========================================================================
   Home: approach
   ========================================================================== */

.approach { padding: 96px 48px; }

.approach .section-lede { max-width: 42em; margin-bottom: 56px; line-height: 1.7; }
.approach .section-lede strong { font-weight: 600; color: var(--charcoal); }
.approach .section-title { margin-bottom: 22px; }

.rhythm {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 64px;
  padding: 0;
  list-style: none;
}
.rhythm li { display: flex; align-items: center; gap: 10px; }
.rhythm .pill {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  padding: 11px 22px;
  border-radius: 999px;
}
.pill-sage { background: var(--pale-sage); }
.pill-mustard { background: var(--pale-mustard); }
.pill-blush { background: var(--blush); }

.module-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
}

.module-card {
  background: #FFFFFF;
  border-radius: 22px;
  padding: 24px 22px;
  transition: transform .18s ease;
}
.module-card:hover { transform: translateY(-4px); }

.module-num {
  display: inline-flex;
  width: 34px; height: 34px;
  border-radius: 50%;
  color: #FFFFFF;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 14px;
}
.module-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 6px;
}
.module-card p {
  font-size: 14px;
  line-height: 1.55;
  font-style: italic;
  font-weight: 300;
  color: var(--ink-soft);
  margin: 0;
}

/* Mustard character lounging on top of the module cards */
.lounger {
  position: absolute;
  top: -74px;
  right: 26px;
  width: 170px;
  pointer-events: auto;
}

/* ==========================================================================
   Home: credibility + partner
   ========================================================================== */

.credibility {
  padding: 80px 48px;
  background: var(--pale-mustard);
}
.credibility .wrap {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.credibility h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.25;
  margin: 0 0 18px;
}
.credibility .body {
  font-size: 17px;
  line-height: 1.7;
  font-weight: 300;
  color: var(--ink-soft);
  max-width: 40em;
  margin: 0 auto 14px;
  text-wrap: pretty;
}
.credibility .founder {
  font-size: 15.5px;
  line-height: 1.7;
  font-weight: 300;
  color: var(--ink-mute);
  max-width: 38em;
  margin: 0 auto;
}

.partner {
  position: relative;
  padding: 96px 48px;
  background: var(--blush);
  overflow: hidden;
}
.partner .wrap {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.partner .kicker {
  font-size: 14px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--coral-text);
  margin: 0 0 16px;
}
.partner h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.18;
  margin: 0 0 18px;
}
.partner .body {
  font-size: 17px;
  line-height: 1.65;
  font-weight: 300;
  color: var(--ink-soft);
  margin: 0 0 34px;
}
.partner .alt {
  font-size: 14px;
  color: var(--ink-mute);
  margin: 18px 0 0;
}
.partner .alt a { font-weight: 500; }

/* Coral note-taker beside the partner CTA */
.notetaker {
  position: absolute;
  bottom: 18px;
  right: max(18px, calc(50% - 560px));
  width: 130px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { padding: 64px 48px 48px; }
.site-footer.tint { background: var(--pale-mustard); }

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

/* The mark is a transparent PNG; it sits straight on the footer background */
.footer-badge img { display: block; width: 84px; height: auto; }
.footer-tag {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  margin: 0;
  color: var(--ink-soft);
}
.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a {
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
.footer-fine {
  font-size: 13px;
  color: var(--ink-faint);
  margin: 8px 0 0;
}

/* ==========================================================================
   Library page
   ========================================================================== */

.library-header {
  position: relative;
  overflow: hidden;
  padding: 52px 48px 8px;
  text-align: center;
}
.library-header .wrap {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}
.library-header .kicker {
  font-size: 13.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--sage);
  margin: 0 0 14px;
}
.library-header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 4.4vw, 54px);
  line-height: 1.14;
  margin: 0 0 16px;
}
.library-header .lede {
  font-size: 18px;
  line-height: 1.65;
  font-weight: 300;
  color: var(--ink-soft);
  margin: 0;
}

.shelf-section { padding: 36px 24px 0; }
.shelf-wrap { max-width: 980px; margin: 0 auto; }

.shelf-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shelf-stage {
  flex: 1;
  position: relative;
  padding: 24px 0 0;
  touch-action: pan-y;
}

.book-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(8px, 2vw, 22px);
  min-height: 280px;
  transition: transform .45s cubic-bezier(.3, 1.3, .4, 1);
}

.book {
  display: block;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  text-decoration: none;
  transition: transform .45s cubic-bezier(.3, 1.3, .4, 1), opacity .45s ease;
  transform: scale(.92);
  opacity: .62;
  position: relative;
  flex: none;
}
.book.focused {
  transform: translateY(-16px) scale(1.12);
  opacity: 1;
}
/* the one downloadable book is a link; give it the interactive affordances */
a.book { cursor: pointer; }
a.book:hover, a.book:focus-visible { transform: translateY(-22px) scale(1.14); }
a.book:focus-visible { outline: 3px solid var(--sage); outline-offset: 4px; border-radius: 8px; }

/* coming-soon slots: visually muted, nothing suggests a click */
.book.soon { cursor: default; opacity: .48; }

.book-shadow {
  position: absolute;
  left: 8%; right: 8%;
  bottom: -10px;
  height: 14px;
  border-radius: 50%;
  background: rgba(62, 62, 63, .14);
  filter: blur(4px);
  opacity: 0;
  transition: opacity .45s ease;
}
.book.focused .book-shadow { opacity: 1; }

.book-cover {
  width: clamp(104px, 13vw, 148px);
  height: clamp(150px, 19vw, 212px);
  border-radius: 6px 14px 14px 6px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 14px 14px 20px;
  text-align: left;
}
/* real workbook: the cover art is page 1 of the PDF */
.book-cover.has-cover {
  padding: 0;
  overflow: hidden;
  justify-content: flex-end;
  align-items: center;
}
.book-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.book-download-tag {
  position: relative;
  margin: 0 0 10px;
  background: rgba(62, 62, 63, .78);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: .02em;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.book-spine {
  position: absolute;
  left: 7px; top: 0; bottom: 0;
  width: 2.5px;
  background: rgba(255, 255, 255, .35);
  border-radius: 2px;
}
.book-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(13px, 1.4vw, 16px);
  line-height: 1.25;
  color: #FFFFFF;
  text-wrap: pretty;
}
.book-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.book-kind {
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .85);
  font-weight: 500;
}
.soon-flag + .book-title { margin-top: 22px; }
.soon-flag {
  position: absolute;
  top: 14px; right: -8px;
  background: var(--coral);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 6px 6px 6px 0;
  box-shadow: 0 1px 0 rgba(62, 62, 63, .15);
}

.shelf-board {
  height: 20px;
  background: var(--shelf);
  border-radius: 6px;
  box-shadow: 0 4px 0 var(--shelf-shadow);
}

/* Checkout card */

.checkout-section { padding: 48px 24px 72px; }

.checkout-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: 18px;
  border: 1.5px solid var(--paper-border);
  padding: 28px 34px 32px;
  position: relative;
  box-shadow: 0 2px 0 rgba(62, 62, 63, .06);
}

.checkout-brand {
  text-align: center;
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-faint);
  margin: 0 0 4px;
}
.checkout-heading {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  margin: 0 0 20px;
  border-bottom: 2px solid var(--charcoal);
  padding-bottom: 12px;
}

.checkout-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1.5px solid var(--paper-rule);
}
.checkout-row .field {
  flex: none;
  font-size: 12.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
}
.checkout-row .val-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
}
.checkout-row .val-desc {
  font-size: 14.5px;
  font-weight: 300;
  line-height: 1.55;
}
.checkout-row .val-ghost {
  font-size: 15px;
  color: var(--paper-ghost);
  font-style: italic;
}

.checkout-stamp-row {
  padding: 9px 0 0;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.due-stamp {
  display: inline-block;
  border: 3px double var(--coral-text);
  color: var(--coral-text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .04em;
  padding: 7px 13px;
  border-radius: 6px;
  transform: rotate(-3deg);
  line-height: 1.3;
  text-align: center;
}

@keyframes stampin {
  0%   { opacity: 0; transform: rotate(-6deg) scale(2.2); }
  55%  { opacity: 1; transform: rotate(-6deg) scale(.9); }
  75%  { transform: rotate(-6deg) scale(1.06); }
  100% { opacity: 1; transform: rotate(-6deg) scale(1); }
}

@keyframes spark-fly {
  0%   { opacity: 0; transform: scale(.3); }
  35%  { opacity: 1; transform: scale(1.3) translate(2px, -8px); }
  100% { opacity: 0; transform: scale(1.5) translate(6px, -16px); }
}

.out-stamp-box { position: relative; }
.out-stamp {
  display: inline-block;
  border: 3px solid var(--sage);
  color: var(--sage);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .06em;
  padding: 9px 15px;
  border-radius: 6px;
  animation: stampin .5s cubic-bezier(.2, 1.3, .4, 1) both;
}
.out-sparks {
  position: absolute;
  top: -34px; right: -24px;
  overflow: visible;
  pointer-events: none;
}
.out-sparks g {
  transform-box: fill-box;
  transform-origin: center;
  animation: spark-fly .8s ease both;
}

.checkout-actions {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.btn-checkout {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--coral);
  color: #FFFFFF;
  font-size: 18px;
  padding: 15px 32px;
}
.btn-checkout svg { flex: none; }
.btn-checkout:hover { background: var(--coral-deep); color: #FFFFFF; transform: translateY(-2px); }

.library-note {
  text-align: center;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-mute);
  max-width: 34em;
  margin: 30px auto 0;
}

/* ==========================================================================
   Chatty — the mascot rig
   ==========================================================================
   The artwork is one traced SVG scene (viewBox 0 0 1658 1354):
   ground → chatty(body+face) → laptop → arm → chat-bubble → sparks.
   .chatty-pop (HTML wrapper) owns the entrance; inside the SVG, the
   .pose wrappers own state poses (hop, puff, shrug) while #chatty and
   #arm own the infinite loops (breathe, typing) — so they never fight.
   ========================================================================== */

.chatty {
  position: relative;
  width: 100%;
  aspect-ratio: 1658 / 1354;   /* reserves space: no layout shift */
  -webkit-user-select: none;
  user-select: none;
}

.chatty svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chatty-pop { width: 100%; height: 100%; }

.chatty.interactive { cursor: pointer; }

/* Entrance: pop with overshoot */
@keyframes chatty-pop-in {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.chatty-pop {
  transform-origin: 50% 82%;
}
.chatty.entering .chatty-pop {
  animation: chatty-pop-in .6s cubic-bezier(.34, 1.56, .64, 1) both;
}
.chatty.pre-enter .chatty-pop { transform: scale(0); }

/* ------- part transform plumbing ------- */

.chatty [data-part] { transform-box: fill-box; }

/* the big groups transform about scene coordinates */
.chatty .pose,
.chatty [data-part="chatty"],
.chatty [data-part="arm"],
.chatty [data-part="chat-bubble"] { transform-box: view-box; }

.chatty .pose-chatty,
.chatty [data-part="chatty"] { transform-origin: 64% 74.3%; }  /* body bottom */
.chatty .pose-arm,
.chatty [data-part="arm"] { transform-origin: 72.4% 65.4%; }   /* shoulder */
.chatty [data-part="chat-bubble"] { transform-origin: 26% 26%; }

.chatty .pose { transition: transform .35s cubic-bezier(.34, 1.3, .5, 1); }
.chatty [data-part="arm"] { transition: transform .45s cubic-bezier(.34, 1.3, .5, 1); }

.chatty.no-bubble [data-part="chat-bubble"] { display: none; }

/* Idle breathing — character only; the laptop stays put */
@keyframes chatty-breathe {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(1.014); }
}
.chatty [data-part="chatty"] {
  animation: chatty-breathe 3.2s ease-in-out infinite;
}

/* Typing loop — the signature idle: a soft two-beat tap */
@keyframes chatty-type {
  0%   { transform: rotate(0deg); }
  7%   { transform: rotate(2.3deg); }
  14%  { transform: rotate(0.2deg); }
  22%  { transform: rotate(2.3deg); }
  32%  { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}
.chatty.typing [data-part="arm"] {
  animation: chatty-type 1.9s ease-in-out infinite;
}

/* ...each tap dips the key row under the fist... */
@keyframes chatty-key-dip {
  0%, 100% { transform: translateY(0); }
  7%   { transform: translateY(4px); }
  13%  { transform: translateY(0); }
  22%  { transform: translateY(4px); }
  28%  { transform: translateY(0); }
  32%  { transform: translateY(0); }
}
.chatty.typing .key {
  animation: chatty-key-dip 1.9s ease-in-out infinite;
}

/* ...and the chat-bubble text lines pulse, as if being written */
.chatty .bar { transform-box: fill-box; transform-origin: 0% 50%; }
@keyframes chatty-bar-pulse {
  0%, 100% { transform: scaleX(1); }
  7%   { transform: scaleX(1.035); }
  22%  { transform: scaleX(1.035); }
  32%  { transform: scaleX(1); }
}
.chatty.typing .bar {
  animation: chatty-bar-pulse 1.9s ease-in-out infinite;
}
.chatty.typing .bar + .bar { animation-delay: .1s; }

/* Chat-bubble life: every 6–10s the lines clear and retype */
@keyframes chatty-bar-retype {
  0%   { transform: scaleX(1); }
  18%  { transform: scaleX(0); }
  34%  { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}
.chatty.retyping .bar {
  animation: chatty-bar-retype 1.4s cubic-bezier(.5, 0, .3, 1) both;
}
.chatty.retyping .bar + .bar { animation-delay: .18s; }

/* robot icon blinks occasionally */
.chatty .bot-eye {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .07s ease-out;
}
.chatty.bot-blink .bot-eye { transform: scaleY(.12); }

/* bubble hover: a small bounce */
@keyframes chatty-bubble-bounce {
  0%   { transform: translateY(0); }
  30%  { transform: translateY(-16px); }
  55%  { transform: translateY(0); }
  75%  { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}
.chatty.bubble-bounce [data-part="chat-bubble"] {
  animation: chatty-bubble-bounce .7s cubic-bezier(.34, 1.3, .5, 1) both;
}

/* Hover / tap hop: squash → stretch → settle (character only) */
@keyframes chatty-hop {
  0%   { transform: scale(1, 1) translateY(0); }
  28%  { transform: scale(1.06, .94) translateY(10px); }
  58%  { transform: scale(.96, 1.06) translateY(-38px); }
  80%  { transform: scale(1.02, .98) translateY(0); }
  100% { transform: scale(1, 1) translateY(0); }
}
.chatty.hopping .pose-chatty {
  animation: chatty-hop .65s cubic-bezier(.34, 1.3, .5, 1) both;
}

/* Caught mid-keystroke: everything freezes for a beat... */
.chatty.caught [data-part="arm"],
.chatty.caught .key,
.chatty.caught .bar {
  animation-play-state: paused;
}

/* ...then the arm lifts off the keyboard */
.chatty.arm-up [data-part="arm"] { transform: rotate(-8deg); }

/* Embarrassed shrink-shrug */
.chatty.embarrassed .pose-chatty { transform: scale(.96) rotate(-1.5deg); }

/* Confident chest-puff while talking */
.chatty.talking .pose-chatty { transform: scaleY(1.02) rotate(.4deg); }

/* Recovery nod */
@keyframes chatty-nod {
  0%   { transform: rotate(0deg); }
  30%  { transform: rotate(2.5deg) translateY(8px); }
  60%  { transform: rotate(-0.8deg); }
  100% { transform: rotate(0deg); }
}
.chatty.nodding .pose-chatty {
  animation: chatty-nod .7s ease both;
}

/* Wave — the arm lifts off the keyboard and rocks hello */
@keyframes chatty-wave {
  0%   { transform: rotate(0deg); }
  20%  { transform: rotate(-24deg); }
  40%  { transform: rotate(-13deg); }
  60%  { transform: rotate(-26deg); }
  80%  { transform: rotate(-14deg); }
  100% { transform: rotate(0deg); }
}
.chatty.waving [data-part="arm"] {
  animation: chatty-wave 1.7s ease-in-out both;
}

/* ------- face ------- */

.chatty .part-eye {
  transform-origin: center;
  transition: transform .09s ease-out;
}
.chatty .part-pupil {
  /* translate driven by JS lerp loop; no transition needed */
  transform-origin: center;
}

.chatty .part-blush {
  opacity: 0;
  transition: opacity .3s ease;
}
.chatty.embarrassed .part-blush { opacity: .85; }

.chatty .part-mouth [data-mouth] { display: none; }
.chatty .part-mouth [data-mouth][data-visible="true"] { display: inline; }

/* Sparks burst (from the lid logo dot) */
.chatty [data-part="sparks"] { opacity: 0; }
.chatty [data-part="sparks"] path {
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes chatty-spark {
  0%   { opacity: 0; transform: scale(.2); }
  30%  { opacity: 1; transform: scale(1.25) translate(3px, -8px); }
  100% { opacity: 0; transform: scale(1.4) translate(8px, -18px); }
}
.chatty.sparking [data-part="sparks"] { opacity: 1; }
.chatty.sparking [data-part="sparks"] path {
  animation: chatty-spark .8s ease both;
}
.chatty.sparking [data-part="sparks"] path:nth-child(2) { animation-delay: .07s; }
.chatty.sparking [data-part="sparks"] path:nth-child(3) { animation-delay: .14s; }

/* Speech bubble (click quips) — anchored over the character, not the scene */
.chatty-say {
  position: absolute;
  left: 62%;
  bottom: calc(100% - 12px);
  transform: translateX(-50%) scale(.6);
  transform-origin: 50% 100%;
  background: #FFFFFF;
  color: var(--charcoal);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.4;
  padding: 12px 18px;
  border-radius: 16px;
  border: 2.5px solid var(--charcoal);
  width: max-content;
  max-width: 240px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .25s ease;
  z-index: 5;
}
.chatty-say::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 14px; height: 14px;
  background: #FFFFFF;
  border-right: 2.5px solid var(--charcoal);
  border-bottom: 2.5px solid var(--charcoal);
  transform: translateX(-50%) rotate(45deg);
}
.chatty.saying .chatty-say {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ==========================================================================
   Secondary characters
   ========================================================================== */

.buddy { display: block; }
.buddy [data-part] { transform-box: fill-box; }
.buddy .part-eye { transform-origin: center; transition: transform .09s ease-out; }

@keyframes buddy-kick {
  0%, 100% { transform: rotate(0deg); }
  30%      { transform: rotate(-14deg); }
  65%      { transform: rotate(8deg); }
}
.buddy .part-legs { transform-origin: 20% 80%; }
.buddy.reacting .part-legs { animation: buddy-kick .9s ease both; }

@keyframes buddy-scribble {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-9deg) translateY(-2px); }
  40% { transform: rotate(5deg); }
  60% { transform: rotate(-7deg) translateY(-1px); }
  80% { transform: rotate(4deg); }
}
.buddy .part-pencil { transform-origin: 30% 70%; }
.buddy.reacting .part-pencil { animation: buddy-scribble .8s ease both; }

@keyframes buddy-tilt {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(-4deg); }
}
.buddy.reacting .part-tilt { animation: buddy-tilt .8s ease both; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 860px) {
  .demo-stage {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }
  .demo-chatty { flex: none; width: 260px; margin-bottom: -6px; }
  .chat-a::before { display: none; }
  .lounger { top: -66px; right: 10px; width: 148px; }
}

@media (max-width: 640px) {
  .site-nav { padding: 18px 22px; }
  .nav-links { gap: 16px; }
  .hero { padding: 36px 22px 72px; }
  .section, .approach, .partner { padding-left: 22px; padding-right: 22px; }
  .section { padding-top: 64px; padding-bottom: 64px; }
  .hero-mascot { flex-basis: 320px; }
  .brand img { width: 150px; }
  .demo-card { padding: 24px 20px 26px; }
  .checkout-card { padding: 24px 20px 28px; }
  .notetaker { width: 96px; right: 8px; bottom: 8px; }
  /* shelf becomes a horizontal scroller; auto margins keep it centered when it fits */
  .book-row {
    overflow-x: auto;
    justify-content: flex-start;
    padding: 0 4px 14px;
    -webkit-overflow-scrolling: touch;
  }
  .book-row .book:first-child { margin-left: auto; }
  .book-row .book:last-child { margin-right: auto; }
  .library-header, .site-footer { padding-left: 22px; padding-right: 22px; }
}

/* ==========================================================================
   Mobile & tablet compatibility fixes — scoped to small viewports and
   coarse pointers only; desktop rendering (≥1024px, mouse) is untouched.
   ========================================================================== */

/* mobile fixes: touch targets — grow the hit area of bare text links to
   ~44px without moving a pixel (negative margins cancel the padding) */
@media (pointer: coarse) {
  .nav-links a:not(.nav-cta),
  .footer-links a,
  .partner .alt a {
    padding: 13px 6px;
    margin: -13px -6px;
  }
}

@media (max-width: 640px) {
  /* mobile fixes: library shelf — the stage is a flex item, so its implied
     min-width:auto kept it at the book row's full 560px and pushed the whole
     page wider than the phone screen; letting it shrink turns the row into
     the horizontal scroller the rules above intend. pan-x re-enables the
     horizontal touch swipe that the base pan-y rule blocks. */
  .shelf-stage { min-width: 0; touch-action: pan-x pan-y; }

  /* mobile fixes: hero — hide the smiley face on the headline blob; at phone
     widths the blob sits mid-sentence and the face reads as a misprint */
  .b1 .blob svg { display: none; }

  /* mobile fixes: partner — reserve room under the copy so the note-taking
     character can't sit on top of the email link */
  .partner { padding-bottom: 150px; }
}

/* ==========================================================================
   Reduced motion — everything renders static
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .chatty [data-part="chatty"],
  .chatty.typing [data-part="arm"],
  .chatty.typing .key,
  .chatty.typing .bar { animation: none; }
  .chatty.pre-enter .chatty-pop { transform: none; }
}
