/* ==========================================================================
   Latitude24 Books — coastal, literary, sun-bleached
   ========================================================================== */
:root {
  --shell: #fbf7f0;
  --sand: #f3ebdd;
  --sand-2: #e9dcc6;
  --driftwood: #6d5843;
  --ink: #1d2a2c;
  --ink-soft: #445356;
  --sea: #2c5a5c;
  --sea-deep: #1b3b3d;
  --gulf: #7ea3ae;
  --gulf-pale: #dce7e6;
  --coral: #bc5838;
  --coral-deep: #9d4226;

  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgb(29 42 44 / 6%), 0 2px 8px rgb(29 42 44 / 6%);
  --shadow-md: 0 10px 30px -10px rgb(29 42 44 / 25%);
  --shadow-lg: 0 30px 60px -20px rgb(27 59 61 / 40%);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
.loading[hidden],
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--shell);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--sea); text-underline-offset: .18em; }
a:hover { color: var(--sea-deep); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; letter-spacing: -.01em; margin: 0 0 .5em; font-optical-sizing: auto; }
h2 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.9rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--coral); outline-offset: 3px; border-radius: 4px; }
.story :focus-visible, .pull-quote :focus-visible { outline-color: #ffd2c2; }

.container { width: min(1200px, 100% - 2.5rem); margin-inline: auto; }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }
.eyebrow {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--coral-deep);
  margin-bottom: .9rem;
}
.eyebrow-light { color: #f2b9a3; }

.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: var(--radius-sm); }
.skip-link:focus { top: 1rem; }
.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; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--sea);
  --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .85rem 1.4rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background: var(--bg); color: var(--fg);
  font-weight: 600; font-size: .98rem; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), background-color .2s, box-shadow .2s, border-color .2s;
}
.btn:hover { color: var(--fg); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn svg { width: 1.15em; height: 1.15em; }
.btn-primary { --bg: var(--coral); }
.btn-primary:hover { --bg: var(--coral-deep); }
.btn-lg { padding: 1.05rem 1.8rem; font-size: 1.05rem; }
.btn-price { padding-left: .7rem; margin-left: .1rem; border-left: 1px solid rgb(255 255 255 / 40%); font-variant-numeric: tabular-nums; }
.btn-small { padding: .6rem 1.05rem; font-size: .9rem; }
.btn-ghost { --bg: transparent; --fg: var(--sea); border-color: var(--sea); }
.btn-ghost:hover { --bg: var(--sea); --fg: #fff; }
.btn-sand { --bg: var(--sand); --fg: var(--sea-deep); }
.btn-sand:hover { --bg: #fff; --fg: var(--sea-deep); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.btn-link { font-weight: 600; text-decoration: none; color: var(--sea); }
.btn-link:hover { text-decoration: underline; }
.icon-btn { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; color: var(--ink); }
.icon-btn:hover { background: var(--sand); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: rgb(251 247 240 / 82%);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .3s;
}
.site-header.is-scrolled { border-bottom-color: rgb(138 118 96 / 20%); background: rgb(251 247 240 / 94%); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--sea-deep); }
.brand:hover { color: var(--sea-deep); }
.brand-mark { width: 34px; height: 34px; color: var(--sea); }
.brand-text, .brand-footer { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; letter-spacing: -.01em; }
.brand b { color: var(--coral); font-weight: 700; }
.brand-text span, .brand-footer span { font-weight: 400; font-style: italic; color: var(--ink-soft); }
.site-nav { display: flex; gap: 1.75rem; margin-left: auto; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: .95rem; font-weight: 500; position: relative; padding: .3rem 0; }
.site-nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--coral); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.site-nav a:hover::after { transform: scaleX(1); }
.cart-button {
  position: relative; display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1rem; border: 1.5px solid var(--sea); border-radius: 999px;
  background: transparent; color: var(--sea); font-weight: 600; font-size: .92rem; cursor: pointer;
  transition: background-color .2s, color .2s;
}
.cart-button:hover { background: var(--sea); color: #fff; }
.cart-button svg { width: 20px; height: 20px; }
.cart-count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  display: inline-grid; place-items: center;
  background: var(--coral); color: #fff; font-size: .75rem; font-weight: 700;
}
.cart-count.bump { animation: bump .45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35); } }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(2.5rem, 5vw, 5rem) 0 clamp(3rem, 6vw, 5.5rem); }
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgb(126 163 174 / 28%), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgb(233 220 198 / 90%), transparent 60%),
    linear-gradient(180deg, var(--sand) 0%, var(--shell) 100%);
}
.hero-bg::after { /* soft tide lines */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 140px; opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 140' preserveAspectRatio='none'%3E%3Cpath d='M0 80c150-30 300-30 450 0s300 30 450 0 225-30 300-15' fill='none' stroke='%237ea3ae' stroke-opacity='.35' stroke-width='1.5'/%3E%3Cpath d='M0 110c150-30 300-30 450 0s300 30 450 0 225-30 300-15' fill='none' stroke='%237ea3ae' stroke-opacity='.2' stroke-width='1.5'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { margin-bottom: .9rem; }
.hero-title { display: block; font-size: clamp(3.4rem, 2rem + 6vw, 6.4rem); font-weight: 700; line-height: .95; letter-spacing: -.03em; color: var(--sea-deep); }
.hero-subtitle { display: block; margin-top: .55rem; font-size: clamp(1.45rem, 1rem + 1.6vw, 2.1rem); font-weight: 400; font-style: italic; color: var(--coral-deep); letter-spacing: -.01em; }
.hero-byline { color: var(--ink-soft); font-size: .98rem; margin-bottom: 1.4rem; }
.hero-byline strong { color: var(--ink); }
.hero-byline .sep { margin-inline: .25rem; color: var(--driftwood); }
.hero-synopsis { max-width: 36rem; font-size: 1.06rem; color: var(--ink-soft); }
.hero-synopsis p:first-child { color: var(--ink); font-family: var(--font-display); font-size: 1.25rem; line-height: 1.5; }

.buy-box { margin-top: 1.8rem; }
.format-picker { border: 0; padding: 0; margin: 0 0 1.25rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.format-picker legend { font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .6rem; padding: 0; }
.format-option { position: relative; cursor: pointer; }
.format-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.format-card {
  display: flex; flex-direction: column; gap: .1rem; min-width: 158px;
  padding: .8rem 1.1rem; border: 1.5px solid var(--sand-2); border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 70%); transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.format-name { font-weight: 600; font-size: .95rem; }
.format-price { font-family: var(--font-display); font-size: 1.15rem; color: var(--sea); font-variant-numeric: tabular-nums; }
.format-option:hover .format-card { border-color: var(--gulf); }
.format-option input:checked + .format-card { border-color: var(--sea); background: #fff; box-shadow: 0 0 0 3px rgb(44 90 92 / 14%); }
.format-option input:focus-visible + .format-card { outline: 2.5px solid var(--coral); outline-offset: 3px; }
.format-option.is-coming-soon { opacity: .72; cursor: not-allowed; }
.format-option.is-coming-soon .format-card { background: rgb(243 235 221 / 45%); border-style: dashed; }
.pill-soon {
  display: inline-block;
  margin-left: .35rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--driftwood);
  color: #fff;
  vertical-align: middle;
}
.pill-preorder, .cart-pill-preorder {
  display: inline-block;
  margin-left: .35rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--coral);
  color: #fff;
  vertical-align: middle;
}
.cart-preorder-ship {
  font-size: .78rem;
  color: var(--coral-dark, #b84b28);
  font-weight: 600;
  margin: 0 0 .5rem;
}
.buy-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 1.75rem; }
.buy-note { margin-top: 1rem; font-size: .875rem; color: var(--ink-soft); }

.hero-media { margin: 0; position: relative; }
.hero-media img { width: 100%; aspect-ratio: 1200 / 896; object-fit: cover; border-radius: calc(var(--radius) + 6px); box-shadow: var(--shadow-lg); }
.hero-media::before {
  content: ''; position: absolute; inset: auto -18px -18px auto; width: 62%; height: 62%; z-index: -1;
  border-radius: calc(var(--radius) + 6px); background: var(--gulf-pale);
}

.hero-details {
  display: grid; gap: 1.5rem; margin-top: clamp(3rem, 6vw, 4.5rem);
  grid-template-columns: 1.1fr 1fr; grid-template-areas: 'inside quote' 'inside author';
}
.inside-card { grid-area: inside; padding: clamp(1.5rem, 3vw, 2.4rem); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.inside-card h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.parts { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: .1rem; }
.parts li { display: grid; grid-template-columns: 5.2rem 1fr; column-gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--sand-2); }
.parts li:last-child { border-bottom: 1px solid var(--sand-2); }
.part-num { grid-row: span 2; font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--coral-deep); padding-top: .25rem; }
.part-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.part-detail { color: var(--ink-soft); font-size: .95rem; }
.pull-quote {
  grid-area: quote; margin: 0; padding: clamp(1.5rem, 3vw, 2.2rem);
  border-radius: var(--radius); background: var(--sea-deep); color: var(--sand);
  position: relative; overflow: hidden;
}
.pull-quote::before { content: '“'; position: absolute; right: 1rem; top: -1.6rem; font-family: var(--font-display); font-size: 9rem; line-height: 1; color: rgb(243 235 221 / 10%); }
.pull-quote p { font-family: var(--font-display); font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); line-height: 1.38; font-style: italic; margin-bottom: .8rem; }
.author-card { grid-area: author; display: flex; gap: 1.5rem; align-items: flex-start; padding: clamp(1.5rem, 3vw, 2.2rem); background: var(--sand); border-radius: var(--radius); }
.author-card h3 { font-size: 1.5rem; margin-bottom: .4rem; }
.author-card p:last-child { margin: 0; color: var(--ink-soft); font-size: .98rem; line-height: 1.6; }
.author-cover { width: 96px; flex: none; border-radius: 4px; box-shadow: var(--shadow-md); transform: rotate(-2deg); }
.author-photo { width: 130px; height: 130px; flex: none; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-md); border: 3.5px solid #fff; }
@media (max-width: 640px) {
  .author-card { flex-direction: column; align-items: flex-start; }
}

/* ---------- Swag & Catalog ---------- */
.eyebrow-badge { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; flex-wrap: wrap; }
.eyebrow-text { font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--driftwood); }
.badge { display: inline-flex; align-items: center; padding: .25rem .65rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--sand-2); color: var(--sea-deep); width: fit-content; }
.badge-accent { background: var(--coral); color: #fff; }

.backlist, .swag-section { padding: clamp(4rem, 8vw, 7rem) 0; background: var(--shell); }
.section-head { max-width: 42rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-lede { color: var(--ink-soft); font-size: 1.08rem; }
.book-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(1.5rem, 3vw, 2.25rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.book-card article { height: 100%; display: flex; flex-direction: column; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .3s var(--ease), transform .3s var(--ease); }
.book-card article:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.book-media { position: relative; overflow: hidden; aspect-ratio: 3 / 4; background: var(--sand); outline-offset: -3px; }
.swag-media { aspect-ratio: 4 / 3 !important; }
.book-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.book-hover {
  position: absolute; inset: auto 0 0 0; padding: 3.5rem 1.4rem 1.3rem;
  color: #fff; font-size: .96rem; line-height: 1.5;
  background: linear-gradient(180deg, transparent, rgb(27 59 61 / 78%) 35%, rgb(27 59 61 / 94%));
  transform: translateY(101%); transition: transform .45s var(--ease);
}
.book-hover p { margin: 0; }
.book-meta { font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #f2b9a3; margin-bottom: .45rem !important; }
@media (hover: hover) {
  .book-media:hover img, .book-media:focus-visible img, .book-media:focus-within img { transform: scale(1.04); }
  .book-media:hover .book-hover, .book-media:focus-visible .book-hover { transform: translateY(0); }
}
@media (hover: none) {
  .book-hover { position: static; transform: none; padding: 1rem 1.25rem 0; color: var(--ink-soft); background: none; }
  .book-meta { color: var(--coral-deep); }
  .book-media { aspect-ratio: auto; overflow: visible; background: none; }
  .book-media img { aspect-ratio: 3 / 4; }
  .swag-media img { aspect-ratio: 4 / 3; }
}
.book-info { display: flex; flex-direction: column; flex: 1; padding: 1.2rem 1.35rem 1.35rem; }
.swag-header { margin-bottom: .4rem; }
.swag-header .badge { margin-bottom: .5rem; }
.swag-header h3 { margin-bottom: .15rem; font-size: 1.25rem; }
.swag-sub { font-size: .85rem; color: var(--sea); font-weight: 600; margin: 0; }
.swag-short { font-size: .92rem; color: var(--ink-soft); line-height: 1.45; margin: .5rem 0 1rem; flex: 1; }
.book-author { color: var(--ink-soft); font-style: italic; font-family: var(--font-display); margin-bottom: 1rem; }
.book-buy { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.book-price { margin: 0; display: flex; flex-direction: column; line-height: 1.25; }
.book-price strong { font-family: var(--font-display); font-size: 1.25rem; color: var(--sea-deep); font-variant-numeric: tabular-nums; }
.book-price span { font-size: .8rem; color: var(--ink-soft); }

.product-buy { margin-top: auto; display: flex; flex-direction: column; gap: .75rem; }
.product-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.format-select {
  padding: .5rem .75rem;
  font-size: .85rem;
  font-family: var(--font-body);
  border: 1.5px solid var(--sand-2);
  border-radius: var(--radius-sm);
  background: var(--shell);
  color: var(--ink);
  cursor: pointer;
  max-width: 175px;
  transition: border-color .2s;
}
.format-select:hover { border-color: var(--sea); }
.format-select:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }

/* ---------- Our Story ---------- */
.story { position: relative; padding: clamp(4rem, 8vw, 7rem) 0; background: var(--sea-deep); color: var(--sand); overflow: hidden; }
.story::before {
  content: ''; position: absolute; inset: 0; opacity: .35; pointer-events: none;
  background: radial-gradient(800px 400px at 100% 0%, rgb(126 163 174 / 40%), transparent 60%), radial-gradient(600px 400px at 0% 100%, rgb(208 112 79 / 18%), transparent 60%);
}
.story-grid { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.story-media { margin: 0; }
.story-media img { width: 100%; aspect-ratio: 1264 / 848; object-fit: cover; border-radius: var(--radius); box-shadow: 0 30px 60px -25px rgb(0 0 0 / 55%); }
.story h2 { color: #fff; }
.story-copy > p { color: rgb(243 235 221 / 86%); }
.story-points { list-style: none; padding: 0; margin: 1.5rem 0 2rem; display: grid; gap: .8rem; }
.story-points li { position: relative; padding-left: 1.6rem; color: rgb(243 235 221 / 86%); }
.story-points li::before { content: ''; position: absolute; left: 0; top: .62em; width: .7rem; height: 1.5px; background: var(--coral); }
.story-points strong { color: #fff; font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: var(--sand); padding: 3.5rem 0 1.5rem; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 2rem; align-items: start; }
.brand-footer { color: var(--sea-deep); text-decoration: none; display: inline-block; margin-bottom: .4rem; }
.footer-details summary { cursor: pointer; font-weight: 600; color: var(--sea-deep); }
.footer-details p { margin-top: .75rem; color: var(--ink-soft); }
.footer-contact { text-align: right; }
.footer-base { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgb(138 118 96 / 25%); color: var(--ink-soft); font-size: .85rem; }
.footer-base p { margin: 0; }

/* ---------- Dialogs (cart drawer + checkout) ---------- */
dialog { padding: 0; border: 0; color: var(--ink); background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: rgb(18 32 34 / 45%); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
body.dialog-open { overflow: hidden; }

.drawer { margin: 0 0 0 auto; height: 100dvh; width: min(440px, 100vw); }
.drawer[open] { animation: slide-in .38s var(--ease); }
.drawer[open]::backdrop { animation: fade-in .3s ease; }
.drawer.closing { animation: slide-out .28s ease forwards; }
.drawer.closing::backdrop { animation: fade-out .28s ease forwards; }
.drawer-panel { height: 100%; display: flex; flex-direction: column; background: var(--shell); box-shadow: -20px 0 50px rgb(0 0 0 / 15%); }
.drawer-header, .modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem 1.1rem 1.5rem; border-bottom: 1px solid var(--sand-2); }
.drawer-header h2, .modal-header h2 { font-size: 1.45rem; margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; }
.drawer-footer { padding: 1.25rem 1.5rem 1.5rem; border-top: 1px solid var(--sand-2); background: #fff; }
.subtotal-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; }
.subtotal-row strong { font-family: var(--font-display); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.drawer-footer .muted { margin: .3rem 0 1rem; }

.ship-progress { margin-bottom: 1.25rem; padding: .9rem 1rem; border-radius: var(--radius-sm); background: var(--gulf-pale); font-size: .9rem; }
.ship-progress p { margin: 0 0 .55rem; }
.ship-bar { height: 6px; border-radius: 999px; background: rgb(255 255 255 / 70%); overflow: hidden; }
.ship-bar span { display: block; height: 100%; width: 0; background: var(--sea); border-radius: inherit; transition: width .5s var(--ease); }

.cart-lines { list-style: none; margin: 0; padding: 0; }
.cart-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--sand-2); }
.cart-line img { width: 64px; height: 86px; object-fit: cover; border-radius: 4px; box-shadow: var(--shadow-sm); }
.cart-line h3 { font-size: 1.05rem; margin: 0 0 .1rem; }
.cart-line .meta { font-size: .85rem; color: var(--ink-soft); margin: 0 0 .6rem; }
.line-price { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--sand-2); border-radius: 999px; background: #fff; }
.qty button { width: 32px; height: 32px; border: 0; background: transparent; cursor: pointer; border-radius: 50%; font-size: 1.1rem; line-height: 1; }
.qty button:hover { background: var(--sand); }
.qty output { min-width: 1.8rem; text-align: center; font-weight: 600; font-size: .92rem; font-variant-numeric: tabular-nums; }
.remove-btn { display: block; margin-top: .5rem; margin-left: auto; padding: 0; border: 0; background: none; color: var(--ink-soft); font-size: .8rem; text-decoration: underline; cursor: pointer; }
.remove-btn:hover { color: var(--coral-deep); }
.cart-empty { text-align: center; padding: 3rem 0; color: var(--ink-soft); }

.modal { margin: auto; width: min(720px, 100vw - 1.5rem); max-height: calc(100dvh - 1.5rem); }
.modal[open] { animation: rise .38s var(--ease); }
.modal[open]::backdrop { animation: fade-in .3s ease; }
.modal-panel { display: flex; flex-direction: column; max-height: calc(100dvh - 1.5rem); background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.modal-body { overflow-y: auto; padding: 1.5rem; min-height: 280px; }
.loading { display: grid; place-items: center; gap: 1rem; padding: 3rem 0; color: var(--ink-soft); }
.loading[hidden] { display: none !important; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--sand-2); border-top-color: var(--sea); border-radius: 50%; animation: spin .8s linear infinite; }

.notice { padding: .9rem 1.1rem; border-radius: var(--radius-sm); background: var(--sand); font-size: .9rem; margin-bottom: 1.25rem; }
.notice strong { color: var(--coral-deep); }
.order-summary { list-style: none; padding: 0; margin: 0 0 1.25rem; font-size: .95rem; }
.order-summary li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; }
.order-summary .total { border-top: 1px solid var(--sand-2); margin-top: .4rem; padding-top: .7rem; font-weight: 700; }
.demo-form { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.demo-form .full { grid-column: 1 / -1; }
.field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .35rem; color: var(--ink-soft); }
.field input, .field select {
  width: 100%; padding: .75rem .9rem; font: inherit; font-size: .98rem; color: var(--ink);
  border: 1.5px solid var(--sand-2); border-radius: var(--radius-sm); background: var(--shell);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 3px rgb(44 90 92 / 15%); background: #fff; }
.success { text-align: center; padding: 1.5rem 0 .5rem; }
.success-icon { width: 64px; height: 64px; margin: 0 auto 1rem; display: grid; place-items: center; border-radius: 50%; background: var(--gulf-pale); color: var(--sea); }
.success-icon svg { width: 30px; height: 30px; }
.success h3 { font-size: 1.8rem; }
.error-text { color: var(--coral-deep); }

/* ---------- Order Confirmation / Thank You Page ---------- */
.thankyou-section {
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(4rem, 8vw, 7rem);
  background: var(--shell);
  min-height: calc(100vh - var(--header-h) - 200px);
}
.thankyou-card {
  max-width: 680px;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: clamp(2rem, 4vw, 3rem);
  border: 1px solid var(--sand-2);
}
.thankyou-header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.thankyou-header h1 {
  font-size: clamp(2rem, 1.5rem + 1.8vw, 2.8rem);
  color: var(--sea-deep);
  margin-bottom: .6rem;
}
.thankyou-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .9rem;
  border-radius: 999px;
  background: var(--gulf-pale);
  color: var(--sea-deep);
  font-weight: 600;
  font-size: .85rem;
  margin-bottom: 1rem;
}
.thankyou-badge svg {
  width: 1.15em;
  height: 1.15em;
  color: var(--sea);
}
.order-details-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: .95rem;
}
.order-details-table tr {
  border-bottom: 1px solid var(--sand-2);
}
.order-details-table th {
  text-align: left;
  padding: .85rem 0;
  color: var(--ink-soft);
  font-weight: 500;
  width: 38%;
}
.order-details-table td {
  padding: .85rem 0;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}
.order-note {
  background: var(--sand);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  margin: 1.75rem 0;
  font-size: .92rem;
  line-height: 1.6;
}
.order-note strong {
  color: var(--sea-deep);
}
.thankyou-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 60;
  padding: .85rem 1.25rem; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: .95rem; box-shadow: var(--shadow-md);
  transform: translate(-50%, 150%); opacity: 0; transition: transform .35s var(--ease), opacity .35s;
  pointer-events: none; white-space: nowrap; max-width: calc(100vw - 2rem); overflow: hidden; text-overflow: ellipsis;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@keyframes slide-in { from { transform: translateX(100%); } }
@keyframes slide-out { to { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 959px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .hero-media::before { inset: auto -10px -10px auto; }
  .hero-details { grid-template-columns: 1fr; grid-template-areas: 'quote' 'inside' 'author'; }
  .story-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .site-nav { display: none; }
  .header-inner { justify-content: space-between; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-contact { text-align: left; }
  .footer-base { flex-direction: column; }
}
@media (max-width: 480px) {
  body { font-size: 1rem; }
  .cart-label { display: none; }
  .format-picker { display: grid; grid-template-columns: 1fr 1fr; }
  .format-card { min-width: 0; }
  .buy-actions .btn { width: 100%; }
  .buy-actions { justify-content: center; }
  .author-card { flex-direction: column; }
  .demo-form { grid-template-columns: 1fr; }
  .modal { width: 100vw; max-height: 100dvh; }
  .modal-panel { max-height: 100dvh; border-radius: 0; min-height: 100dvh; }
}
