/* THE WHITFIELD FAMILY: the 3D family book (proof). Coal ground, one warm pool of light, the book on it. */
@font-face { font-family: "Gloock"; src: url(../fonts/Gloock-Regular.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "Caslon Text"; src: url(../fonts/LibreCaslonText-Regular.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "Caslon Display"; src: url(../fonts/LibreCaslonDisplay-Regular.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "Cedarville"; src: url(../fonts/CedarvilleCursive.woff2) format("woff2"); font-display: swap; }
:root {
  --coal: #111312; --glaze: #eeeeea; --gilt: #c9a35c; --prime: #a3262a; --muted: rgba(238,238,234,.72);
  --paper: #ece2cb; --ink: #2b211a; --ease: cubic-bezier(.22,.61,.36,1);
}
* { box-sizing: border-box; }
html { background: var(--coal); color: var(--glaze); }
body { margin: 0; font: 400 17px/1.6 "Caslon Text", Georgia, serif; -webkit-font-smoothing: antialiased; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 30; background: var(--glaze); color: var(--coal); padding: 10px 14px; }
.skip:focus { top: 12px; }

.ab-top { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; justify-content: space-between; align-items: baseline; padding: 22px clamp(16px, 4vw, 48px); pointer-events: none; }
.ab-top > * { pointer-events: auto; }
.ab-brand { font: 400 20px/1 "Gloock", serif; letter-spacing: .02em; color: var(--glaze); text-decoration: none; text-transform: uppercase; display: inline-block; padding: 14px 0; margin: -14px 0; }
.ab-crumb { margin: 0; font: 500 11px/1 ui-monospace, "IBM Plex Mono", monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--gilt); }

/* the scroll track and the sticky stage */
.book-scroll { position: relative; height: 800vh; outline: none; }
.book-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: #070a08; --env-t: 0; --env-x: 0; }
/* the room: the empty shop from our own film, far out of focus and graded into tile green and coal, with the lamps
   kept warm. It moves a little against the camera so the book sits in real depth; the pool of lamp light is the
   counter's own (in the 3D scene). */
.book-env { position: absolute; inset: -8%; z-index: 0; pointer-events: none;
  background: url(../materials/env-shop.jpg) 50% 38% / cover no-repeat;
  transform: translate3d(calc(var(--env-x) * -1.6%), calc(var(--env-t) * -5%), 0) scale(calc(1.04 + var(--env-t) * 0.06));
  will-change: transform; }
.book-env::before { content: ""; position: absolute; inset: 0;
  /* warm directional light: a soft shaft from the upper left, as from the shop's front window lamp */
  background:
    linear-gradient(118deg, rgba(232,186,112,.11) 8%, rgba(232,186,112,.05) 30%, transparent 52%),
    radial-gradient(70% 60% at 50% 55%, rgba(150,104,52,.16), transparent 70%); }
.book-env::after { content: ""; position: absolute; inset: 0;
  /* the far room recedes: deep bottle-green shadow at the edges, coal at the floor */
  background:
    radial-gradient(120% 95% at 50% 46%, transparent 42%, rgba(8,22,17,.55) 78%, rgba(5,9,7,.9) 100%),
    linear-gradient(to bottom, transparent 62%, rgba(5,8,6,.7)); }
.book-stage::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; box-shadow: inset 0 0 16vmin rgba(0,0,0,.55); }
.book-motes { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 2.4s var(--ease) .6s; mix-blend-mode: screen; }
.book-ready .book-motes { opacity: 1; }
#book-canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s var(--ease); }
.book-ready #book-canvas { opacity: 1; }

.book-hint { position: absolute; left: 0; right: 0; bottom: 88px; z-index: 4; text-shadow: 0 1px 12px rgba(0,0,0,.9), 0 0 3px rgba(0,0,0,.8); text-align: center; pointer-events: none; transition: opacity .3s linear; }
.bh-kicker { margin: 0 0 10px; font: 500 11px/1 ui-monospace, "IBM Plex Mono", monospace; letter-spacing: .2em; text-transform: uppercase; color: var(--gilt); }
.bh-scroll { margin: 0; font: 400 15px/1 "Caslon Text", serif; color: var(--muted); }

.book-nav { position: absolute; left: 50%; bottom: 14px; z-index: 5; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 6px; background: rgba(10,12,12,.72); border: 1px solid rgba(201,163,92,.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .6s var(--ease); }
.book-ready .book-nav { opacity: 1; }
.book-nav p { margin: 0; min-width: 190px; text-align: center; font: 500 11px/1.2 ui-monospace, "IBM Plex Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--glaze); }
.book-nav button { width: 44px; height: 44px; border: 1px solid rgba(201,163,92,.5); background: none; color: var(--gilt); font: 400 24px/1 "Caslon Display", serif; cursor: pointer; transition: background .2s, color .2s; }
.book-nav button:hover:not(:disabled) { background: var(--gilt); color: var(--coal); }
.book-nav button:disabled { opacity: .3; cursor: default; }
.book-nav button:focus-visible { outline: 2px solid var(--gilt); outline-offset: 2px; }

/* the ending: under the closed book, the invitation */
.book-end { position: absolute; left: 0; right: 0; bottom: max(96px, 13vh); z-index: 6; display: grid; justify-items: center; gap: 18px; opacity: 0; pointer-events: none; text-align: center; }
.book-end.on { pointer-events: auto; }
.be-kicker { margin: 0; font: 500 12px/1 ui-monospace, "IBM Plex Mono", monospace; letter-spacing: .3em; text-transform: uppercase; color: var(--gilt); }
.be-btn { display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 30px; background: var(--prime); color: var(--glaze); font: 600 16px/1 "Instrument Sans", system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; border-radius: 2px; transition: background .2s var(--ease), transform .2s var(--ease); }
.be-btn:hover { background: #b8242a; } .be-btn:active { transform: scale(.97); }
.be-btn:focus-visible { outline: 2px solid var(--gilt); outline-offset: 3px; }
.book-nav.dim { opacity: 0 !important; pointer-events: none; }
.bt-end { text-align: center; margin: 60px 0 10px; }
.bt-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 28px; background: #a3262a; color: #eeeeea; font: 600 16px/1 "Instrument Sans", system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; }

/* the plain reading version: always there for screen readers; shown when motion is reduced or WebGL is missing */
.book-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: normal; }
.book-text:focus-within, .book-static .book-text { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; }
.book-static .book-scroll { display: none; }
.book-static .book-text { max-width: 720px; margin: 0 auto; padding: 120px 16px 80px; }
.book-text { color: var(--ink); }
.book-static .book-text, .book-text:focus-within { background: var(--paper) url(../materials/paper.jpg) center/cover; padding: clamp(32px, 6vw, 72px) clamp(22px, 6vw, 72px); margin: 110px auto 60px; max-width: 760px; box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.bt-head { text-align: center; margin-bottom: 40px; }
.bt-kicker { font: 500 11px/1 ui-monospace, "IBM Plex Mono", monospace; letter-spacing: .2em; text-transform: uppercase; color: #7a2421; }
.book-text h1 { font: 400 clamp(34px, 6vw, 54px)/1.05 "Gloock", serif; margin: 10px 0 0; }
.book-text h1 span { display: block; font: 400 18px/1.4 "Caslon Display", serif; letter-spacing: .1em; margin-top: 10px; }
.bt-inscription { font: 400 24px/1.3 "Cedarville", cursive; color: #3a2a1e; transform: rotate(-1deg); margin-top: 28px; }
.bt-ch { margin: 56px 0; }
.bt-label { text-align: center; font: 400 13px/1 "Caslon Display", serif; letter-spacing: .3em; text-transform: uppercase; color: #7a2421; margin: 0 0 8px; }
.book-text h2 { text-align: center; font: 400 26px/1.2 "Caslon Display", serif; margin: 0 0 26px; }
.bt-year { display: block; font: 400 46px/1.1 "Gloock", serif; }
.bt-ch p:not(.bt-label) { font-size: 18px; line-height: 1.65; margin: 0 0 .8em; }
.bt-fig { margin: 48px 0; text-align: center; }
.bt-fig img { width: 100%; height: auto; padding: 10px; background: #efe6d2; box-shadow: 0 8px 22px rgba(30,18,8,.35); }
.bt-fig figcaption { font-size: 15px; line-height: 1.5; margin-top: 18px; }
.bt-hand { display: block; font: 400 22px/1.3 "Cedarville", cursive; color: #3a2a1e; margin-bottom: 6px; }
.bt-note { display: block; font: 500 10px/1.4 ui-monospace, "IBM Plex Mono", monospace; letter-spacing: .16em; text-transform: uppercase; color: rgba(43,33,26,.65); margin-top: 6px; }

.ab-foot { padding: 28px clamp(16px, 4vw, 48px) 36px; border-top: 1px solid rgba(201,163,92,.25); }
.ab-foot p { margin: 0 auto; max-width: 900px; text-align: center; font: 400 13px/1.6 "Caslon Text", serif; color: var(--muted); }
.ab-foot a { color: var(--gilt); text-underline-offset: 3px; display: inline-block; padding: 12px 0; margin: -12px 0; }

@media (max-width: 767px) {
  .book-env { background-image: url(../materials/env-shop-960.jpg); background-position: 50% 30%; }
  .ab-top { padding: 16px; }
  .ab-brand { font-size: 17px; }
  .ab-crumb-a { display: none; }
  .book-nav { bottom: max(14px, env(safe-area-inset-bottom)); }
  .book-nav p { min-width: 150px; font-size: 10px; }
  .book-hint { bottom: 92px; }
}
@media (prefers-reduced-motion: reduce) { #book-canvas, .book-nav, .book-hint { transition: none; } .book-motes { display: none; } }
