/* =========================================================================
   Hannah E. Marks — author site
   A brand of its own: warm paper, espresso ink, clay & blush, serif voice.
   The books keep their own worlds; this is the library they live in.
   ========================================================================= */

:root {
  --paper:      #faf5ec;
  --paper-deep: #f3ead9;
  --ink:        #33302b;
  --ink-soft:   #6d675c;
  --clay:       #b85c38;
  --clay-deep:  #9c4a2b;
  --blush:      #ecd8c8;
  --olive:      #6b7b5e;
  --olive-deep: #55644a;
  --gold:       #c9a227;
  --line:       #e2d7c3;

  --maxw: 1080px;
  --f-serif: 'Fraunces', Georgia, serif;
  --f-sans:  'Karla', system-ui, sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--f-sans);
  font-size: clamp(1.02rem, .4vw + .95rem, 1.14rem);
  line-height: 1.75; color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--clay-deep); }
h1, h2, h3 { font-family: var(--f-serif); font-weight: 600; line-height: 1.08; margin: 0 0 .45em; color: var(--ink); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); letter-spacing: -.01em; }
h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 2.6rem, var(--maxw)); margin-inline: auto; }
.center { text-align: center; }
.eyebrow {
  font-family: var(--f-sans); font-weight: 700; font-size: .82rem;
  letter-spacing: .18em; text-transform: uppercase; color: var(--clay);
  margin: 0 0 .8rem;
}
.orn { color: var(--gold); font-size: 1.2em; }  /* ✳ ornament */

/* a11y */
.skip-link {
  position: absolute; left: 50%; top: -110px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: .8rem 1.5rem; z-index: 999;
  border-radius: 0 0 12px 12px; font-weight: 700; transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; }
:focus-visible { outline: 3px solid var(--clay); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--f-sans); font-weight: 700; font-size: 1rem;
  padding: .95rem 1.8rem; border-radius: 4px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; line-height: 1;
  transition: transform .18s var(--ease), background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-clay { background: var(--clay); color: #fff; }
.btn-clay:hover { background: var(--clay-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,245,236,.9); backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; }
.brand { font-family: var(--f-serif); font-weight: 700; font-size: 1.5rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.brand .dot { color: var(--clay); }
.nav-links { display: flex; align-items: center; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-weight: 700; font-size: .98rem; color: var(--ink); text-decoration: none;
  padding: .5rem .9rem; border-radius: 4px; transition: background .15s var(--ease);
}
.nav-links a:hover { background: var(--paper-deep); }
.nav-links a.book-link { color: var(--clay-deep); }
.nav-toggle { display: none; }
.nav-right { display: flex; align-items: center; gap: .6rem; }

/* the world toggle — flip between Hannah's world and the book's world */
.world-toggle {
  display: inline-flex; align-items: center;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px;
}
.world-toggle .seg {
  font-family: var(--f-sans); font-weight: 700; font-size: .88rem; line-height: 1;
  color: var(--ink-soft); text-decoration: none; padding: .5rem .95rem; border-radius: 999px;
  transition: background .18s var(--ease), color .18s var(--ease); white-space: nowrap;
}
.world-toggle .seg:hover { color: var(--ink); }
.world-toggle .seg.is-active { background: var(--ink); color: var(--paper); }
.world-toggle .seg.is-book:not(.is-active):hover { color: var(--clay-deep); }

/* =========================================================================
   The shared basket — IDENTICAL pill to the Yet Jet header (so it doesn't
   change when toggling worlds), with the full drawer available in place.
   ========================================================================= */
.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: .5rem;
  background: #3a917c; color: #fff; border: none; cursor: pointer;
  font-family: 'Fredoka', var(--f-sans); font-weight: 600; font-size: 1rem;
  padding: .62rem 1.05rem; border-radius: 999px;
  transition: background .15s var(--ease), transform .15s var(--ease);
}
.cart-btn:hover { background: #2c7767; transform: translateY(-1px); }
.cart-count {
  min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; background: #cf4d22; color: #fff;
  border-radius: 999px; font-size: .8rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.cart-count[data-empty="true"] { display: none; }

/* button aliases used by the drawer markup */
.btn-primary { background: var(--clay); color: #fff; }
.btn-primary:hover { background: var(--clay-deep); }
.btn-lg { font-size: 1.1rem; padding: 1.05rem 2rem; }
.btn-block { width: 100%; justify-content: center; }

/* overlay, drawer & modals (author-skinned) */
.overlay {
  position: fixed; inset: 0; background: rgba(51,48,43,.5); z-index: 200;
  opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility .3s var(--ease);
}
.overlay.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(430px, 100%);
  background: var(--paper); z-index: 210; transform: translateX(102%);
  transition: transform .38s var(--ease); display: flex; flex-direction: column;
  box-shadow: 0 30px 70px rgba(51,48,43,.3); border-radius: 18px 0 0 18px;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.4rem; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 1.4rem; }
.icon-btn { background: transparent; border: none; cursor: pointer; padding: .4rem; border-radius: 8px; color: var(--ink); line-height: 0; }
.icon-btn:hover { background: var(--paper-deep); }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.35rem; }
.drawer-foot { padding: 1.35rem; border-top: 1px solid var(--line); background: #fff; border-radius: 0 0 0 18px; }
.cart-empty { text-align: center; color: var(--ink-soft); padding: 2.2rem 0; font-family: var(--f-serif); font-style: italic; font-size: 1.2rem; }
.cart-line { display: grid; grid-template-columns: 64px 1fr auto; gap: .95rem; align-items: center; padding: .95rem 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 64px; border-radius: 6px; box-shadow: 0 8px 20px rgba(51,48,43,.18); }
.cart-line .title { font-weight: 700; font-size: 1rem; }
.cart-line .sub { color: var(--ink-soft); font-size: .9rem; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.qty button { width: 40px; height: 40px; border: none; background: transparent; font-size: 1.25rem; cursor: pointer; color: var(--ink); }
.qty button:hover { background: var(--paper-deep); }
.qty input { width: 44px; text-align: center; border: none; font-size: 1.05rem; font-weight: 700; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-line .qty { transform: scale(.8); transform-origin: left; margin-top: .3rem; }
.line-remove { background: none; border: none; color: var(--ink-soft); cursor: pointer; font-size: .85rem; text-decoration: underline; padding: 0; }
.cart-totals { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.2rem; margin-bottom: .3rem; }
.cart-totals b { color: var(--clay-deep); }
.ship-note { color: var(--ink-soft); font-size: .9rem; margin: 0 0 1rem; }
.modal {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 1.5rem;
  opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility .25s var(--ease);
}
.modal.open { opacity: 1; visibility: visible; }
.modal-card {
  background: #fff; border-radius: 14px; max-width: 530px; width: 100%; padding: 2rem;
  box-shadow: 0 30px 70px rgba(51,48,43,.3); transform: translateY(18px); transition: transform .25s var(--ease);
  max-height: 90dvh; overflow: auto;
}
.modal.open .modal-card { transform: none; }
.callout { background: var(--paper-deep); border-left: 4px solid var(--clay); border-radius: 8px; padding: 1rem 1.2rem; margin: 1rem 0; font-size: .97rem; }
.reassure { font-family: var(--f-serif); font-style: italic; color: var(--ink-soft); }

/* ---------- hero ---------- */
.hero { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3rem, 6vw, 5rem); position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.6rem); font-weight: 600; margin: 0 0 .35em;
}
.hero h1 .accent { font-style: italic; color: var(--clay); }
.hero .tagline {
  font-family: var(--f-serif); font-style: italic; font-size: clamp(1.25rem, 2vw, 1.6rem);
  color: var(--olive-deep); margin: 0 0 1.1rem; line-height: 1.45;
}
.hero .lede { max-width: 46ch; color: var(--ink-soft); margin-bottom: 1.8rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; }

/* the arch portrait */
.arch-frame { position: relative; justify-self: center; width: min(100%, 400px); }
.arch-frame img {
  width: 100%; aspect-ratio: 4 / 5.1; object-fit: cover; object-position: 50% 28%;
  border-radius: 999px 999px 10px 10px;
}
.arch-frame::before {
  content: ""; position: absolute; inset: -16px -16px auto auto;
  width: 100%; height: 100%;
  border: 2px solid var(--clay); border-radius: 999px 999px 10px 10px;
  transform: translate(0, 0); z-index: -1;
}
.arch-frame::after {
  content: "✳"; position: absolute; top: -34px; left: -12px;
  color: var(--gold); font-size: 1.7rem;
}
.hero-note {
  font-size: .92rem; color: var(--ink-soft); margin-top: 1.2rem;
  display: flex; gap: .6rem; align-items: center;
}
.hero-note::before { content: ""; width: 42px; height: 1px; background: var(--clay); }

/* ---------- section scaffolding ---------- */
.band { padding: clamp(3.2rem, 7vw, 5.5rem) 0; }
#books, #about, #educators { scroll-margin-top: 84px; }
.band.tint { background: var(--paper-deep); }
.band-head { max-width: 62ch; margin-bottom: clamp(1.8rem, 4vw, 2.8rem); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* reveals */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- books ---------- */
.book-card {
  display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(1.8rem, 4vw, 3.2rem);
  align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: clamp(1.6rem, 4vw, 3rem);
  box-shadow: 0 18px 50px rgba(51,48,43,.08);
}
.book-card .cover { justify-self: center; max-width: 300px; }
.book-card .cover img { border-radius: 6px; box-shadow: 0 24px 55px rgba(51,48,43,.28); transform: rotate(-2deg); transition: transform .3s var(--ease); }
.book-card:hover .cover img { transform: rotate(0deg) scale(1.02); }
.book-kicker { font-weight: 700; font-size: .82rem; letter-spacing: .16em; text-transform: uppercase; color: var(--olive); margin-bottom: .6rem; }
.book-card h3 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: .4rem; }
.book-card .meta { color: var(--ink-soft); font-size: .95rem; margin-bottom: 1rem; }
.book-card .desc { color: var(--ink); max-width: 52ch; }
.book-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.4rem; }

.book-next {
  margin-top: 1.6rem; border: 2px dashed var(--line); border-radius: 14px;
  padding: clamp(1.4rem, 3vw, 2rem) clamp(1.6rem, 4vw, 3rem);
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between;
  background: transparent;
}
.book-next h3 { margin: 0 0 .2rem; font-style: italic; }
.book-next p { margin: 0; color: var(--ink-soft); }
.book-next .mail { font-weight: 700; color: var(--clay-deep); white-space: nowrap; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.about-photo { position: relative; margin: 0; }
.about-photo img { width: 100%; border-radius: 12px; }
.about-photo::before {
  content: ""; position: absolute; inset: 14px -14px -14px 14px;
  border: 2px solid var(--olive); border-radius: 12px; z-index: -1;
}
.about-photo figcaption {
  font-family: var(--f-serif); font-style: italic; font-size: .95rem;
  color: var(--ink-soft); margin-top: 1rem; text-align: center;
}


/* ---------- educators strip ---------- */
.edu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.2rem, 3vw, 2rem); }
.edu-card {
  display: flex; flex-direction: column; gap: .5rem; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: 1.6rem 1.5rem;
  text-decoration: none; color: var(--ink);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.edu-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(51,48,43,.1); }
.edu-card .tag { font-weight: 700; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--olive); }
.edu-card h3 { font-size: 1.2rem; margin: 0; }
.edu-card p { margin: 0; color: var(--ink-soft); font-size: .95rem; flex: 1; }
.edu-card .go { font-weight: 700; color: var(--clay-deep); font-size: .95rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--paper); padding: clamp(2.6rem, 5vw, 4rem) 0 2rem; }
.site-footer a { color: var(--blush); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.foot-grid { display: flex; flex-wrap: wrap; gap: 2rem 4rem; justify-content: space-between; }
.foot-brand { font-family: var(--f-serif); font-weight: 700; font-size: 1.5rem; margin: 0 0 .4rem; }
.foot-brand .dot { color: var(--clay); }
.foot-grid p { color: rgba(250,245,236,.7); max-width: 40ch; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.foot-note { margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid rgba(250,245,236,.16); font-size: .9rem; color: rgba(250,245,236,.6); display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; justify-content: space-between; }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .hero-grid, .about-grid, .book-card { grid-template-columns: 1fr; }
  .arch-frame { order: -1; width: min(80%, 340px); }
  .edu-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 440px; margin-inline: auto; }
}
@media (max-width: 768px) {
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--paper); padding: .6rem 1.2rem 1.2rem; border-bottom: 1px solid var(--line); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle {
    display: inline-grid; place-items: center; width: 44px; height: 44px;
    background: transparent; border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: ""; display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; position: relative;
  }
  .nav-toggle span::before { position: absolute; top: -6px; }
  .nav-toggle span::after { position: absolute; top: 6px; }
}
@media (max-width: 640px) {
  .brand { font-size: 1.15rem; }
  .nav { gap: .5rem; }
  .world-toggle .seg { padding: .42rem .62rem; font-size: .78rem; }
  .cart-btn { padding: .55rem .7rem; }
  .cart-btn .cart-label { display: none; }
}
@media (max-width: 400px) {
  .brand { font-size: 1rem; }
  .nav-right { gap: .4rem; }
  .world-toggle .seg { padding: .38rem .5rem; font-size: .72rem; }
}
