/* The Diary of an Online Entrepreneur: site styles (direction A, The Jacket)
   Palette sampled from the v2.3 printed cover:
   paper #f5eedf, ink #2a261e, gold #a8823f */

:root {
  --paper: #f5eedf;
  --paper-2: #efe6d3;
  --ink: #2a261e;
  --ink-soft: #4a4438;
  --gold: #a8823f;
  --bronze: #765a22;      /* gold darkened for small text on paper */
  --night: #14110c;
  --night-2: #1d1912;
  --cream: #f3ecdd;
  --cream-soft: #cfc6b3;
  --gold-night: #d0a862;  /* gold lifted for text on night */
  --error: #8a2c19;       /* error text and field border on paper */
  --serif: 'EB Garamond', 'Iowan Old Style', 'Palatino Linotype', serif;
  --sans: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  --pad: clamp(1.25rem, 4vw, 4rem);
  --ease: cubic-bezier(.22,1,.36,1);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .16 0 0 0 0 .15 0 0 0 0 .12 .26 0 0 0 -.1'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--serif);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
p, h1 { margin: 0; }
i { font-style: normal; }
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
[hidden] { display: none !important; }
::selection { background: rgba(168,130,63,.3); color: var(--ink); }
/* paper grain: one small tile behind the content, so type and the cover stay sharp */
body { background: var(--grain) 0 0 / 240px 240px, var(--paper); }
@media print { body { background: #fff; } }

/* ---------- shared hero frame ---------- */
.hero {
  position: relative;
  flex: 1 0 auto;
  padding: 0 var(--pad) clamp(1.5rem, 4vh, 3rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.bar {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem;
  padding: clamp(1.1rem, 2.4vh, 1.75rem) 0;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.mark { font-weight: 600; color: inherit; text-decoration: none; }
a.mark { display: inline-block; padding: 0.95rem 0; margin: -0.95rem 0; }   /* 44px tap height, same layout */
.bar-note { text-align: right; opacity: 0.78; }
.bar-note i { margin: 0 0.35em; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bronze);
}

/* ---------- opt-in form (shared skeleton) ---------- */
.optin { position: relative; display: flex; flex-wrap: wrap; gap: 0.6rem; max-width: 31rem; }
.optin input {
  flex: 1 1 12rem; min-width: 0;
  height: 3.25rem; padding: 0 1rem;
  font: 400 1.0625rem/1 var(--sans);
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 2px;
  outline: none;                 /* focus is drawn with box-shadow below */
  transition: box-shadow .2s ease, border-color .2s ease;
}
.optin input::placeholder { color: currentColor; opacity: 0.72; }
.optin button {
  flex: 0 0 auto;
  height: 3.25rem; padding: 0 1.6rem;
  font: 600 0.78rem/1 var(--sans);
  letter-spacing: 0.18em; text-transform: uppercase;
  border: 1px solid transparent; border-radius: 2px;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease, transform .25s ease;
}
.optin button:active { transform: translateY(1px); }
.optin button { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 0.7em; }
.optin button:disabled { cursor: progress; }
.optin button.is-busy .ico-arrow { display: none; }
.optin button.is-busy::after {                 /* a thin gold line runs along the button while the email is sent */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--gold-night); transform-origin: 0 50%;
}
.ico-arrow { width: 1em; height: 1em; flex: none; transition: transform .35s var(--ease); }
@media (hover: hover) { .optin button:hover .ico-arrow, .btn:hover .ico-arrow { transform: translateX(4px); } }
.optin button:focus-visible .ico-arrow, .btn:focus-visible .ico-arrow { transform: translateX(4px); }
.form-note {
  flex: 1 0 100%;
  color: var(--error);
  font: 500 0.82rem/1.4 var(--sans);
  min-height: 0;
}
.form-note:empty { display: none; }
.micro { margin-top: 0.9rem; font: 500 0.82rem/1.4 var(--sans); letter-spacing: 0.02em; }
.consent { margin-top: 0.3rem; font: 400 0.82rem/1.5 var(--sans); opacity: 0.78; max-width: 31rem; }

/* ---------- the book: a render of the printed paperback, built from the print cover file ----------
   17 angles of the same book under the same light live in assets/book/. The page shows the resting
   angle as a plain image. On a desktop pointer the script swaps angles on a canvas laid over it.
   --w is the width of the book itself; the image is wider because it carries the floor shadow.
   The numbers below come from render/turn-meta.json (render/pack_turn.py writes them). */
.shot {
  --f: 0.5297; --ml: 0.2871; --mr: 0.1832; --mb: 0.055; --pivot: 55.85%;
  --w: clamp(13rem, 24vw, 22rem);
  --iw: calc(var(--w) / var(--f));
  position: relative; z-index: 1; flex: none;
  width: var(--iw);
  margin: 0 calc(var(--iw) * var(--mr) * -1) calc(var(--iw) * var(--mb) * -1) calc(var(--iw) * var(--ml) * -1);
}
.shot-in { position: relative; transform-origin: var(--pivot) 50%; transform: scaleX(var(--sx, 1)); }   /* --pivot is the line the book turns about */
.shot img { width: 100%; height: auto; }
.shot canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.shot-in.is-turning img { opacity: 0; }

/* =====================================================
   A: THE JACKET  (light, asymmetric, cover as artifact)
   ===================================================== */
.hero-a { color: var(--ink); }
.a-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 6rem);
  align-items: center;
  max-width: 82rem; width: 100%; margin: 0 auto;
}
.a-title {
  margin-top: 1.1rem;
  font-weight: 400;
  font-size: clamp(2.7rem, 5.9vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.022em;
}
.a-title span { display: block; }
.a-sub {
  display: flex; align-items: center; gap: 1rem;
  margin-top: 1.25rem;
  font-style: italic;
  font-size: clamp(1.25rem, 1.9vw, 1.7rem);
  color: var(--bronze);
}
.rule { display: inline-block; width: 3rem; height: 1px; background: var(--gold); flex: none; }
.a-jacket { margin-top: clamp(1.25rem, 2.6vh, 2rem); max-width: 34rem; }
.a-jacket p { font-size: clamp(1.1rem, 1.3vw, 1.3rem); line-height: 1.5; color: var(--ink-soft); }
.a-jacket p + p { margin-top: 0.7em; color: var(--ink); }
.optin-a { margin-top: clamp(1.4rem, 3vh, 2.2rem); }
.optin-a input:focus-visible { box-shadow: 0 0 0 2px var(--ink), 0 0 0 5px rgba(168,130,63,.35); }
.optin input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.optin input[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 2px var(--error), 0 0 0 5px rgba(138,44,25,.2); }
.optin input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 100px var(--paper) inset; }
.optin input:-webkit-autofill:focus-visible { box-shadow: 0 0 0 100px var(--paper) inset, 0 0 0 2px var(--ink); }
.optin-a button { background: var(--ink); color: var(--paper); }
.optin-a button:focus-visible { background: var(--bronze); outline: 2px solid var(--ink); outline-offset: 3px; }
@media (hover: hover) { .optin-a button:hover { background: var(--bronze); } }

.a-stage {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(1.5rem, 4vh, 2.75rem);
}
.a-stage::before {                         /* a pool of light behind the cover */
  content: ''; position: absolute; z-index: 0; left: 50%; top: 42%; width: 155%; aspect-ratio: 1; pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255,253,247,.95), rgba(255,253,247,.55) 42%, rgba(255,253,247,0) 72%);
}
.a-pull {
  position: relative; z-index: 1;
  font-style: italic; text-align: center;
  font-size: clamp(1.05rem, 1.3vw, 1.3rem); line-height: 1.4;
  color: var(--ink-soft);
}

/* ---------- motion (every piece of content is visible without it) ---------- */
.optin input.shake { animation: shake .42s ease both; }
@keyframes shake { 20% { transform: translateX(-5px); } 45% { transform: translateX(4px); } 70% { transform: translateX(-2px); } 100% { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .optin input.shake { animation: none; } }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation-duration: .22s; }
  ::view-transition-new(root) { animation-duration: .4s; }

  /* page load */
  .js .bar { animation: fade .9s ease both; }
  .js .rise { animation: rise .95s var(--ease) both; animation-delay: calc(var(--i, 0) * 85ms + 140ms); }
  .js .a-title span { animation: line 1.1s var(--ease) both; animation-delay: 120ms; }
  .js .a-title span + span { animation-delay: 260ms; }
  .js .rule { transform-origin: 0 50%; animation: draw .9s var(--ease) .7s both; }
  .optin button.is-busy::after { animation: busy 1.15s ease-in-out infinite; }

  /* the book fades up onto its shadow */
  .js .a-stage::before { animation: fade 1.8s ease both; }
  .js .a-stage .shot { animation: settle 1.3s var(--ease) .2s both; }

  /* thank-you: the seal draws itself */
  .js .seal circle { stroke-dasharray: 142; stroke-dashoffset: 142; animation: stroke 1.1s var(--ease) .2s forwards; }
  .js .seal path { stroke-dasharray: 26; stroke-dashoffset: 26; animation: stroke .55s var(--ease) .95s forwards; }

  /* thank-you: the paperback half arrives as it scrolls into view (opacity only, nothing moves the layout) */
  .js .reveal { opacity: 0; }
  .js .reveal.in { opacity: 1; transition: opacity 1s ease; transition-delay: calc(var(--i, 0) * 80ms); }   /* the transition lives on the arrived state, so hiding on load is instant */
  .js .ty-divide.in::before, .js .ty-divide.in::after { transition: transform 1.3s var(--ease) .1s; }
  .js .ty-divide::before { transform-origin: 100% 50%; }
  .js .ty-divide::after { transform-origin: 0 50%; }
  .js .ty-divide:not(.in)::before, .js .ty-divide:not(.in)::after { transform: scaleX(0); }
  .js .ty-stage:not(.in) .shot { opacity: 0; transform: translateY(26px) scale(.97); }
  .js .ty-stage.in .shot { transition: opacity 1.1s ease, transform 1.4s var(--ease); }
  .pb-note.swap { animation: fade .5s ease both; }

  /* 404 runs without script */
  .nf-body > * { animation: rise .95s var(--ease) both; animation-delay: calc(var(--i, 0) * 85ms + 140ms); }
  .nf-body > :nth-child(2) { --i: 1; } .nf-body > :nth-child(3) { --i: 2; } .nf-body > :nth-child(4) { --i: 3; }
  .page-nf .bar { animation: fade .9s ease both; }

  .btn:not(.is-done):hover .dl-arrow, .btn:not(.is-done):focus-visible .dl-arrow { transform: translateY(1.5px); }

  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes line { from { opacity: 0; clip-path: inset(0 -0.1em 100% -0.1em); transform: translateY(0.28em); } 30% { opacity: 1; } to { opacity: 1; clip-path: inset(-0.2em -0.1em -0.35em -0.1em); transform: none; } }
  @keyframes draw { from { transform: scaleX(0); } to { transform: none; } }
  @keyframes settle { from { opacity: 0; transform: translateY(30px) scale(.96); } to { opacity: 1; transform: none; } }
  @keyframes stroke { to { stroke-dashoffset: 0; } }
  @keyframes busy { 0% { transform: scaleX(0); transform-origin: 0 50%; } 50% { transform: scaleX(1); transform-origin: 0 50%; } 50.01% { transform: scaleX(1); transform-origin: 100% 50%; } 100% { transform: scaleX(0); transform-origin: 100% 50%; } }
}

/* =====================================================
   THANK-YOU PAGE  (same tokens, same type, same buttons)
   ===================================================== */
.ty { color: var(--ink); padding: 0 var(--pad); flex: 1 0 auto; overflow-x: clip; }
.ty-deliver {
  max-width: 44rem; margin: 0 auto; text-align: center;
  padding: clamp(2rem, 7vh, 5rem) 0 clamp(2.5rem, 7vh, 5rem);
  display: flex; flex-direction: column; align-items: center;
}
.ty-title {
  margin-top: 1rem; font-weight: 400;
  font-size: clamp(2.5rem, 5.2vw, 4.6rem); line-height: 1; letter-spacing: -0.022em;
}
.ty-lead { text-wrap: balance; margin-top: 1.1rem; font-size: clamp(1.12rem, 1.35vw, 1.35rem); line-height: 1.5; color: var(--ink-soft); max-width: 30rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 3.5rem; padding: 0 2rem;
  font: 600 0.8rem/1.2 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none;
  background: var(--ink); color: var(--paper);
  border: 1px solid transparent; border-radius: 2px; cursor: pointer;
  transition: background-color .25s ease, transform .25s ease;
}
.btn:focus-visible { background: var(--bronze); outline: 2px solid var(--ink); outline-offset: 3px; }
@media (hover: hover) { .btn:hover { background: var(--bronze); } }
.btn:active { transform: translateY(1px); }
.btn svg { width: 1em; height: 1em; flex: none; }
.ty-deliver .btn { margin-top: clamp(1.5rem, 3.5vh, 2.25rem); }
.seal { width: 3rem; height: 3rem; margin-bottom: 1.15rem; flex: none; }
.seal circle { stroke: var(--gold); stroke-width: 1.1; transform: rotate(-90deg); transform-origin: 50% 50%; }
.seal path { stroke: var(--bronze); stroke-width: 1.7; stroke-linecap: square; }
.ico-dl path { transition: transform .35s var(--ease), opacity .25s ease, stroke-dashoffset .45s var(--ease) .12s; }
.ico-dl .dl-check { stroke-dasharray: 14; stroke-dashoffset: 14; opacity: 0; }
.btn.is-done .dl-arrow { transform: translateY(5px); opacity: 0; }
.btn.is-done .dl-tray { opacity: 0; }
.btn.is-done .dl-check { stroke-dashoffset: 0; opacity: 1; }
.ty-meta { margin-top: 0.9rem; font: 500 0.82rem/1.4 var(--sans); letter-spacing: 0.04em; color: var(--ink-soft); }
.ty-alt { margin-top: 0.1rem; font: 400 0.82rem/1.4 var(--sans); letter-spacing: 0.02em; color: var(--ink-soft); }
.ty-alt a { display: inline-block; padding: 0.82rem 0.2rem; color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.ty-alt a:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }
@media (hover: hover) { .ty-alt a:hover { color: var(--bronze); } }

.ty-divide { scroll-margin-top: 1.5rem; display: flex; align-items: center; justify-content: center; gap: 1.25rem; max-width: 82rem; margin: 0 auto; }
.ty-divide::before, .ty-divide::after { content: ''; height: 1px; background: rgba(168,130,63,.55); flex: 1; }

.ty-offer {
  max-width: 68rem; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem); align-items: center;
  padding: clamp(2.5rem, 8vh, 6rem) 0 clamp(3rem, 9vh, 7rem);
}
.ty-offer {                                   /* the paperback sits on a slightly deeper sheet, edge to edge */
  margin-top: clamp(2rem, 5vh, 3.25rem);
  position: relative; z-index: 0;
}
.ty-offer::before {
  content: ''; position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%);
  background: var(--grain) 0 0 / 240px 240px, var(--paper-2);
}
.ty-stage { display: flex; justify-content: center; }
.ty-h2 { text-wrap: balance; font-weight: 400; font-size: clamp(1.9rem, 3.2vw, 2.9rem); line-height: 1.08; letter-spacing: -0.016em; }
.ty-h2 em { display: block; color: var(--bronze); }
.ty-body { margin-top: clamp(1.1rem, 2.4vh, 1.6rem); max-width: 33rem; }
.ty-body p { font-size: clamp(1.1rem, 1.3vw, 1.28rem); line-height: 1.55; color: var(--ink-soft); }
.ty-body p + p { margin-top: 0.75em; }
.pb { margin-top: clamp(1.4rem, 3vh, 2rem); max-width: 33rem; padding-top: 1.1rem; border-top: 1px solid rgba(168,130,63,.55); }
.pb-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.25rem; margin-top: 0.5rem; }
.pb-price { font-size: clamp(2.6rem, 4.4vw, 3.6rem); line-height: 0.9; letter-spacing: -0.02em; font-variant-numeric: lining-nums; }
.pb-price sup { font-size: 0.42em; vertical-align: 0.95em; margin-right: 0.08em; color: var(--bronze); }
.pb-price.is-pending { font: 500 0.9rem/1.3 var(--sans); letter-spacing: 0.02em; color: var(--ink-soft); padding-bottom: 0.9rem; }
.pb-ship { display: flex; flex-direction: column; gap: 0.35rem; flex: 0 1 15rem; min-width: 0; }
.pb-ship span { font: 500 0.7rem/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--bronze); }
.pb-ship select {
  width: 100%; height: 3rem; padding: 0 2.4rem 0 0.9rem;
  font: 400 1rem/1 var(--sans); color: var(--ink);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%232a261e' stroke-width='1.5'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E") right 0.9rem center / 0.7rem auto no-repeat;
  border: 1px solid var(--ink); border-radius: 2px;
  -webkit-appearance: none; appearance: none; cursor: pointer;
  transition: box-shadow .2s ease;
}
.pb-ship select:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ink), 0 0 0 5px rgba(168,130,63,.35); }
.pb-note { margin-top: 0.8rem; font: 400 0.86rem/1.45 var(--sans); color: var(--ink-soft); }
.pb-note:empty { display: none; }
.ty-offer .btn { margin-top: 1.1rem; }
.stub-note { margin-top: 0.7rem; font: 500 0.82rem/1.4 var(--sans); color: var(--bronze); }
.stub-note:empty { display: none; }
.ty-close { margin-top: clamp(1.5rem, 3.4vh, 2.25rem); max-width: 33rem; }
.ty-close p { font-size: clamp(1.05rem, 1.2vw, 1.2rem); line-height: 1.55; color: var(--ink-soft); }
.ty-sign { margin-top: 0.6em !important; color: var(--ink) !important; font-style: italic; }

/* ---------- footer ---------- */
.foot {
  flex: none;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.4rem 1.1rem;
  padding: 0.35rem var(--pad) 0.55rem;
  min-height: 4.25rem;
  font: 400 0.78rem/1.4 var(--sans); letter-spacing: 0.06em; color: var(--ink-soft);
  border-top: 1px solid rgba(42,38,30,.1);
}
.foot a { color: inherit; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .3s ease, color .2s ease; background-position: 0 calc(100% - 0.7rem); padding: 0.85rem 0.15rem; }
.foot a:focus-visible { color: var(--ink); background-size: 100% 1px; outline: 2px solid var(--ink); outline-offset: -4px; }
@media (hover: hover) { .foot a:hover { color: var(--ink); background-size: 100% 1px; } }
.mark:focus-visible { outline: 2px solid var(--ink); outline-offset: -6px; }
.foot i { color: var(--gold); }

/* ---------- tablet and phone ---------- */
@media (max-width: 900px) {
  .bar-note { display: none; }
  .bar { padding: 0.9rem 0; }
  .a-grid { grid-template-columns: 1fr; gap: 1.1rem; align-content: start; }
  .a-stage { order: -1; flex-direction: row; justify-content: flex-start; gap: 1.25rem; }
  .a-pull { text-align: left; font-size: 1rem; }
  .a-title { margin-top: 0.6rem; font-size: clamp(2.2rem, 10vw, 3.4rem); }
  .a-sub { margin-top: 0.7rem; font-size: 1.12rem; }
  .rule { width: 2rem; }
  .a-jacket { margin-top: 0.9rem; }
  .a-jacket p { font-size: 1.02rem; line-height: 1.45; }
  .a-jacket p + p { margin-top: 0.55em; }
  .optin-a { margin-top: 1.1rem; }
  .optin button { flex: 1 1 100%; }

  .ty-deliver { padding-top: 1.5rem; }
  .ty-deliver .btn, .ty-offer .btn { width: 100%; }
  .pb-ship { flex-basis: 12.5rem; }
  .ty-offer { grid-template-columns: 1fr; gap: 2.25rem; }
  .foot i { display: none; }
  .foot { gap: 0.2rem 1.4rem; }
  .ty-h2 { font-size: clamp(1.7rem, 7.6vw, 2.4rem); }
}
/* phones: the form comes before the cover, so the button is on the first screen */
@media (max-width: 699px) {
  .a-stage { order: 0; flex-direction: column; align-items: center; gap: 1.4rem; margin-top: 2.5rem; padding-bottom: 1.25rem; }
  .a-stage .shot { --w: 11.5rem; }
  .a-pull { text-align: center; font-size: 1.12rem; }
}
/* tablets held upright: two columns, like desktop */
@media (min-width: 700px) and (max-width: 900px) {
  .a-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: center; align-content: center; }
  .a-stage { order: 0; flex-direction: column; align-items: center; gap: 1.5rem; }
  .a-stage .shot { --w: clamp(10rem, 27vw, 14rem); }
  .a-pull { text-align: center; }
  .a-title { font-size: clamp(2.4rem, 6.2vw, 3.3rem); }
}
@media (min-width: 901px) and (max-height: 760px) {
  .a-title { font-size: clamp(2.5rem, 4.6vw, 4.2rem); }
  .a-stage .shot { --w: clamp(11rem, 19vw, 16rem); }
}

/* ---------- 404 ---------- */
.nf { flex: 1 0 auto; display: flex; flex-direction: column; padding: 0 var(--pad); }
.nf-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3rem 0 4rem; }
.nf-body h1 { margin-top: 1rem; font-weight: 400; font-size: clamp(2.3rem, 5vw, 4rem); line-height: 1.02; letter-spacing: -0.022em; }
.nf-body p.nf-lead { margin-top: 1rem; font-size: clamp(1.1rem, 1.3vw, 1.3rem); line-height: 1.5; color: var(--ink-soft); max-width: 26rem; }
.nf-body .btn { margin-top: 2rem; }

/* =====================================================
   THANK-YOU, THE STAGE  (the paperback half goes to night, under a warm light)
   ===================================================== */
.page-ty .ty-offer { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); color: var(--cream); background-color: var(--night); margin-top: clamp(3rem, 7vh, 4.75rem); padding: clamp(4rem, 12vh, 8rem) 0 clamp(4rem, 12vh, 8rem); max-width: 74rem; gap: clamp(2rem, 6vw, 6.5rem); }
.page-ty .ty-offer::before { background: radial-gradient(46rem 40rem at calc(50% - 20rem) 46%, rgba(208,168,98,.2), rgba(208,168,98,0) 70%), var(--grain) 0 0 / 240px 240px, var(--night); }
.page-ty .ty-stage { position: relative; }
.page-ty .ty-stage .shot { --w: clamp(13rem, 25vw, 23rem); }
.page-ty .ty-stage::before {                   /* a lit patch of floor under the book, so its shadow reads on night */
  content: ''; position: absolute; z-index: 0; left: 50%; bottom: -5%; width: 170%; height: 36%; transform: translateX(-52%);
  background: radial-gradient(closest-side, rgba(208,168,98,.22), rgba(208,168,98,0)); pointer-events: none;
}
.page-ty .ty-h2 { color: var(--cream); font-size: clamp(2rem, 3.3vw, 3rem); line-height: 1.06; text-wrap: wrap; }
.page-ty .ty-h2 em { color: var(--gold-night); }
.page-ty .ty-body p, .page-ty .ty-close p, .page-ty .pb-note { color: var(--cream-soft); }
.page-ty .ty-sign { color: var(--cream) !important; }
.page-ty .ty-offer .eyebrow, .page-ty .pb-ship span, .page-ty .pb-price sup, .page-ty .stub-note { color: var(--gold-night); }
.page-ty .pb { border-top-color: rgba(208,168,98,.5); }
.page-ty .pb-price { color: var(--cream); font-size: clamp(3.2rem, 5.6vw, 4.8rem); }
.page-ty .pb-ship select { color: var(--cream); border-color: rgba(243,236,221,.6); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23f3ecdd' stroke-width='1.5'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E"); }
.page-ty .pb-ship select option { color: var(--ink); background: var(--paper); }
.page-ty .pb-ship select:focus-visible { box-shadow: 0 0 0 2px var(--cream), 0 0 0 5px rgba(208,168,98,.45); }
.page-ty .ty-offer .btn { background: var(--cream); color: var(--night); min-height: 3.75rem; padding: 0 2.4rem; }
.page-ty .ty-offer .btn:focus-visible { background: var(--gold-night); outline-color: var(--cream); }
@media (hover: hover) { .page-ty .ty-offer .btn:hover { background: var(--gold-night); } }
.page-ty .foot { background: var(--night); color: var(--cream-soft); border-top-color: rgba(243,236,221,.14); }
.page-ty .foot a:focus-visible { color: var(--cream); outline-color: var(--cream); }
@media (hover: hover) { .page-ty .foot a:hover { color: var(--cream); } }
.page-ty .pb-price.is-pending { color: var(--cream-soft); }
.page-ty .foot i { color: var(--gold-night); }
@media (max-width: 900px) {
  .page-ty .ty-offer { grid-template-columns: 1fr; gap: 2.25rem; padding: 3.25rem 0 3.5rem; }
  .page-ty .ty-offer::before { background: radial-gradient(26rem 24rem at 50% 12rem, rgba(208,168,98,.22), rgba(208,168,98,0) 70%), var(--grain) 0 0 / 240px 240px, var(--night); }
  .page-ty .ty-stage .shot { --w: 12.5rem; }
  .page-ty .ty-h2 { text-wrap: balance; }
}
