/* ===========================================================================
   The two editions.

   The objects on this page are built, not photographed: every face is a div
   in a real CSS 3D scene, so the book has a spine you can see round, the card
   has a thickness, and the lid of the VIP box comes off because it is a
   separate solid sitting on top of another one. A flat mock-up would have
   been two JPEGs and an hour; this way the thing turns when you move the
   mouse, and a reader who tilts it is looking at the same object from a
   different angle rather than at a picture pretending to be one.

   One scene per edition, one rAF for both. The loop only runs while a card is
   actually on screen, and it is never started at all when the reader has
   asked for reduced motion -- in that case every object is laid out in its
   final, assembled position by CSS alone and nothing moves.
   ======================================================================== */

.editions{margin-top:38px}
.editions > .eyebrow{margin-bottom:10px}
.edhead{font-family:var(--display);font-weight:300;line-height:1.18;
  font-size:clamp(1.5rem,5.6vw,2.1rem);color:var(--fg);margin:0 0 6px;
  letter-spacing:.01em}
.edhead i{font-style:normal;color:var(--gold)}
.edintro{margin:0 0 26px;font-size:.92rem;color:var(--muted);max-width:44em}

.edgrid{display:grid;gap:22px;grid-template-columns:1fr}
@media (min-width:860px){ .edgrid{grid-template-columns:1fr 1fr;gap:26px} }

.ed{position:relative;border:1px solid var(--hair);background:
  linear-gradient(180deg,color-mix(in srgb,var(--gold-dim) 5.5%,transparent),transparent 46%);
  padding:0 0 24px;overflow:hidden;
  transition:border-color .4s ease, box-shadow .4s ease}
.ed:hover{border-color:var(--gold-dim)}
.ed.vip{border-color:var(--hair)}
.ed.vip:hover{border-color:var(--gold)}

/* the hairline that walks the top edge when the card arrives */
.ed::before{content:"";position:absolute;left:0;top:0;height:1px;width:0;
  background:linear-gradient(90deg,transparent,var(--gold),transparent);
  transition:width 1.1s cubic-bezier(.2,.85,.25,1) .1s}
.ed.in::before{width:100%}

/* ---------------------------------------------------------------- the stage */
.edstage{position:relative;height:338px;perspective:1100px;
  perspective-origin:50% 46%;
  background:radial-gradient(120% 86% at 50% 24%,color-mix(in srgb,var(--gold-dim) 7%,transparent),transparent 70%)}
.edscene{position:absolute;inset:0;transform-style:preserve-3d;
  transform:rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg))}

/* every solid is a box of faces around one centre */
.obj{position:absolute;left:50%;top:50%;width:0;height:0;
  transform-style:preserve-3d;
  transition:transform 1.25s cubic-bezier(.22,.9,.24,1),
             opacity .7s ease}
.fc{position:absolute;left:0;top:0;transform-origin:50% 50%;
  background:var(--raise);
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--gold-dim) 16%,transparent)}
.fc img{display:block;width:100%;height:100%;object-fit:cover}

.f-front {width:var(--w);height:var(--h);transform:translate(-50%,-50%) translateZ(calc(var(--d)/2))}
.f-back  {width:var(--w);height:var(--h);transform:translate(-50%,-50%) rotateY(180deg) translateZ(calc(var(--d)/2))}
.f-left  {width:var(--d);height:var(--h);transform:translate(-50%,-50%) rotateY(-90deg) translateZ(calc(var(--w)/2))}
.f-right {width:var(--d);height:var(--h);transform:translate(-50%,-50%) rotateY(90deg)  translateZ(calc(var(--w)/2))}
.f-top   {width:var(--w);height:var(--d);transform:translate(-50%,-50%) rotateX(90deg)  translateZ(calc(var(--h)/2))}
.f-bot   {width:var(--w);height:var(--d);transform:translate(-50%,-50%) rotateX(-90deg) translateZ(calc(var(--h)/2))}

/* ------------------------------------------------------------------ the book */
.o-book{--w:150px;--h:211px;--d:11px}
.o-book .f-front{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--gold-dim) 30%,transparent),
  0 26px 50px -22px var(--objshadow)}
/* the page block: a cream slab with the suggestion of leaves in it */
.o-book .f-right,.o-book .f-top,.o-book .f-bot{
  background:repeating-linear-gradient(to right,#E7E2D4 0 1px,#CFC8B6 1px 2px)}
.o-book .f-top,.o-book .f-bot{
  background:repeating-linear-gradient(to bottom,#E7E2D4 0 1px,#CFC8B6 1px 2px)}
.o-book .f-back{background:#0B1322}
/* the spine, set in the same champagne as everything else */
.o-book .f-left{background:linear-gradient(90deg,#060B18,#0C1426 55%,#060B18);
  display:flex;align-items:center;justify-content:center}
.o-book .spine{writing-mode:vertical-rl;transform:rotate(180deg);
  font-family:var(--display);font-weight:400;font-size:8px;letter-spacing:.2em;
  color:var(--gold);white-space:nowrap;text-transform:uppercase;opacity:.9}

/* ------------------------------------------------------------------ the card */
.o-card{--w:158px;--h:100px;--d:3px}
.o-card .fc{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--gold-dim) 34%,transparent)}
.o-card .f-front{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--gold-dim) 40%,transparent),
  0 18px 34px -16px var(--objshadow)}
.o-card .f-back{background:#0A1120}
.o-card .f-left,.o-card .f-right,.o-card .f-top,.o-card .f-bot{
  background:linear-gradient(90deg,#AFA389,#F1DDA9,#8C8268)}

/* ------------------------------------------------------------------- the box */
.o-base{--w:150px;--h:30px;--d:108px}
.o-lid {--w:156px;--h:18px;--d:112px}
.o-base .fc,.o-lid .fc{background:linear-gradient(180deg,#1E1C1B,#0C0B0A);
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--gold-dim) 20%,transparent)}
.o-base .f-top{background:#050505}            /* the open mouth of the base */
.o-lid .f-top{background:
  radial-gradient(130% 160% at 50% 0%,#2B2826,#0E0D0C 70%);
  display:flex;align-items:center;justify-content:center}
.o-lid .f-top img{width:46px;height:auto;object-fit:contain;
  filter:drop-shadow(0 0 13px color-mix(in srgb,var(--gold) 60%,transparent))}
/* the open mouth of the base gets the champagne lip a real rigid box has */
.o-base .f-top{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--gold) 26%,transparent),
  inset 0 7px 16px -5px rgba(0,0,0,.95)}

/* ---------------------------------------------------- where everything rests */
/* Every solid is a zero-sized anchor at the centre of the stage, which is why
   these offsets are in pixels and not percentages: a percentage translate
   resolves against the element's own box, and the box here is 0 x 0. */

/* before they arrive */
.o-book {transform:translate3d(0,26px,0) scale(.86);opacity:0}
.o-card {transform:translate3d(0,34px,0) scale(.86);opacity:0}
.o-base {transform:translate3d(0,60px,0);opacity:0}
.o-lid  {transform:translate3d(0,-40px,-130px) rotateX(-76deg);opacity:0}

/* assembled: the book stood up and turned, the card leaning on its corner */
.ed.in .o-book{opacity:1;
  transform:translate3d(-54px,-8px,20px) rotateY(-19deg) rotateX(3deg) scale(1);
  transition-delay:.14s}
.ed.in .o-card{opacity:1;
  transform:translate3d(44px,58px,100px) rotateY(-26deg) rotateZ(-8deg);
  transition-delay:.34s}

/* the VIP set: the lid stood on its edge behind everything, so the foil on it
   is something you read rather than something you look down on */
/* The lid does not fly off and hang in the air -- it lifts a thumb's width
   and sits there, just out of line with the base, the way a lid looks a
   second after somebody has taken it off. You can see the dark mouth of the
   base under it, and the mark on the lid stays something you can read rather
   than a plane turned on its edge. */
.ed.vip .o-book{transform:translate3d(0,30px,0) rotateX(70deg) scale(.86);opacity:0}
.ed.vip .o-lid {transform:translate3d(52px,58px,-40px);opacity:0}
.ed.vip.in .o-base{opacity:1;transform:translate3d(30px,76px,-50px);transition-delay:.06s}
.ed.vip.in .o-lid {opacity:1;
  transform:translate3d(34px,22px,-30px) rotateX(-26deg) rotateZ(-5deg);
  transition-delay:.3s}
.ed.vip.in .o-book{opacity:1;
  transform:translate3d(-60px,-14px,44px) rotateY(-19deg) rotateX(3deg) scale(.86);
  transition-delay:.52s}
.ed.vip.in .o-card{opacity:1;
  transform:translate3d(24px,76px,112px) rotateY(-26deg) rotateZ(-8deg) scale(.86);
  transition-delay:.72s}

/* the light that runs over the foil once the set has landed */
.sheen{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.sheen i{position:absolute;top:-30%;left:-40%;width:28%;height:170%;
  background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--gold) 16%,transparent),transparent);
  transform:rotate(16deg);opacity:0}
.ed.in .sheen i{animation:edsweep 2.6s cubic-bezier(.4,0,.2,1) 1.1s 1}
@keyframes edsweep{
  0%{opacity:0;left:-40%} 14%{opacity:1} 86%{opacity:1} 100%{opacity:0;left:120%}}

/* ------------------------------------------------------------------ the words */
.edbody{padding:0 22px}
.edname{font-family:var(--display);font-weight:300;font-size:1.44rem;
  color:var(--fg);margin:0;line-height:1.1;letter-spacing:.01em}
.ed.vip .edname{color:var(--gold)}
.edtag{margin:5px 0 0;font-size:.78rem;letter-spacing:.14em;
  text-transform:uppercase;color:var(--faint)}

.edprice{display:flex;align-items:baseline;gap:8px;margin:16px 0 2px;
  border-top:1px solid var(--hair-soft);padding-top:15px}
.edprice b{font-family:var(--display);font-weight:300;font-size:2.3rem;
  line-height:1;color:var(--gold);font-variant-numeric:tabular-nums;
  text-shadow:0 0 26px color-mix(in srgb,var(--gold) 30%,transparent)}
.edprice span{font-size:.76rem;letter-spacing:.2em;color:var(--faint)}

.edfeat{list-style:none;margin:16px 0 0;padding:0}
.edfeat li{position:relative;padding:0 0 0 20px;margin:0 0 9px;
  font-size:.88rem;color:var(--muted);line-height:1.45;
  opacity:0;transform:translateY(7px);
  transition:opacity .55s ease,transform .55s cubic-bezier(.2,.85,.25,1)}
.ed.in .edfeat li{opacity:1;transform:none}
.edfeat li::before{content:"";position:absolute;left:1px;top:.52em;
  width:7px;height:7px;border:1px solid var(--gold-dim);
  transform:rotate(45deg)}
.edfeat li.key{color:var(--fg)}
.edfeat li.key::before{background:var(--gold);border-color:var(--gold)}

.edorder{display:block;width:100%;margin-top:20px;text-align:center}
.ed.vip .edorder{border-color:var(--gold);color:var(--gold)}
.edfoot{margin:11px 0 0;font-size:.76rem;color:var(--faint);line-height:1.5;max-width:66ch}

/* a quiet instruction, and only where a pointer exists to follow it */
.edhint{display:none;position:absolute;left:0;right:0;bottom:8px;text-align:center;
  font-size:var(--lbl);letter-spacing:.18em;text-transform:uppercase;
  color:var(--faint);opacity:0;transition:opacity .6s ease .9s}
@media (hover:hover) and (pointer:fine){
  .edhint{display:block}
  .ed.in .edhint{opacity:.55}
  .ed.in:hover .edhint{opacity:0;transition-delay:0s}
}

/* ------------------------------------------------------- phones and no-motion */
@media (max-width:520px){
  .edstage{height:272px}
  .o-book{--w:126px;--h:177px;--d:9px}
  .o-card{--w:132px;--h:84px;--d:3px}
  .o-base{--w:126px;--h:26px;--d:91px}
  .o-lid {--w:131px;--h:15px;--d:94px}
  .edbody{padding:0 16px}
  .edprice b{font-size:2rem}
  /* the offsets above are tuned to the wide stage; on a phone the stage is
     shorter than the book is tall, so the whole set comes in and up */
  .ed.in .o-book{transform:translate3d(-44px,-12px,16px) rotateY(-19deg) rotateX(3deg) scale(1)}
  .ed.in .o-card{transform:translate3d(36px,42px,80px) rotateY(-26deg) rotateZ(-8deg)}
  .ed.vip.in .o-base{transform:translate3d(24px,58px,-40px)}
  .ed.vip.in .o-lid {transform:translate3d(27px,14px,-24px) rotateX(-26deg) rotateZ(-5deg)}
  .ed.vip.in .o-book{transform:translate3d(-48px,-14px,34px) rotateY(-19deg) rotateX(3deg) scale(.86)}
  .ed.vip.in .o-card{transform:translate3d(18px,52px,86px) rotateY(-26deg) rotateZ(-8deg) scale(.86)}
  /* no pointer to follow the instruction with */
  .edhint{display:none!important}
}

/* If motion is not wanted, the set is simply already built. The global rule in
   app.css kills the transitions; these rules make sure the final positions are
   what gets painted, rather than the collapsed starting ones. */
@media (prefers-reduced-motion:reduce){
  .ed::before{width:100%}
  .edfeat li{opacity:1;transform:none}
  .o-book,.o-card,.o-base,.o-lid{opacity:1}
  .o-book{transform:translate3d(-54px,-8px,20px) rotateY(-19deg) scale(1)}
  .o-card{transform:translate3d(44px,58px,100px) rotateY(-26deg) rotateZ(-8deg)}
  .ed.vip .o-base{transform:translate3d(30px,76px,-50px)}
  .ed.vip .o-lid {transform:translate3d(34px,22px,-30px) rotateX(-26deg) rotateZ(-5deg)}
  .ed.vip .o-book{transform:translate3d(-60px,-14px,44px) rotateY(-19deg) scale(.86)}
  .ed.vip .o-card{transform:translate3d(24px,76px,112px) rotateY(-26deg) rotateZ(-8deg) scale(.86)}
  .sheen{display:none}
  /* nothing turns when the pointer moves, so do not promise that it does */
  .edhint{display:none}
}
