/* =========================================================
   Alice Clarke – single page "desk" demo
   One scrolling page laid out like Alice's desk:
     1. a newspaper cutting (her name) and a 35mm photo print,
        both tucked under the top edge of the notebook
     2. the notebook, open to her work
     3. an About sheet tucked under the bottom of the notebook,
        with her business card on top
   Every surface uses a real photographic texture (CC0),
   tinted in CSS with background-blend-mode: multiply.
   Sizes use container units (cqi) of the desk column, so
   the arrangement keeps its proportions at any width.
   ========================================================= */

/* ---------- Scale ----------
   Every length is written as a multiple of --u and the root font size
   matches it, so the whole page scales from here. At 1.1 the notebook
   column is about 1300px wide, which leaves room at 1920px for most of
   the clippings and photos either side of it.
   Small phones use the original 1x sizing. */
:root { --u: 1.1px; font-size: 110%; }
@media (max-width: 599px) { :root { --u: 1px; font-size: 100%; } }

:root {
  --cloth: #c4b0ea;          /* lilac cover, before the linen darkens it */
  --paper: #f7f0de;          /* notebook paper */
  --paper-edge: #e6dcc4;
  --sheet: #fbf7ec;          /* loose writing paper */
  --newsprint: #e9e3d2;
  --card: #fdfaf3;
  --ink: #14324a;            /* deep navy ink */
  --ink-teal: #1d5a6e;       /* fountain-pen teal */
  --news-ink: #1c1a17;
  --rule: #b9cfd3;
  --ribbon: #8f78bf;

  --font-script: "Caveat Brush", "Segoe Script", cursive;
  --font-body: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-head: "Playfair Display", "Times New Roman", serif;

  --tex-desk:    url("../img/textures/desk-oak.webp");
  --tex-floor:   url("../img/textures/floor-planks.webp");
  --tex-paper:   url("../img/textures/paper-grain.webp");
  --tex-linen:   url("../img/textures/cloth-linen.webp");
  --stitch-light:   url("../img/textures/stitch-light.webp");
  --stitch-light-v: url("../img/textures/stitch-light-v.webp");

  /* a wash of colour over the paper grain keeps the flecks subtle */
  --arrow-ink:  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2314324a' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 12.5 12 4M5.5 3.8H12.2V10.5'/%3E%3C/svg%3E");
  --arrow-teal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%231d5a6e' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 12.5 12 4M5.5 3.8H12.2V10.5'/%3E%3C/svg%3E");

  --wash: linear-gradient(rgb(250 244 229 / .45), rgb(250 244 229 / .45));

  /* shadows for loose items lying on the desk */
  --lying: 0 calc(1 * var(--u)) calc(2 * var(--u)) rgb(40 22 8 / .28), 0 calc(12 * var(--u)) calc(24 * var(--u)) -10px rgb(40 22 8 / .45);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }

/* ---------- The desk ---------- */
html {
  background: var(--tex-floor) 0 0 / auto calc(602 * var(--u)), #2e241b;   /* the floor, below the desk */
}
body {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.5;
}
body::before {                           /* lamp light from above, darker edges; stays with the window */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 50% 18%, rgb(255 236 200 / .2), transparent 70%),
    radial-gradient(ellipse 90% 85% at 50% 45%, transparent 55%, rgb(45 22 6 / .38));
}

a { color: inherit; }

.desk {
  container-type: inline-size;
  position: relative;
  z-index: 1;
  /* leaves at least a tenth of the window either side for the loose items */
  width: min(calc(1180 * var(--u)), 100% - calc(48 * var(--u)), 100% - 20vw);
  margin: 0 auto;
  padding: clamp(calc(28 * var(--u)), 6vh, calc(72 * var(--u))) 0 clamp(calc(56 * var(--u)), 12vh, calc(140 * var(--u)));
}

/* =========================================================
   1. Above the notebook
   ========================================================= */
.top {
  --tuck: 7cqi;                          /* how far the print slides under the notebook */
  position: relative;
  z-index: 1;                            /* below the notebook */
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  margin-bottom: calc(-1 * var(--tuck));
}

/* ----- 35mm photo print, landscape (3:2) ----- */
.print {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  position: relative;
  width: 38cqi;
  aspect-ratio: 3 / 2;
  margin: 0;
  border-radius: calc(2 * var(--u));
  overflow: hidden;
  background: #222;
  box-shadow: var(--lying);
  transform: translateX(2cqi) rotate(4deg);
  /* the row's bottom is 7cqi under the notebook's top edge; lifting the print
     3.7cqi leaves its bottom-left corner (raised 1.3cqi by the rotation)
     just 2cqi under the cover */
  margin-bottom: 3.7cqi;
}
.print img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
}
.print::after {                          /* glossy print sheen */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgb(255 255 255 / .2), transparent 32%, transparent 72%, rgb(255 255 255 / .07));
  pointer-events: none;
}

/* ----- Newspaper cutting ----- */
.clipping {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  position: relative;
  width: 40cqi;
  margin-bottom: 1cqi;                   /* less of it is tucked under than the photo */
  padding: 2.6cqi 3cqi 9cqi;             /* bottom padding is the part under the page */
  color: var(--news-ink);
  transform: translateX(-1cqi) rotate(-2.4deg);
  filter: drop-shadow(0 calc(1 * var(--u)) calc(1 * var(--u)) rgb(40 22 8 / .3)) drop-shadow(0 calc(10 * var(--u)) calc(14 * var(--u)) rgb(40 22 8 / .3));
}
.clipping::before {                      /* the cut newsprint, with scissor-cut edges */
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 30% 20%, transparent 50%, rgb(170 140 80 / .12)),
    var(--tex-paper) 0 0 / calc(300 * var(--u)),
    var(--newsprint);
  background-blend-mode: normal, multiply;
  clip-path: polygon(0.5% 1.6%, 14% 0.6%, 31% 1.8%, 52% 0.2%, 71% 1.4%, 88% 0.4%, 99.6% 1.3%,
                     99.1% 28%, 100% 56%, 99.4% 100%, 0.3% 100%, 0.9% 63%, 0% 31%);
}
.clipping__kicker {
  margin: 0 0 1.1cqi;
  padding: .5cqi 0 .45cqi;
  border-top: calc(3 * var(--u)) double var(--news-ink);
  border-bottom: calc(1 * var(--u)) solid var(--news-ink);
  font-size: clamp(.68rem, 1.05cqi, .85rem);
  letter-spacing: .28em;
  text-transform: uppercase;
  text-align: center;
}
.clipping__headline {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(2.6rem, 6.6cqi, 5.4rem);
  line-height: .95;
  letter-spacing: -.01em;
  text-align: center;
}
.clipping__standfirst {
  margin: 1.1cqi 0 1.2cqi;
  font-style: italic;
  font-size: clamp(1.05rem, 1.85cqi, 1.45rem);
  line-height: 1.3;
  text-align: center;
}
.clipping__byline {
  margin: 0;
  padding-top: .7cqi;
  border-top: calc(1 * var(--u)) solid rgb(28 26 23 / .5);
  font-size: clamp(.68rem, 1.05cqi, .85rem);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: center;
}

/* =========================================================
   2. The notebook
   ========================================================= */
.notebook {
  container-type: inline-size;
  position: relative;
  z-index: 2;                            /* over the tucked-in print and cutting */
  padding: clamp(calc(14 * var(--u)), 1.6cqi, calc(22 * var(--u)));
  border-radius: calc(14 * var(--u));
  background: var(--tex-linen) 0 0 / calc(300 * var(--u)), var(--cloth);
  background-blend-mode: multiply;
  box-shadow:
    0 calc(1 * var(--u)) 0 rgb(255 255 255 / .3) inset,
    0 -2px 0 rgb(0 0 0 / .12) inset,
    0 calc(2 * var(--u)) calc(3 * var(--u)) rgb(40 22 8 / .3),
    0 calc(30 * var(--u)) calc(50 * var(--u)) -18px rgb(40 22 8 / .6);
}
.notebook::before {                      /* stitching round the cover */
  content: "";
  position: absolute;
  inset: calc(6 * var(--u));
  border-radius: calc(10 * var(--u));
  pointer-events: none;
  background:
    var(--stitch-light)   0 0    / calc(150 * var(--u)) calc(7 * var(--u)) repeat-x,
    var(--stitch-light)   0 100% / calc(150 * var(--u)) calc(7 * var(--u)) repeat-x,
    var(--stitch-light-v) 0 0    / calc(7 * var(--u)) calc(150 * var(--u)) repeat-y,
    var(--stitch-light-v) 100% 0 / calc(7 * var(--u)) calc(150 * var(--u)) repeat-y;
  opacity: .8;
}

.spread {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* roughly 16:10, but never shorter than its content needs (an aspect-ratio
     with a minimum height would widen the notebook on narrow windows) */
  min-height: max(calc(540 * var(--u)), 60cqi);
}

.page {
  position: relative;
  min-width: 0;
  padding: clamp(calc(24 * var(--u)), 4.5cqi, calc(64 * var(--u))) clamp(calc(22 * var(--u)), 4.5cqi, calc(64 * var(--u)));
  background: var(--wash), var(--tex-paper) 0 0 / calc(380 * var(--u)), var(--paper);
  background-blend-mode: normal, multiply;
  box-shadow: 0 calc(2 * var(--u)) 0 var(--paper-edge), 0 calc(4 * var(--u)) 0 #ddd2b8, 0 calc(6 * var(--u)) 0 #d3c7aa;
  overflow: hidden;
}
.page--left  { border-radius: calc(6 * var(--u)) calc(2 * var(--u)) calc(2 * var(--u)) calc(6 * var(--u)); }
.page--right { border-radius: calc(2 * var(--u)) calc(6 * var(--u)) calc(6 * var(--u)) calc(2 * var(--u)); }
.page--left::after,
.page--right::after {                    /* shading into the spine */
  content: "";
  position: absolute; top: 0; bottom: 0; width: 9%;
  pointer-events: none;
}
.page--left::after  { right: 0; background: linear-gradient(to left,  rgb(60 45 20 / .16), transparent); }
.page--right::after { left: 0;  background: linear-gradient(to right, rgb(60 45 20 / .16), transparent); }

.page--ruled-foot {
  background:
    repeating-linear-gradient(to bottom, transparent 0 calc(27 * var(--u)), var(--rule) calc(27 * var(--u)) calc(28 * var(--u))) bottom / 100% calc(112 * var(--u)) no-repeat,
    var(--wash),
    var(--tex-paper) 0 0 / calc(380 * var(--u)),
    var(--paper);
  background-blend-mode: normal, normal, multiply;
}

/* pages holding a sketch are columns: the sketch takes whatever room is left */
.page--stack { display: flex; flex-direction: column; }
.page--stack > * { flex: 0 0 auto; }

.ribbon {
  position: absolute;
  top: -10px; bottom: -40px;
  left: calc(50% - calc(8 * var(--u)));
  width: calc(16 * var(--u));
  z-index: 3;
  background: repeating-linear-gradient(0deg, rgb(255 255 255 / .1) 0 calc(1 * var(--u)), transparent calc(1 * var(--u)) calc(3 * var(--u))), var(--ribbon);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - calc(12 * var(--u))), 0 100%);
  pointer-events: none;
}

/* ---------- Watercolour sketches, multiplied into the paper ---------- */
.sketch {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
}
.sketch img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  mix-blend-mode: multiply;
  opacity: .93;
  filter: contrast(.97) saturate(.92);
}
.sketch--grow { flex: 1 1 0; }

/* Controller on the left page: floated to the middle right, with the text
   wrapping round the painted outline. */
/* the newsletters and writing links sit in the middle of the page */
.flow { padding-bottom: 4cqi; display: flow-root; }
.flow > .eyebrow:first-of-type { margin-top: 0; }
.sketch--wrap {
  display: block;
  float: right;
  width: 38%;
  margin: 0;                             /* margins would stretch the shape image */
  /* outline of the painting's left edge, traced from its transparency
     (a polygon works everywhere, including pages opened straight from disk) */
  shape-outside: polygon(100% 0%, 21% 2%, 14% 10%, 11% 18%, 9% 26%, 8% 34%, 6% 42%, 4% 50%,
                         3% 58%, 2% 66%, 1% 74%, 2% 82%, 3% 90%, 11% 98%, 100% 100%);
  shape-margin: calc(16 * var(--u));
}
.sketch--wrap img { width: 100%; max-height: none; }

/* Pen-drawn icons beside links (Doodle Icons, CC0) */
.doodle {
  display: inline-block;
  height: 1.2em;
  width: auto;
  margin-right: .4em;
  vertical-align: -.25em;
  opacity: .9;
}
.icon-link { text-decoration: none; }
.link-row--icons { gap: .7em 1.4em; font-size: 1.15rem; }
.link-row--icons .doodle { height: 1.5em; vertical-align: -.4em; }
.sketch--tilt-l img { transform: rotate(-4deg); }
.sketch--tilt-r img { transform: rotate(3deg); }

/* ---------- Typography (notebook and sheet) ---------- */
.script {
  font-family: var(--font-script);
  color: var(--ink-teal);
  font-weight: 400;
  line-height: .95;
  margin: 0 0 .35em;
}
.script--h1 { font-size: clamp(2.6rem, 5.4cqi, 4.8rem); transform: rotate(-2deg); transform-origin: left; }

.lede { font-size: clamp(1.1rem, 1.8cqi, 1.45rem); margin: .2em 0 1em; }

.eyebrow {
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin: 1.4em 0 .3em;
  opacity: .8;
}

.big-para { margin: .1em 0 .5em; font-size: clamp(1.4rem, 2.6cqi, 2.2rem); line-height: 1.3; }
.big-link {
  text-decoration: underline;
  text-decoration-thickness: calc(2 * var(--u));
  text-underline-offset: .2em;
}
.big-link:hover { color: var(--ink-teal); }
.big-title { font-size: clamp(1.4rem, 2.6cqi, 2.2rem); line-height: 1.15; margin: .1em 0 .25em; }
.big-para:has(+ .desc) { margin-bottom: .15em; }
.desc { margin: 0 0 1em; font-size: 1.02rem; line-height: 1.45; }

.link-row { display: flex; flex-wrap: wrap; gap: .6em 1.6em; margin: 0; padding: 0; list-style: none; }
.link-row a { text-decoration: none; border-bottom: calc(1.5 * var(--u)) solid var(--ink); }
/* icon links: only the words are underlined, not the doodle */
.link-row a.icon-link { border-bottom: 0; }
.link-row a.icon-link::after { content: none; }
.link-row .icon-link span { border-bottom: calc(1.5 * var(--u)) solid var(--ink); }

/* The "opens elsewhere" arrow. A small drawing rather than the ↗ character,
   which iOS and some other systems show as a coloured emoji. It is a
   background in the link's end padding, so it stays on the same line as the
   last word and draws the same in every browser. */
.big-link,
.link-row a:not(.icon-link),
.link-row .icon-link span {
  background: var(--arrow-ink) no-repeat right 55% / .62em;
}
.big-link { padding-right: .8em; background-size: .52em; }
.link-row a:not(.icon-link), .link-row .icon-link span { padding-right: .95em; }
.big-link:hover { background-image: var(--arrow-teal); }

h3 { font-weight: 500; font-size: 1.35rem; margin: 1.3em 0 .3em; }

.awards { display: grid; grid-template-columns: auto 1fr; gap: .3em 1.4em; margin: .4em 0 0; }
.awards dt { font-variant-numeric: oldstyle-nums; }
.awards dd { margin: 0; }

/* =========================================================
   3. Below the notebook
   ========================================================= */
.bottom {
  position: relative;
  z-index: 1;                            /* the sheet's top edge slides under the notebook */
  display: grid;
  grid-template-columns: 60fr 40fr;
  align-items: start;
  margin-top: -3.2cqi;
}

/* ----- About sheet: a loose page of writing paper ----- */
.sheet {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  margin-left: 3cqi;
  padding: 7cqi 6cqi 13cqi;              /* top padding covers the tucked-in edge; the award lies over the foot */
  background: var(--wash), var(--tex-paper) 0 0 / calc(380 * var(--u)), var(--sheet);
  background-blend-mode: normal, multiply;
  border-radius: calc(2 * var(--u));
  box-shadow: var(--lying);
  transform: rotate(-1.4deg);
}
.sheet .awards { max-width: 30cqi; }
.sketch--corner {
  position: absolute;
  right: 3.5cqi;
  bottom: 3cqi;
  width: 14cqi;
}
.sketch--corner img { transform: rotate(6deg); }

/* Publications: the mastheads, printed small */
.logos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(92 * var(--u)), 1fr));
  gap: calc(14 * var(--u)) calc(22 * var(--u));
  align-items: center;
  margin: .6em 0 0;
  padding: 0;
  list-style: none;
}
.logos a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(34 * var(--u));
  border-radius: calc(3 * var(--u));
}
.logos img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  opacity: .82;
  mix-blend-mode: multiply;              /* the ink sits in the paper */
  transition: opacity .15s;
}
.logos a:hover img, .logos a:focus-visible img { opacity: 1; }
.logos a:focus-visible { outline: 2px solid var(--ink-teal); outline-offset: 4px; }

/* the 2025 award card, lying over the foot of the About page */
.award {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  justify-self: start;
  position: relative;
  z-index: 2;
  width: 26cqi;
  margin: 0 0 -5cqi 9cqi;
  overflow: hidden;
  border-radius: calc(2 * var(--u));
  box-shadow: var(--lying);
  transform: rotate(-3deg);
}
.award img { display: block; width: 100%; height: auto; }

/* ----- Business card (90 × 55 mm) ----- */
.bottom__side {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.bottom > .bottom__side { pointer-events: none; }   /* only the card and photo catch clicks */
.bottom__side > * { pointer-events: auto; }
.card {
  position: relative;
  z-index: 2;
  width: 36cqi;
  aspect-ratio: 90 / 55;
  margin: 9cqi 0 0 -5cqi;                /* overlaps the edge of the sheet */
  padding: 2.6cqi 3cqi;
  display: flex;
  flex-direction: column;
  border-radius: calc(3 * var(--u));
  background: var(--tex-paper) 0 0 / calc(260 * var(--u)), var(--card);
  background-blend-mode: multiply;
  box-shadow: 0 calc(1 * var(--u)) calc(1 * var(--u)) rgb(40 22 8 / .35), 0 calc(2 * var(--u)) 0 #e8e1d0, var(--lying);
  transform: rotate(5deg);
}
.card__name {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.35rem, 2.6cqi, 2rem);
  line-height: 1.05;
  color: var(--ink);
}
.card__role {
  margin: .25em 0 0;
  font-style: italic;
  font-size: clamp(.95rem, 1.45cqi, 1.1rem);
}
.card__heading {
  margin: auto 0 .45em;
  padding-top: .6em;
  border-top: calc(1 * var(--u)) solid rgb(20 50 74 / .35);
  font-weight: 500;
  font-size: clamp(.68rem, 1cqi, .8rem);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.card__links {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .25em;
  font-size: clamp(.92rem, 1.4cqi, 1.08rem);
}
.card__links span {
  display: inline-block;
  min-width: 6.2em;
  font-size: .8em;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .75;
}
.card__links a { text-decoration: none; border-bottom: calc(1.5 * var(--u)) solid var(--ink-teal); }

/* =========================================================
   4. Clippings and photos either side of the notebook
   They sit outside the desk column, partly under the notebook and
   the About sheet, and are only shown where the window is wide
   enough to see them.
   ========================================================= */
.desk-clip { overflow-x: clip; }   /* the side items may run past the window edge */

/* ---------- The room: the desktop runs off the top of the page, and its front edge drops to the floor ---------- */
.desk-clip {
  position: relative;
  /* the floor in front of the desk holds the footer */
}
.tabletop {
  position: relative;
  background: var(--tex-desk) 0 0 / calc(768 * var(--u)), #b48a5c;
}
/* The front edge: a rounded lip in the same oak, lit along the top and falling
   into shadow underneath, with the desk's shadow on the floor below. */
.tabletop::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  height: calc(30 * var(--u));
  background:
    linear-gradient(to bottom,
      rgb(255 240 215 / .5) 0,
      rgb(255 240 215 / .15) calc(5 * var(--u)),
      transparent calc(10 * var(--u)),
      rgb(40 20 5 / .35) 70%,
      rgb(20 10 2 / .75) 100%),
    var(--tex-desk) 0 0 / calc(768 * var(--u)),
    #a77c50;
  box-shadow:
    0 calc(2 * var(--u)) 0 rgb(10 5 0 / .55),
    0 calc(30 * var(--u)) calc(60 * var(--u)) calc(10 * var(--u)) rgb(0 0 0 / .55);
}

.strewn { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
/* The rows above and below the notebook are transparent boxes as wide as the
   column; only the things in them should catch clicks, so the loose items
   underneath can still be picked up wherever they show. */
.top, .bottom { pointer-events: none; }
.top > *, .bottom > * { pointer-events: auto; }
.strewn__item { position: absolute; margin: 0; pointer-events: auto; }
.strewn__item img { display: block; width: 100%; height: auto; }

/* photos: glossy prints */
.snap { box-shadow: var(--lying); border-radius: calc(2 * var(--u)); overflow: hidden; }
.snap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(125deg, rgb(255 255 255 / .18), transparent 35%);
}
.snap--stage { border: calc(7 * var(--u)) solid #f6f3ec; border-bottom-width: calc(22 * var(--u)); }   /* a bordered print */

/* clippings: scissor-cut edges */
.clip { filter: drop-shadow(0 calc(1 * var(--u)) calc(1 * var(--u)) rgb(40 22 8 / .3)) drop-shadow(0 calc(10 * var(--u)) calc(14 * var(--u)) rgb(40 22 8 / .3)); }
.clip img { clip-path: polygon(1% 1.5%, 22% .4%, 47% 1.6%, 70% .2%, 99% 1.2%, 98.4% 34%, 99.4% 67%, 98.6% 99%, 72% 98.2%, 41% 99.6%, 14% 98.4%, .6% 99.2%, 1.4% 62%, 0 30%); }

/* Where each item sits.
   On a wide window an item is tucked a little under the notebook (--tb) and
   lies on the desk beside it. As the window narrows, it slides further under
   the notebook so it stays in the window, but never so far that the face (or
   headline) is covered: --fx is how far across the item that is, from its
   left edge. On phones the window edge crops the outer side as well, so what
   shows is a vertical strip around the face.
     --w   width            --tb  how far it is tucked under on a wide window
     --fx  where the face is (0 = left edge, 1 = right edge)                  */
.desk {
  --g: calc((100vw - 100cqi) / 2);   /* from the window edge to the desk column */
  --m: calc(1.5cqi + 12px);          /* keep clear of the window edge */
  --e: 0cqi;                         /* the notebook's edge, in from the column's */
  --c: 4cqi;                         /* keep the face this far clear of the notebook */
}
.strewn__item { width: var(--w); }
.strewn--l {
  left: min(max(var(--tb) - var(--w), var(--m) - var(--g)),
            var(--e) - var(--c) - var(--fx) * var(--w));
}
.strewn--r {
  left: calc(100% + max(min(-1 * var(--tb), var(--g) - var(--m) - var(--w)),
                        var(--c) - var(--e) - var(--fx) * var(--w)));
}

/* left of the notebook */
.clip--lucy        { --w: 24cqi; --tb: 3cqi; --fx: .55; top: 6cqi;   transform: rotate(-7deg); }
.snap--gym         { --w: 19cqi; --tb: 2cqi; --fx: .72; top: 42cqi;  transform: rotate(4deg); }
.clip--buffy       { --w: 23cqi; --tb: 4cqi; --fx: .35; top: 80cqi;  transform: rotate(-4deg); }
.snap--rally       { --w: 18cqi; --tb: 3cqi; --fx: .45; top: 122cqi; transform: rotate(5deg); }
/* right of the notebook */
.clip--stan        { --w: 26cqi; --tb: 3cqi; --fx: .5;  top: 30cqi;  transform: rotate(-5deg); }
.snap--stage       { --w: 18cqi; --tb: 4cqi; --fx: .5;  top: 64cqi;  transform: rotate(4deg); }
.snap--hovercraft  { --w: 26cqi; --tb: 3cqi; --fx: .5;  top: 102cqi; transform: rotate(-3deg); }
/* the PAX photo lies under the business card (it sits in .bottom__side) */
.snap--pax {
  --w: 27cqi;
  position: relative;
  left: auto;
  z-index: 1;                            /* under the card */
  margin: -3cqi 0 0 4cqi;
  transform: rotate(4deg);
}

/* ---------- Footer, on the floor below the desk ---------- */
.site-foot {
  position: relative;
  padding: calc(64 * var(--u)) calc(24 * var(--u)) calc(48 * var(--u));
  color: #fff;
  font-size: .95rem;
  text-align: center;
  text-shadow: 0 1px 2px rgb(0 0 0 / .6);
}
.site-foot p { margin: 0; }
.site-foot__links { display: flex; justify-content: center; gap: 1.6em; margin-bottom: .5em !important; }
.site-foot a { color: #fff; text-decoration: none; }
.site-foot a:hover, .site-foot a:focus-visible { text-decoration: underline; }

/* =========================================================
   Tablets and phones
   ========================================================= */
@media (max-width: 990px) {
  .desk { width: calc(100% - calc(24 * var(--u))); }

  /* the cutting comes first; the photo still slides under the notebook */
  .top {
    --tuck: 12cqi;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .clipping {
    width: 74cqi;
    margin: 0 0 6cqi;
    padding: 5cqi 6cqi 5.5cqi;
    transform: rotate(1.2deg);
  }
  .clipping__kicker, .clipping__byline { font-size: .72rem; }
  .clipping__headline { font-size: clamp(2.2rem, 11.5cqi, 4rem); }
  .clipping__standfirst { margin: 2.4cqi 0; }
  .clipping__kicker { margin-bottom: 3cqi; padding: 1.2cqi 0; }
  .clipping__byline { padding-top: 1.6cqi; }
  .print { width: 66cqi; transform: rotate(2deg); }
  .sketch--wrap { width: 40%; }

  /* the centre column is narrower, so the items either side can peek out */
  .notebook { padding: calc(10 * var(--u)); margin-inline: 13cqi; }
  .page { padding: calc(20 * var(--u)) calc(16 * var(--u)); }
  .spread { grid-template-columns: 1fr; aspect-ratio: auto; min-height: 0; gap: calc(12 * var(--u)); }
  .page { min-height: 0; border-radius: calc(6 * var(--u)); }
  .page--left::after, .page--right::after { display: none; }
  .page--ruled-foot { padding-bottom: calc(100 * var(--u)); }
  .sketch--grow { flex: 0 0 auto; }
  .sketch img { max-height: calc(230 * var(--u)); }
  .ribbon { left: auto; right: calc(22 * var(--u)); top: -12px; bottom: auto; height: calc(90 * var(--u)); width: calc(14 * var(--u)); }

  /* static here, so the PAX photo can join the items either side */
  .bottom { display: block; margin-top: -4cqi; position: static; z-index: auto; }
  .bottom__side { display: contents; }
  .sheet { z-index: 1; }
  .sheet { margin: 0 12cqi; padding: 12cqi 6cqi 50cqi; transform: rotate(-.8deg); }
  .sheet .awards { max-width: none; }
  .sketch--corner { width: 30cqi; right: 6cqi; bottom: 15cqi; }
  .logos { grid-template-columns: repeat(3, 1fr); gap: calc(12 * var(--u)) calc(14 * var(--u)); }
  .logos a { height: calc(26 * var(--u)); }
  .award { display: block; width: 62cqi; margin: -16cqi 0 0 16cqi; transform: rotate(-2.5deg); }
  .card {
    width: 74cqi;
    margin: 5cqi auto 0;
    padding: 6cqi 7cqi;
    transform: rotate(3deg);
  }
  .card__name { font-size: 1.6rem; }
  .card__heading { font-size: .72rem; }

  /* Items either side, at a size that suits the notebook: the notebook and
     the window edge crop each one to a vertical strip around the face. */
  .desk { --e: 13cqi; --c: 7cqi; }
  .clip--lucy       { --w: 44cqi; --fx: .66; top: 19%; transform: rotate(-4deg); }
  .snap--gym        { --w: 30cqi; --fx: .55; top: 36%; transform: rotate(3deg); }
  .clip--buffy      { --w: 38cqi; top: 53%; transform: rotate(-3deg); }
  .snap--rally      { --w: 30cqi; top: 70%; transform: rotate(-3deg); }
  .clip--stan       { --w: 42cqi; top: 26%; transform: rotate(-3deg); }
  .snap--stage      { --w: 30cqi; top: 40%; transform: rotate(3deg);
                      border-width: calc(5 * var(--u)); border-bottom-width: calc(15 * var(--u)); }
  .snap--hovercraft { --w: 44cqi; top: 62%; transform: rotate(-3deg); }
  .snap--pax        { --w: 44cqi; --tb: 3cqi; --fx: .46; position: absolute; z-index: 0; margin: 0;
                      left: calc(100% + max(min(-1 * var(--tb), var(--g) - var(--m) - var(--w)),
                                            var(--c) - var(--e) - var(--fx) * var(--w)));
                      top: 51%; transform: rotate(3deg); }
}


/* =========================================================
   5. Picking items up (js/examine.js)
   ========================================================= */

/* ---------- On the desk ---------- */
[data-examine] {
  cursor: zoom-in;
  transition: translate .18s ease, scale .18s ease, box-shadow .18s ease, filter .18s ease;
}
[data-examine] a { cursor: pointer; }
.is-picked { visibility: hidden; }           /* it has left the desk */

/* lift a little on hover, to show it can be picked up */
@media (hover: hover) {
  [data-examine]:not(.is-copy):hover { translate: 0 calc(-5 * var(--u)); scale: 1.015; }
  .snap[data-examine]:hover, .print[data-examine]:hover,
  .sheet[data-examine]:hover, .card[data-examine]:hover {
    box-shadow: 0 calc(2 * var(--u)) calc(3 * var(--u)) rgb(40 22 8 / .22),
                0 calc(24 * var(--u)) calc(36 * var(--u)) calc(-10 * var(--u)) rgb(40 22 8 / .5);
  }
  .clip[data-examine]:hover, .clipping[data-examine]:hover {
    filter: drop-shadow(0 calc(2 * var(--u)) calc(2 * var(--u)) rgb(40 22 8 / .25))
            drop-shadow(0 calc(20 * var(--u)) calc(22 * var(--u)) rgb(40 22 8 / .35));
  }
}

/* the button that picks an item up */
.examine-btn {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0; padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.examine-btn:focus-visible { outline: 3px solid #fff8ec; outline-offset: 3px; box-shadow: 0 0 0 6px var(--ink-teal); }
/* on items that hold links (the cutting, sheet and card), the button is
   hidden until it's reached with the keyboard */
.examine-btn--hidden {
  inset: auto auto calc(100% + 6px) 0;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.examine-btn--hidden:focus-visible {
  width: auto; height: auto;
  clip-path: none;
  padding: .3em .8em;
  border-radius: 99px;
  background: var(--ink);
  color: #fff8ec;
  font: 500 .85rem/1.3 var(--font-body);
  box-shadow: none;
}

/* ---------- The viewer ---------- */
html.is-examining { overflow: hidden; }       /* the page stays still underneath */

.viewer {
  width: 100vw; height: 100dvh;
  max-width: none; max-height: none;
  margin: 0; padding: 0;
  border: 0;
  background: transparent;
  overflow: auto;
  color: #f7f0e2;
  font-family: var(--font-body);
}
.viewer::backdrop {
  background: rgb(22 12 4 / .68);
  backdrop-filter: blur(3px);                /* the desk goes out of focus */
}
.viewer__stage {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 4vw, 64px);
  padding: 7vh 6vw;
}
.viewer__object { flex: 0 0 auto; }
.flip-holder { perspective: 1800px; }

.viewer__panel {
  view-transition-name: viewer-panel;
  width: min(380px, 30vw);
  text-shadow: 0 1px 2px rgb(0 0 0 / .4);
}
.viewer--no-panel .viewer__panel {        /* the title still names the dialog for screen readers */
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
}
.viewer__title { margin: 0 0 .25em; font: 600 clamp(1.6rem, 2.4vw, 2.3rem)/1.15 var(--font-body); }
.viewer__meta {
  margin: 0 0 1.1em;
  font-size: .8rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .8;
}
.viewer__text { margin: 0 0 1.4em; font-size: 1.15rem; line-height: 1.55; }
.viewer__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8em 1.4em; margin: 0; }
.viewer__flip {
  padding: .45em 1.1em;
  border: 1.5px solid rgb(247 240 226 / .7);
  border-radius: 99px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}
.viewer__flip:hover { background: rgb(247 240 226 / .12); }
.viewer__link { color: inherit; }
.viewer__close {
  position: fixed;
  top: 18px; right: 18px;
  z-index: 2;
  width: 46px; height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgb(247 240 226 / .92);
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgb(0 0 0 / .35);
}
.viewer button:focus-visible, .viewer a:focus-visible { outline: 3px solid #fff8ec; outline-offset: 3px; }

/* photos: a print that turns over to show the note on the back */
.flip {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.3, .7, .3, 1);
  cursor: pointer;
}
.flip.is-flipped { transform: rotateY(180deg); }
.flip__face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgb(0 0 0 / .3), 0 30px 60px -20px rgb(0 0 0 / .6);
}
.flip__front img { display: block; width: 100%; height: 100%; object-fit: cover; }
.flip__front::after {                    /* glossy sheen */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, rgb(255 255 255 / .16), transparent 35%);
}
.flip__back {
  transform: rotateY(180deg);
  display: flex; align-items: center; justify-content: center;
  padding: 8%;
  background: var(--wash), var(--tex-paper) 0 0 / 300px, #f1ede3;   /* matte photo-paper back */
  background-blend-mode: normal, multiply;
}
.flip__note {
  margin: 0;
  max-width: 34ch;
  font-family: var(--font-script);
  font-size: clamp(1.3rem, 2.6vw, 2.2rem);
  line-height: 1.25;
  color: #2b4c8c;                         /* blue biro */
  text-align: center;
  text-shadow: none;
  transform: rotate(-3deg);
}

/* clippings: the same scissor-cut edges, larger */
.viewer__clipping {
  filter: drop-shadow(0 2px 2px rgb(0 0 0 / .3)) drop-shadow(0 30px 40px rgb(0 0 0 / .45));
}
.viewer__clipping img {
  display: block;
  clip-path: polygon(1% 1.5%, 22% .4%, 47% 1.6%, 70% .2%, 99% 1.2%, 98.4% 34%, 99.4% 67%, 98.6% 99%, 72% 98.2%, 41% 99.6%, 14% 98.4%, .6% 99.2%, 1.4% 62%, 0 30%);
}

/* paper items: a copy of the real thing, straightened */
.viewer__paper { container-type: inline-size; display: flex; justify-content: center; color: var(--ink); text-shadow: none; }
.viewer__paper .is-copy {
  position: relative;
  margin: 0 !important;
  transform: none !important;
  translate: none !important;
  scale: none !important;
  cursor: auto;
  flex: 0 0 auto;
}
.viewer__paper .sheet.is-copy, .viewer__paper .card.is-copy {
  box-shadow: 0 2px 4px rgb(0 0 0 / .3), 0 30px 60px -20px rgb(0 0 0 / .6);
}

/* ---------- Narrow screens: the item on top, notes underneath ---------- */
@media (max-width: 759px) {
  .viewer::backdrop { background: rgb(22 12 4 / .86); backdrop-filter: none; }   /* blur is costly on phones */
  .viewer__stage { flex-direction: column; justify-content: flex-start; gap: 20px; padding: 72px 6vw 40px; }
  .viewer__panel { width: 100%; max-width: 560px; }
  .viewer__close { top: 12px; right: 12px; }
}

/* ---------- Animation ----------
   The item's flight is a view transition named "picked": the browser morphs
   it from its place on the desk (rotated, small) to the viewer (straight,
   large) and back. */
::view-transition-group(picked) {
  animation-duration: .5s;
  animation-timing-function: cubic-bezier(.2, .75, .25, 1);
}
/* a slight turn of the wrist part-way through the lift */
html[data-vt="pickup"]::view-transition-image-pair(picked) { animation: wrist .5s ease-in-out; }
@keyframes wrist { 45% { transform: perspective(1400px) rotateX(7deg) rotateY(-4deg); } }

/* putting it down is quicker, and settles with a tiny overshoot */
html[data-vt="putdown"]::view-transition-group(picked) {
  animation-duration: .38s;
  animation-timing-function: cubic-bezier(.3, 1.3, .55, 1);
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }

::view-transition-new(viewer-panel) { animation: panel-in .4s cubic-bezier(.2, .7, .3, 1) .15s both; }
::view-transition-old(viewer-panel) { animation: panel-out .15s ease-in both; }
@keyframes panel-in  { from { opacity: 0; transform: translateX(16px); } }
@keyframes panel-out { to   { opacity: 0; } }

@media (max-width: 759px) {
  ::view-transition-group(picked) { animation-duration: .36s; }
  html[data-vt="putdown"]::view-transition-group(picked) { animation-duration: .3s; }
  @keyframes panel-in { from { opacity: 0; transform: translateY(12px); } }
}

/* fallback (no view transitions, or reduced motion): a simple fade */
.viewer--fade[open] { animation: viewer-fade .22s ease-out; }
.viewer--fade[open]::backdrop { animation: viewer-fade .22s ease-out; }
@keyframes viewer-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .flip { transition: none; }
  [data-examine] { transition: none; }
}
