/* The business card site. Builds on styles.css (tokens, cursor).
   The paper and everything pressed into it are drawn by card.js (WebGL);
   this file lays out the desk, the card, what sits on each side, and the
   case cards that pop out of the grid. */

:root{
  --paper-col: #F6F5F0;   /* cool white cotton stock */
  --edge-hi: #F3F2EC;
  --edge-lo: #D9D7CF;
  --card-ink: #2E2E2C;
  --card-soft: #8a877e;   /* small labels, printed lighter */
  --pencil: #B23A2E;      /* the editor's mark */
  --t: 4px;               /* card thickness */
  /* pressed into the paper, lit from the top left like the printing card.js
     draws: the wall on the top-left side falls in shadow, the bottom-right lip
     catches the light. One for text, one for pictures (a pressed plate). */
  --press-text: -0.5px -0.5px 0.5px rgba(40,36,30,0.22), 0.5px 0.8px 0.5px rgba(255,255,255,0.9);
  --press-plate: -1px -1px 1.5px rgba(40,36,30,0.28), 1px 1px 1px rgba(255,255,255,0.95), 0 0 0 0.5px rgba(40,36,30,0.07);
  --press-floor: inset 1px 1px 2.5px rgba(30,27,22,0.3), inset -1px -1px 1px rgba(255,255,255,0.2);
  --safe-t: 0px; --safe-r: 0px; --safe-b: 0px; --safe-l: 0px;
}

html, body{ height: 100%; overflow: hidden; }
body{
  display: block;
  min-height: 0;
  color: var(--card-ink);
  /* the desk: Elephant's Breath. backdrop.js paints the moving version over it */
  background: #CCBFB3;
}
/* the moving desk fades in over the plain one once it's drawn (backdrop.js), rather than popping on */
.backdrop{ opacity: 0; transition: opacity 1.2s ease; }
.backdrop.is-ready{ opacity: 1; }
.backdrop{
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
}
/* a whisper of grain over everything, so the white isn't digital-flat */
body::after{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* the yellow arrow needs an outline on white. Over a side of the card it
   turns to point the way the card will go (card.js sets --ang). */
.cursor-dot{ filter: drop-shadow(0 0 1px rgba(40,38,34,0.75)) drop-shadow(0 1px 3px rgba(40,38,34,0.25)); }
/* turning to point is eased; changing shape back to the arrow is instant
   (rotate and scale are separate properties so only the turn is animated) */
.cursor-arrow, .cursor-dot.hover .cursor-arrow{ transform: none; rotate: var(--ang, 0deg); scale: var(--sc, 1); transition: rotate 0.22s ease; }
.cursor-dot.hover{ --sc: 1.12; }
/* a plus over things that open, a minus where a click closes: centred on the
   pointer (which sits at the arrow's tip, 3px in). They pop in, and go at once. */
.cursor-shape{
  position: absolute;
  left: -7px;
  top: -7px;
  opacity: 0;
  scale: 0.5;
  rotate: -90deg;
  transition: none;
}
/* over a playing YouTube film the page can't follow the pointer: the cursor steps aside (card.js) */
.cursor-dot.is-away{ opacity: 0 !important; transition: opacity 0.12s ease; }
.cursor-dot[data-mode="plus"] .cursor-plus,
.cursor-dot[data-mode="minus"] .cursor-minus{
  opacity: 1;
  scale: 1;
  rotate: 0deg;
  transition: opacity 0.15s ease, scale 0.25s cubic-bezier(.3,.7,.2,1.2), rotate 0.25s cubic-bezier(.3,.7,.2,1.2);
}
.cursor-dot[data-mode="plus"] .cursor-arrow,
.cursor-dot[data-mode="minus"] .cursor-arrow{ opacity: 0; }

.sr-only{
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------- stage ----------------
   Fills the screen. On a phone held upright it's turned a quarter-turn, so
   the card lies along the long side of the screen and looks the same when
   the phone is turned sideways: as if it were locked in landscape. */
.stage{
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
}
.stage > .desk, .stage > .card{ grid-area: 1 / 1; }
/* turning a phone over: out of sight at once while it re-lays itself, then
   straight back (card.js). Quick, so it doesn't add to the phone's own turn. */
.stage{ transition: opacity 0.12s ease; }
/* a phone: the card sits on one flat tone, Elephant's Breath (the desk's own
   base colour, under the moving backdrop on desktop). A browser that keeps a
   strip down the notch side fills it with the page's colour, so it's the
   same tone, with no line; and nothing animates behind the card. */
html.phone-page, html.phone-page body{ background: #CCBFB3; }
html.phone-page .backdrop{ display: none; }
.is-reorienting .stage{ opacity: 0; transition: none; }
/* first load: out of sight until card.js has it laid out, posed and printed,
   then the card and its shadow fade in on the desk */
.is-loading .stage{ opacity: 0; transition: none; animation: show-anyway 0.6s ease 6s forwards; } /* if the script never gets there */
@keyframes show-anyway{ to{ opacity: 1; } }
.stage.is-arriving{ transition: opacity 0.7s ease; }
@media (orientation: portrait) and (max-width: 900px){
  .stage{
    inset: auto;
    left: 50%;
    top: 50%;
    width: 100vh;
    width: 100dvh;
    height: 100vw;
    transform: translate(-50%, -50%) rotate(90deg);
  }
}


/* ---------------- the desk under the card ----------------
   Sized to the resting card and given the same lie-on-the-desk angle
   (card.js), so its shadow sits right under it. Fades as the card lifts. */
.desk{
  position: relative;
  width: var(--rw, 600px);
  height: var(--rh, 343px);
  perspective: 2000px;
  pointer-events: none;
}
.desk-plane{ position: absolute; inset: 0; transform-style: preserve-3d; }
.desk-shadow{
  position: absolute;
  border-radius: 8px;
  transform: translateZ(calc(var(--t) * -0.5 - 1px));
}
.desk-shadow--wide{ inset: 3% -1.5% -5% 1%; background: rgba(60,55,45,0.24); filter: blur(24px); }
.desk-shadow--near{ inset: 1.5% -0.2% -1.6% 0.6%; background: rgba(40,36,30,0.36); filter: blur(5px); }

/* ---------------- the card ----------------
   card       size (bigger when a side with something to read is up), perspective
   card-tilt  pose: lying on the desk, nudged by the pointer, lifted (card.js)
   card-flip  the turn itself, animated by card.js
   face       two of them, each a WebGL canvas with HTML on top. card.js
              swaps what's on them and which one is facing you. */
.card{
  position: relative;
  width: var(--w, 600px);
  height: var(--h, 343px);
  perspective: 2000px;
  touch-action: none; /* its size follows the turn, set by card.js each frame */
}
.card-tilt, .card-flip{
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.face{
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 4px;
  background: var(--paper-col);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  container-type: size;
  transform: translateZ(calc(var(--t) / 2));
}
#faceB{ transform: rotateY(180deg) translateZ(calc(var(--t) / 2)); }
.face canvas{ position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* until the type is ready (it waits for the fonts) the card is plain paper; then the
   printing fades in, rather than a black box showing first (Joe, 26 Nov). The back face
   is first drawn while it faces away, so it needn't fade. */
.face canvas{ opacity: 0; transition: opacity 0.5s ease; }
.face canvas.is-drawn{ opacity: 1; }
#faceB canvas{ transition: none; }
.face-ui, .layer{ position: absolute; inset: 0; }
/* everything printed in HTML is pressed in too, a touch */
.face-ui, .case-paper{ text-shadow: var(--press-text); }
/* pictures sit in a shallow pressed plate: walls outside, a little shade on the floor */
.tile-img, .about-photo{ box-shadow: var(--press-plate); }
.tile-img::after, .about-photo::after{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: var(--press-floor);
}

/* the card's own shadow once it's up off the desk */
.card-shadow{
  position: absolute;
  inset: 4% 3%;
  border-radius: 10px;
  background: rgba(50,45,38,0.34);
  filter: blur(30px);
  opacity: 0;
  will-change: transform, opacity;
}

/* ---------------- edges ----------------
   Four thin faces turned 90°, so the card has a real thickness: the near
   edge shows while it lies on the desk, the others while it turns. */
.e{
  position: absolute;
  display: block;
  -webkit-backface-visibility: visible;
  backface-visibility: visible;
}
.e--t, .e--b{
  left: 0;
  width: 100%;
  height: var(--t);
  transform-origin: 50% 0;
  transform: rotateX(90deg) translateY(calc(var(--t) / -2));
}
.e--t{ top: 0; background: linear-gradient(90deg, var(--edge-hi), #FBFAF6 40%, var(--edge-hi)); }
.e--b{ top: 100%; background: linear-gradient(90deg, #CFCDC5, var(--edge-lo) 45%, #CBC9C1); }
.e--l, .e--r{
  top: 0;
  width: var(--t);
  height: 100%;
  transform-origin: 0 50%;
  transform: rotateY(90deg) translateX(calc(var(--t) / -2));
}
.e--l{ left: 0; background: linear-gradient(180deg, var(--edge-hi), #E6E4DD); }
.e--r{ left: 100%; background: linear-gradient(180deg, #E2E0D9, #CFCDC5); }

/* ---------------- links pressed into the card ----------------
   The email and LinkedIn are part of the printing (card.js); these sit over
   them, sized to the words, and draw a fine rule under them on hover. */
.card-link{
  position: absolute;
  z-index: 1;
  color: var(--card-ink);
  outline: none;
}
.card-link::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12%;
  height: 1px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0.6);
  transition: opacity 0.3s ease, transform 0.4s ease;
}
.card-link:hover::after, .card-link:focus-visible::after{ opacity: 0.45; transform: none; }

/* ---------------- right: the work ---------------- */
.layer--cases{
  display: flex;
  flex-direction: column;
  padding:
    calc(11cqh + var(--safe-t)) calc(4cqw + var(--safe-r))
    calc(7cqh + var(--safe-b)) calc(4cqw + var(--safe-l));
}
.back-grid{
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 3cqh 2cqw;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tile{
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  outline: none;
}
/* the pictures are "printed" on the stock: greyscale, multiplied into the
   paper. Point at one and it comes up in full colour. */
.tile-img{ position: relative; flex: 1; min-height: 0; overflow: hidden; background: #e2e0d9; }
.tile-img img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05) brightness(1.03);
  mix-blend-mode: multiply;
  opacity: 0.9;
  transition: filter 0.9s ease, opacity 0.4s ease;
}
.tile:hover .tile-img img,
.tile:focus-visible .tile-img img{ filter: none; mix-blend-mode: normal; opacity: 1; }
.tile:focus-visible .tile-img{ outline: 2px solid var(--card-ink); outline-offset: 2px; }
.tile-cap{
  margin-top: 1cqh;
  font: 600 max(10px, 2.9cqh)/1.15 "Cormorant SC", Georgia, serif;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-num{ margin-right: 0.45em; color: #94918a; }
@media (hover: none){
  .tile-img img{ filter: none; mix-blend-mode: normal; opacity: 1; }
}

/* ---------------- top: about ---------------- */
.layer--about{
  display: grid;
  grid-template-columns: 55cqh minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0 4.5cqw;
  padding:
    calc(11cqh + var(--safe-t)) calc(5cqw + var(--safe-r))
    calc(7cqh + var(--safe-b)) calc(4cqw + var(--safe-l));
}
.about-photo{ position: relative; margin: 0; overflow: hidden; background: #e2e0d9; }
/* both pictures print into the paper together (so the crossfade doesn't go muddy) */
.about-prints{ position: absolute; inset: 0; mix-blend-mode: multiply; opacity: 0.92; }
.about-photo img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  filter: grayscale(1) contrast(1.04);
}
/* The easter egg. Desktop: point at the photo and a soft-edged circle of
   armour opens where you point and follows you round, as if seeing through
   his jumper (card.js sets --mx and --my). Phones: a touch fades the whole
   picture to the knight, kept while the finger's down and a moment after
   (Joe, 26 Nov). The two pictures are cut to the same frame with the faces
   matched, so only the armour changes. Both are layers of one mask, so the
   sweep below can use the same picture. */
@property --egg-r{ syntax: "<number>"; inherits: true; initial-value: 0; }
@property --egg{ syntax: "<number>"; inherits: true; initial-value: 0; }
.about-knight{
  -webkit-mask-image:
    linear-gradient(rgba(0,0,0,var(--egg)), rgba(0,0,0,var(--egg))),
    radial-gradient(circle calc(var(--egg-r) * 24cqh) at var(--mx, 50%) var(--my, 35%), #000 45%, transparent 100%);
  mask-image:
    linear-gradient(rgba(0,0,0,var(--egg)), rgba(0,0,0,var(--egg))),
    radial-gradient(circle calc(var(--egg-r) * 24cqh) at var(--mx, 50%) var(--my, 35%), #000 45%, transparent 100%);
}
.about-photo{ transition: --egg-r 0.6s cubic-bezier(.3,.7,.2,1), --egg 0.9s ease; }
@media (hover: hover){ .about-photo:hover{ --egg-r: 1; } }
.about-photo.is-knighted{ --egg: 1; transition: --egg-r 0.6s cubic-bezier(.3,.7,.2,1), --egg 0.5s ease; }
.about-photo img{ -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
/* phones: now and then a band of armour sweeps across, top left to bottom right */
@property --sweep{ syntax: "<percentage>"; inherits: true; initial-value: -40%; }
.about-photo.is-sweeping .about-knight{
  -webkit-mask-image: linear-gradient(135deg, transparent calc(var(--sweep) - 24%), #000 calc(var(--sweep) - 7%), #000 calc(var(--sweep) + 7%), transparent calc(var(--sweep) + 24%));
  mask-image: linear-gradient(135deg, transparent calc(var(--sweep) - 24%), #000 calc(var(--sweep) - 7%), #000 calc(var(--sweep) + 7%), transparent calc(var(--sweep) + 24%));
  animation: egg-sweep 3s cubic-bezier(.45,.05,.4,1) both;
}
@keyframes egg-sweep{ from{ --sweep: -30%; } to{ --sweep: 130%; } }
.about-text{
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding-bottom: 6cqh;
  /* fades out at the foot, so it's plain there's more below */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 7cqh), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 7cqh), transparent);
  font: 500 max(14px, 2.75cqh)/1.45 "Cormorant Garamond", Georgia, serif;
}
.nw{ white-space: nowrap; }
.about-text::-webkit-scrollbar{ display: none; }
.about-lead{
  margin: 0 0 1.6cqh;
  font: 600 max(16px, 3.8cqh)/1.15 "Cormorant SC", Georgia, serif;
  letter-spacing: 0.02em;
}
/* where he works, a quieter line just under the lead */
.about-lead:has(+ .about-now){ margin-bottom: 0.5cqh; }
/* "Monks" links to monks.com, underlined (Joe, 27 Nov) */
.about-now a{ color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.about-now a:hover, .about-now a:focus-visible{ color: var(--card-ink); outline: none; }
.about-now{
  margin: 0 0 2cqh;
  font: 600 max(11px, 2.3cqh)/1.2 "Cormorant SC", Georgia, serif;
  letter-spacing: 0.07em;
  color: var(--card-soft);
}
.about-bio{ max-width: 34em; margin: 0; }
.about-bio + .about-bio{ margin-top: 1.4cqh; }
.about-bio.is-placeholder{ color: var(--card-soft); font-style: italic; }
.about-label{
  margin: 4.5cqh 0 1cqh;
  font: 600 max(11px, 2.2cqh)/1.2 "Cormorant SC", Georgia, serif;
  letter-spacing: 0.07em;
  color: var(--card-soft);
}
.about-clients{ margin: 0; max-width: 34em; }
.about-awards{ margin: 0; display: grid; gap: 1.2cqh; }
.about-awards dt{ font: 600 1em/1.3 "Cormorant SC", Georgia, serif; letter-spacing: 0.02em; }
.about-awards dd{ margin: 0; color: #5b5953; }

/* ---------------- bottom: get in touch ----------------
   Everything on it is pressed into the paper; only the link areas are HTML. */

/* ---------------- left: fun stuff ---------------- */
.layer--fun{
  display: flex;
  flex-direction: column;
  padding:
    calc(11cqh + var(--safe-t)) calc(4cqw + var(--safe-r))
    calc(7cqh + var(--safe-b)) calc(4cqw + var(--safe-l));
}
.fun-grid{
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--tiles, 2), minmax(0, 1fr)); /* as many as there are (card.js): three since 27 Nov */
  grid-template-rows: minmax(0, 1fr); /* the tiles fill the room there is, so their names stay on the card however wide the screen */
  gap: 0 3cqw;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fun-grid .tile-cap{ margin-top: 1.4cqh; font-size: max(12px, 3.2cqh); }
/* a fun tile with no picture is set in type (15 Minutes had this till it got its title slide, 27 Nov) */
.tile-img--type{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ECEAE3;
  color: #3d3c38;
  transition: background 0.6s ease;
}
.tile:hover .tile-img--type, .tile:focus-visible .tile-img--type{ background: #E4E1D8; }
.type-15{
  font: 600 32cqh/0.85 "Cormorant SC", Georgia, serif;
  /* pressed into the panel: a light lip below, a shadow above */
  text-shadow: 0 1px 0 rgba(255,255,255,0.75), 0 -1px 0 rgba(0,0,0,0.12);
}
.type-note{
  font: 600 max(10px, 2.5cqh)/1 "Cormorant SC", Georgia, serif;
  letter-spacing: 0.08em;
  color: var(--card-soft);
}
.type-sub{
  margin-top: 1.6cqh;
  font: 600 max(11px, 3.4cqh)/1 "Cormorant SC", Georgia, serif;
  letter-spacing: 0.09em;
  color: #6f6c64;
}

/* ---------------- the arrows (desktop) ----------------
   Fine engraved arrows, one a little beyond each side of the card. They come
   up after a few seconds of not turning it, and drift outward a touch. On a
   phone they're pressed into the card instead (card.js), so these stay hidden. */
.arrows{
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  z-index: 5;
}
.is-phone .arrows{ display: none; }
.arrow{
  --x: 0px;
  --y: 0px;
  position: absolute;
  left: -24px;
  top: -24px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: none;
  color: #6f665a;
  opacity: 0;
  pointer-events: none;
  outline: none;
  transform: translate(var(--x), var(--y));
  transition: transform 1s cubic-bezier(.3,.7,.2,1), opacity 0.5s ease, color 0.3s ease;
}
.arrow--left{ --x: calc(var(--ox, 400px) * -1); }
.arrow--right{ --x: var(--ox, 400px); }
.arrow--top{ --y: calc(var(--oy, 250px) * -1); }
.arrow--bottom{ --y: var(--oy, 250px); }
.arrow-turn{ display: block; width: 100%; height: 100%; scale: var(--as, 0.75); transition: scale 0.6s ease; } /* sized to the card (card.js) */
.arrow--left .arrow-turn{ transform: rotate(180deg); }
.arrow--top .arrow-turn{ transform: rotate(-90deg); }
.arrow--bottom .arrow-turn{ transform: rotate(90deg); }
.arrow svg{
  position: absolute;
  left: 2px;
  top: 16px;
  width: 44px;
  height: 16px;
  overflow: visible;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,0.45));
}
.arrows.is-shown .arrow.is-on{
  opacity: 1;
  pointer-events: auto;
  transition: transform 1s cubic-bezier(.3,.7,.2,1), opacity 1.6s ease, color 0.3s ease;
}
.arrows.is-shown .arrow--top{ transition-delay: 0s, 0.15s, 0s; }
.arrows.is-shown .arrow--left{ transition-delay: 0s, 0.3s, 0s; }
.arrows.is-shown .arrow--bottom{ transition-delay: 0s, 0.45s, 0s; }
.arrows.is-shown .arrow svg{ animation: drift 2.8s ease-in-out infinite; }
.arrow:hover, .arrow:focus-visible{ color: var(--card-ink); }
@keyframes drift{
  0%, 100%{ transform: translateX(0); }
  50%{ transform: translateX(4px); }
}
/* shorter round the other sides, where there's less room than round the card itself */
.arrows.is-short .arrow svg{ left: 11px; width: 26px; height: 9.5px; top: 19.25px; }

/* ---------------- a case, on a card of its own ---------------- */
.case{
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
}
.case[hidden]{ display: none; }
.case-veil{
  position: absolute;
  inset: 0;
  background: rgba(204,191,179,0.55); /* the desk's own colour, over the card underneath */
  opacity: 0;
  transition: opacity 0.5s ease;
}
.case-open .case-veil{ opacity: 1; }
.case-card{
  position: relative;
  width: var(--cw, 1000px);
  height: var(--ch, 571px);
  container-type: size;
  will-change: transform, opacity;
  outline: none;
}
.case-shadow{
  position: absolute;
  inset: 3% 2.5% -1.5%;
  border-radius: 12px;
  background: rgba(50,45,38,0.36);
  filter: blur(36px);
  transform: translateY(24px);
}
.case-paper{
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 4px;
  background: var(--paper-col);
  box-shadow: inset 0 0 0 1px rgba(40,36,30,0.05);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 2.4cqh;
  padding:
    calc(3.8cqh + var(--safe-t)) calc(3.8cqw + var(--safe-r))
    calc(4.5cqh + var(--safe-b)) calc(3.8cqw + var(--safe-l));
  color: var(--card-ink);
}
.case-paper > canvas{ position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.case-top{
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 2.6cqw;
  font: 600 max(12px, 2.9cqh)/1 "Cormorant SC", Georgia, serif;
  letter-spacing: 0.05em;
  color: var(--card-soft);
}
.case-count{ margin-right: auto; }
.case-steps{ display: flex; align-items: baseline; gap: 1.8cqw; }
/* a hairline between the two case names, so they don't run together */
.case-steps-rule{ align-self: center; width: 1px; height: 0.95em; background: currentColor; opacity: 0.45; }
.case-top button{
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  outline: none;
}
.case-top button:hover, .case-top button:focus-visible{ color: var(--card-ink); }
#casePrev::before{ content: "‹ "; }
#caseNext::after{ content: " ›"; }
/* a side of just two (fun stuff): plain arrows between them, no names (card.js) */
.case-steps.is-pair{ gap: 1.4cqw; }
.case-steps.is-pair .case-steps-rule{ display: none; }
.case-steps.is-pair button{ padding: 0 0.2em; font-size: 1.5em; line-height: 0.7; }
.case-steps.is-pair #casePrev::before{ content: "‹"; }
.case-steps.is-pair #caseNext::after{ content: "›"; }
.case-close::after{ content: " ×"; }

.case-main{
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 41fr) minmax(0, 59fr);
  gap: 3.8cqw;
  min-height: 0;
}
.case-text{ display: flex; flex-direction: column; min-height: 0; }
.case-slot{ flex: none; }
.case-scroll{
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  /* room on the left for the quotes' opening marks, which hang into the margin */
  margin-left: -0.5em;
  padding: 1.6cqh 1cqw 6cqh 0.5em;
  outline: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 1.6cqh, #000 calc(100% - 7cqh), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 1.6cqh, #000 calc(100% - 7cqh), transparent);
  font: 500 max(13px, 2.6cqh)/1.45 "Cormorant Garamond", Georgia, serif;
}
.case-scroll::-webkit-scrollbar{ display: none; }
.case-hook{ margin: 0 0 3.6cqh; font-size: 1.12em; line-height: 1.38; }
.case-facts{ margin: 0 0 4.2cqh; display: grid; gap: 2.2cqh; }
.case-facts dd{ margin: 0; }
.case-facts dt, .case-label{
  margin: 0 0 0.5cqh;
  font: 600 max(11px, 2.15cqh)/1.2 "Cormorant SC", Georgia, serif;
  letter-spacing: 0.07em;
  color: var(--card-soft);
}
.case-note{ margin: 1cqh 0 0; color: #5b5953; }
/* a second show under its own title (25 Minutes of AI, on the 15 Minutes card):
   inked small caps a step up from the labels, its words the size of the first */
.case-subtitle{
  margin: 0 0 0.8cqh;
  font: 600 1.12em/1.2 "Cormorant SC", Georgia, serif;
  letter-spacing: 0.04em;
  color: var(--card-ink);
}
.case-words ul{ list-style: none; margin: 2.4cqh 0 0; padding: 0; display: grid; gap: 3cqh; }
.case-word blockquote{ margin: 0; font-style: italic; font-size: 1.14em; line-height: 1.3; text-indent: -0.4em; }
.case-word p{
  margin: 0.7cqh 0 0;
  font: 600 max(10px, 1.95cqh)/1.2 "Cormorant SC", Georgia, serif;
  letter-spacing: 0.06em;
  color: #9b988f;
}
.case-links{
  display: flex;
  flex-wrap: wrap;
  gap: 1cqh 2.6cqw;
  margin: 4.4cqh 0 0;
  font: 600 max(12px, 2.3cqh)/1.3 "Cormorant SC", Georgia, serif;
  letter-spacing: 0.05em;
}
.case-links a{ border-bottom: 1px solid rgba(46,46,44,0.3); transition: border-color 0.3s ease; }
.case-links a:hover, .case-links a:focus-visible{ border-color: var(--card-ink); outline: none; }
/* a project that's no longer live */
.case-ended{
  margin: 4.4cqh 0 0;
  font-style: italic;
  color: #6f6c64;
}
.case-next{
  display: block;
  width: 100%;
  margin: 5cqh 0 0;
  padding: 2.4cqh 0 0;
  border: 0;
  border-top: 1px solid rgba(46,46,44,0.15);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  outline: none;
}
.case-next-title{
  display: block;
  margin-top: 0.4cqh;
  font: 600 max(16px, 3.6cqh)/1.15 "Cormorant SC", Georgia, serif;
  letter-spacing: 0.02em;
}
.case-next:hover .case-next-title, .case-next:focus-visible .case-next-title{
  text-decoration: underline 1px;
  text-underline-offset: 0.18em;
}

/* the editor's mark, in red pencil */
.redline{ white-space: nowrap; }
.redline del{ position: relative; text-decoration: none; transition: color 0.4s ease 0.25s; }
.redline del::after{
  content: "";
  position: absolute;
  left: -2%;
  right: 0;
  top: 56%;
  height: 1.5px;
  background: var(--pencil);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.55s cubic-bezier(.65,0,.35,1) 0.25s;
}
.redline ins{
  display: inline-block;
  vertical-align: bottom;
  max-width: 0;
  overflow: hidden;
  text-indent: 0;
  text-decoration: none;
  font-style: normal;
  color: var(--pencil);
  opacity: 0;
  transition: max-width 0.7s cubic-bezier(.22,.61,.36,1) 0.85s, opacity 0.3s ease 0.85s;
}
.is-marked .redline del{ color: #9b988f; }
.is-marked .redline del::after{ transform: scaleX(1); }
.is-marked .redline ins{ max-width: 8em; opacity: 1; }

/* 15 Minutes of Now: the films, listed like a running order */
.case-films ul{ list-style: none; margin: 1.6cqh 0 4.2cqh; padding: 0; display: grid; gap: 1.5cqh; }
.case-films li{ display: grid; gap: 0.2cqh; }
.film-meta{
  font: 600 max(10px, 1.95cqh)/1.2 "Cormorant SC", Georgia, serif;
  letter-spacing: 0.06em;
  color: #9b988f;
}
.gallery-empty{
  display: grid;
  place-items: center;
  margin: 0;
  box-shadow: var(--press-plate), var(--press-floor);
  font: 600 max(12px, 2.6cqh)/1 "Cormorant SC", Georgia, serif;
  letter-spacing: 0.08em;
  color: var(--card-soft);
}

/* the pictures, printed on the right of the card */
.case-gallery{
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* or a long caption widens it */
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 1.8cqh;
  min-height: 0;
}
.gallery-track{
  display: flex;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  outline: none;
}
.gallery-track::-webkit-scrollbar{ display: none; }
.slide{
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px; /* so the next picture's plate doesn't show at the edge */
}
/* sized to the picture itself (not letterboxed), so its pressed plate fits it */
.slide img, .slide video{
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  box-shadow: var(--press-plate);
}
/* a picture with see-through edges (a collage) sits straight on the paper, no plate */
.slide img.is-plain{ box-shadow: none; }
/* a film: its thumbnail and a play button, pressed into a plate like the pictures */
.slide .film{
  position: relative;
  width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  background: #1b1a18;
  box-shadow: var(--press-plate);
}
.film > *{ position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt{ padding: 0; background: none; outline: none; }
.slide .yt img{ width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; box-shadow: none; }
.yt-play{
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(44px, 10cqh);
  aspect-ratio: 1;
  border-radius: 50%;
  translate: -50% -50%;
  background: rgba(246,245,240,0.92);
  box-shadow: 0 2px 12px rgba(0,0,0,0.28);
  font-size: max(11px, 2.3cqh);
  transition: scale 0.2s ease;
}
.yt-play::after{
  content: "";
  position: absolute;
  left: 54%;
  top: 50%;
  translate: -50% -50%;
  border-left: 1.05em solid var(--card-ink);
  border-top: 0.62em solid transparent;
  border-bottom: 0.62em solid transparent;
}
.yt:hover .yt-play, .yt:focus-visible .yt-play{ scale: 1.07; }

.gallery-bar{
  display: flex;
  align-items: baseline;
  gap: 2cqw;
  font: 600 max(11px, 2.2cqh)/1.25 "Cormorant SC", Georgia, serif;
  letter-spacing: 0.05em;
  color: var(--card-soft);
}
.gallery-count{ flex: none; color: var(--card-ink); }
.gallery-cap{ flex: 1; min-width: 0; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.03em; }
.gallery-steps{ flex: none; display: flex; align-items: center; gap: 1.4cqw; }
.gallery-steps > button{
  padding: 0 0.2em;
  border: 0;
  background: none;
  font: 600 1.5em/1 "Cormorant SC", Georgia, serif;
  color: var(--card-soft);
  outline: none;
}
.gallery-steps > button:hover, .gallery-steps > button:focus-visible{ color: var(--card-ink); }
/* a dot per picture, pressed into the paper; the one in view is inked */
.gallery-dots{ display: flex; align-items: center; }
.gallery-dot{
  position: relative;
  width: 13px;
  height: 18px;
  padding: 0;
  border: 0;
  background: none;
  outline: none;
}
.gallery-dot::before{
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  translate: -50% -50%;
  background: rgba(46,46,44,0.16);
  box-shadow: inset 0.5px 0.5px 1px rgba(30,27,22,0.35), 0.5px 0.5px 0 rgba(255,255,255,0.85);
  transition: background 0.3s ease, scale 0.3s ease;
}
.gallery-dot:hover::before, .gallery-dot:focus-visible::before{ background: rgba(46,46,44,0.42); }
.gallery-dot.is-on::before{ background: var(--card-ink); box-shadow: none; scale: 1.15; }
.gallery-dots.is-many .gallery-dot{ width: 9px; } /* more than twelve (15 Minutes): the caption keeps its room */
/* A film with sound: a 16:9 frame (like the YouTube films) pressed into the
   paper, with a pause button and a small speaker in its bottom-right corner
   (waves when it's on) and a line along its foot to move through it (card.js). */
.slide .clip{
  position: relative;
  width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  background: #1b1a18;
  box-shadow: var(--press-plate);
}
.slide .clip video{ width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; box-shadow: none; }
/* the speaker and the pause button: paper discs, so they read on a light film or a dark one */
.film-sound, .film-play{
  position: absolute;
  bottom: 9px; /* clear of the line along the foot */
  width: 30px; /* a bigger target than the disc you see */
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--card-ink);
  outline: none;
  opacity: 0.82;
  transition: opacity 0.2s ease;
}
.film-sound{ right: 3px; }
.film-play{ right: 29px; }
.film-sound::before, .film-play::before{
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: rgba(248, 247, 242, 0.9);
  box-shadow: 0 1px 3px rgba(20, 18, 14, 0.28);
}
.film-sound:hover, .film-sound:focus-visible, .film-sound[aria-pressed="true"],
.film-play:hover, .film-play:focus-visible{ opacity: 1; }
.film-sound:focus-visible::before, .film-play:focus-visible::before{ box-shadow: 0 0 0 1.5px var(--card-ink); }
.film-sound svg, .film-play svg{ position: relative; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.film-sound .sound-on, .film-sound[aria-pressed="true"] .sound-off{ display: none; }
.film-sound[aria-pressed="true"] .sound-on{ display: inline; }
.film-play .icon-play{ display: none; fill: currentColor; stroke: none; }
.clip.is-paused .film-play .icon-play{ display: inline; }
.clip.is-paused .film-play .icon-pause{ display: none; }
/* how far the film's got: a thin light line along the foot, with a faint shadow so
   it shows on a white frame too. Press or drag along it to move through the film. */
.film-bar{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px; /* the part you can press: taller than the line */
  cursor: pointer;
  touch-action: none; /* a drag here moves through the film, not the pictures */
}
.film-bar::before, .film-bar-fill{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  transition: height 0.15s ease;
}
.film-bar::before{ background: rgba(255, 255, 255, 0.28); box-shadow: 0 -0.5px 1.5px rgba(20, 18, 14, 0.25); }
.film-bar-fill{ background: rgba(248, 247, 242, 0.95); transform: scaleX(0); transform-origin: left; }
.film-bar:hover::before, .film-bar:hover .film-bar-fill,
.film-bar.is-scrubbing::before, .film-bar.is-scrubbing .film-bar-fill{ height: 5px; }
.is-phone .film-sound, .is-phone .film-play{ bottom: 8px; width: 36px; height: 36px; }
.is-phone .film-sound{ right: 0; }
.is-phone .film-play{ right: 28px; }
.is-phone .film-sound::before, .is-phone .film-play::before{ inset: 7px; }
.is-phone .film-sound:active, .is-phone .film-play:active{ opacity: 0.6; }
.is-phone .film-bar{ height: 18px; }
/* the button that opens the pictures up: phones only */
.gallery-zoom{ display: none; }

/* ---------------- phones ----------------
   The card sits on a flat tone with a slim margin (card.js), no desk shadow. */
/* (the card keeps clear of the notch and home bar with its margin, card.js) */
.is-phone .desk{ display: none; }
.is-phone .card-shadow{ inset: 3% 2%; filter: blur(18px); }
.is-phone .case-main{ grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); }

/* Phones: each side keeps a clear margin, a thumb wide, along the edge that
   turns it back (fun stuff: the right; the work: the left), so a tap there
   always goes back to the card and never opens a tile. The pressed arrow
   pointing back sits in it. */
.is-phone .layer--fun{ padding-right: calc(7.5cqw + var(--safe-r)); }
.is-phone .layer--cases{ padding-left: calc(7.5cqw + var(--safe-l)); }

/* A case on a phone: the same paper and small caps, with room for a thumb.
   Prev, Next and Close keep their size but take a finger-sized area each, as
   do the picture controls (plain marks: Joe found pressed rounds too much).
   What the picture is sits on its own line above them. */
.is-phone .case-top{ font-size: max(13px, 3.4cqh); }
.is-phone .case-top button{ padding: 12px 9px; margin: -12px -9px; }
.is-phone .case-steps.is-pair button{ padding: 12px 14px; margin: -12px -8px; } /* the bare arrows: a finger's width each */
.is-phone .case-steps{ gap: 5.2cqw; }
.is-phone .gallery-bar{ flex-wrap: wrap; align-items: center; gap: 0 1.6cqw; }
.is-phone .gallery-cap{ flex: 1 0 100%; order: -1; margin-bottom: 0.3cqh; }
.is-phone .gallery-zoom{ margin-left: auto; }
.is-phone .gallery-steps{ gap: 1.6cqw; }
.is-phone .gallery-dot{ width: 12px; height: 34px; }
.is-phone .gallery-dots.is-many .gallery-dot{ width: 9px; }
.is-phone .case-card:not(.is-viewing) .gallery-count{ display: none; }
.is-phone .gallery-steps > button,
.is-phone .gallery-zoom{
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--card-ink);
  outline: none;
}
.is-phone .gallery-steps > button{ font: 600 23px/1 "Cormorant SC", Georgia, serif; padding-bottom: 3px; }
.is-phone .gallery-steps > button:active, .is-phone .gallery-zoom:active{ opacity: 0.45; }
.gallery-zoom svg{ width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.gallery-zoom .zoom-shut{ display: none; }

/* the pictures opened up: they fill the card, the words step aside */
.is-phone .case-card.is-viewing .case-paper{
  gap: 0;
  padding:
    calc(2.6cqh + var(--safe-t)) calc(3cqw + var(--safe-r))
    calc(2.6cqh + var(--safe-b)) calc(3cqw + var(--safe-l));
}
.is-phone .case-card.is-viewing .case-top{ display: none; }
.is-phone .case-card.is-viewing .case-main{ grid-template-columns: minmax(0, 1fr); gap: 0; }
.is-phone .case-card.is-viewing .case-text{ display: none; }
.case-card.is-viewing .gallery-zoom .zoom-open{ display: none; }
.case-card.is-viewing .gallery-zoom .zoom-shut{ display: block; }


@media (prefers-reduced-motion: reduce){
  .redline del, .redline del::after, .redline ins{ transition: none !important; }
}
