/* =========================================================
   Suman Mahapatra · a sideways CV
   site.css · composition: layout, type, texture, motion.
   The art lives in art.css and art/*.js.

   The page is an ordinary vertical page first. On a wide screen
   with a fine pointer, <html> gets the class .h and the scenes
   are laid in one row inside a native horizontal scroller.

   1  tokens            5  the top bar
   2  base and type     6  VERTICAL  (html:not(.h))
   3  strips            7  SIDEWAYS  (html.h)
   4  shared pieces     8  motion    9  print

   Colours: the palette below, and nothing else.

   Sideways, two lines run through the whole row:
     --Y     the baseline all the big type sits on
     --foot  the line the small things at the bottom stand on
   ========================================================= */

/* ---------- 1 · tokens ---------- */

:root {
  --paper: #EFEBE2;
  --cream: #F7F4EC;
  --ink: #1F1D1A;
  --clay: #C96F4E;
  --clay-deep: #A85538;
  --sky: #9DB8CC;
  --sky-deep: #6F8FA8;
  --blush: #E3A79A;
  --olive: #7C8363;
  --night: #14161A;
  --amber: #E9A03B;
  --blueprint: #2E4A66;                           /* the blue of an engineering print */
  --sepia: #5A3E2B;                               /* the brown ink of the notebook studies */

  --live: #3E8E57;
  --soft: #5C5850;                                /* quiet ink for small labels on paper and cream */

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(.3, 0, .2, 1);


  color-scheme: light;
}

/* ---------- 2 · base and type ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.5;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; padding: 0; font-weight: 400; font-size: inherit; }
ul, ol { list-style: none; }
a { color: inherit; }
cite { font-style: normal; }
canvas { display: block; }
button { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; font: inherit; color: inherit; -webkit-appearance: none; appearance: none; }
[hidden] { display: none !important; }

::selection { background: var(--amber); color: var(--ink); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 7px var(--cream);
}
[tabindex="-1"]:focus { outline: none; }

/* words that are there for a reader that speaks the page, and take no room on it */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* small labels: a quiet letterspaced sans */
.label {
  font-family: var(--sans);
  font-size: var(--f-label, 11.5px);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: .13em;
  text-transform: uppercase;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--fg-soft);
}

.meta {
  font-family: var(--sans);
  font-size: var(--f-meta, 13px);
  line-height: 1.6;
  letter-spacing: .014em;
  color: var(--fg-soft);
  text-wrap: balance;
}

/* the name of a thing: italic, above its headline */
.title {
  font-size: var(--f-title);
  font-style: italic;
  line-height: 1.15;
  letter-spacing: -.006em;
}

/* the headline is the message */
.headline {
  font-size: var(--f-head);
  line-height: 1.04;
  letter-spacing: -.026em;
}
.ln { display: block; }

.body {
  font-size: var(--f-body);
  line-height: 1.5;
  max-width: var(--mw);
  text-wrap: balance;
}
.scene--now .body { font-variant-numeric: oldstyle-nums proportional-nums; }      /* the dates, in text figures */
.nb { white-space: nowrap; }

/* the rule the firm runs on, set like a pull quote */
.rule {
  font-size: var(--f-rule);
  font-style: italic;
  line-height: 1.14;
  letter-spacing: -.014em;
}
.rule::before {
  content: "";
  display: block;
  width: 1.7em;
  height: 2px;
  margin-bottom: .52em;
  background: var(--clay);
  transform-origin: 0 50%;
}

/* the broken sentences: a touch of weight, as a medium cut would have */
.line {
  font-weight: 400;
  letter-spacing: -.03em;
  -webkit-text-stroke: .008em currentColor;
}
.frag { pointer-events: auto; }                 /* the overlay lets clicks through to the art; the words themselves can still be selected */

.live {
  display: inline-block;
  width: .62em;
  height: .62em;
  border-radius: 50%;
  background: var(--live);
}

/* ---------- 3 · strips ---------- */

.strip {
  --bg: var(--paper);
  --fg: var(--ink);
  --fg-soft: var(--soft);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;              /* what hangs out of a strip is cut, and never adds to the page's scroll size */
  background-color: var(--bg);
  color: var(--fg);
}
.strip--paper { --bg: var(--paper); }
.strip--cream { --bg: var(--cream); }
.strip--clay { --bg: var(--clay); --fg-soft: var(--night); }
.strip--clay-deep { --bg: var(--clay-deep); --fg: var(--cream); --fg-soft: var(--cream); }
.strip--sky { --bg: var(--sky); --fg-soft: #3B3833; }
.strip--sky-deep { --bg: var(--sky-deep); --fg-soft: var(--ink); }
.strip--blush { --bg: var(--blush); --fg-soft: #3B3833; }
.strip--olive { --bg: var(--olive); --fg: var(--night); --fg-soft: var(--night); }
.strip--night { --bg: var(--night); --fg: var(--cream); --fg-soft: #BFBBB2; }
.strip--blueprint { --bg: var(--blueprint); --fg: var(--cream); --fg-soft: #C9D6E2; }

.tone-olive { color: var(--night); }         /* a fragment of a broken sentence, in the ink of the strip it lies on */
.tone-night { color: var(--cream); }

/* layers inside a strip, bottom to top:
   0 the art · 1 the vignette and the big numeral · 2 the grain · 3 the type · 6 the bar (site.js) */

/* the art slot: the art scripts fill it; without them the strip is a plain colour field */
.strip > .art {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* grain: it belongs to the strip and travels with it, like the tooth of the paper. Type is printed over it and stays sharp.
   One fine noise field: its dark half as dark specks, its light half as light specks, so every colour is grained
   both ways and none is dirtied. (Written here in full, not as a custom property: a var() is read again on every restyle.) */
.strip::before,
html:not(.h) .play::before,
html:not(.h) .foot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='a' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .09 0 0 0 0 .08 0 0 0 0 .07 -.31 0 0 0 .155'/%3E%3C/filter%3E%3Cfilter id='b' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .98 0 0 0 0 .94 .23 0 0 0 -.115'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3Crect width='100%25' height='100%25' filter='url(%23b)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* a soft vignette for the "photograph" strips; it steps back once the art brings its own */
.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(125% 100% at 50% 46%, rgba(20, 22, 26, 0) 52%, rgba(20, 22, 26, .2) 100%);
  transition: opacity 1.1s var(--ease);
}
.photo:has(.sm-art.is-ready)::after { opacity: 0; }

.copy, .base, .seam, .role, .cue { position: relative; z-index: 3; }

/* the drawings (art/sketch.js): ink on the strip's own paper. A slot is .art.sketch and lies on layer 0 like the
   other art, under the grain and under every word. Three places take one:
     .sheet     a strip that is nothing but a drawing, after the text of its scene (S2, S4, S5)
     .topband   a text strip with a drawing in its empty upper part (or, in S6, behind its text)
     the first interstitial: one study filling each strip, behind the words
   (The second interstitial is photographs, as the title scene is: .photo strips with a plain .art slot.)
   Without the art scripts a slot is empty and its strip is plain paper or colour. */

/* ---------- 4 · shared pieces ---------- */

.links a, .mail a {
  text-decoration: underline;
  text-decoration-color: var(--clay);
  text-decoration-thickness: .06em;
  text-underline-offset: .2em;
  transition: text-decoration-color .3s var(--ease);
}
.links a:hover, .mail a:hover { text-decoration-color: currentColor; }

.links { display: flex; flex-wrap: wrap; gap: 0 1.5em; font-size: var(--f-body); }
.links a { display: inline-flex; align-items: center; min-height: 44px; }
.links a[target]::after { content: "\2197"; content: "\2197" / ""; margin-left: .3em; font-family: var(--sans); font-size: .78em; transition: translate .35s var(--ease); }
@media (hover: hover) { .links a[target]:hover::after { translate: .12em -.12em; } }

/* the facts under a project: a hairline, then one quiet line */
.specs::before {
  content: "";
  display: block;
  width: 100%;
  max-width: var(--mw);
  height: 1px;
  margin-bottom: .95em;
  background: currentColor;
  opacity: .24;
  transform-origin: 0 50%;
}
.specs .meta + .meta { margin-top: .1em; }

/* the big numeral of a project: paper on paper, cut by the edges of its strip */
.num {
  position: absolute;
  z-index: 1;
  font-size: var(--f-num);
  line-height: .7;
  letter-spacing: 0;
  font-variant-numeric: lining-nums;
  color: rgba(31, 29, 26, .07);
  color: color-mix(in srgb, var(--tint, var(--ink)) var(--tint-k, 9%), var(--paper));
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
#gemforge { --tint: var(--blush); --tint-k: 36%; }
#crm { --tint: var(--olive); --tint-k: 24%; }
#siteworks { --tint: var(--amber); --tint-k: 19%; }

/* the path: four rows */
.rows { max-width: var(--mw); font-size: var(--f-body); }
.rows li, .hard li { position: relative; }
.rows li::before, .hard li::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: currentColor;
  opacity: .24;
  transform-origin: 0 50%;
}
.row-a { display: block; font-size: var(--f-body); line-height: 1.28; text-wrap: balance; }
.row-b { display: block; font-family: var(--sans); font-size: var(--f-label, 11.5px); font-weight: 500; letter-spacing: .13em; text-transform: uppercase; line-height: 1.45; color: var(--fg-soft); }
.rows .dot { display: none; }
.row-b.dots { display: flex; --dot: 1.3em; }         /* the label breaks only at its dots, and never leaves one hanging */

/* S2: the four kinds of hard work, a plain list under the copy: a hairline over each, one line each where there is room */
.hard { max-width: var(--mw); font-size: var(--f-hard, var(--f-body)); line-height: 1.25; }
.hard li { padding: .42em 0 .46em; text-wrap: balance; }

/* a quiet run of things with dots between them (the facts under a project, the toolbox). Each thing after the
   first carries its dot in front of it, and the run is cut at its own left edge: wherever the lines break,
   no dot is left hanging at either end of a line, and no thing is broken in two */
.dots { --dot: 1.1em; display: flex; flex-wrap: wrap; margin-left: calc(var(--dot) * -1); clip-path: inset(-1em -1em -1em var(--dot)); }
.dots > * { white-space: nowrap; }
.dots > :first-child { padding-left: var(--dot); }
.dots i { display: inline-block; width: var(--dot); font-style: normal; text-align: center; }
.tools::before { flex: none; width: calc(100% - var(--dot)); margin-left: var(--dot); margin-right: 100%; }   /* its hairline keeps a row to itself */

/* the quotation on the cream strip */
.quote blockquote {
  font-size: var(--f-quote);
  font-style: italic;
  line-height: 1.32;
  letter-spacing: -.008em;
}
.quote .ln:nth-child(3) { margin-top: .5em; }

/* S1: the invitation, three short lines beside the envelope. The first two are the call, the third is quieter.
   Like the envelope it is a child of the scene, laid over the strips: it carries the ink of the paper it stands on */
.cue { --fg: var(--ink); --fg-soft: var(--soft); }
.cue-1, .cue-2, .cue-3 { display: block; }
.cue-1, .cue-2 { color: var(--fg); }
.cue-1, .cue-3 { text-wrap: balance; }
.cue-3 { margin-top: .5em; }

/* S1: the courier. The envelope is a link to the next scene, and the whole of it is the target.
   It is a child of its scene, not of a strip: a strip would cut it off where it hangs over the seam.
   --cw and --ch, its size, are set on the scene (parts 6 and 7), so the invitation can keep clear of it. */
.courier {
  position: absolute;
  z-index: 4;
  display: block;
  width: var(--cw);
  height: var(--ch);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: translate .55s var(--ease);
}
.courier > .art { position: absolute; inset: 0; display: block; }
.courier:focus-visible { outline-offset: 5px; }
@media (hover: hover) { .courier:hover { translate: 9px 0; } }
html:not(.js) .courier { display: none; }        /* no script, no drawing: no empty link. The words still say where to go */

/* S2: the run sheet. One job as the log has it, in real text; the only place the page sets a monospace face.
   Pale ink on night, hairlines between the lines. A line is time, step, what happened, and the result at the right. */
.run { position: relative; z-index: 3; }
.run-lines {
  --pale: rgba(247, 244, 236, .76);
  --pale: color-mix(in srgb, var(--cream) 76%, var(--night));
  --dim: rgba(247, 244, 236, .52);
  --dim: color-mix(in srgb, var(--cream) 52%, var(--night));
  max-width: 66ch;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: var(--f-run, 12px);
  line-height: 1.5;
  letter-spacing: 0;
  font-variant-numeric: lining-nums tabular-nums;
  font-variant-ligatures: none;
  color: var(--pale);
}
.run-lines li {
  display: grid;
  grid-template-columns: 8ch 8ch minmax(0, 1fr) auto;
  column-gap: 2ch;
  align-items: baseline;
  padding: var(--run-pad, .5em) 0;
  border-top: 1px solid rgba(247, 244, 236, .13);
}
.run-lines .t, .run-lines .r { color: var(--dim); }
.run-lines .s { color: var(--cream); }
.run-lines .r { text-align: right; }
/* a part that is withheld: a solid bar in the line's own ink, as high as the lowercase letters */
.held { display: inline-block; height: 1ex; background: currentColor; opacity: .55; }
.held--7 { width: 7ch; }
.held--14 { width: 14ch; }
.held--18 { width: 18ch; }
.held--23 { width: 23ch; }
/* the moment: everything waits here for a person */
.run-lines .is-stop { border-top-color: rgba(233, 160, 59, .5); }
.run-lines .is-stop .s { color: var(--amber); font-weight: 700; letter-spacing: .06em; }
.run-lines .is-stop .w { color: var(--cream); }
.lamp { display: inline-block; width: .7em; height: .7em; border-radius: 50%; background: var(--amber); }
/* ...and the person's answer, some time later, set as the firm's rule is set */
.run-lines .is-done { grid-template-columns: 8ch auto minmax(0, 1fr) auto; margin-top: .9em; padding-top: .8em; border-top-color: rgba(247, 244, 236, .3); color: var(--cream); }
.run-lines .is-done .s, .run-lines .is-done .w { font-family: var(--serif); font-style: italic; font-size: 1.42em; line-height: 1.1; letter-spacing: -.01em; }
.run-lines .is-done .r { color: var(--cream); }
.tick { display: inline-block; width: 1.05em; height: .9em; vertical-align: -.05em; overflow: visible; }
.run-note { margin-top: 1.5em; font-family: var(--sans); font-size: var(--f-meta, 13px); line-height: 1.5; letter-spacing: .014em; color: rgba(247, 244, 236, .56); color: color-mix(in srgb, var(--cream) 56%, var(--night)); }

/* the paper dinosaur: a button whose left third stays behind the seam (its strip cuts it off) */
.peek {
  --peek-w: 110px;
  --peek-h: 125px;
  position: absolute;
  z-index: 3;
  left: calc(var(--peek-w) / -3);
  width: var(--peek-w);
  height: var(--peek-h);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: translate .55s var(--ease);
}
.peek > .art { position: absolute; inset: 0; display: block; }
.peek:focus-visible { translate: 18px 0; outline-offset: -3px; box-shadow: none; }
@media (hover: hover) { .peek:hover { translate: 18px 0; } }
@media (min-width: 720px) { .peek { --peek-w: 150px; --peek-h: 170px; } }
html:not(.js) .peek { display: none; }           /* no script: nothing to open, so nothing peeks */

/* the game it opens */
.play { --fg-soft: var(--soft); color: var(--ink); }
.game {
  width: 100%;
  height: 186px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.game:focus { outline: none; }
.game:focus-visible { outline: 2px solid var(--ink); outline-offset: -5px; }
.close {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: var(--f-label, 11.5px);
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--fg-soft);
  text-decoration: underline;
  text-decoration-color: var(--clay);
  text-decoration-thickness: 1px;
  text-underline-offset: .32em;
}
@media (hover: hover) { .close:hover { color: var(--ink); text-decoration-color: currentColor; } }

.foot { --fg-soft: var(--soft); }

/* ---------- 5 · the top bar ---------- */

.mark {
  font-size: 17px;
  line-height: 24px;
  letter-spacing: -.005em;
  text-decoration: none;
  white-space: nowrap;
}
.idx { display: flex; align-items: center; }
.idx ol { display: flex; }
.idx a {
  position: relative;
  display: block;
  padding: 10px 7px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: .09em;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.idx a::after {
  content: "";
  position: absolute;
  left: 7px;
  right: calc(7px + .09em);
  bottom: 9px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .5s var(--ease);
}
.idx a:hover::after,
.idx a[aria-current]::after,
html[data-cur="1"] .idx [data-i="1"]::after, html[data-hov="1"] .idx [data-i="1"]::after,
html[data-cur="2"] .idx [data-i="2"]::after, html[data-hov="2"] .idx [data-i="2"]::after,
html[data-cur="3"] .idx [data-i="3"]::after, html[data-hov="3"] .idx [data-i="3"]::after,
html[data-cur="4"] .idx [data-i="4"]::after, html[data-hov="4"] .idx [data-i="4"]::after,
html[data-cur="5"] .idx [data-i="5"]::after, html[data-hov="5"] .idx [data-i="5"]::after,
html[data-cur="6"] .idx [data-i="6"]::after, html[data-hov="6"] .idx [data-i="6"]::after,
html[data-cur="7"] .idx [data-i="7"]::after, html[data-hov="7"] .idx [data-i="7"]::after,
html[data-cur="8"] .idx [data-i="8"]::after, html[data-hov="8"] .idx [data-i="8"]::after { transform: scaleX(1); }

/* the CV, beside the index: a small outlined tag. It is redrawn with the rest of the bar inside every strip,
   in that strip's ink, so it can be read over every colour the bar passes; under the pointer it fills a little */
.idx a.cv { margin: 0 7px 0 6px; padding: 10px calc(8px - .09em) 10px 8px; }
.idx a.cv + a.cv { margin-left: 0; text-transform: uppercase; }   /* the Tools tag sits beside the CV tag */
.idx a.cv::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 9px;
  bottom: 9px;
  border: 1px solid currentColor;
  opacity: .72;
}
.idx a.cv::after {
  left: 0;
  right: 0;
  top: 9px;
  bottom: 9px;
  height: auto;
  transform: none;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.idx a.cv:hover::after,
html[data-hov="cv"] .idx a.cv[data-i="cv"]::after,
html[data-hov="tools"] .idx a.cv[data-i="tools"]::after { opacity: .2; }

.hud, .prog { display: none; }

/* =========================================================
   6 · VERTICAL  (phones, touch, short windows, no script)
   Every scene stacks: its art as a band, then its text.
   ========================================================= */

html:not(.h) {
  --pad: clamp(20px, 5.6vw, 88px);
  --f-line: clamp(42px, min(13.4vw, 17vh), 104px);
  --f-line: clamp(42px, min(13.4vw, 17svh, (100svh - 448px) / 4.76), 104px);   /* the title scene fits the first screen where it can */
  --f-head: clamp(30px, 8.6vw, 56px);
  --f-title: clamp(20px, 5.4vw, 30px);
  --f-body: clamp(18px, 4.8vw, 21px);
  --f-rule: clamp(25px, 6.9vw, 36px);
  --f-quote: clamp(22px, 5.9vw, 29px);
  --f-label: 11px;
  --f-meta: 13px;
  --f-num: clamp(220px, 66vw, 460px);
  --mw: calc(var(--f-body) * 19);
  scroll-behavior: smooth;
}

html:not(.h) .bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px var(--pad) 0;
  color: var(--ink);
}
html:not(.h) .mark { display: inline-flex; align-items: center; min-height: 44px; }
html:not(.h) .idx { margin-right: -7px; }
html:not(.h) .idx ol { display: none; }                      /* a phone keeps the name and the CV; the numbers need the room of a wider screen */
html:not(.h) .idx a.cv { min-width: 44px; text-align: center; }
@media (min-width: 720px) {
  html:not(.h) .idx ol { display: flex; }
  html:not(.h) .idx li a { padding: 10px 12px; min-width: 44px; text-align: center; }
  html:not(.h) .idx li a::after { left: 12px; right: calc(12px + .09em); }
}

html:not(.h) .scene { position: relative; }
html:not(.h) .photo { min-height: 52vh; min-height: 52svh; }
html:not(.js) .scene--now > .photo,
html:not(.js) .scene--project > .photo { min-height: 30vh; min-height: 30svh; }      /* no script, no art: a plain band of colour, so a lower one */

/* text strips: label, name, headline, copy, then the facts under a hairline */
html:not(.h) .text { padding: clamp(40px, 10vw, 76px) var(--pad) clamp(56px, 14vw, 100px); }
html:not(.h) .copy { max-width: 40rem; }
html:not(.h) .seam { display: flex; align-items: center; gap: .75em; margin-bottom: 1.5em; }
html:not(.h) .title { margin-bottom: .34em; }
html:not(.h) .headline + .body { margin-top: 1.05em; }
html:not(.h) .body + .body { margin-top: .7em; }
html:not(.h) .hard { --f-hard: calc(var(--f-body) * .94); margin-top: 1.2em; }
html:not(.h) .kit { margin-top: 1.15em; }                 /* S2: what the platform is made of, one quiet line under the list */
html:not(.h) .rule { margin-top: 1.6em; }
html:not(.h) .specs { margin-top: 1.9em; max-width: 40rem; }
html:not(.h) .links { margin-top: .5em; }
html:not(.h) .num { top: -.02em; right: -.07em; }
html:not(.h) .rows { margin-top: 1.7em; }
html:not(.h) .rows li { padding: .85em 0 .9em; }
html:not(.h) .row-b { margin-top: .45em; }

/* the sheets of drawings: each a band after the text of its scene; paper and cream ones keep a hairline, so they read as a sheet of their own */
html:not(.h) .sheet { height: clamp(360px, 54vh, 640px); height: clamp(360px, 54svh, 640px); }
html:not(.h) .sheet:not(.strip--blueprint)::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: rgba(31, 29, 26, .2);
}
html:not(.js) .sheet { display: none; }                                              /* no script, no drawing: no empty sheet of paper */
html:not(.js) .sheet.strip--blueprint { display: block; height: 30vh; height: 30svh; }   /* ...but the print is still a band of colour */
/* S2: the plan of the estate is the largest drawing, so its band is a little taller than the others */
html:not(.h) .sheet--plan { height: clamp(460px, 60vh, 540px); height: clamp(460px, 60svh, 540px); }
/* S2: the run sheet, a block of night as wide as the page. On a narrow screen a line takes two rows:
   time, step and result, then what happened under them.
   It is marked .sheet only so that the keys stop on it (site.js): it is words, not a drawing, so it keeps
   its own height and it stays when there is no script */
html:not(.h) .runsheet { height: auto; padding: clamp(44px, 11vw, 80px) var(--pad) clamp(52px, 13vw, 92px); }
html:not(.js) .strip.runsheet { display: block; }
html:not(.h) .run { max-width: 40rem; }
html:not(.h) .run-lines { --f-run: clamp(11.5px, 3.1vw, 12px); --run-pad: .62em; margin-top: 1.5em; }
html:not(.h) .run-lines li { grid-template-columns: 8ch minmax(0, 1fr) auto; column-gap: 1.5ch; }
html:not(.h) .run-lines .t { grid-column: 1; grid-row: 1; }
html:not(.h) .run-lines .s { grid-column: 2; grid-row: 1; }
html:not(.h) .run-lines .r { grid-column: 3; grid-row: 1; }
html:not(.h) .run-lines .w { grid-column: 2 / 4; grid-row: 2; margin-top: .1em; }
html:not(.h) .run-lines .is-done { grid-template-columns: 8ch minmax(0, 1fr) auto; }
html:not(.h) .run-lines .is-done .w { margin-top: .05em; }
@media (min-width: 600px) {
  html:not(.h) .run-lines { --f-run: 13px; --run-pad: .5em; }
  html:not(.h) .run-lines li { grid-template-columns: 8ch 8ch minmax(0, 1fr) auto; column-gap: 2ch; }
  html:not(.h) .run-lines .is-done { grid-template-columns: 8ch auto minmax(0, 1fr) auto; }
  html:not(.h) .run-lines .s, html:not(.h) .run-lines .w, html:not(.h) .run-lines .r { grid-column: auto; grid-row: auto; margin-top: 0; }
}

/* a drawing inside a text strip: a band across the top of the strip, and the text starts under it */
html.js:not(.h) .strip.topband { --band: clamp(200px, 30vw, 320px); padding-top: calc(var(--band) + clamp(24px, 6vw, 48px)); }
html.js:not(.h) #crm .strip.topband { --band: clamp(180px, 28vw, 300px); }
html.js:not(.h) .scene--path .strip.topband { --band: clamp(220px, 30vw, 320px); }
html:not(.h) .topband > .art.sketch { bottom: auto; height: var(--band, 200px); }
html.js:not(.h) .topband .num { top: calc(var(--band) - .02em); }      /* the numeral starts under the drawing, not across it */

/* S1 and the interstitials: the broken sentence, stacked on its bands */
html:not(.h) .scene--title,
html:not(.h) .scene--inter {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--rows);
}
html:not(.h) .scene--title > .strip,
html:not(.h) .scene--inter > .strip { grid-column: 1; min-height: 0; }
html:not(.h) .scene--title > .strip:nth-child(1), html:not(.h) .scene--inter > .strip:nth-child(1) { grid-row: 1; }
html:not(.h) .scene--title > .strip:nth-child(2), html:not(.h) .scene--inter > .strip:nth-child(2) { grid-row: 2; }
html:not(.h) .scene--title > .strip:nth-child(3), html:not(.h) .scene--inter > .strip:nth-child(3) { grid-row: 3; }
html:not(.h) .scene--inter > .strip:nth-child(4) { grid-row: 4; }
html:not(.h) .line {
  grid-column: 1;
  grid-row: 1 / -1;
  z-index: 3;
  display: grid;
  grid-template-rows: var(--rows);
  font-size: var(--f-line);
  line-height: 1.04;
  pointer-events: none;
}
html:not(.h) .cell { display: block; padding: 0 var(--pad); }
html:not(.h) .frag { display: block; }

html:not(.h) .scene--title {
  --bp: calc(var(--f-line) * .15);
  --r1: max(41vh, calc(var(--f-line) * 1.04 + var(--bp) * 2 + 278px));     /* room for the masthead and the dial */
  --r1: max(41svh, calc(var(--f-line) * 1.04 + var(--bp) * 2 + 278px));
  --r2: calc(var(--f-line) * 2.08 + 2 * var(--bp));
  --r3: max(calc(100vh - var(--r1) - var(--r2)), calc(var(--f-line) * 1.04 + 170px));     /* room under the words for the envelope */
  --r3: max(calc(100svh - var(--r1) - var(--r2)), calc(var(--f-line) * 1.04 + 170px));
  --rows: var(--r1) var(--r2) var(--r3);
  --cw: clamp(150px, 43.6vw, 170px);           /* the envelope: about 170 by 120 */
  --ch: calc(var(--cw) * .706);
}
html:not(.h) .scene--title .photo { min-height: 0; }
/* the dial is dark: it stops above the words. The birds keep mostly to the right of them. */
html:not(.h) .scene--title .strip--clay > .art { bottom: calc(var(--f-line) * 1.04 + var(--bp) * 2 + 6px); }
@media (max-width: 719px) {
  html:not(.h) .scene--title .strip--sky > .art { right: -62%; }
}
html:not(.h) .scene--title .cell:nth-child(1) { align-self: end; padding-bottom: var(--bp); }
html:not(.h) .scene--title .cell:nth-child(2) { align-self: center; }
html:not(.h) .scene--title .cell:nth-child(3) { align-self: start; padding-top: var(--bp); }
html:not(.h) .role { position: absolute; top: 49px; left: var(--pad); right: var(--pad); }
/* the envelope lies under the words, at the right; the invitation stands beside it, on the left.
   The paint stroke stops above them both, as the dial stops above its words */
html:not(.h) .scene--title .strip--paper > .art { bottom: calc(var(--ch) + 34px); }
html:not(.h) .courier { right: var(--pad); bottom: 20px; }
html:not(.h) .cue { position: absolute; left: var(--pad); right: calc(var(--pad) + var(--cw) + 14px); bottom: 24px; }
html:not(.h) .cue-h { display: none; }

html:not(.h) .scene--inter {
  --ip: calc(var(--f-line) * .46);
  --row: calc(var(--f-line) * 1.04 + 2 * var(--ip));
  --rows: repeat(3, var(--row));
}
html:not(.h) .scene--inter .cell { align-self: center; }
/* the first interstitial carries a study behind each word: taller bands, so there is a drawing to see */
html.js:not(.h) .inter--a { --row: max(calc(var(--f-line) * 1.04 + 2 * var(--ip)), min(52vw, 240px)); }
/* the quotation: a plain band of sky, then three photographs, and its author under the last words.
   With the art, a photograph's band is taller: the words stand at its top and the picture, low in its frame, shows under them. */
html:not(.h) .inter--b { --pic: var(--row); --rows: var(--row) repeat(2, var(--pic)) calc(var(--pic) + 30px); }
html.js:not(.h) .inter--b { --pic: max(var(--row), min(66vw, 300px)); }
html.js:not(.h) .inter--b .cell:nth-child(n+2) { align-self: start; margin-top: var(--ip); }
html:not(.h) .inter--b .cell:last-child { align-self: start; margin-top: var(--ip); }
html:not(.h) .by {
  grid-column: 1;
  grid-row: 4;
  z-index: 3;
  align-self: start;
  margin-top: calc(var(--ip) + var(--f-line) * 1.04 + 12px);
  padding: 0 var(--pad);
  color: var(--ink);
}

/* S6: two paper strips meet between S5 and S6, so a hairline keeps the seam */
html:not(.h) .scene--path > .strip:first-child::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: var(--pad);
  right: var(--pad);
  top: 0;
  height: 1px;
  background: rgba(31, 29, 26, .2);
}
html:not(.h) .tools { max-width: calc(var(--mw) + var(--dot)); line-height: 1.7; }
html:not(.h) .scene--path .strip--cream { padding-top: clamp(64px, 17vw, 120px); padding-bottom: clamp(72px, 19vw, 132px); }
html:not(.h) .quote { max-width: 21em; }
html:not(.h) .quote .seam { display: block; margin: 1.9em 0 0; }
html:not(.h) .quote .seam span, html:not(.h) .quote .seam cite { display: block; }
html:not(.h) .quote .seam .dot { display: none; }

/* S7: the night band keeps a narrow paper strip beside it, so the dinosaur still has a seam to peek round.
   The game opens as a band underneath. */
html:not(.h) .scene--contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max(96px, 22vw);
}
html:not(.h) .scene--contact > .strip--night {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 78vh;
  min-height: 78svh;
  padding: 72px var(--pad);
}
html:not(.h) .scene--contact .headline { font-size: var(--f-line); line-height: 1.04; letter-spacing: -.03em; white-space: nowrap; }
html:not(.h) .mail { margin-top: .5em; font-size: clamp(30px, 9.4vw, 64px); line-height: 1.2; letter-spacing: -.02em; }
html:not(.h) .mail a { display: inline-flex; align-items: center; min-height: 48px; }
html:not(.h) .scene--contact .links { margin-top: .8em; }
html:not(.h) .nook { grid-column: 2; grid-row: 1; }
html:not(.h) .peek { bottom: clamp(28px, 7vh, 64px); }

html:not(.h) .play {
  position: relative;
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-rows: 0fr;
  background: var(--paper);
  transition: grid-template-rows .6s var(--ease);
}
html:not(.h) .is-open > .play { grid-template-rows: 1fr; }
html:not(.h) .play-in { position: relative; z-index: 3; min-height: 0; overflow: hidden; }
html:not(.h) .play .label { padding: 30px var(--pad) 0; }
html:not(.h) .game { margin-top: 10px; }
html:not(.h) .close { margin: 2px var(--pad) 6px; }

html:not(.h) .foot { position: relative; background: var(--paper); padding: 26px var(--pad) calc(30px + env(safe-area-inset-bottom, 0px)); }
html:not(.h) .fine { position: relative; z-index: 3; }
html:not(.h) .fine span { display: block; }
html:not(.h) .fine .dot { display: none; }

/* wide but upright (a tablet on its side, a window too short for the row, no script):
   the text of a scene sets as two columns, the headline on the left and its copy on the right, on one baseline */
@media (min-width: 900px) {
  html:not(.h) { --f-head: clamp(38px, 4.3vw, 60px); }
  html:not(.h) .text {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    column-gap: clamp(40px, 6vw, 112px);
    padding-top: clamp(64px, 8vw, 112px);
    padding-bottom: clamp(72px, 9vw, 128px);
  }
  html:not(.h) .text > .copy { display: contents; }
  html:not(.h) .text > .copy > * { position: relative; z-index: 3; }
  html:not(.h) .num { display: none; }
  html:not(.h) .text > .seam { grid-column: 1; grid-row: 1; }
  html:not(.h) .text .title { grid-column: 1; grid-row: 2; }
  html:not(.h) .text .headline { grid-column: 1; grid-row: 3 / span 4; align-self: baseline; }
  html:not(.h) .text .headline + .body,
  html:not(.h) .text .headline + .rows { grid-column: 2; grid-row: 3; align-self: baseline; margin-top: 0; }
  html:not(.h) .text .body + .body { grid-column: 2; grid-row: 4; }
  html:not(.h) .text .hard { grid-column: 2; grid-row: 5; }
  html:not(.h) .text > .base { grid-column: 2; grid-row: 6; }
  html:not(.h) .text .kit { grid-column: 2; grid-row: 6; }
  html:not(.h) .scene--now .text > .base { grid-row: 7; }
  html:not(.h) .rows li:first-child { padding-top: 0; }
  html:not(.h) .rows li:first-child::before { content: none; }
}

/* =========================================================
   7 · SIDEWAYS  (html.h, set by site.js)
   ========================================================= */

html.h, html.h body { height: 100%; overflow: hidden; overscroll-behavior: none; }

html.h {
  --u: min(1vw, 1.6vh);                        /* the poster unit: type keeps its place in the picture at any window shape */
  --edge: clamp(18px, 2.2vw, 40px);
  --Y: 38vh;                                   /* the line all the big type sits on */
  --foot: clamp(30px, 6.6vh, 74px);            /* the line the small things at the bottom stand on */
  --gut: clamp(50px, 5.6vw, 120px);
  --seam-x: clamp(11px, 1.25vw, 24px);         /* where the upright labels run, beside a seam */
  --f-line: min(5.6vw, 17vh);
  --f-head: clamp(30px, calc(var(--u) * 3.9), 98px);
  --f-title: clamp(19px, calc(var(--u) * 1.9), 46px);
  --f-body: clamp(16px, calc(var(--u) * 1.36), 26px);
  --f-rule: clamp(23px, calc(var(--u) * 2.9), 62px);
  --f-quote: clamp(18px, calc(var(--u) * 1.72), 36px);
  --f-label: clamp(11px, calc(var(--u) * .8), 12.5px);
  --f-meta: clamp(12.5px, calc(var(--u) * .92), 15px);
  --f-num: min(62vh, 40vw);
  --mw: calc(var(--f-body) * 17);              /* the measure: about 36 characters of copy */
}

html.h .track {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
html.h .track::-webkit-scrollbar { display: none; width: 0; height: 0; }
html.h main { position: relative; display: flex; flex: none; height: 100%; }      /* relative: the first-page hint moves it by its left (part 8) */

html.h .scene {
  position: relative;
  flex: none;
  display: grid;
  grid-template-columns: var(--cols);
  grid-template-rows: 100%;
  height: 100%;
}
html.h .strip { height: 100%; min-width: 0; clip-path: inset(0); }

/* composition: strip widths per scene. The row is a little over ten windows long.
   site.js sets the sentence scenes again from the words as actually set, keeping each total.
   The widths are chosen for the places the row comes to rest (the keys stop on every scene's left edge,
   on the left edge of every sheet of drawings, and with the first interstitial in the middle of the window),
   so that each of those is a whole picture:
     · the title is 94 wide, as a project is: 6 of the next scene, the night strip, shows at the right edge of the first page;
     · a project's picture and text are 94 wide: what follows (its sheet, or the next scene) shows as a sliver at the right;
     · S4 and S5 end in a sheet of drawings (58, 58). At its stop the sheet is whole, and the next scene begins beside it;
     · S2 goes on after its sheet (62): the plan of the estate, then the run sheet, 58. The plan is about 2.05 to 1
       and fills the height under the bar, so its strip is as wide as that makes it plus a margin: about 122 on a
       16 by 10 window, 109 on a 16 by 9 one, and never more than 130. The keys stop on the left edge of both;
     · the first interstitial is 66 wide: 17 of S2's sheet on its left, 17 of the ring on its right;
     · S6 is 72.2 wide: the window ends just inside the sky strip of the quotation, after "The purpose". */
html.h .scene--title {
  --cols: 21.49vw 42.87vw 29.64vw;             /* 94 in all (what site.js makes of the words in the first serif of the stack) */
  --cw: clamp(210px, 26vh, 330px);             /* the envelope: large enough to be the second thing the eye meets */
  --ch: calc(var(--cw) * .7);
}
html.h .scene--now {
  --plan-h: calc(100vh - var(--edge) - 40px - var(--foot) * .45);     /* the plan's height: from under the bar to just above the foot of the window */
  --plan: clamp(80vw, calc(var(--plan-h) * 2.05 + 8vw), 130vw);       /* ...so its strip is as wide as the plan is, and a margin of 4 either side */
  --cols: 52vw 48vw 62vw var(--plan) 58vw;
}
html.h .inter--a { --cols: 24.4vw 12.6vw 29vw; }
html.h #gemforge { --cols: 53vw 41vw; }
html.h #crm { --cols: 46vw 48vw 58vw; }
html.h #siteworks { --cols: 54vw 40vw 58vw; }
html.h #patent { --cols: 46vw 54vw; }              /* one whole window: the words, then the sheet of figures */
html.h .scene--path { --pw: 41.8vw; --cols: var(--pw) 30.4vw; }
html.h .inter--b { --cols: 27.9vw 24.5vw 18.2vw 29.4vw; --f-line: min(4.1vw, 13vh); }
html.h .scene--contact {
  --nook: max(14vw, 170px);                    /* the narrow paper strip the dinosaur peeks from */
  --nook-open: max(34vw, 330px);               /* ...and how wide it opens for the game */
  --cols: calc(100vw - var(--nook)) var(--nook);
}

/* the art drifts a little slower than its strip, so it needs a bleed on both sides */
html.h .strip > .art { left: -3.6vw; right: -3.6vw; }
/* the flock's home is the upper third of its box: a taller box keeps most of it under the sentence */
html.h .scene--title .strip--sky > .art { bottom: -80%; }

/* the drawings are ink on the sheet itself: a drawing keeps to its strip and travels with it (no bleed, no drift) */
html.h .strip > .art.sketch { left: 0; right: 0; transform: none; }
/* S2: the ledger, faint, in the paper above the headline */
html.h .strip > .sketch[data-art="ledger"] { left: 1vw; right: 1vw; top: 2.5vh; bottom: auto; height: 27.5vh; }
/* S4: the house study, in the paper above the name of the project (it ends clear of the name at any window shape) */
html.h .strip > .sketch[data-art="crm-house"] {
  left: calc(var(--gut) - 1vw);
  right: auto;
  width: 40vw;
  top: 2vh;
  bottom: auto;
  height: calc(var(--Y) - var(--f-head) * 1.1 - var(--f-title) * 1.15 - var(--u) * .2 - 2vh - 6px);
}
/* S3 and S5: the notebook notes, in the paper above the name of the project, as wide as the strip (they end clear of the name) */
html.h .strip > .sketch[data-art="gem-notes"],
html.h .strip > .sketch[data-art="price-notes"] {
  left: 1vw;
  right: 1vw;
  top: 2vh;
  bottom: auto;
  height: calc(var(--Y) - var(--f-head) * 1.1 - var(--f-title) * 1.15 - var(--u) * .2 - 2vh - 6px);
}
/* S2: the plan of the estate keeps clear of the bar and of the foot of the window, with the margins of a drawing sheet */
html.h .strip > .sketch[data-art="harness"] { left: 4vw; right: 4vw; top: calc(var(--edge) + 40px); bottom: calc(var(--foot) * .45); }
/* S6: the circuit, under the bar and well above the quotation */
html.h .strip > .sketch[data-art="schematic"] { top: 8vh; bottom: auto; height: 55vh; }
/* a paper or cream sheet lies against the paper of its scene's text: a hairline keeps the seam */
html.h .sheet:not(.strip--blueprint)::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(31, 29, 26, .2);
}

/* ---- the broken sentence: one baseline, at --Y, across the seams ---- */
html.h .scene--title,
html.h .scene--inter {
  --f: calc(var(--f-line) * var(--fit, 1));
  --S: calc(var(--f) * 1.25);
}
html.h .line {
  position: absolute;
  z-index: 3;
  left: 0;
  top: calc(var(--Y) - var(--S));
  width: 100%;
  display: grid;
  grid-template-columns: var(--cols);
  font-size: var(--f);
  line-height: 1;
  pointer-events: none;
}
html.h .cell {
  display: flex;
  align-items: baseline;
  min-width: 0;
  padding: 0 .2em;
  white-space: nowrap;
}
html.h .cell::before { content: ""; flex: none; width: 0; height: var(--S); }
html.h .frag { flex: none; }
html.h .cell--end .frag { margin-left: auto; }
html.h .cell--mid .frag { margin-left: auto; margin-right: auto; }
html.h .cell--spread .frag:last-child { margin-left: auto; }
/* the author of the quotation, small, under its last words */
html.h .by {
  position: absolute;
  z-index: 3;
  left: 0;
  top: calc(var(--Y) + var(--f) * .66);
  width: 100%;
  display: grid;
  grid-template-columns: var(--cols);
  color: var(--ink);
  pointer-events: none;
}
html.h .by cite { grid-column: -2 / -1; padding-left: calc(var(--f) * .24); pointer-events: auto; }

/* S1 captions */
html.h .role { position: absolute; left: var(--edge); right: var(--edge); top: calc(var(--edge) + 40px); }
@media (max-width: 1599px) {
  html.h .role > span { display: block; }      /* two lines of the same length under the name */
}
/* the envelope lies at the END OF THE SENTENCE, where the eye already is when it has read "real work.": it comes in
   from beyond the right edge, across the seam, and part of it stays out of the window, so the reader can see
   there is more that way. The invitation stands under it, against the seam, in the paper strip's own ink.
   Line one is set like the site's rule lines (serif italic); the other two are small labels. */
html.h .courier {
  left: calc(100% - 5.4vw);
  top: calc(var(--Y) - var(--f-line) * .42 - var(--ch) * .5);
  will-change: transform;
}
html.h .cue {
  --cue-gap: clamp(14px, 1.5vw, 30px);
  --fg-soft: var(--soft);
  position: absolute;
  grid-column: 3 / 4;                          /* its box is the paper strip's own column, wherever site.js puts the seams */
  grid-row: 1;
  right: var(--cue-gap);
  top: calc(var(--Y) - var(--f-line) * .42 + var(--ch) * .5 + .4vh);
  bottom: auto;
  max-width: min(23em, calc(100% - var(--cue-gap) * 2));
  text-align: right;
}
html.h .cue-1 {
  font-family: var(--serif); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: -.012em;
  font-size: clamp(17px, 1.42vw, 30px); line-height: 1.18; color: var(--ink);
}
html.h .cue-2 { margin-top: .75em; color: var(--ink); }
html.h .cue-3 { margin-top: .35em; white-space: nowrap; }
@media (max-height: 759px) { html.h .cue-3 { display: none; } }   /* a short window: the paint stroke needs the room */
html.h .cue-v { display: none; }
html.h .cue-h { display: inline-block; margin-left: .35em; }

/* ---- text strips: a column hung from --Y, and a block standing on --foot ---- */
html.h .text {
  --fh: var(--f-head);
  display: flex;
  flex-direction: column;
  padding: calc(var(--Y) - var(--fh) * 1.1) 2.4vw var(--foot) var(--gut);
}
/* the first line of the headline sits on --Y whatever the serif: a strut gives its line box a known rise */
html.h .headline .ln:first-child::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 1.1em;
  vertical-align: baseline;
}
html.h .text .headline { -webkit-text-stroke: .007em currentColor; }
html.h .title {
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: calc(var(--u) * .2);
  white-space: nowrap;
}
html.h .headline + .body { margin-top: calc(var(--u) * 2.1); }
html.h .body + .body { margin-top: calc(var(--u) * .95); }

/* what stands on the foot line: the facts, the pull quote, the quotation */
html.h .base { margin-top: auto; padding-top: calc(var(--u) * 2); }
html.h .links { margin-top: calc(var(--u) * .1); margin-bottom: -11px; }
html.h .rule { padding-bottom: calc(var(--u) * .3); }

/* the label of a strip runs up its left seam, like the print on the edge of a film */
html.h .seam {
  position: absolute;
  left: var(--seam-x);
  bottom: var(--foot);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  line-height: 1.3;
}
html.h .seam .live { margin: 0 0 .9em; }

/* the numeral: low and to the right, its foot under the edge of the window, its side under the next strip */
html.h .num { right: -.1em; bottom: -.1em; }
html.h #gemforge .num { right: -.17em; }             /* a 1 is narrow: its stem goes to the seam */

/* S2: the copy takes a wider measure (each paragraph sets in two lines) and closer leading, and the list under it
   is a size smaller: together they end above the pull quote on the foot line, at any window shape.
   Under the list, one quiet line of what the platform is made of: it stands in the air the pull quote kept
   above itself, and the copy closes up by a few px to give it the rest (the quote stays on its line) */
html.h .scene--now .text { padding-right: 3vw; }
html.h .scene--now { --mw: calc(var(--f-body) * 23); }
html.h .scene--now .body { line-height: 1.38; }
html.h .scene--now .headline + .body { margin-top: calc(var(--u) * 1.35); }
html.h .scene--now .body + .body { margin-top: calc(var(--u) * .7); }
html.h .hard { --f-hard: clamp(13px, calc(var(--u) * 1.16), 22px); margin-top: calc(var(--u) * .9); }
html.h .hard li { padding: calc(var(--u) * .21) 0 calc(var(--u) * .23); white-space: nowrap; }
html.h .kit { margin-top: calc(var(--u) * .5); line-height: 1.35; font-size: clamp(11px, calc((45vw - var(--gut)) / 36.5), var(--f-meta)); }   /* always one row */
@media (max-width: 1019px) {
  html.h .kit { display: none; }               /* a window too narrow for that row: the plan says it, two strips on */
}
html.h .scene--now .rule { padding-top: calc(var(--u) * 1); }
/* S2: for a reader that speaks the page, the words about the plan lie where the plan is (so does find in page) */
html.h .plan-says { grid-column: 4; grid-row: 1; left: 50%; top: 50%; }
/* S2: the run sheet. Its heading sits on --Y, the lines hang under it */
html.h .runsheet { padding: calc(var(--Y) - var(--f-label) * 1.08) 3vw var(--foot) var(--gut); }
html.h .run-lines { --f-run: clamp(11.5px, calc(var(--u) * 1), 16px); --run-pad: calc(var(--u) * .46); margin-top: calc(var(--u) * 1.5); }
html.h .run-note { margin-top: calc(var(--u) * 1.5); }

/* the path: four rows between the headline and the toolbox, in the part of the strip the bridge drawing leaves
   empty (its left two thirds, under the deck). The rows are a size smaller than copy, and no wider than that part;
   a label breaks only at its dots. In a small window the type is at its smallest and the labels take more lines,
   so the rows close up */
html.h .rows {
  --f-row: clamp(14px, calc(var(--u) * 1.16), 23px);
  --f-rowb: clamp(10px, calc(var(--u) * .7), 12.5px);
  width: calc(var(--pw, 41.8vw) * .65 - var(--gut));
  max-width: none;
  margin-top: calc(var(--u) * 1.3);
}
html.h .rows li { padding: calc(var(--u) * .62) 0 calc(var(--u) * .74); }
html.h .row-a { font-size: var(--f-row); line-height: 1.2; }
html.h .row-b { margin-top: calc(var(--u) * .28); font-size: var(--f-rowb); letter-spacing: .09em; line-height: 1.4; }
html.h .scene--path .tools.base { padding-top: calc(var(--u) * 1); }
@media (max-width: 1439px), (max-height: 899px) {
  html.h .rows li { padding: calc(var(--u) * .46) 0 calc(var(--u) * .56); }
  html.h .row-b { margin-top: calc(var(--u) * .2); }
}
html.h .tools { line-height: 1.75; }             /* as wide as its strip allows: two rows where there is room */
html.h .tools::before { margin-bottom: 1.05em; }
/* two paper strips meet between S5 and S6: a hairline keeps the seam */
html.h .scene--path > .strip:first-child::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(31, 29, 26, .2);
}
/* the cream strip: a small quotation low down, with room around it; its source runs up the seam */
html.h .strip--cream.text { --qgut: clamp(44px, 4.4vw, 96px); padding-left: var(--qgut); padding-top: 0; }
html.h .quote { padding-top: 0; }
html.h .quote .seam { left: calc(var(--seam-x) - var(--qgut)); bottom: 0; }

/* ---- S7 ---- */
/* the two lines are set large (--f-hello), so the wide night strip is held by its words; "Say hello." still stands on --Y.
   The size gives way to the height of a short window, so the first line stays under the bar. */
html.h .scene--contact { --f-hello: min(8.6vw, 22vh); }
html.h .scene--contact .copy {
  position: absolute;
  left: var(--gut);
  right: 3vw;
  top: calc(var(--Y) - var(--f-hello) * 1.1);
}
html.h .scene--contact .headline { font-size: var(--f-hello); line-height: 1; letter-spacing: -.034em; }
html.h .mail { margin-top: calc(var(--f-hello) * .12); font-size: var(--f-hello); line-height: 1.1; letter-spacing: -.034em; white-space: nowrap; }
html.h .mail a { text-decoration-thickness: .03em; text-underline-offset: .15em; }
html.h .scene--contact .links { margin: calc(var(--u) * 1.5) 0 0; gap: 0 1.8em; font-size: clamp(17px, calc(var(--u) * 1.5), 30px); }

/* the paper strip is as wide as it will ever open, laid over the night strip and cut back to its narrow self:
   opening it is one clip-path moving, so the picture underneath is never laid out again */
html.h .nook {
  --shut: calc(var(--nook-open) - var(--nook));
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  z-index: 2;
  width: var(--nook-open);
  clip-path: inset(0 0 0 var(--shut));
  transition: clip-path .7s var(--ease);
}
html.h .is-open > .nook { --shut: 0px; }
html.h .peek {
  bottom: clamp(44px, 11vh, 124px);
  transform: translateX(var(--shut));          /* it stays on the seam as the seam moves */
  transition: transform .7s var(--ease), translate .55s var(--ease);
}
/* the game: its ground line lies on --Y, the baseline of "Say hello." */
html.h .play {
  position: absolute;
  z-index: 3;
  right: 0;
  width: var(--nook-open);
  bottom: calc(100% - var(--Y) - var(--below, 30px));
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}
html.h .is-open > .play { opacity: 1; pointer-events: auto; transition: opacity .5s var(--ease) .32s; }
html.h .play .label { padding: 0 var(--edge) calc(var(--u) * 1.1); }
html.h .close { position: absolute; top: 100%; left: var(--edge); min-height: 36px; margin-top: 2px; }

/* the small print runs up the far edge of the last strip. The footer itself is a zero-width item at the end of the row. */
html.h .foot { position: relative; z-index: 4; flex: none; width: 0; height: 100%; }
html.h .fine {
  position: absolute;
  right: var(--seam-x);
  bottom: var(--foot);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  line-height: 1.5;
}
html.h .fine span { display: block; }
html.h .fine .dot { display: none; }

/* ---- the bar: fixed to the window, and redrawn inside every strip in that strip's own ink,
   so the wordmark changes colour exactly at the seam ---- */
html.h .mark {
  position: fixed;
  z-index: 50;
  top: calc(var(--edge) - 6px);
  left: var(--edge);
  padding: 6px 0;
  font-size: clamp(16px, calc(var(--u) * 1.18), 21px);
}
html.h .idx {
  position: fixed;
  z-index: 50;
  top: calc(var(--edge) - 10px);
  right: calc(var(--edge) - 7px);
}
html.h .idx a { font-size: clamp(10.5px, calc(var(--u) * .76), 13px); }
html.h .hud { display: block; position: absolute; top: 0; left: 0; color: var(--fg); pointer-events: none; }
html.h .hud .mark, html.h .hud .idx { z-index: 6; }
html.h .prog {
  display: block;
  position: fixed;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
}
html.h .prog i {
  display: block;
  height: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 0 50%;
}
html.h.hud-on .bar .mark,
html.h.hud-on .bar .idx a { color: transparent; }

/* ---- small windows: the type has reached its smallest size, so the copy takes a wider measure
   and the things around it give way ---- */
@media (max-height: 700px) {
  html.h { --mw: calc(var(--f-body) * 21); --Y: 37vh; }
  html.h .headline + .body { margin-top: calc(var(--u) * 1.5); }
  html.h .base { padding-top: calc(var(--u) * 1.2); }
  /* S2: the copy is at its smallest size and cannot shrink with the window, so its leading and the list close up */
  html.h .scene--now { --mw: calc(var(--f-body) * 23); }
  html.h .scene--now .body { line-height: 1.36; }
  html.h .scene--now .headline + .body { margin-top: calc(var(--u) * 1.2); }
  html.h .scene--now .body + .body { margin-top: calc(var(--u) * .5); }
  html.h .hard { --f-hard: 12.5px; margin-top: calc(var(--u) * .8); }
  html.h .hard li { padding: calc(var(--u) * .14) 0 calc(var(--u) * .16); }
  html.h .kit { margin-top: calc(var(--u) * .4); }
  html.h .scene--now .rule { padding-top: calc(var(--u) * .8); }
  html.h .run-lines { --run-pad: calc(var(--u) * .34); margin-top: calc(var(--u) * 1.1); }
  html.h .run-note { margin-top: calc(var(--u) * 1); }
}
@media (max-height: 640px) {
  html.h .quote .seam > * { display: block; }  /* the source of the quotation, as two short lines */
  html.h .quote .seam .dot { display: none; }
}
@media (max-width: 1100px) {
  html.h { --f-num: min(52vh, 31vw); }
}

/* ---------- 8 · motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .live { animation: live 2.8s ease-in-out infinite; }
  .lamp { animation: live 3.6s ease-in-out infinite; }
  html.h .cue-h { animation: nudge 3.2s var(--ease) infinite; }
  html:not(.h) .cue-v { display: inline-block; animation: sink 3.2s var(--ease) infinite; }

  /* Sideways only, and all of it a pure function of where the row is (site.js publishes the numbers):
       --sd     on a strip: how far its centre is from the centre of the window, in window widths
       --d      on a scene: the same for the scene, in scene widths
       --v      scroll speed, -1..1, eased
       .is-in   on a scene while at least 30% of it is on screen
     With no numbers, everything rests in its place. Nothing is ever hidden unless its scene is .is-in,
     so a number left over from an earlier visit cannot keep type out of sight. */

  /* layers: the photograph lies deepest and travels slower than its strip (and, being heavy, falls a little
     further behind at speed); the type lies on top and travels a touch faster; the numeral slides out from
     under the next strip. The art's bleed (part 7) covers the whole of its travel. */
  html.h .strip > .art {
    transform: translate3d(calc(var(--sd, var(--d, 0)) * -3vw + var(--v, 0) * 1.2vw), 0, 0);
  }
  html.h .text > .copy,
  html.h .text > .base,
  html.h .scene--contact .copy {
    transform: translate3d(calc(var(--sd, var(--d, 0)) * 1.3vw), 0, 0);
  }
  html.h .num {
    transform: translate3d(calc(var(--sd, var(--d, 0)) * 7vw), 0, 0);
  }

  /* text strips: as a strip comes in from the right its type settles: the headline rises onto --Y, the copy clears.
     Three steps, each done by the time its words are wholly in the window. (Not the first strip of S6: it leads
     its scene in, so it is on screen before the scene counts as in.) */
  html.h .is-in > .text {
    --q1: clamp(0, calc((var(--sd, 0) - .38) / .3), 1);
    --q2: clamp(0, calc((var(--sd, 0) - .34) / .3), 1);
    --q3: clamp(0, calc((var(--sd, 0) - .3) / .3), 1);
  }
  html.h .scene--path > .text:first-child { --q1: 0; --q2: 0; --q3: 0; }
  html.h .text .headline .ln { transform: translate3d(0, calc(var(--q1, 0) * .22em), 0); opacity: calc(1 - var(--q1, 0)); }
  html.h .text .headline .ln + .ln { transform: translate3d(0, calc(var(--q2, 0) * .3em), 0); opacity: calc(1 - var(--q2, 0)); }
  html.h .text .title { opacity: calc(1 - var(--q1, 0)); }
  html.h .text .body, html.h .text .rows, html.h .text .hard, html.h .text .kit, html.h .text > .base { opacity: calc(1 - var(--q3, 0)); }
  /* ...and the hairlines are drawn, left to right, as it does */
  html.h .text .specs::before, html.h .text .rule::before, html.h .text .rows li::before, html.h .text .hard li::before { transform: scaleX(calc(1 - var(--q3, 0))); }

  /* the broken sentences of the interstitials: the later fragments settle onto the baseline as their strips arrive,
     one from above, the next from below. --scene-w is the scene's width in window widths, --cell-at the place of
     the fragment's strip in the scene (both follow the strip widths set in part 7). Only fragments whose strip is
     still wholly outside the window when the scene becomes .is-in take part, so nothing ever changes in view. */
  html.h .inter--a.is-in .cell:nth-child(n+2),
  html.h .inter--b.is-in .cell:nth-child(n+3) {
    --cell-sd: calc(var(--d, -9) * var(--scene-w, 1) + var(--cell-at, 0));
    --cell-q: clamp(0, calc((var(--cell-sd) - .4) / .3), 1);
  }
  html.h .scene--inter .frag {
    transform: translate3d(0, calc(var(--cell-q, 0) * var(--dy, .2em)), 0);
    opacity: calc(1 - var(--cell-q, 0));
  }
  html.h .scene--inter .cell:nth-child(even) { --dy: -.16em; }
  html.h .inter--a { --scene-w: .66; }
  html.h .inter--a .cell:nth-child(2) { --cell-at: -.023; }
  html.h .inter--a .cell:nth-child(3) { --cell-at: .185; }
  html.h .inter--b { --scene-w: 1; }
  html.h .inter--b .cell:nth-child(3) { --cell-at: .115; }
  html.h .inter--b .cell:nth-child(4) { --cell-at: .35; }
  html.h .is-in > .by cite { opacity: calc(1 - clamp(0, calc((var(--d, -9) + .35 - .38) / .3), 1)); }

  /* the title is on screen when the page opens, so it settles in time instead: once, slowly */
  html.h .scene--title .frag { animation: settle 1.25s var(--ease) backwards; animation-delay: calc(.2s + var(--i, 0) * .14s); }
  html.h .scene--title .cell:nth-child(2) .frag:nth-child(1) { --i: 1; --dy: -.16em; }
  html.h .scene--title .cell:nth-child(2) .frag:nth-child(2) { --i: 2; }
  html.h .scene--title .cell:nth-child(3) .frag { --i: 3; --dy: -.16em; }
  html.h .role { animation: fade 1.6s var(--ease) 1s backwards; }

  /* ---- the first page: the letter arrives, and the page says which way it goes ---- */
  /* the envelope slides in from beyond the right edge once the sentence has settled; the invitation follows it */
  html.h .courier { animation: arrive 1.3s cubic-bezier(.16, 1, .3, 1) 1.5s backwards; }
  html.h .cue { animation: fade 1.6s var(--ease) 2.3s backwards; }

  /* the hint, sideways only and only until the reader has moved (.moved, from site.js, takes it away for good):
     after 4.5 s the whole row is pulled 34px to the left and let go, and once more 6 s later.
     It is the row's own left that moves, not a transform: the bar is redrawn inside every strip with
     position: fixed, and a transform on the row would make the row the box those copies are fixed to.
     The scroller is never touched, and nothing is laid out again: only where the row is painted changes. */
  html.h:not(.moved) main { animation: pull 1.1s var(--ease) 4.5s 1, pull 1.1s var(--ease) 11.6s 1; }

  /* the chase: as the row moves left the envelope goes right, 3.2 times as far, so on the screen it leaves
     2.2 times as fast as the page comes. All of it from the scene's own --d, on the envelope alone.
     The scene is 94vw wide and --d is in scene widths, so (-.0319 - --d) * 94vw is how far the row has moved,
     in px; -.0319 is --d with the page at rest, so at rest (and for the first 12px, where .moved begins)
     nothing moves at all (with no number at all, the title has not been seen yet: the envelope is away).
     Once the envelope is well out of the window (the row a fifth of a scene along)
     it is shrunk to nothing where it is, and then set back in its place: it cannot be met again further
     down the row, and it comes back the same way when the reader returns to the first page. */
  html.h.moved .courier {
    transform:
      translate3d(calc(max(0px, (-.0319 - var(--d, -1)) * 94vw - 12px) * 3.2 * clamp(0, calc((.27 - (-.0319 - var(--d, -1))) / .02), 1)), 0, 0)
      scale(clamp(0, calc((.23 - (-.0319 - var(--d, -1))) / .02), 1));
  }
  /* ...but a reader who comes to it with the keyboard always finds it at home */
  html.h.moved .courier:focus-visible { transform: none; }

  /* ---- S2: the run sheet is written as its strip crosses the window, a line for every 4% of a window's width.
     --sd is where the strip's centre is: the nine working lines are all there before it reaches the centre
     (the last, STOP, at .065), and the person's answer comes only once the centre has passed. ---- */
  html.h .run-lines li { opacity: clamp(0, calc((var(--at, 1) - var(--sd, 0)) / .035), 1); }
  html.h .run-lines li:nth-child(1) { --at: .42; }
  html.h .run-lines li:nth-child(2) { --at: .38; }
  html.h .run-lines li:nth-child(3) { --at: .34; }
  html.h .run-lines li:nth-child(4) { --at: .3; }
  html.h .run-lines li:nth-child(5) { --at: .26; }
  html.h .run-lines li:nth-child(6) { --at: .22; }
  html.h .run-lines li:nth-child(7) { --at: .18; }
  html.h .run-lines li:nth-child(8) { --at: .14; }
  html.h .run-lines li:nth-child(9) { --at: .1; }
  html.h .run-lines .is-done { opacity: clamp(0, calc((-.03 - var(--sd, -1)) / .06), 1); }

}
@media (prefers-reduced-motion: reduce) {
  html:not(.h) { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; }
}

@keyframes live { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(.45em); } }
@keyframes sink { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(.3em); } }
@keyframes settle { from { opacity: 0; translate: 0 var(--dy, .2em); } to { opacity: 1; translate: 0 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes arrive { from { translate: calc(6vw + var(--cw)) 0; } to { translate: 0 0; } }
@keyframes pull { 0%, 100% { left: 0; } 45% { left: -34px; } }

/* ---------- 9 · print ---------- */

@media print {
  .hud, .cue, .peek, .courier, .play { display: none !important; }
  .strip::before { display: none; }
}
