/* ==========================================================================
   Overcast blueprint

   Every colour is a named token. The light theme is the default; the dark
   theme redefines the same names, so switching is one attribute on <html>.

   Accent roles, used nowhere else:
     blue   structure and anything you can press
     gold   force and load, and the co-op status dot
     red    flagged clinical risk, on the heart screen only
     grey   the neutral dots of the heart
   ========================================================================== */

:root {
  --bg: #eef2f7;
  --mist-a: #9fb0c5;
  --mist-b: #d3dce8;
  --ink: #0c1018;
  --ink-2: #2f3d51;
  --line: rgba(12, 16, 24, 0.13);
  --blue: #0a66c2;
  --blue-text: #0a58a8;
  --glow: #3aa0ff;
  --gold: #f5c242;
  --gold-text: #8a6400;
  --red: #d9434f;
  --grey: #7b8797;
  --cloud: rgba(255, 255, 255, 0.5);
  /* chart colours, checked with the palette validator against this theme's surface */
  --series: #0a66c2;
  --series-rest: #7b8797;

  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --gut: clamp(1rem, 2.6vw, 2.25rem);
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);

  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #0c1422;
  --mist-a: #1c2d49;
  --mist-b: #132036;
  --ink: #e9eff8;
  --ink-2: #a9b9cf;
  --line: rgba(233, 239, 248, 0.15);
  --blue: #0a66c2;
  --blue-text: #6cb6ff;
  --gold-text: #f5c242;
  --grey: #8b98aa;
  --cloud: rgba(130, 160, 210, 0.09);
  --series: #3391f0;
  --series-rest: #66748a;

  color-scheme: dark;
}

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

html,
body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 3px;
  border-radius: 2px;
}

/* a heading that only takes focus so that reading starts there: it needs no ring */
[tabindex='-1']:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

.mono {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.skip {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  padding: 0.6rem 0.9rem;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.skip:focus {
  top: 1rem;
}

/* ==========================================================================
   Sky and stage
   ========================================================================== */

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(180deg, var(--mist-a) 0%, var(--mist-b) 40%, var(--bg) 82%);
}

/* three soft clouds, each a blurred ellipse that drifts very slowly */
.sky i {
  position: absolute;
  width: 70vmax;
  height: 26vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--cloud), transparent);
  filter: blur(18px);
  animation: drift 90s linear infinite alternate;
  will-change: transform;
}

.sky i:nth-child(1) {
  left: -20vmax;
  top: 2vh;
}

.sky i:nth-child(2) {
  right: -30vmax;
  top: 22vh;
  animation-duration: 120s;
  animation-direction: alternate-reverse;
}

.sky i:nth-child(3) {
  left: 20vmax;
  top: 48vh;
  width: 90vmax;
  animation-duration: 150s;
}

@keyframes drift {
  to {
    transform: translate3d(14vmax, 2vh, 0);
  }
}

#stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  transition: opacity 0.45s var(--ease);
}

html.intro:not(.intro-go) #stage {
  opacity: 0;
}

.no-webgl #stage {
  display: none;
}

/* ==========================================================================
   Chrome: the logo, and the row at the top right
   ========================================================================== */

.chrome {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gut);
  pointer-events: none;
}

.chrome > * {
  pointer-events: auto;
}

/*
  On every page but home, a band of sky sits behind the logo and the top row.
  It is the same colour as the sky there, so it cannot be seen, but anything
  that scrolls up underneath (text, or a 3D object) fades out instead of
  colliding with the chrome.
*/
body:not([data-route='home']) .chrome::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 6.25rem;
  background: linear-gradient(
    180deg,
    var(--mist-a) 0%,
    var(--mist-a) 42%,
    color-mix(in srgb, var(--mist-a) 72%, transparent) 74%,
    transparent 100%
  );
  pointer-events: none;
  z-index: -1;
}

.logo {
  display: block;
  width: 56px;
  height: 56px;
  flex: none;
  color: var(--ink);
}

.logo span,
.logo svg,
.logo img {
  display: block;
  width: 100%;
  height: 100%;
}

.logo .ph {
  display: grid;
  place-items: center;
  border: 1px dashed var(--ink-2);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.6rem;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem clamp(0.8rem, 1.6vw, 1.5rem);
  padding-top: 0.55rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  letter-spacing: 0.08em;
}

.top a {
  text-decoration: none;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.95rem;
}

/* the gold dot: it breathes, to say the status is current */
.status i {
  position: relative;
  width: 0.55rem;
  height: 0.55rem;
  flex: none;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 1px rgba(12, 16, 24, 0.35);
}

.status i::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  from {
    transform: scale(1);
    opacity: 0.9;
  }

  to {
    transform: scale(3);
    opacity: 0;
  }
}

/* a text link whose underline draws itself in from the left */
.tl,
.status span,
.go,
.side a {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.35s var(--ease);
  padding-bottom: 0.2em;
}

.tl:hover,
.tl:focus-visible,
.status:hover span,
.go:hover,
.go:focus-visible,
.side a:hover,
.side a[aria-current='page'] {
  background-size: 100% 1px;
}

.theme {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  transition: background 0.2s var(--ease);
}

.theme:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.theme svg {
  width: 1.2rem;
  height: 1.2rem;
  transition: transform 0.5s var(--ease);
}

[data-theme='dark'] .theme svg {
  transform: rotate(180deg);
}

.resume {
  padding: 0.55rem 0.95rem;
  background: var(--blue);
  color: #fff;
  letter-spacing: 0.1em;
  transition:
    background 0.2s,
    transform 0.2s var(--ease);
}

.resume:hover {
  background: #0b74dc;
}

/* ==========================================================================
   The way back, and the other pages (not on home)
   ========================================================================== */

.side {
  position: fixed;
  left: var(--gut);
  top: 6rem;
  z-index: 20;
  display: grid;
  gap: 1.4rem;
  width: 11rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.side a {
  text-decoration: none;
}

.side .home {
  font-size: 0.875rem;
  justify-self: start;
}

.side ul {
  display: grid;
  gap: 0.5rem;
  color: var(--ink-2);
}

.side li a[aria-current='page'] {
  color: var(--ink);
}

/* ==========================================================================
   Pages
   ========================================================================== */

#world {
  position: fixed;
  inset: 0;
  z-index: 10;
  outline: none;
}

/* on home a drag belongs to the ring, so the browser must not scroll or zoom with it */
body[data-route='home'] #world {
  touch-action: none;
}

.page {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  /* reaching the end of a page never turns into the browser's own back, forward or refresh gesture */
  overscroll-behavior: none;
  padding: 7.25rem var(--gut) 4rem calc(var(--gut) + 13rem);
  /* a vertical drag scrolls the page; a sideways one is left for the 3D object */
  touch-action: pan-y;
}

.go {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

/* a hairline rule that draws itself when its page arrives */
.rule {
  height: 1px;
  background: var(--line);
  transform-origin: left;
}

.page.is-in .rule {
  animation: draw 0.9s var(--ease) both;
}

@keyframes draw {
  from {
    transform: scaleX(0);
  }
}

h1.title {
  font-stretch: 118%;
  font-weight: 700;
  font-size: clamp(1.9rem, 4.2vw, 3.5rem);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}

.lede {
  margin-top: 1.1rem;
  max-width: 34rem;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* label and value pairs, each on its own hairline */
.rows {
  margin-top: 1.75rem;
  max-width: 36rem;
}

.rows > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}

.rows > div:last-child {
  border-bottom: 1px solid var(--line);
}

.rows dt {
  padding-top: 0.2rem;
  color: var(--ink-2);
}

.rows dd {
  font-size: 0.9688rem;
  line-height: 1.45;
}

/* tool chips: the tool's own logo and its name */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  margin-top: 1.5rem;
}

.chips li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.chips img {
  width: 1.05rem;
  height: 1.05rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.75rem;
  margin-top: 1.6rem;
  color: var(--blue-text);
}

.note {
  margin-top: 0.9rem;
  color: var(--ink-2);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
}

.ph {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  border-bottom: 1px dashed var(--ink-2);
}

/* ==========================================================================
   Home
   ========================================================================== */

.page-home {
  overflow: hidden;
  padding: 0;
  /* the page itself is see-through to the pointer, so the ring behind it can be dragged */
  pointer-events: none;
  touch-action: none;
}

.page-home a,
.page-home button {
  pointer-events: auto;
}

.name-block {
  position: absolute;
  left: 0;
  right: 0;
  top: 53.5%;
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  padding-inline: var(--gut);
  text-align: center;
}

/* each letter is its own piece, so the name can arrive letter by letter */
.name .ch {
  display: inline-block;
}

.name {
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(2.3rem, 8.2vw, 118px);
  line-height: 0.95;
  letter-spacing: 0.1em;
  /* the tracking adds space after the last letter too; this takes it back so the name stays centred */
  margin-right: -0.1em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: letter-spacing 0.6s var(--ease);
}

.name:hover,
.name:focus-visible {
  letter-spacing: 0.125em;
}

.tagline {
  color: var(--ink-2);
  letter-spacing: 0.3em;
  margin-right: -0.3em;
}

.page-home .down {
  margin-top: clamp(0.5rem, 3vh, 2rem);
}

.edge {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.edge.left {
  left: var(--gut);
}

.edge.right {
  right: var(--gut);
}

/* the names under the ring. The script moves each to sit beneath its object. */
.ring-labels {
  position: absolute;
  inset: 0;
}

.ring-label {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0;
  will-change: transform, opacity;
}

.ring-label:focus-visible {
  opacity: 1 !important;
}

/* with motion reduced the ring is a still row: every name shows at once, so each wraps inside its own slot */
.ring-still .ring-label {
  width: var(--ring-slot, 9rem);
  white-space: normal;
  text-align: center;
  font-size: 0.6875rem;
  line-height: 1.5;
  letter-spacing: 0.14em;
}

/* without WebGL the ring is a plain row of marks */
.ring-static {
  position: absolute;
  left: var(--gut);
  right: var(--gut);
  top: 16%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem clamp(1rem, 3vw, 2.5rem);
}

.ring-static a {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  width: 6.5rem;
  text-align: center;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mark {
  width: 3.25rem;
  height: 3.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mark-logo {
  width: 3.25rem;
  height: 3.25rem;
  object-fit: contain;
  border-radius: 20.8%;
}

.mark-logo[src$='.png'] {
  image-rendering: pixelated;
}

/* ==========================================================================
   Project pages
   ========================================================================== */

/*
  Three pieces: the heading, the object with its demo, and the detail.
  On a wide screen the heading and the detail share the left column and the
  object takes the right. On a phone they stack: heading, object, detail.
*/
.project {
  display: grid;
  grid-template-columns: minmax(0, 32rem) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    'head aside'
    'detail aside';
  column-gap: clamp(1.75rem, 4.5vw, 4.25rem);
  align-items: start;
  max-width: 84rem;
}

.project .head {
  grid-area: head;
}

.project .aside {
  grid-area: aside;
}

.project .detail {
  grid-area: detail;
}

.status-tag {
  display: inline-block;
  margin-bottom: 0.85rem;
  padding: 0.28rem 0.6rem;
  border: 1px solid color-mix(in srgb, var(--gold-text) 32%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--gold) 8%, transparent);
  color: var(--gold-text);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
}

.brief {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.45rem;
  padding-left: 1rem;
  border-left: 2px solid var(--blue-text);
  max-width: 34rem;
}

.brief > div {
  display: grid;
  gap: 0.18rem;
}

.brief dt {
  color: var(--blue-text);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
}

.brief dd {
  font-size: 0.9688rem;
  line-height: 1.5;
  color: var(--ink);
  text-wrap: pretty;
}

.project .aside {
  display: grid;
  gap: 1rem;
}

.detail-extra:empty {
  display: none;
}

/* empty on purpose: the 3D object is drawn behind this space, and follows it */
.hero-space {
  height: min(40vh, 22rem);
  display: grid;
  place-items: center;
  cursor: grab;
  touch-action: pan-y;
}

.hero-space:active {
  cursor: grabbing;
}

.hero-space .mark {
  display: none;
  width: 9rem;
  height: 9rem;
}

.no-webgl .hero-space .mark {
  display: block;
}

.demo {
  display: grid;
  gap: 0.7rem;
}

.demo-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.3rem 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.6875rem;
}

.demo-head b {
  font-weight: 500;
  color: var(--ink);
}

.flag {
  color: var(--ink-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--blue-text) 55%, transparent);
  border-radius: 4px;
  color: var(--blue-text);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}

.btn:hover:not(:disabled) {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* one slider style for every demo: a soft track and a blue thumb */
input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2rem;
  background: transparent;
  cursor: ew-resize;
}

input[type='range']::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink-2) 24%, transparent);
}

input[type='range']::-moz-range-track {
  height: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink-2) 24%, transparent);
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1rem;
  height: 1rem;
  margin-top: calc(1px - 0.5rem);
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--glow) 22%, transparent);
}

input[type='range']::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
}

.readout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 1.25rem;
}

.readout b {
  font-stretch: 112%;
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* the dynamometer's chart */
.chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.plot {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.plot-wrap {
  position: relative;
}

/* axes and gridlines: solid hairlines that stay out of the way */
.chart .axis {
  stroke: var(--line);
  stroke-width: 1;
}

/* the norm band is a wash, never a block */
.chart .band {
  fill: color-mix(in srgb, var(--ink-2) 11%, transparent);
}

.chart .trial {
  fill: none;
  stroke: var(--series-rest);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* the one trial that is the point takes the accent; the others stay grey */
.chart .trial.best {
  stroke: var(--series);
}

/* markers carry a ring in the page colour, so they stay readable where they cross a line */
.chart .peak {
  fill: var(--gold);
  stroke: var(--bg);
  stroke-width: 2;
}

.chart .at {
  fill: var(--series-rest);
  stroke: var(--bg);
  stroke-width: 2;
}

.chart .at.best {
  fill: var(--series);
}

.chart .cross {
  stroke: var(--ink-2);
  stroke-width: 1;
}

/* text is always ink, never the colour of the data */
.chart .tick {
  font-family: var(--mono);
  font-size: 9px;
  fill: var(--ink-2);
}

.chart:focus-visible {
  outline-offset: 4px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

/* keys: a short stroke for a line, a swatch for a band, a dot for a marker */
.key {
  display: inline-block;
  flex: none;
}

.key.line {
  width: 1rem;
  height: 2px;
  background: var(--series-rest);
}

.key.line.best {
  background: var(--series);
}

.key.band {
  width: 0.8rem;
  height: 0.6rem;
  background: color-mix(in srgb, var(--ink-2) 22%, transparent);
}

.key.dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--grey);
}

.key.dot.peak {
  background: var(--gold);
}

.key.dot.flagged {
  width: 0.78rem;
  height: 0.78rem;
  background: var(--red);
}

.readout .key {
  margin-right: 0.45rem;
}

.bars {
  display: grid;
  gap: 0.45rem;
}

.bars > div {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) 3rem;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.bars .track {
  height: 8px;
}

/* a bar grows from one baseline: square where it starts, rounded where it ends */
.bars .fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 0 4px 4px 0;
  background: var(--series-rest);
  transition: width 0.35s var(--ease);
}

/* the top guess is the point, so it alone takes the accent */
.bars > div:first-child .fill {
  background: var(--series);
}

.bars > div:first-child {
  font-weight: 600;
}

.bars .pct {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-align: right;
}

.meta-credit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.4rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--ink-2);
}

.meta-credit img {
  width: 1.5rem;
  height: 1.5rem;
}

.threshold-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1rem;
}

.threshold-bar .note {
  margin-top: 0;
}

.link-btn {
  color: var(--blue-text);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.1em;
  transition: opacity 0.2s;
}

.link-btn:hover {
  opacity: 0.75;
}

/* the publication's diagram & abstract preview */
.twin {
  width: 100%;
  max-width: 30rem;
  height: auto;
}

.twin rect,
.twin circle {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
}

.twin .dig {
  stroke: var(--blue-text);
  stroke-dasharray: 3 3;
}

.twin .flow {
  fill: none;
  stroke: var(--blue-text);
  stroke-width: 1.2;
  stroke-dasharray: 4 5;
  animation: flow 1.6s linear infinite;
}

@keyframes flow {
  to {
    stroke-dashoffset: -18;
  }
}

.twin text {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  fill: var(--ink-2);
}

.cite {
  display: grid;
  gap: 0.85rem;
  max-width: 40rem;
  padding-left: 1rem;
  border-left: 1px solid var(--ink-2);
  font-size: 0.9688rem;
  line-height: 1.6;
  color: var(--ink);
  text-wrap: pretty;
}

.abstract-more {
  display: grid;
  gap: 1rem;
}

.highlights-list {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.highlights-list > .mono {
  color: var(--ink-2);
  font-size: 0.6875rem;
}

.highlights-list ul {
  display: grid;
  gap: 0.45rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.highlights-list li {
  position: relative;
  padding-left: 0.9rem;
}

.highlights-list li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--blue-text);
  font-weight: 700;
}

.abstract-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.25rem;
  color: var(--blue-text);
}

/* ==========================================================================
   Experience, About, Hobbies
   ========================================================================== */

.about {
  display: grid;
  grid-template-columns: minmax(20rem, 25.5rem) minmax(0, 34rem);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    'photo head'
    'photo detail';
  column-gap: clamp(2.25rem, 5vw, 4.75rem);
  align-items: start;
  max-width: 72rem;
}

.about-head {
  grid-area: head;
}

.about-photo {
  grid-area: photo;
}

.about-detail {
  grid-area: detail;
}

.portrait {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 7 / 8;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--ink) 32%, transparent);
  background: color-mix(in srgb, var(--bg) 52%, transparent);
  border-radius: 4px;
  transition:
    border-color 0.25s var(--ease),
    background 0.25s var(--ease);
}

.portrait:hover,
.portrait:focus-visible {
  border-color: var(--blue-text);
}

.portrait-frame {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait .formal {
  object-position: 50% 14%;
}

.portrait .casual {
  object-position: 76% 22%;
  clip-path: inset(0 0 0 100%);
  transition: clip-path 0.85s var(--ease);
}

.portrait[aria-pressed='true'] .casual {
  clip-path: inset(0 0 0 0);
}

.portrait .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px dashed var(--ink-2);
  text-align: center;
  padding: 1rem;
}

.portrait-note {
  margin-top: 0.65rem;
  color: var(--ink-2);
  font-size: 0.6875rem;
}

.contact {
  margin-top: 2rem;
}

.contact ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.75rem;
  margin-top: 0.8rem;
  color: var(--blue-text);
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
}

/* ==========================================================================
   Narrow screens: the same pages, stacked
   ========================================================================== */

@media (max-width: 900px) {
  /* on the same line as the status, to its left, so the two read as one row */
  .side {
    position: fixed;
    top: 5.85rem;
    width: auto;
  }

  /* the list of other pages moves to the bottom of each page */
  .side ul {
    display: none;
  }

  .page {
    padding: 8.85rem var(--gut) 3rem;
  }

  body:not([data-route='home']) .chrome::before {
    height: 7.75rem;
  }

  .logo {
    width: 44px;
    height: 44px;
  }

  .top {
    min-width: 0;
    flex: 1;
    padding-top: 0;
    font-size: 0.75rem;
    gap: 0.35rem 0.65rem;
  }

  .status {
    order: 5;
    flex: 1 0 100%;
    justify-content: flex-end;
    text-align: right;
    gap: 0.4rem;
    font-size: 0.545rem;
    letter-spacing: 0.015em;
    line-height: 1.35;
    white-space: normal;
  }

  .project,
  .about {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    row-gap: 1.25rem;
  }

  .project {
    grid-template-areas:
      'head'
      'aside'
      'detail';
    row-gap: 1rem;
  }

  .about {
    grid-template-areas:
      'head'
      'photo'
      'detail';
  }

  .hero-space {
    height: 34vh;
  }

  .about-photo {
    max-width: 21.5rem;
  }

  .edge {
    top: auto;
    bottom: 1.25rem;
    transform: none;
  }

  .name-block {
    top: 47.5%;
  }

  .tagline {
    font-size: 0.5625rem;
    letter-spacing: 0.18em;
    margin-right: -0.18em;
  }

  .page-home .down {
    margin-top: 0.5rem;
  }

  /* the row of line marks takes several lines on a phone, so the marks and the name stack instead of sharing fixed places */
  .ring-flat .page-home:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding: 8.25rem var(--gut) 4.25rem;
    /* on a very short screen the stack may not fit; there it scrolls rather than clips */
    overflow-y: auto;
    pointer-events: auto;
    touch-action: pan-y;
  }

  .ring-flat .ring-static,
  .ring-flat .name-block {
    position: static;
    padding-inline: 0;
  }

  /* centred by its margins: when the stack is taller than the screen they fall to zero, so the top is never cut off */
  .ring-flat .ring-static {
    margin-top: auto;
  }

  .ring-flat .name-block {
    margin-bottom: auto;
  }

  .ring-static a {
    width: 5.9rem;
  }

  .bars > div {
    grid-template-columns: 8rem minmax(0, 1fr) 2.6rem;
  }

  .more {
    display: flex !important;
  }
}

/* the other pages, listed at the foot of a page on a phone */
.more {
  display: none;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
}

/* the link icons only appear on a phone */
.tl .ico {
  display: none;
}

/*
  The phone header: one row. Logo on the left; GitHub, LinkedIn and Email as
  icons, then sound, theme and the resume on the right. The status line gets
  its own centred line below, on home only; inside a page that line is the
  way back.
*/
@media (max-width: 640px) {
  .chrome {
    align-items: center;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .logo {
    width: 40px;
    height: 40px;
  }

  .top {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.15rem;
    padding-top: 0;
  }

  .top .tl {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: none;
    transition: background 0.2s var(--ease);
  }

  .top .tl:active,
  .top .tl:hover {
    background: color-mix(in srgb, var(--ink) 8%, transparent);
  }

  .tl .tx {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .tl .ico {
    display: block;
    width: 1.1rem;
    height: 1.1rem;
    fill: currentColor;
  }

  .tl .ico.line {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linejoin: round;
  }

  .resume {
    margin-left: 0.35rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.6875rem;
    white-space: nowrap;
  }

  /* the status: a centred line under the row, on home; inside a page the back link has that spot */
  .status {
    position: absolute;
    top: calc(100% - 0.1rem);
    left: 0;
    right: 0;
    justify-content: center;
    text-align: center;
    font-size: 0.5625rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }

  body:not([data-route='home']) .status {
    display: none;
  }

  .side {
    top: 4.6rem;
  }

  .page {
    padding-top: 7.25rem;
  }

  body:not([data-route='home']) .chrome::before {
    height: 6.75rem;
  }
}

/* ==========================================================================
   Arriving: words that rise, rows that follow
   A page gets the class "is-in" the moment it comes into view. --d0 is how
   long its words wait first (a project page waits for the camera's dive).
   ========================================================================== */

.kw {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.kw > span {
  display: inline-block;
  transform: translateY(108%) rotate(3deg);
  transform-origin: 0 100%;
}

.is-in .kw > span {
  transform: none;
  transition: transform 1s var(--ease);
  transition-delay: calc(var(--d0, 0.05s) + var(--i, 0) * 80ms);
}

.rv {
  opacity: 0;
  transform: translateY(18px);
}

.is-in .rv {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
  transition-delay: calc(var(--d0, 0.05s) + 0.12s + var(--i, 0) * 60ms);
}

.page.proj {
  opacity: 0;
  transition: opacity 0.28s;
}

.page.proj.is-in {
  opacity: 1;
  transition: opacity 0.5s var(--d0, 0s);
}

/* the name leans a little with the pointer */
.name-block {
  transform: translate3d(calc(var(--mx, 0) * -7px), calc(var(--my, 0) * -4px), 0);
}

/* one quiet line of help on home; it goes once anything has been touched */
.hint {
  position: absolute;
  left: 50%;
  bottom: 2.6rem;
  transform: translateX(-50%);
  color: var(--ink-2);
  font-size: 0.625rem;
  letter-spacing: 0.24em;
  white-space: nowrap;
  transition: opacity 0.8s;
}

.hint.gone,
.ring-flat .hint {
  opacity: 0;
}

/* ==========================================================================
   Edge cues: the name of the page that lies each way, as a faint outline at
   the edge of the screen. --p runs 0 to 1 as a swipe towards it goes on.
   ========================================================================== */

.cues {
  position: fixed;
  inset: 0;
  z-index: 15;
  overflow: hidden;
  pointer-events: none;
}

.cue {
  --p: 0;
  position: absolute;
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(3rem, 9vh, 6rem);
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px var(--ink);
  /* unseen at rest: a clipped outline at the edge reads as a mistake, and the home screen already names each way */
  opacity: calc(var(--p) * 0.95);
  transition:
    opacity 0.25s,
    transform 0.18s linear;
}

.cue.left {
  left: 0;
  top: 50%;
  writing-mode: vertical-rl;
  transform: translate(calc(-80% + var(--p) * 74%), -50%) rotate(180deg);
}

.cue.right {
  right: 0;
  top: 50%;
  writing-mode: vertical-rl;
  transform: translate(calc(80% - var(--p) * 74%), -50%);
}

.cue.down {
  left: 50%;
  bottom: 0;
  transform: translate(-50%, calc(80% - var(--p) * 70%));
}

.cue.up {
  left: 50%;
  top: 5.4rem;
  opacity: calc(var(--p) * 0.9);
  transform: translate(-50%, calc(-50% + var(--p) * 60%));
}

/* ==========================================================================
   Experience: one role at a time, and the line that moves between them
   --at is the place on the line (0 to 1); --pull is a swipe in progress.
   ========================================================================== */

.page-exp,
.page-hob {
  display: flex;
  flex-direction: column;
}

.page-exp {
  padding-bottom: 2.25rem;
}

.xp {
  --at: 0;
  --pull: 0;
  flex: 1;
  min-height: 27rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(0.75rem, 2.5vh, 1.75rem);
  max-width: 88rem;
}

.xp-label {
  color: var(--ink-2);
  letter-spacing: 0.3em;
  outline: none;
}

.xp-stage {
  display: grid;
  transform: translateX(calc(var(--pull) * -24vw));
}

.xp-role {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 4rem);
  opacity: 0;
  visibility: hidden;
  transform: translateX(7vw);
  transition:
    opacity 0.4s,
    transform 0.7s var(--ease),
    visibility 0s 0.4s;
}

.xp-role.before {
  transform: translateX(-7vw);
}

.xp-role.on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.6s 0.12s,
    transform 0.8s var(--ease) 0.08s,
    visibility 0s;
}

.xp-when {
  color: var(--blue-text);
  letter-spacing: 0.24em;
}

.xp-title {
  margin-top: 0.9rem;
  font-stretch: 122%;
  font-weight: 800;
  font-size: clamp(2.3rem, 6vw, 6.25rem);
  line-height: 0.93;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}

/* a role's words rise each time it becomes the one showing */
.is-in .xp-role:not(.on) .kw > span {
  transform: translateY(108%) rotate(3deg);
  transition: none;
}

.is-in .xp-role.on .kw > span {
  transition-delay: calc(0.14s + var(--i, 0) * 90ms);
}

.xp-where {
  margin-top: 1.4rem;
  color: var(--ink-2);
}

.xp-points {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.9rem;
  max-width: 35rem;
  color: var(--ink-2);
  font-size: clamp(0.95rem, 1.15vw, 1.0625rem);
  line-height: 1.5;
}

.xp-emblem {
  justify-self: center;
  width: min(100%, 22rem, 40vh);
}

/* line drawings that draw themselves. Each stroke is one unit long. */
.emblem {
  width: 100%;
  height: auto;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.emblem > * {
  stroke-dasharray: 1 1.1;
  stroke-dashoffset: 1.05;
}

.is-in .xp-role.on .emblem > * {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.3s var(--ease);
  transition-delay: calc(0.25s + var(--n, 0) * 55ms);
}

.emblem .thin {
  stroke-width: 1;
  opacity: 0.55;
}

.emblem .blue {
  stroke: var(--blue-text);
}

.emblem .gold {
  stroke: var(--gold);
  stroke-width: 4;
}

.xp-line {
  position: relative;
  height: 4.5rem;
}

.xp-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 0.5rem;
  height: 1px;
  background: var(--line);
  transform: scaleX(0);
  transform-origin: left;
}

.is-in .xp-track {
  transform: none;
  transition: transform 1.4s var(--ease) 0.2s;
}

.xp-track i {
  position: absolute;
  left: 0;
  right: 0;
  top: -0.5px;
  height: 2px;
  background: var(--blue-text);
  transform: scaleX(var(--at));
  transform-origin: left;
  transition: transform 0.8s var(--ease);
}

.xp-node {
  position: absolute;
  left: var(--p);
  top: 0;
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
}

.is-in .xp-node {
  opacity: 1;
  transition: opacity 0.7s 0.7s;
}

.xp-node:first-of-type {
  justify-items: start;
  transform: none;
  text-align: left;
}

.xp-node:last-of-type {
  justify-items: end;
  transform: translateX(-100%);
  text-align: right;
}

.xp-node i {
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--ink-2);
  border-radius: 50%;
  background: var(--bg);
  transition:
    background 0.4s,
    border-color 0.4s,
    box-shadow 0.4s,
    transform 0.4s var(--ease);
}

.xp-node:hover i {
  transform: scale(1.25);
}

.xp-node.past i {
  border-color: var(--blue-text);
}

.xp-node[aria-selected='true'] i {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--glow) 24%, transparent);
}

.xp-node span {
  color: var(--ink-2);
  font-size: 0.6875rem;
  white-space: nowrap;
}

.xp-node .name {
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  opacity: 0.8;
}

.xp-node[aria-selected='true'] span {
  color: var(--ink);
}

/* ==========================================================================
   Hobbies: tall slices. A photo, or something built for the purpose.
   Every slice arrives the same way: mist clearing from left to right.
   ========================================================================== */

.hob {
  flex: 1;
  min-height: 20rem;
  max-height: 40rem;
  max-width: 88rem;
  display: flex;
  gap: clamp(0.6rem, 1.4vw, 1.25rem);
  margin-top: clamp(1.25rem, 3.5vh, 2.5rem);
}

.hob-panel {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: flex-grow 0.7s var(--ease);
}

.hob-panel:hover,
.hob-panel:focus-within {
  flex-grow: 1.7;
}

.hob-panel h2 {
  font-stretch: 118%;
  font-weight: 700;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@property --wipe {
  syntax: '<percentage>';
  inherits: false;
  initial-value: -40%;
}

.slice,
.shelf {
  --wipe: -40%;
  position: relative;
  flex: 1;
  min-height: 0;
  -webkit-mask-image: linear-gradient(100deg, #000 var(--wipe), transparent calc(var(--wipe) + 40%));
  mask-image: linear-gradient(100deg, #000 var(--wipe), transparent calc(var(--wipe) + 40%));
}

.is-in .slice,
.is-in .shelf {
  --wipe: 110%;
  transition: --wipe 1.5s var(--ease);
  transition-delay: calc(0.15s + var(--i, 0) * 140ms);
}

.slice {
  overflow: hidden;
  background: var(--mist-b);
}


/* the photo is a little larger than its window, and slides against the pointer: a slice of a wider view */
.slice img {
  position: absolute;
  left: -8%;
  top: -6%;
  width: 116%;
  height: 112%;
  max-width: none;
  object-fit: cover;
  filter: saturate(0.8);
  transform: translate3d(calc(var(--mx, 0) * (-2% - var(--i, 0) * 0.5%)), calc(var(--my, 0) * -1.8%), 0);
  transition: filter 0.6s;
}

/* a veil of mist over the top of each photo; it thins when the slice is looked at */
.slice::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--mist-a) 46%, transparent), transparent 48%);
  transition: opacity 0.6s;
  pointer-events: none;
}

.hob-panel:hover .slice img {
  filter: none;
}

.hob-panel:hover .slice::after {
  opacity: 0.2;
}

.slice.empty {
  display: grid;
  place-items: center;
  border: 1px dashed var(--ink-2);
  background: transparent;
  color: var(--ink-2);
  text-align: center;
  line-height: 1.9;
}

.slice.empty::after {
  display: none;
}

/* Reading: a shelf of plain books that turns with the pointer, and one book that opens */
.shelf {
  display: grid;
  align-content: end;
  perspective: 900px;
  font-size: clamp(11px, 0.95vw, 15px);
}

.shelf-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.3em;
  transform: rotateY(calc(var(--mx, 0) * 18deg - 8deg)) rotateX(calc(var(--my, 0) * -8deg + 4deg));
  transform-origin: 50% 100%;
  transform-style: preserve-3d;
}

.spine {
  --tone: var(--ink);
  position: relative;
  display: block;
  flex: none;
  width: var(--w);
  height: var(--h);
  background:
    linear-gradient(transparent 1em, rgba(255, 255, 255, 0.4) 1em, rgba(255, 255, 255, 0.4) calc(1em + 1px), transparent calc(1em + 1px)),
    var(--tone);
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease);
}

.spine:hover {
  transform: translateZ(1.8em) translateY(-0.3em);
}

/* the side of a book, and the tops of its pages: they give it depth as the shelf turns */
.spine::before,
.spine::after {
  content: '';
  position: absolute;
}

.spine::before {
  left: 100%;
  top: 0;
  width: 6.5em;
  height: 100%;
  background: color-mix(in srgb, var(--tone) 70%, #000);
  transform: rotateY(90deg);
  transform-origin: left;
}

.spine::after {
  left: 0;
  bottom: 100%;
  width: 100%;
  height: 6.5em;
  background: #ece7dc;
  transform: rotateX(90deg);
  transform-origin: bottom;
}

.tone-b {
  --tone: var(--blue);
}

.tone-c {
  --tone: var(--grey);
}

.tone-d {
  --tone: var(--ink-2);
}

.tome {
  position: relative;
  flex: none;
  width: 7.4em;
  height: 10.4em;
  margin-left: 0.6em;
  transform: rotateY(-12deg);
  transform-style: preserve-3d;
}

.tome .leaf {
  position: absolute;
  inset: 0.25em 0.25em 0.25em 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.35rem;
  padding: 0.65em;
  background: #f6f3ec;
  box-shadow: inset 7px 0 9px -7px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.tome .leaf .leaf-title {
  color: #0c1018;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.tome .leaf .go,
.tome .leaf .ph {
  color: #0a58a8;
  border-color: #2f3d51;
  font-size: 0.625rem;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: normal;
}

.tome .leaf .ph {
  color: #2f3d51;
}

.tome .cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  transform: translateZ(1px);
  transform-origin: left;
  transition: transform 0.9s var(--ease);
}

.tome .cover::before {
  content: '';
  position: absolute;
  inset: 0.5em;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.tome .cover span {
  font-size: 0.625rem;
  letter-spacing: 0.2em;
}

.tome:hover .cover,
.tome:focus-within .cover,
.tome.open .cover {
  transform: translateZ(1px) rotateY(-150deg);
}

.shelf-board {
  height: 3px;
  background: var(--ink);
}

/* ==========================================================================
   The opening. The inline script in the page adds "intro" to <html> before
   anything is drawn; main.js adds "intro-play" and then removes both.
   If the script never runs, everything fades in by itself after six seconds.
   ========================================================================== */

.opening {
  display: none;
}

html.intro .opening {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  pointer-events: none;
  animation: bail 0.8s 6s forwards;
}

html.intro .opening::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg);
  transition: opacity 1.3s var(--ease);
}

html.intro-play .opening::before {
  opacity: 0;
}

/* the seal, large: its disc grows in and its strokes draw; then it travels to the corner where the logo lives */
.intro-seal {
  position: relative;
  width: 96px;
  height: 96px;
  color: var(--ink);
  transform-origin: 0 0;
  transition: transform 1.05s cubic-bezier(0.7, 0, 0.15, 1);
}

.intro-seal svg {
  width: 100%;
  height: 100%;
  animation: seal-in 0.8s var(--ease) both;
}

.intro-seal path {
  stroke-dasharray: 42;
  stroke-dashoffset: 42;
  animation: seal-draw 0.9s 0.2s var(--ease) forwards;
}

@keyframes seal-in {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
}

@keyframes seal-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes bail {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes appear {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes letter {
  from {
    opacity: 0;
    transform: translateY(0.32em);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

html.intro :is(.logo, .name .ch, .tagline, .page-home .go, .hint, .top, .ring-labels, .cues, .ring-nav) {
  opacity: 0;
  animation: appear 0.6s 6.2s both;
}

html.intro-play .name .ch {
  animation: letter 1.1s var(--ease) both;
  animation-delay: calc(0.45s + var(--i) * 55ms);
}

html.intro-play :is(.tagline, .page-home .go, .hint, .top) {
  animation: appear 0.9s 1.3s both;
}

html.intro-play :is(.ring-labels, .cues) {
  animation: appear 0.8s 1.7s both;
}

/* ==========================================================================
   Narrow screens, for the pieces above
   ========================================================================== */

@media (max-width: 900px) {
  .page-exp,
  .page-hob {
    display: block;
  }

  .xp {
    min-height: 0;
  }

  .xp-stage {
    overflow-x: clip;
  }

  .xp-role {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
  }

  .xp-emblem {
    order: -1;
    justify-self: start;
    width: 8.5rem;
  }

  .xp-title {
    font-size: clamp(1.85rem, 9.2vw, 3.2rem);
  }

  .xp-line {
    margin-top: 1.25rem;
  }

  .xp-node .name {
    display: none;
  }

  .hob {
    flex-direction: column;
    max-height: none;
    gap: 1.75rem;
  }

  .hob-panel,
  .hob-panel:hover {
    flex: none;
  }

  .slice,
  .shelf {
    flex: none;
    height: 44vh;
  }

  .shelf {
    font-size: 14px;
  }

  .cue {
    font-size: 2.6rem;
  }

  .hint {
    bottom: 3.6rem;
    font-size: 0.5625rem;
    letter-spacing: 0.1em;
  }
}

/* ==========================================================================
   Reduced motion: nothing glides, draws or drifts. Everything is simply there.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .sky i,
  .status i::after,
  .twin .flow {
    animation: none;
  }

  * {
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }

  .name-block,
  .shelf-row,
  .slice img {
    transform: none;
  }
}

/* the shelf stays put under the pointer: its panel does not widen when hovered, so the book being reached for never slides away */
.hob-panel.is-books:hover,
.hob-panel.is-books:focus-within {
  flex-grow: 1;
}

/* opened, the cover is seen from behind: its lettering would read backwards, so it fades */
.tome .cover span,
.tome .cover::before {
  transition: opacity 0.3s;
}

.tome:hover .cover span,
.tome:focus-within .cover span,
.tome.open .cover span {
  opacity: 0;
}

/* ==========================================================================
   The name: a variable font, set light, whose letters swell under the pointer
   (main.js sets each letter's weight and width)
   ========================================================================== */

.name .ch {
  font-variation-settings: 'wght' 430, 'wdth' 104;
}

/* ==========================================================================
   Real project material: parts of a demo, sources, empty slots, files, frames
   ========================================================================== */

.block {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

/* where something came from */
.src {
  color: var(--ink-2);
  font-size: 0.625rem;
  line-height: 1.7;
  letter-spacing: 0.08em;
  text-transform: none;
}

/* thumbnails of real files; pressing one opens it large */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.75rem;
}

.shot {
  display: grid;
  gap: 0.4rem;
  text-align: left;
}

.shot img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  transition: transform 0.5s var(--ease);
}

.shot:hover img {
  transform: scale(1.03);
}

.shot span {
  color: var(--ink-2);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  line-height: 1.5;
}

/* a live deployment, in a frame */
.embed {
  display: grid;
  gap: 0.6rem;
}

.embed-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.25rem;
  color: var(--blue-text);
}

.embed iframe {
  width: 100%;
  height: min(38rem, 78vh);
  border: 1px solid var(--line);
  background: #fff;
}

.embed.running [data-run] {
  display: none;
}

/* small forms inside a demo */
.form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 0.6rem 1.25rem;
}

.form label {
  display: grid;
  gap: 0.1rem;
}

.form label span {
  color: var(--ink-2);
  font-size: 0.6875rem;
}

.form output {
  color: var(--ink);
}

.seg {
  display: inline-flex;
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.seg button {
  padding: 0.45rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition:
    background 0.2s,
    color 0.2s;
}

.seg button[aria-pressed='false']:hover {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

.seg button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--bg);
}

/* a short list of results */
.result {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1.25rem;
}

.result > div {
  display: grid;
  gap: 0.1rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--line);
}

.result dt {
  color: var(--ink-2);
  font-size: 0.625rem;
}

.result dd {
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.chart .band.inner {
  fill: color-mix(in srgb, var(--ink-2) 20%, transparent);
}

.key.band.inner {
  background: color-mix(in srgb, var(--ink-2) 40%, transparent);
}

.chart [data-ref] {
  stroke-dasharray: 2 3;
}

/* the heart's held-out patients: one dot each */
.swarm .sick {
  fill: var(--grey);
}

.swarm .well {
  fill: none;
  stroke: var(--grey);
  stroke-width: 1;
}

.swarm .sick.flagged {
  fill: var(--red);
}

.swarm .well.flagged {
  stroke: var(--red);
  stroke-width: 1.4;
}

.swarm .flagzone {
  fill: color-mix(in srgb, var(--red) 8%, transparent);
}

.swarm .cross {
  stroke: var(--ink);
  stroke-width: 1.5;
}

.tally {
  gap: 0.4rem 1.6rem;
}

.tally > span {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
}

.tally i {
  font-style: normal;
}

.table-scroll {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.data th,
table.data td {
  padding: 0.4rem 0.9rem 0.4rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
}

table.data th {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* the row for the model and threshold that were chosen */
table.data .chosen td {
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--blue-text);
}

/* LabSpotter: the clips, the player with the detector's boxes, the verdict */
.clips {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
}

.clips button {
  position: relative;
  opacity: 0.55;
  transition: opacity 0.3s;
}

.clips img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.clips button:hover,
.clips button[aria-selected='true'] {
  opacity: 1;
}

.clips button[aria-selected='true']::after {
  content: '';
  position: absolute;
  inset: auto 0 -5px 0;
  height: 2px;
  background: var(--blue-text);
}

.player {
  position: relative;
  margin-top: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  background: #000;
}

.player video,
.film {
  display: block;
  width: 100%;
  height: auto;
}

.film {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #000;
}

.boxes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.boxes rect {
  fill: none;
  stroke: #f5c242;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.boxes text {
  fill: #f5c242;
  font-family: var(--mono);
  font-size: 9px;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.75);
  stroke-width: 2.5px;
}

.verdict {
  font-size: 0.9375rem;
  line-height: 1.6;
}

.verdict .mono {
  color: var(--ink-2);
  font-size: 0.625rem;
}

.verdict .ok {
  color: var(--blue-text);
}

.verdict .off {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.25em;
}

/* the cane: its recorded session as one strip, a block per state */
.track-states {
  --at: 0%;
  position: relative;
  height: 1.6rem;
  border-radius: 2px;
  background: color-mix(in srgb, var(--ink-2) 12%, transparent);
}

.track-states i {
  position: absolute;
  top: 0;
  bottom: 0;
}

.s-monitoring {
  background: color-mix(in srgb, var(--ink-2) 16%, transparent);
}

.s-impact {
  background: var(--gold);
}

.s-check_still {
  background: color-mix(in srgb, var(--gold) 55%, var(--blue));
}

.s-pre_alert {
  background: var(--blue);
}

.s-alert {
  background: var(--red);
}

.key.swatch {
  width: 0.85rem;
  height: 0.55rem;
  border-radius: 1px;
}

.key.swatch.s-monitoring {
  border: 1px solid var(--line);
}

.track-states b {
  position: absolute;
  left: var(--at);
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--ink);
}

/* the paper */
.paper {
  display: grid;
  gap: 0.6rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: border-color 0.25s var(--ease);
}

.paper:hover {
  border-top-color: var(--blue-text);
}

.paper b {
  font-stretch: 112%;
  font-weight: 700;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.15;
  text-wrap: balance;
}

.paper .mono {
  color: var(--ink-2);
  font-size: 0.6875rem;
}

.paper .mono:last-child {
  color: var(--blue-text);
}

/* ==========================================================================
   Hobbies as chapters, and the viewer that opens
   ========================================================================== */

button.slice {
  display: block;
  width: 100%;
  cursor: zoom-in;
}

.slice .count {
  position: absolute;
  left: 0.8rem;
  bottom: 0.8rem;
  z-index: 1;
  padding: 0.32rem 0.55rem;
  background: rgba(12, 16, 24, 0.72);
  color: #fff;
  font-size: 0.625rem;
  border-radius: 2px;
  backdrop-filter: blur(4px);
  opacity: 0.86;
  transition:
    opacity 0.3s,
    transform 0.3s var(--ease);
}

.hob-panel:hover .count,
.slice:focus-visible .count {
  opacity: 1;
}

.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 1rem var(--gut) 1rem;
  border: 0;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  color: var(--ink);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.9rem;
}

.lightbox[open] {
  display: grid;
  animation: appear 0.35s both;
}

.lightbox::backdrop {
  background: transparent;
}

.lightbox header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.lightbox header p:first-child {
  font-size: 0.875rem;
  letter-spacing: 0.24em;
}

.lightbox header p:nth-child(2) {
  color: var(--ink-2);
}

.lightbox header button {
  margin-left: auto;
}

.lightbox figure {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  gap: 0.7rem;
}

.lightbox figure img {
  --wipe: -40%;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
  -webkit-mask-image: linear-gradient(100deg, #000 var(--wipe), transparent calc(var(--wipe) + 40%));
  mask-image: linear-gradient(100deg, #000 var(--wipe), transparent calc(var(--wipe) + 40%));
}

.lightbox figure img.in {
  --wipe: 110%;
  transition: --wipe 0.9s var(--ease);
}

.lightbox figcaption {
  max-width: 44rem;
  color: var(--ink-2);
  font-size: 0.6875rem;
  line-height: 1.6;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: none;
}

.lb-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--ink-2);
  border-radius: 50%;
  background: var(--bg);
  font-family: var(--mono);
  transform: translateY(-50%);
}

.lb-arrow.prev {
  left: var(--gut);
}

.lb-arrow.next {
  right: var(--gut);
}

.lightbox.single .lb-arrow {
  display: none;
}

.lb-strip {
  display: flex;
  justify-content: center;
  gap: 4px;
  overflow-x: auto;
}

.lb-strip button {
  flex: none;
  width: 3.4rem;
  height: 3.4rem;
  opacity: 0.45;
  transition: opacity 0.3s;
}

.lb-strip button[aria-current='true'],
.lb-strip button:hover {
  opacity: 1;
}

.lb-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 900px) {
  .form {
    grid-template-columns: minmax(0, 1fr);
  }

  .clips {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px 4px;
    row-gap: 8px;
  }

  .slice .count {
    opacity: 1;
    transform: none;
  }

  .lb-arrow {
    top: auto;
    bottom: 5.6rem;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .name .ch {
    font-variation-settings: 'wght' 800, 'wdth' 125;
  }
}

/* a software project's own logo, where a CAD project has its 3D object */
.app-logo {
  width: 4.5rem;
  height: 4.5rem;
  margin-bottom: 1.4rem;
  object-fit: contain;
  border-radius: 20.8%;
  image-rendering: auto;
}

.app-logo[src$='.png'] {
  image-rendering: pixelated;
}

.player {
  width: 100%;
}

/* on a phone the strip of thumbnails is the way through a chapter; the arrows would sit on the caption */
@media (max-width: 900px) {
  .lb-arrow {
    display: none;
  }
}

/* ==========================================================================
   One number, large: the thing to remember about a project
   ========================================================================== */

.stat {
  display: grid;
  gap: 0.25rem;
  margin-top: 1.4rem;
  max-width: 32rem;
}

.stat b {
  font-stretch: 120%;
  font-weight: 800;
  font-size: clamp(2.5rem, 4.6vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--blue-text);
}

.stat span {
  color: var(--ink-2);
  font-size: 0.6875rem;
  line-height: 1.55;
}

/* ==========================================================================
   Fewer lines. Space separates things; rules are kept only where they carry
   meaning (a slider's track, the Experience timeline).
   ========================================================================== */

.rows > div,
.rows > div:last-child,
.result > div,
.demo-head,
.highlights-list,
.more,
.cite,
.brief,
.paper,
table.data td,
.shot img,
.player,
.film,
.embed iframe,
.portrait-frame {
  border: 0;
}

.rows > div {
  padding: 0.4rem 0;
}

.result > div {
  padding: 0.35rem 0;
}

.demo-head {
  padding-bottom: 0;
}

.brief,
.cite {
  padding-left: 0;
}

.paper {
  padding-top: 0;
}

table.data .chosen td {
  box-shadow: none;
  color: var(--blue-text);
}

/* ==========================================================================
   The landing. First only the page: the sky and the name. Then the objects
   fly in. Then the rest arrives. (No curtain, no seal.)
   ========================================================================== */

html.intro .opening {
  display: none;
}

html.intro .logo {
  opacity: 1;
  animation: none;
}

html.intro-play .name .ch {
  animation-delay: calc(0.05s + var(--i) * 55ms);
}

html.intro-play :is(.tagline, .page-home .go, .hint, .top) {
  animation: appear 0.9s 1.9s both;
}

html.intro-play :is(.ring-labels, .cues) {
  animation: appear 0.8s 2.2s both;
}

/* the sound button: waves when on, a cross when off */
.sound-btn {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
}

.sound-btn svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-btn .body {
  fill: currentColor;
}

.sound-btn .mute,
.sound-btn[aria-pressed='true'] .mute {
  display: none;
}

.sound-btn[aria-pressed='false'] .mute {
  display: inline;
}

.sound-btn[aria-pressed='false'] .wave {
  display: none;
}

/* the landing: once every object is in place, a light passes along the name, letter by letter */
@keyframes glint {
  0%,
  100% {
    color: var(--ink);
    text-shadow: none;
  }

  40% {
    color: var(--glow);
    text-shadow: 0 0 22px color-mix(in srgb, var(--glow) 55%, transparent);
  }
}

html.intro-play .name .ch {
  animation:
    letter 1.1s var(--ease) both,
    glint 1.1s ease-in-out both;
  animation-delay: calc(0.05s + var(--i) * 55ms), calc(2.3s + var(--i) * 60ms);
}

/* without WebGL: the same horizon, drawn once */
.no-webgl .sky::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 30vh;
  background: linear-gradient(transparent, var(--bg) 85%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 200' preserveAspectRatio='none'%3E%3Cpath d='M0 140 L90 95 L150 120 L240 60 L330 115 L420 80 L500 120 L600 45 L690 105 L780 75 L870 118 L960 70 L1050 110 L1130 85 L1200 105 V200 H0Z' fill='%23050a14' fill-opacity='.6'/%3E%3C/svg%3E")
      bottom / 100% 100% no-repeat;
}

/* the snow photo is wide, so it is framed in a soft blur of itself (assets/portrait-casual-framed.jpg) and shown whole */
.portrait .casual {
  object-position: 50% 50%;
}

:root:not([data-theme='dark']) .no-webgl .sky::after {
  background: linear-gradient(transparent, var(--bg) 85%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 200' preserveAspectRatio='none'%3E%3Cpath d='M0 140 L90 95 L150 120 L240 60 L330 115 L420 80 L500 120 L600 45 L690 105 L780 75 L870 118 L960 70 L1050 110 L1130 85 L1200 105 V200 H0Z' fill='%235d779b' fill-opacity='.3'/%3E%3C/svg%3E")
      bottom / 100% 100% no-repeat;
}

/* ==========================================================================
   The landing, final word. The sky and top bar appear quickly; the objects
   spin in; then the name rises and the ring navigation settles.
   ========================================================================== */

html.intro-play:not(.intro-go) :is(.tagline, .page-home .go, .hint, .top, .ring-labels, .cues, .ring-nav) {
  opacity: 0;
  animation: none;
  pointer-events: none;
}

html.intro-play:not(.intro-go) .name .ch {
  opacity: 0;
  animation: none;
}

html.intro-go .top {
  animation: appear 0.5s 0.3s both;
}

html.intro-go .name .ch {
  animation:
    letter 0.75s var(--ease) both,
    glint 0.85s ease-in-out both;
  animation-delay: calc(0.58s + var(--i) * 32ms), calc(1.2s + var(--i) * 35ms);
}

html.intro-go :is(.tagline, .page-home .go, .hint, .ring-nav) {
  animation: appear 0.55s 1s both;
}

html.intro-go :is(.ring-labels, .cues) {
  animation: appear 0.5s 1.2s both;
}

/* ==========================================================================
   Engagement controls: home ring stepper, hero drag cue, project pager,
   LabSpotter sign-off, About copy-email & portrait badge, Experience arrows
   ========================================================================== */

.ring-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
  pointer-events: auto;
}

.ring-flat .ring-nav {
  display: none;
}

.spin-btn {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid color-mix(in srgb, var(--ink) 11%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 40%, transparent);
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1;
  color: var(--ink-2);
  transition:
    border-color 0.2s,
    color 0.2s,
    background 0.2s;
}

.spin-btn:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--blue-text) 45%, transparent);
  color: var(--blue-text);
  background: color-mix(in srgb, var(--blue) 9%, transparent);
}

.spin-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.ring-count,
.xp-counter {
  color: var(--ink-2);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ring-count {
  min-width: 3.2rem;
}

.xp-counter {
  min-width: 2.8rem;
}

.hero-space {
  position: relative;
}

.hero-hint {
  position: absolute;
  left: 50%;
  bottom: 0.35rem;
  transform: translateX(-50%);
  color: var(--ink-2);
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  opacity: 0.68;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.45s var(--ease);
}

.hero-space.acted .hero-hint,
.no-webgl .hero-hint {
  opacity: 0;
}

.proj-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  max-width: 84rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.pager-link {
  display: grid;
  gap: 0.25rem;
  text-decoration: none;
}

.pager-link.next {
  text-align: right;
  margin-left: auto;
}

.pager-link .mono {
  color: var(--blue-text);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
}

.pager-link b {
  font-stretch: 112%;
  font-weight: 700;
  font-size: 1.05rem;
  transition: color 0.2s var(--ease);
}

.pager-link:hover b,
.pager-link:focus-visible b {
  color: var(--blue-text);
}

.embed-frame {
  position: relative;
}

.embed-status {
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.5rem;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  border-left: 2px solid var(--blue-text);
  color: var(--ink-2);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: none;
}

.embed-frame.loaded .embed-status {
  display: none;
}

.signoff {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.2rem;
}

.btn.ghost {
  border-color: var(--line);
  color: var(--ink-2);
}

.btn.ghost:hover:not(:disabled) {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  border-color: var(--ink-2);
  color: var(--ink);
}

.btn[aria-pressed='true'] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.btn[data-verify='flagged'][aria-pressed='true'] {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.signoff-state {
  color: var(--ink-2);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: none;
}

.clips button[data-verified]::before {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(12, 16, 24, 0.5);
}

.clips button[data-verified='confirmed']::before {
  background: var(--blue);
}

.clips button[data-verified='flagged']::before {
  background: var(--red);
}

.portrait-badge {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  padding: 0.28rem 0.55rem;
  background: rgba(12, 16, 24, 0.72);
  color: #fff;
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  border-radius: 2px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.email-row {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
}

.copy-btn {
  padding: 0.18rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink-2);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  transition:
    border-color 0.2s,
    color 0.2s,
    background 0.2s;
}

.copy-btn:hover,
.copy-btn.copied {
  border-color: var(--blue-text);
  color: var(--blue-text);
}

.copy-btn.copied {
  background: color-mix(in srgb, var(--blue) 12%, transparent);
}

.xp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.xp-arrows {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.xp-link {
  margin-top: 1rem;
  color: var(--blue-text);
}

@media (max-width: 900px) {
  .proj-pager {
    margin-top: 2rem;
  }
}
