:root {
  color-scheme: dark;
  --background: #1a1815;
  --text: #f5efe6;
  --muted: #b7ab9b;
  --gold: #ddbe8e;
  --line: #ffffff24;
  --sans: "Avenir Next", Avenir, system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  font-family: var(--sans);
  background: var(--background);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(ellipse at 72% 42%, #544333 0%, #2b231c 38%, transparent 72%),
    linear-gradient(130deg, #211d18, #151411 78%);
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
button[aria-disabled="true"] { cursor: default; }
img { display: block; }

.site-shell { max-width: 1500px; margin: auto; padding: 0 clamp(28px, 5.1vw, 80px); }
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 13px; font: 21px var(--serif); }
.book-mark { position: relative; width: 34px; height: 34px; border: 1px solid #ddbe8e69; border-radius: 50%; }
.book-mark::before, .book-mark::after {
  content: "";
  position: absolute;
  top: 10px;
  width: 8px;
  height: 12px;
  border: 1px solid var(--gold);
}
.book-mark::before { left: 8px; border-radius: 2px 1px 0 2px; transform: skewY(10deg); }
.book-mark::after { right: 8px; border-radius: 1px 2px 2px 0; transform: skewY(-10deg); }
.masthead time, .eyebrow {
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .17em;
  line-height: 1.5;
  text-transform: uppercase;
}
.masthead time { color: var(--muted); }

.layout {
  display: grid;
  grid-template-columns: minmax(270px, .8fr) minmax(0, 1.65fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: center;
  min-height: calc(100svh - 84px);
  padding: 38px 0 36px;
}
.intro { padding-bottom: 20px; }
.eyebrow { margin: 0; }
h1 {
  margin: 17px 0 18px;
  font-family: var(--serif);
  font-size: clamp(58px, 7.2vw, 110px);
  font-weight: 400;
  letter-spacing: -.074em;
  line-height: .92;
}
h1 em { display: block; color: var(--gold); font-weight: inherit; }
.description { max-width: 29ch; margin: 0 0 27px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 164px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid #f1d7b0;
  border-radius: 5px;
  background: #e5c89e;
  color: #241c13;
  font-size: 13px;
  font-weight: 700;
  transition: background-color .2s;
}
.primary:hover { background: #f5dbb5; }
.primary:active { background: #d4b387; }
.page-index { margin-top: 39px; padding-top: 20px; border-top: 1px solid var(--line); }
.page-index .eyebrow { color: var(--muted); }
.thumbs { display: flex; gap: 16px; margin-top: 12px; }
.thumb {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  min-width: 60px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.thumb img {
  width: 43px;
  height: auto;
  aspect-ratio: 3 / 5;
  border: 1px solid #ffffff30;
  border-radius: 2px;
  opacity: .68;
  transition: opacity .2s, border-color .2s;
}
.thumb[aria-current] { color: var(--text); }
.thumb[aria-current] img { outline: 1px solid var(--gold); outline-offset: 3px; opacity: 1; }
.thumb:hover img { opacity: 1; border-color: var(--gold); }

.reader {
  --spread: min(100%, 750px, calc(clamp(380px, 100svh - 295px, 625px) * 1.2));
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  min-width: 0;
}
.scene { display: grid; place-items: center; width: 100%; }
.book {
  position: relative;
  isolation: isolate;
  width: var(--spread);
  aspect-ratio: 6 / 5;
  transform: translateX(var(--book-offset, -25%));
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}
.reader[data-view="spread"] .book { --book-offset: 0%; }
.paper, .sheet {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background: #dbd1bf;
}
.paper { box-shadow: 0 2px 4px #0005, 0 18px 30px #0005, 0 45px 70px -29px #000a; }
.paper-left { left: 0; border-radius: 3px 0 0 3px; }
.paper-right { right: 0; border-radius: 0 3px 3px 0; }
.paper img, .sheet img { width: 100%; height: 100%; border-radius: inherit; pointer-events: none; }
.reader[data-view="cover"] .paper-right {
  border-radius: 3px 4px 4px 3px;
  box-shadow: 1px 1px #827155, 2px 2px #d2c3a5, 3px 3px #827155, 4px 4px #cfbea1,
    5px 5px #634f37, 0 18px 30px #0008, 0 45px 70px -26px #000c;
}
.reader[data-view="cover"] .paper-right, .reader[data-view="spread"] .paper-left,
.reader[data-view="spread"]:not([data-end]) .paper-right { cursor: grab; }
.reader[data-turning] .book, .reader[data-turning] .paper { cursor: grabbing; }
.reader[data-view="cover"] .paper-right::after, .reader[data-view="spread"] .paper-left::after,
.reader[data-view="spread"]:not([data-end]) .paper-right::after {
  content: "";
  pointer-events: none;
  position: absolute;
  bottom: 0;
  width: 24px;
  height: 24px;
  opacity: .56;
  transition: opacity .2s, scale .2s;
}
.reader[data-view="cover"] .paper-right::after, .reader[data-view="spread"]:not([data-end]) .paper-right::after {
  right: 0;
  border-radius: 0 0 3px 0;
  background: linear-gradient(135deg, transparent 49%, #0008 50%, #fff5 64%, #ffe9bc);
  transform-origin: bottom right;
}
.reader[data-view="spread"] .paper-left::after {
  left: 0;
  border-radius: 0 0 0 3px;
  background: linear-gradient(225deg, transparent 49%, #0008 50%, #fff5 64%, #ffe9bc);
  transform-origin: bottom left;
}
.reader:not([data-turning]) .paper:hover::after { opacity: .95; scale: 1.16; }
.reader[data-turning] .paper::after { display: none; }
.spine {
  display: none;
  pointer-events: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 9%;
  translate: -50% 0;
  background: linear-gradient(90deg, transparent, #0002 38%, #160e086b 49%, #ffefd332 52%, transparent);
}
.reader[data-view="spread"]:not([data-turning]) .spine { display: block; }
.turn-frame, .turn-shadow { position: absolute; inset: 0; pointer-events: none; }
.turn-shadow {
  left: 50%;
  overflow: hidden;
  border-radius: 0 3px 3px 0;
}
.turn-shadow::before {
  content: "";
  position: absolute;
  left: var(--fold-x);
  top: var(--fold-y);
  width: 48%;
  height: 275%;
  translate: -50% -50%;
  rotate: var(--shade-angle);
  background: linear-gradient(90deg, transparent 49.5%, #120c0790 50%, #120c0740 57%, transparent 90%);
  opacity: var(--shade-strength);
}
.sheet { right: 0; overflow: hidden; transform-origin: 0 0; }
.sheet-front { border-radius: 0 3px 3px 0; }
.sheet-back {
  background: #e3d7c2;
  border-radius: 0 3px 3px 0;
  box-shadow: inset -1px 0 #fffd;
}
.sheet-back img { transform: scaleX(-1); }
.sheet-back::after, .sheet-front::after {
  position: absolute;
  inset: 0;
  content: "";
  opacity: var(--shade-strength);
}
.sheet-back::after { background: linear-gradient(var(--paper-angle), #33281982, #fdf2d643 47%, #fef5df74 85%, #fff7); }
.sheet-front::after { background: linear-gradient(var(--paper-angle), transparent 40%, #160e0659); }

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 23px;
}
.turn-controls {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 3px;
  border: 1px solid #ffffff2b;
  border-radius: 30px;
  background: #171412b5;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  transition: background-color .2s, color .2s;
}
.icon-button:hover:not([aria-disabled="true"]) { background: #ffffff15; color: var(--gold); }
.icon-button[aria-disabled="true"] { color: #ffffff49; }
.arrow {
  position: relative;
  display: inline-block;
  width: 15px;
  height: 12px;
  background: linear-gradient(currentColor, currentColor) center / 14px 1px no-repeat;
}
.arrow::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-left: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
}
.arrow.right { transform: rotate(180deg); }
.counter { min-width: 70px; color: var(--muted); text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.counter b { color: var(--text); font-weight: 700; }
.counter i { display: inline-block; width: 1px; height: 12px; margin: 0 9px; vertical-align: -.12em; rotate: 18deg; background: #ffffff49; }
.fullscreen { border: 1px solid #ffffff2b; background: #171412b5; }
.fullscreen span {
  width: 15px;
  height: 15px;
  background:
    linear-gradient(currentColor 0 0) left top/6px 1px, linear-gradient(currentColor 0 0) right top/6px 1px,
    linear-gradient(currentColor 0 0) left bottom/6px 1px, linear-gradient(currentColor 0 0) right bottom/6px 1px,
    linear-gradient(currentColor 0 0) left top/1px 6px, linear-gradient(currentColor 0 0) right top/1px 6px,
    linear-gradient(currentColor 0 0) left bottom/1px 6px, linear-gradient(currentColor 0 0) right bottom/1px 6px;
  background-repeat: no-repeat;
}
.fullscreen[aria-pressed="true"] span { scale: .72; }
.hint { margin: 7px 0 0; color: var(--muted); font-size: 11px; letter-spacing: .025em; }
.hint-mobile { display: none; }
.reader:fullscreen {
  --spread: min(calc(100vw - 72px), calc((100svh - 156px) * 1.2));
  background: radial-gradient(ellipse, #544333, #211b15 79%);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 760px) {
  body { background: radial-gradient(ellipse at 50% 48%, #594636, #272019 64%, #191713); }
  .site-shell { padding-inline: 20px; }
  .masthead { min-height: 61px; }
  .brand { gap: 9px; font-size: 17px; }
  .book-mark { scale: .86; }
  .layout { grid-template-columns: 1fr; gap: 22px; padding: 20px 0 28px; min-height: auto; }
  .intro { display: contents; }
  .intro .eyebrow, .description, .primary { display: none; }
  .booklet-heading { text-align: center; }
  h1 { margin: 0; font-size: clamp(36px, 8.7vw, 63px); text-align: center; letter-spacing: -.063em; }
  h1 em { display: inline; }
  .reader {
    --spread: min(calc(100% - 14px), clamp(205px, calc((100svh - 320px) * .6), 420px));
    grid-row: 2;
  }
  .book { aspect-ratio: 3 / 5; transform: none; }
  .paper, .sheet { width: 100%; border-radius: 3px; }
  .paper-right {
    box-shadow: 1px 1px #827155, 2px 2px #d2c3a5, 3px 3px #827155, 4px 4px #cfbea1,
      5px 5px #634f37, 0 15px 25px #0007, 0 27px 44px -20px #000b;
    cursor: grab;
  }
  .turn-frame { overflow: hidden; border-radius: 3px; }
  .turn-shadow { left: 0; }
  .controls { margin-top: 16px; }
  .hint { margin-top: 8px; }
  .hint-mobile { display: inline; }
  .hint-desktop { display: none; }
  .page-index { margin: 0; padding-top: 14px; }
  .thumbs { justify-content: center; gap: 12px; margin-top: 0; }
  .thumb img { width: 31px; }
  .reader:fullscreen { --spread: min(calc(100vw - 36px), calc((100svh - 156px) * .6)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}

.reader-tools { display: flex; justify-content: center; gap: 6px; margin-top: 9px; }
.reader-tool, .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
}
.reader-tool:hover, .text-button:hover { background: #ffffff0f; color: var(--text); }
.search-icon {
  position: relative;
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid currentColor;
  border-radius: 50%;
  flex: 0 0 auto;
}
.search-icon::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1px;
  left: 8px;
  top: 10px;
  rotate: 45deg;
  background: currentColor;
}
.details-icon {
  display: inline-block;
  width: 12px;
  height: 14px;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 2px;
  background: repeating-linear-gradient(to bottom, currentColor 0 1px, transparent 1px 3px) center / 6px 7px no-repeat;
}
.offer-dialog {
  width: min(620px, calc(100% - 32px));
  max-height: min(85svh, 780px);
  padding: 0;
  border: 1px solid #d6b68c49;
  border-radius: 10px;
  background: #262019;
  color: var(--text);
  box-shadow: 0 20px 96px #000a;
  overscroll-behavior: contain;
  scrollbar-color: #7b674d #262019;
}
.offer-dialog::backdrop { background: #110e0bd1; backdrop-filter: blur(5px); }
.dialog-header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 23px 27px 14px;
  border-bottom: 1px solid var(--line);
  background: #262019;
}
.dialog-header h2 {
  margin: 5px 0 0;
  font: 400 clamp(29px, 5vw, 40px) / 1.08 var(--serif);
  letter-spacing: -.04em;
}
.dialog-close { position: relative; flex: 0 0 auto; border: 1px solid var(--line); }
.dialog-close span::before, .dialog-close span::after {
  content: "";
  position: absolute;
  top: calc(50% - .5px);
  left: calc(50% - 7px);
  width: 14px;
  height: 1px;
  background: currentColor;
  rotate: 45deg;
}
.dialog-close span::after { rotate: -45deg; }
.offer-dialog > section { padding: 16px 27px 26px; }
.search-field {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border: 1px solid #d6b68c60;
  border-radius: 5px;
  background: #1c1814;
  color: var(--gold);
}
.search-field:focus-within { outline: 1px solid var(--gold); outline-offset: 2px; }
.search-field input, .share-field input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: 16px var(--sans);
}
.search-field input::placeholder { color: var(--muted); }
.search-status, .copy-status { margin: 12px 0; color: var(--muted); font-size: 12px; }
.copy-status:empty { margin: 0; }
.search-results, .offer-list { list-style: none; padding: 0; margin: 0; }
.result-button {
  display: grid;
  grid-template-columns: 31px 1fr 15px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}
.result-button:hover { background: #ffffff09; }
.result-button > .arrow { color: var(--gold); }
.page-number {
  display: grid;
  place-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--gold);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.result-copy { display: grid; gap: 4px; }
.result-copy strong { font-size: 15px; }
.result-copy small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.back-search { margin: -4px 0 8px -10px; padding-inline: 10px; }
.page-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 13px; }
.page-tab, .tool-pill {
  min-height: 40px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff07;
  color: var(--text);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
}
.page-tab[aria-pressed="true"], .tool-pill:hover { border-color: #ddbe8e96; color: var(--gold); }
.detail-summary { margin: 0 0 13px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.offer-item { padding: 10px 0; border-top: 1px solid var(--line); }
.offer-title { display: flex; justify-content: space-between; align-items: first baseline; gap: 14px; }
.offer-title h3, .offer-terms h3 { margin: 0; font-size: 14px; line-height: 1.35; }
.offer-value { color: var(--gold); text-align: right; font-size: 13px; flex: 0 0 auto; }
.offer-item p, .offer-terms p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.offer-terms { margin-top: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 5px; background: #ffffff05; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.detail-actions [data-go-to] { background: #e5c89e; border-color: #e5c89e; color: #241c13; }
.detail-actions [data-go-to]:hover { background: #f5dbb5; }
.page-proof {
  max-height: min(52svh, 610px);
  margin-top: 15px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #191613;
  overflow: auto;
}
.page-proof img { width: 864px; height: auto; max-width: none; }
.share-field { display: grid; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.share-field input { padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; }
.share-field input:focus-visible, .page-proof:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }

@media (max-width: 530px) {
  .dialog-header { padding: 17px 16px 13px; }
  .offer-dialog > section { padding: 15px 16px 21px; }
  .result-button { gap: 8px; padding-inline: 3px; }
  .tool-pill { padding-inline: 10px; }
  .reader-tool { min-height: 44px; }
}

.demo-link, .recipient-grid a { color: var(--gold); }
.recipient { display: block; }
.booklet-heading h1:has(.recipient:not([hidden])) em { display: block; }
.recipient-property { margin: 8px 0 12px; color: var(--muted); }

@media (max-width: 760px) {
  .recipient-property { margin-bottom: 0; }
}
.demo-intro { max-width: 960px; margin: 56px auto; padding-inline: 16px; }
.demo-intro > p { color: var(--muted); }
.recipient-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.recipient-grid article {
  padding: 22px;
  border: 1px solid #6a5d4b;
  border-radius: 12px;
}
.recipient-grid h2 { margin: 0 0 12px; font-size: 21px; }
.recipient-grid p { color: var(--muted); }
.recipient-grid a { display: inline-block; padding-block: 8px; }
.recipient-grid article { display: flex; flex-direction: column; align-items: flex-start; }
.recipient-grid article p { margin: 0 0 12px; }
.recipient-grid article a { margin-top: auto; }

@media (max-width: 560px) {
  .recipient-grid { grid-template-columns: 1fr; }
}

.recipient-qr {
  width: 128px;
  height: 128px;
  margin: 4px 0 10px;
  border-radius: 4px;
  image-rendering: pixelated;
}
