@font-face {
  font-family: 'Cormorant Garamond';
  src: url('./assets/cormorant-garamond.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('./assets/cormorant-garamond-italic.woff2') format('woff2');
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url('./assets/manrope.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --background: #FFFFFF;
  --surface: #FFFFFF;
  --ink: #252525;
  --accent: #4E73B8;
  --charcoal: #191919;
  --on-dark: #faf9f7;
  --on-dark-muted: #d8d3cf;
  --card-edge: #343434;
  --card-surface: radial-gradient(ellipse at 105% 120%, #514f4d 0%, #292929 37%, transparent 73%),
                  linear-gradient(145deg, #222 0%, #111 38%, #1a1919 100%);
  --card-shadow: inset 0 1px 0 #ffffff16, 0 7px 18px #12121219;
  --radius-media: 12px;
  --radius-card: 24px;
  --card-corners: var(--radius-card) var(--radius-card) 36px var(--radius-card);
  --radius-round: 999px;
  --gap: 16px;
  --section-space: clamp(64px, 8vw, 104px);
  --ui-font: 650 .875rem/1.35 var(--sans);
  --muted: #5F625E;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: Manrope, system-ui, sans-serif;
  --shell: min(100% - 64px, 1100px);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--background); color: var(--ink); font: 400 1rem/1.6 var(--sans); }
h1, h2, h3, p, figure { margin: 0; }
h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.05; }
h2 { font-size: clamp(2.25rem, 4.5vw, 3.5rem); }
a { color: inherit; text-underline-offset: .23em; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button { font: inherit; }

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-media);
  font: var(--ui-font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.button[hidden] { display: none; }
.button:disabled { opacity: .62; cursor: wait; }
.button:active:not(:disabled) { transform: translateY(1px); }
.toast-check {
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.toast-check svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.skip {
  position: fixed;
  z-index: 40;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  background: var(--surface);
  transform: translateY(-150%);
}
.skip:focus { transform: none; }

.cinematic { position: relative; height: 100svh; }
.enhanced .cinematic { height: 270svh; }
.cinematic-stage {
  position: sticky;
  top: 0;
  isolation: isolate;
  overflow: clip;
  height: 100svh;
  background: var(--background);
}
.hero-field {
  position: absolute;
  inset: 0;
  background: #fff;
  pointer-events: none;
}
.hero-field img {
  position: absolute;
  top: 38.5%;
  left: 50%;
  width: min(85%, 1200px);
  transform: translate(-50%, -50%);
  filter: brightness(0);
  opacity: var(--ink-opacity, 1);
}
.hero-field.has-art img { visibility: hidden; }
.hero {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  align-content: end;
  justify-items: center;
  padding: 0 18px clamp(83px, 11.5svh, 104px);
  text-align: center;
  pointer-events: none;
}
.hero-title, .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.deck {
  max-width: min(100%, 38ch);
  font: italic 550 clamp(1.26rem, 1.7vw, 1.48rem)/1.32 var(--serif);
  text-wrap: balance;
}

.book-layer, .scene, .sculpture { position: absolute; inset: 0; pointer-events: none; }
.book-layer { z-index: 2; }
.scene canvas { display: block; width: 100%; height: 100%; }
.cinematic-stage.has-scene .sculpture { visibility: hidden; }
.sculpture {
  --fallback-width: min(27.6svh, 86vw);
  --fallback-start: 45.5svh;
  --fallback-center: calc(var(--fallback-start) - var(--book-arrival, 0) * 4svh);
  --fallback-foot: calc(var(--fallback-center) + var(--fallback-width) * 2475 / 3070);
  --fallback-gap: 17.6svh;
  --fallback-lift: calc((var(--fallback-foot) + var(--fallback-gap) - var(--checkout-top, 100svh)) * var(--paired-lift, 0));
  transform: translateY(calc(-1 * var(--fallback-lift)));
}
.fallback-book {
  position: absolute;
  left: 50%;
  top: var(--fallback-center);
  width: var(--fallback-width);
  aspect-ratio: 1535 / 2475;
  background: url('./assets/arrived-front.webp') center / cover no-repeat;
  box-shadow: 3px 1px #bcb09d, 5px 2px #f0e6d5;
  transform: translate(-50%, -50%) rotate(calc(-7deg * var(--open, 0)));
}
.fallback-shadow {
  position: absolute;
  left: 50%;
  top: var(--fallback-foot);
  width: min(37svh, 62vw);
  height: 2.6svh;
  border-radius: 50%;
  background: #47463e38;
  filter: blur(12px);
  transform: translate(-50%, -25%) scale(calc(.6 + .4 * var(--shadow-strength, 1)));
  opacity: var(--shadow-strength, 1);
}

.order-area, .author, .materials { background: var(--background); }

.order-area {
  --order-inset: clamp(28px, 5vw, 64px);
  display: grid;
  justify-items: center;
  padding: var(--order-inset) 18px 0;
  scroll-margin-top: 16px;
}
.enhanced .cinematic + .order-area {
  /* The card crosses the viewport edge during the last part of the book's turn. */
  position: relative;
  z-index: 4;
  margin-block-start: calc(-33svh - var(--order-inset));
  background: transparent;
}
.gloss-card {
  border: 1px solid var(--card-edge);
  border-radius: var(--card-corners);
  color: var(--on-dark);
  background: var(--card-surface);
  box-shadow: var(--card-shadow);
}
.order-panel {
  width: min(100%, 478px);
  padding: clamp(22px, 4.5vw, 30px);
  background: #080808;
  background-origin: border-box;
  border-color: transparent;
  box-shadow: none;
}
.order-product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: clamp(11px, 3vw, 24px);
}
.order-panel h2 { font-size: clamp(2.35rem, 5vw, 3.25rem); }
.order-description {
  max-width: 24ch;
  margin-top: 7px;
  color: var(--on-dark-muted);
  font: italic 550 clamp(1.05rem, 3.8vw, 1.22rem)/1.25 var(--serif);
}
.format {
  margin-right: .09em;
  color: #f1efeb;
  font: 800 clamp(2.55rem, 11vw, 4.85rem)/.83 var(--sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.10em;
}
.order-details {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 13px;
  padding-top: 11px;
  border-top: 1px solid #ffffff2e;
}
.order-details > span { color: var(--on-dark-muted); font-size: .82rem; }
.order-price { font-size: 1rem; font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; }
.checkout-actions { display: grid; gap: 8px; }
.checkout-actions .form-button { width: 100%; }
.form-button { background: #f7f6f2; color: var(--charcoal); }
.wallet-checkout { gap: 8px; padding-block: 7px; }
.wallet-mark {
  position: relative;
  width: 76px;
  height: 36px;
  overflow: hidden;
}
.wallet-mark img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  max-width: none;
  height: 100%;
  transform: translate(-50%, -50%);
}
/* The Google artwork occupies 400 of the original SVG's 742 units vertically. */
.wallet-mark-google img { height: 185.5%; }
.secondary-button {
  background: #ffffff0b;
  border-color: #ffffff40;
  color: var(--on-dark);
}
.form-note { margin-top: 7px; font-size: .86rem; color: var(--muted); }
.form-note:empty { display: none; }
.gloss-card .form-note { color: var(--on-dark-muted); }

.author {
  display: grid;
  justify-items: center;
  padding: var(--section-space) 20px 0;
  scroll-margin-top: 24px;
}
.author-story { display: grid; justify-items: center; gap: clamp(16px, 3.8svh, 32px); width: min(100%, 570px); }
.author-media { width: min(370px, 75vw); }
.portrait-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1332 / 1356;
  object-fit: contain;
  border-radius: var(--radius-card);
}
.author-copy h2 { text-align: center; }
.author-copy p { margin-top: 12px; color: var(--muted); font-size: clamp(.91rem, 1.35vw, 1rem); line-height: 1.68; }

.materials, .reviews { width: var(--shell); margin: var(--section-space) auto 0; }
.materials h2, .reviews h2 { margin-bottom: clamp(18px, 3vw, 28px); overflow-wrap: anywhere; }
.project-grid { display: grid; gap: clamp(16px, 2.5vw, 30px); }
.review-carousel { display: grid; gap: var(--gap); }
.project { min-width: 0; overflow: hidden; }
.project-feature {
  width: min(100%, 570px);
  border: 1px solid #323232;
  border-radius: 25px 25px 36px 25px;
  color: #faf9f7;
  background:
    radial-gradient(ellipse at 105% 120%, #5a5755 0%, #2c2b2b 37%, transparent 73%),
    linear-gradient(145deg, #202020 0%, #101010 31%, #1a1919 100%) #181818;
  box-shadow: inset 0 1px 0 #ffffff1a, 0 15px 32px #12121225;
}
.project-feature a {
  display: grid;
  grid-template-columns: clamp(66px, 19vw, 125px) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 2.6vw, 22px);
  height: 100%;
  padding: 11px clamp(14px, 3vw, 22px) 11px 11px;
  border-radius: inherit;
  color: inherit;
  text-decoration: none;
}
.project-feature a:focus-visible { outline-offset: -4px; }
.project-feature a:hover { color: #fff; }
.project-feature a:hover h3 { text-decoration: underline; text-underline-offset: .22em; }
.project-feature img {
  width: 100%;
  height: auto;
  aspect-ratio: 1.43;
  object-fit: cover;
  border-radius: 16px;
  filter: saturate(.56);
}
.project-skaun img { object-position: 50% 42%; }
.project-feature h3 { font-size: clamp(1.38rem, 2.5vw, 1.95rem); }
.project-cue {
  display: grid;
  width: 34px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: #f5f3ef;
  color: #171717;
}
.reviews { max-width: 570px; }
.review-card {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: var(--gap);
  padding: 18px 20px 16px;
  border: 1px solid #e3dfda;
  border-radius: var(--card-corners);
  background: #fff;
  box-shadow: 0 12px 25px #2620180c;
}
.review-card blockquote { margin: 0; font: italic 550 clamp(1.12rem, 1.55vw, 1.3rem)/1.28 var(--serif); }
.review-reader {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font: 650 .8125rem/1.35 var(--sans);
}
.review-avatar {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%;
  background: #eeebe5;
}
.review-avatar-barr { object-position: 50% 25%; }
.review-initials { display: grid; place-items: center; color: var(--ink); font: 700 .95rem/1 var(--serif); }
.loop-start { height: 147svh; overflow-anchor: none; background: var(--background); }
.loop-start .hero-field img {
  transform: translate(-50%, calc(-50% + var(--loop-wordmark-rise, 0px)));
}
.loop-start .sculpture { transform: translateY(var(--loop-book-rise, 0px)); }
#test-checkout {
  width: min(calc(100% - 36px), 420px);
  padding: clamp(20px, 5vw, 38px);
  border-radius: var(--card-corners);
}
dialog::backdrop { background: #25252573; }
#test-checkout h2 { font-size: 2.1rem; }
#test-checkout p { margin-top: 15px; }
#test-order-price { font-weight: 750; }
.test-checkout-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; }
.purchase-toast {
  --toast-bottom: max(17px, calc(12px + env(safe-area-inset-bottom)));
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) 25px;
  align-items: center;
  gap: 11px;
  position: fixed;
  z-index: 30;
  inset-inline: 0;
  margin-inline: auto;
  bottom: var(--toast-bottom);
  width: max-content;
  max-width: calc(100vw - 34px);
  padding: 8px 12px 8px 8px;
  border-radius: var(--radius-round);
  font-size: .88rem;
  line-height: 1.25;
  font-weight: 750;
  animation: purchase-slide 6.6s both;
  pointer-events: none;
}
.purchase-toast[hidden] { display: none; }
.purchase-toast img { width: 39px; height: 39px; object-fit: cover; border-radius: 50%; }
.toast-check {
  display: grid;
  width: 25px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  color: #e6f5eb;
  background: #47775d63;
}
@keyframes purchase-slide {
  0% { transform: translateY(calc(100% + var(--toast-bottom) + 3px)); animation-timing-function: cubic-bezier(.18, .8, .25, 1); }
  8%, 92% { transform: translateY(0); }
  92% { animation-timing-function: cubic-bezier(.62, .06, .84, .37); }
  100% { transform: translateY(calc(100% + var(--toast-bottom) + 3px)); }
}
@keyframes purchase-stay {
  from, to { transform: none; }
}

@media (hover: hover) and (pointer: fine) {
  .form-button:hover:not(:disabled) { background: #dfddd6; }
  .secondary-button:hover { background: #ffffff24; }
}
@media (prefers-reduced-motion: no-preference) {
  .reviews.has-carousel {
    --review-inset: clamp(10px, 1.8svh, 18px);
    height: var(--review-section-height, auto);
  }
  .has-carousel .reviews-stage {
    position: sticky;
    top: var(--review-inset);
    z-index: 1;
  }
  .has-carousel .review-carousel {
    grid-template-rows: repeat(var(--review-slots, 3), 1fr);
    gap: clamp(10px, 1.7svh, 16px);
  }
  .has-carousel .review-card {
    grid-area: 1 / 1;
    transform-origin: center top;
    gap: 8px;
    padding: 10px 16px;
  }
  .has-carousel .review-card blockquote {
    font-size: clamp(1rem, 2.35svh, 1.2rem);
    line-height: 1.23;
  }
  .has-carousel .review-avatar { width: 28px; height: 28px; }
  .cinematic:has(.hero-field.has-art) + .order-area .order-panel[data-ink-surface] { background: none; }
  .cinematic:has(.hero-field.has-art) + .order-area .order-panel:not(:focus-within) > * {
    opacity: var(--card-reveal, 1);
  }
  .button { transition: background-color .16s, box-shadow .16s, transform .16s; }
}
@media (max-width: 680px) {
  :root { --shell: calc(100% - 36px); }
  .hero-field img { top: 17.7%; width: 96%; }
  .sculpture { --fallback-start: 40.8svh; --fallback-gap: 19svh; }
  .hero { padding-bottom: clamp(65px, 9.6svh, 90px); }
  .deck { max-width: min(100%, 32ch); font-size: clamp(1.15rem, 5vw, 1.27rem); }
  .order-panel { max-width: 388px; }
  .order-details { margin-top: 18px; }
  .project-grid { gap: 13px; }
  .project-feature img { aspect-ratio: 1.25; }
}
@media (max-width: 360px) {
  .order-panel { padding: 17px; }
}
@media (max-height: 680px) {
  .hero { padding-bottom: 69px; }
  .author-story { gap: 14px; }
  .author-copy p { margin-top: 8px; }
}
@media (max-width: 680px) and (max-height: 680px) {
  .hero { padding-bottom: 72px; }
  .deck { font-size: 1.16rem; }
}
@media (max-height: 560px) {
  .deck { max-width: min(100%, 36ch); font-size: 1.12rem; }
  .materials h2 { margin-bottom: 14px; }
  .project img { max-height: 21svh; }

}
@media (prefers-reduced-motion: reduce) {
  .purchase-toast { animation-name: purchase-stay; }
}
