/* Paraminder Dhiman · portfolio
   One stylesheet for every page. Colours and sizes live in :root. */

@font-face { font-family: "IBM Plex Sans"; font-weight: 300; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }

:root {
  --ground: #212f3a;      /* page background */
  --rule: #8a979b;        /* frame lines */
  --hair: #3d4e59;        /* quiet dividers inside the content */
  --text: #e2e5e1;
  --soft: #c9d0cf;        /* tiles and the role line */
  --muted: #a9b4b6;       /* captions and secondary text */
  --accent: #63c5ce;
  --accent-hi: #9be0e6;
  --link: #63c5ce;        /* links in text */
  --link-hi: #9be0e6;     /* a link under the cursor */
  --rail: clamp(320px, 24vw, 460px);   /* width of the tile column · grows with the window, from 320 to 460 */
  --column: 1200px;       /* widest the text column gets */
  --side: clamp(28px, 3vw, 48px);      /* space on each side of the text column */
  --edge: 20px;           /* space between the frame and the window */
  --tint: rgba(99, 197, 206, 0.08);        /* the accent as a faint wash, behind tags and the current tile */
  --tint-line: rgba(99, 197, 206, 0.35);   /* the accent as a soft border */
  --line-art: #fff;                        /* the tiles' line art */
  --video-bg: #10181e;                     /* behind a video before it loads */
  --play-bg: rgba(33, 47, 58, 0.82);       /* the play button over a video poster */
  --name-shadow: rgba(0, 0, 0, 0.7);       /* behind tile names that sit on a render */

  /* Glass · the page is a dark slate with soft slate-blue glows, and every panel of the frame is
     frosted glass over it. --ground stays as the solid colour a panel reads as, for the few things
     that need a solid colour and for browsers without glass. */
  --base: #182229;                         /* the page under the glass */
  --glass: rgba(33, 47, 58, 0.48);         /* a panel */
  --glass-hi: rgba(255, 255, 255, 0.06);   /* the bright top edge of a panel */
  --glass-rule: rgba(160, 175, 182, 0.34); /* the frame lines between panels */
  --menu-glass: rgba(24, 34, 41, 0.84);    /* the phone header and menu · stronger, as content moves under them */
  --frame-shadow: rgba(0, 0, 0, 0.28);
  /* the glows · each fades out on an eased curve rather than a straight line, so there's no visible edge */
  --glows:
    radial-gradient(1000px 700px at 10% 6%, rgba(120, 150, 185, 0.22) 0%, rgba(120, 150, 185, 0.18) 18%, rgba(120, 150, 185, 0.136) 32%, rgba(120, 150, 185, 0.092) 46%, rgba(120, 150, 185, 0.055) 58%, rgba(120, 150, 185, 0.026) 68%, rgba(120, 150, 185, 0.009) 77%, rgba(120, 150, 185, 0.0) 85%),
    radial-gradient(900px 640px at 94% 92%, rgba(90, 110, 160, 0.2) 0%, rgba(90, 110, 160, 0.164) 18%, rgba(90, 110, 160, 0.124) 32%, rgba(90, 110, 160, 0.084) 46%, rgba(90, 110, 160, 0.05) 58%, rgba(90, 110, 160, 0.024) 68%, rgba(90, 110, 160, 0.008) 77%, rgba(90, 110, 160, 0.0) 85%),
    radial-gradient(600px 460px at 62% 34%, rgba(150, 165, 180, 0.1) 0%, rgba(150, 165, 180, 0.082) 18%, rgba(150, 165, 180, 0.062) 32%, rgba(150, 165, 180, 0.042) 46%, rgba(150, 165, 180, 0.025) 58%, rgba(150, 165, 180, 0.012) 68%, rgba(150, 165, 180, 0.004) 77%, rgba(150, 165, 180, 0.0) 85%);
  color-scheme: dark;
}

/* The light theme · the same roles in light colours, picked so text reads as easily as it does in dark.
   Switched by the button in the header, remembered by the browser, set on <html data-theme="..."> */
:root[data-theme="light"] {
  --ground: #eef0ec;
  --rule: #76838a;
  --hair: #d3d9d8;
  --text: #1c2830;
  --soft: #34434d;
  --muted: #4a575e;
  --accent: #145b63;
  --accent-hi: #0e434a;
  --link: #0f6f7a;        /* links in text */
  --link-hi: #0b5660;     /* a link under the cursor */
  --tint: rgba(20, 91, 99, 0.08);
  --tint-line: rgba(20, 91, 99, 0.35);
  --line-art: #1c2830;
  --video-bg: #dde2df;
  --play-bg: rgba(238, 240, 236, 0.88);
  --name-shadow: rgba(238, 240, 236, 0.9);
  /* frosted white, with a pale blue glow top left and a warm sand glow bottom right */
  --base: #e3e7e3;
  --glass: rgba(250, 251, 249, 0.58);
  --glass-hi: rgba(255, 255, 255, 0.85);
  --glass-rule: rgba(118, 131, 138, 0.38);
  --menu-glass: rgba(244, 246, 243, 0.86);
  --frame-shadow: rgba(40, 55, 65, 0.14);
  --glows:
    radial-gradient(1000px 700px at 10% 6%, rgba(140, 175, 195, 0.4) 0%, rgba(140, 175, 195, 0.328) 18%, rgba(140, 175, 195, 0.248) 32%, rgba(140, 175, 195, 0.168) 46%, rgba(140, 175, 195, 0.1) 58%, rgba(140, 175, 195, 0.048) 68%, rgba(140, 175, 195, 0.016) 77%, rgba(140, 175, 195, 0.0) 85%),
    radial-gradient(900px 640px at 94% 92%, rgba(205, 190, 165, 0.34) 0%, rgba(205, 190, 165, 0.279) 18%, rgba(205, 190, 165, 0.211) 32%, rgba(205, 190, 165, 0.143) 46%, rgba(205, 190, 165, 0.085) 58%, rgba(205, 190, 165, 0.041) 68%, rgba(205, 190, 165, 0.014) 77%, rgba(205, 190, 165, 0.0) 85%),
    radial-gradient(600px 460px at 62% 34%, rgba(160, 190, 200, 0.22) 0%, rgba(160, 190, 200, 0.18) 18%, rgba(160, 190, 200, 0.136) 32%, rgba(160, 190, 200, 0.092) 46%, rgba(160, 190, 200, 0.055) 58%, rgba(160, 190, 200, 0.026) 68%, rgba(160, 190, 200, 0.009) 77%, rgba(160, 190, 200, 0.0) 85%);
  color-scheme: light;
}

/* Changing theme: the browser crossfades the whole page from the old colours to the new ones in one
   piece (a view transition, started in js/site.js), so the frame and the content change together. */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.4s; animation-timing-function: ease; }

/* Going from page to page: the same crossfade, so a new page fades in rather than cutting. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

* { box-sizing: border-box; }

html { background: var(--base); }

body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font: 400 19px/1.6 "IBM Plex Sans", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* The glows, fixed behind everything, so they stay put while the page scrolls. The saturation is the
   lift the panels' glass used to add with a blur. That blur was re-run over only the part of the page
   that changed (a hover, a browser popup closing), which left faint seams; this layer never changes. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--glows), var(--base);
  filter: saturate(135%);
}

/* Grain · a fine noise over the whole page. It breaks up the banding a soft gradient gets on
   most screens and gives the glass a little texture. images/grain.png is a 256px tile. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: url("../images/grain.png");
  mix-blend-mode: overlay;
}

/* Text wrapping · headings split into lines of even length, and paragraphs avoid a lone last word. */
h1, h2, h3, .pull { text-wrap: balance; }
p, li, figcaption, .caption { text-wrap: pretty; }

::selection { background: var(--accent); color: var(--ground); }

a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hi); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- The frame ----------
   A grid of glass panels. The 1px gaps between them carry each panel's edge line, which makes the frame. */

.sheet {
  margin: var(--edge);
  min-height: calc(100vh - 2 * var(--edge));
  min-height: calc(100dvh - 2 * var(--edge));
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: 1px;
  box-shadow: 0 30px 80px var(--frame-shadow);
}

.sheet > * {
  min-width: 0;
  background: var(--glass);   /* see-through over the glows · no blur, as nothing moves behind the frame */
  /* the line is a 1px shadow rather than an outline: Chrome skips the outline of a panel
     with a scrollbar on that side, which lost the frame's right edge beside the content */
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--glass-rule);
}

/* No glass · a visitor who has asked for less transparency gets solid panels. */
@media (prefers-reduced-transparency: reduce) {
  body::after { display: none; }
  .sheet > * { background: var(--ground); }
}

/* ---------- Header ---------- */

.masthead { padding: 16px 22px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* The light and dark switch: one small square button. It shows the sun in dark mode and the moon in
   light mode, the theme a click switches to, and the icon turns as it swaps. Built in js/site.js. */
.theme-toggle {
  position: relative;
  flex: none;
  width: 34px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--rule);
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); background: var(--tint); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { position: absolute; left: 50%; top: 50%; margin: -8px 0 0 -8px; transition: opacity 0.3s ease, transform 0.4s ease; }
.theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.6); }
[data-theme="light"] .theme-toggle .icon-sun { opacity: 0; transform: rotate(90deg) scale(0.6); }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 1; transform: none; }
.masthead a { display: block; color: var(--text); text-decoration: none; }
.masthead .name { display: block; font-size: 19px; font-weight: 600; line-height: 1.3; }
.masthead .role { display: block; font-size: 27px; font-weight: 300; line-height: 1.15; color: var(--soft); }
.masthead a:hover .name,
.masthead a:hover .role { color: var(--accent); }

.pagehead { padding: 16px var(--side) 18px; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.pagehead h1 { margin: 0; font-size: 32px; font-weight: 500; line-height: 1.2; }
.pagehead .meta { margin: 2px 0 0; font-size: 16px; color: var(--muted); }

/* ---------- Tile rail ---------- */

.rail { padding: clamp(22px, 1.7vw, 28px); }

.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 1.4vw, 24px) clamp(16px, 1.25vw, 22px);
}

.tile { display: block; color: var(--soft); text-decoration: none; }
.tile:hover, .tile:focus-visible, .tile.is-hovered { color: var(--accent); }

.tile-box {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border: 1px solid currentColor;
  overflow: hidden;
}

/* Line art: white lines on a clear background, toned down a little until hovered. */
.tile-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.8;
}
/* Inlined line art takes the theme's line colour, so switching themes doesn't have to reload it. */
svg.tile-line { stroke: var(--line-art); }
svg.tile-line [fill]:not([fill="none"]) { fill: var(--line-art); }

.tile:hover .tile-line,
.tile:focus-visible .tile-line,
.tile.is-hovered .tile-line,
.tile[aria-current] .tile-line { opacity: 1; }

/* Rendered image: hidden until hover, keyboard focus, or the tile's own page. */
.tile-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.18s ease;
}
/* With line drawing on hover, the render waits for the lines before fading in. */
.draws-on-hover:hover .tile-img { transition-delay: 0.45s; transition-duration: 0.3s; }

.tile:hover .tile-img,
.tile:focus-visible .tile-img,
.tile.is-hovered .tile-img,
.tile[aria-current] .tile-img { opacity: 1; }

.tile-name { display: block; margin-top: 7px; font-size: clamp(13px, 0.95vw, 15px); line-height: 1.3; }

.tile[aria-current] { color: var(--accent); }
.tile[aria-current] .tile-box { background: var(--tint); }

/* Optional · show the render only while hovering, also on the current page's tile.
   Switched on in js/site.js (RENDER_ON_HOVER_ONLY). Touch screens keep the current page's render,
   because they have no hover. */
@media (hover: hover) {
  .hover-only .tile[aria-current]:not(:hover):not(:focus-visible):not(.is-hovered) .tile-img { opacity: 0; }
}

/* With the switch on, the current page's tile gets a thicker border instead. */
.hover-only .tile[aria-current] .tile-box { border-width: 2px; }

/* Group headings in the rail: a small label with a line, spanning both columns. */
.rail-group {
  grid-column: 1 / -1;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 -6px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.rail-group:not(:first-child) { margin-top: 10px; }
.rail-group::after { content: ""; flex: 1; border-top: 1px solid var(--hair); }

/* Hovering and leaving a tile (the effect is picked in js/site.js). */
.tile.is-leaving .tile-img { opacity: 1; transition: none; }
@media (hover: hover) { .hover-only .tile.is-leaving[aria-current] .tile-img { opacity: 1; } }

/* lines · the line art draws on top while the render fades underneath */
.leave-lines .tile.is-leaving .tile-line,
.leave-lines .tile.is-entering .tile-line { z-index: 1; opacity: 1; }
.leave-lines .tile.is-leaving .tile-img { animation: tile-fade 0.85s ease-in 0.05s forwards; }
@keyframes tile-fade { from { opacity: 1; } to { opacity: 0; } }

/* Light theme: the lines would be lost against a render, so while it shows they turn white.
   Hovering: they whiten as the render fades in. Leaving: they start white over the render and
   ease back to their own colour as it fades out, on the same timing as the fade. */
:root[data-theme="light"].leave-lines .tile.is-entering svg.tile-line { animation: lines-to-white 0.3s ease-out forwards; }
:root[data-theme="light"].leave-lines .tile.is-entering svg.tile-line [fill]:not([fill="none"]) { animation: dots-to-white 0.3s ease-out forwards; }
:root[data-theme="light"].leave-lines .tile.is-leaving svg.tile-line { animation: lines-from-white 0.85s ease-in 0.05s backwards; }
:root[data-theme="light"].leave-lines .tile.is-leaving svg.tile-line [fill]:not([fill="none"]) { animation: dots-from-white 0.85s ease-in 0.05s backwards; }
@keyframes lines-to-white { from { stroke: var(--line-art); } to { stroke: #fff; } }
@keyframes dots-to-white { from { fill: var(--line-art); } to { fill: #fff; } }
@keyframes lines-from-white { from { stroke: #fff; } to { stroke: var(--line-art); } }
@keyframes dots-from-white { from { fill: #fff; } to { fill: var(--line-art); } }

/* The phone menu's button and header only show on small screens (see the end of this file). */
.menu-button, .menu-head { display: none; }

/* Draft and planned projects only ever appear in a local preview. */
.tile.is-planned { opacity: 0.55; cursor: default; }
.tile.is-planned:hover { color: var(--soft); }
.tile.is-planned:hover .tile-line { opacity: 0.8; }
.tag { color: var(--muted); }

/* ---------- Content ---------- */

/* The content sits in one centred column: the side padding grows so the column is never wider than --column. */
main {
  padding-top: 40px;
  padding-bottom: 56px;
  padding-left: max(var(--side), calc((100% - var(--column)) / 2));
  padding-right: max(var(--side), calc((100% - var(--column)) / 2));
}

.prose { max-width: var(--column); }
.prose p { margin: 0 0 16px; }
.prose p:last-child { margin-bottom: 0; }
.lead { font-size: 23px; line-height: 1.5; }

h2 { margin: 48px 0 10px; font-size: 25px; font-weight: 500; line-height: 1.3; }

.work { list-style: none; margin: 0; padding: 0; max-width: var(--column); border-top: 1px solid var(--hair); }
.work li { border-bottom: 1px solid var(--hair); }
.work a, .work .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 24px;
  padding: 13px 0;
  text-decoration: none;
}
.work .w-title { font-size: 20px; text-decoration: underline; text-underline-offset: 3px; }
.work .w-meta { font-size: 16px; color: var(--muted); }
.work .row { color: var(--muted); }
.work .work-group {
  padding: 22px 0 8px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.work .work-group:first-child { padding-top: 12px; }

/* Tools used in a role: highlighted as small tags under the role line. */
/* Plain labels with no border, so they don't read as buttons. */
.tools { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tools::before {
  content: "Tools";
  content: "Tools" / "";                       /* the list already has a label for screen readers */
  margin-right: 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.tools li {
  padding: 1px 8px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  background: var(--tint);
}

/* The short contact line at the end of every page. */
.contact-note { margin: 64px 0 0; padding-top: 22px; border-top: 1px solid var(--hair); max-width: var(--column); color: var(--soft); }

/* The Contact page. */
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 28px 0 0; }
.contact-button {
  display: inline-block;
  padding: 5px 14px;
  font-size: 16px;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.contact-button:hover { background: var(--accent); color: var(--ground); }
.contact-address { color: var(--text); user-select: all; }
.contact-hint { font-size: 15px; color: var(--muted); }
.contact-actions + .contact-actions { margin-top: 14px; }
.entries.contact-list { margin-top: 36px; max-width: var(--column); }

.empty { color: var(--muted); }

/* Images, clips and captions on project pages. */
figure { margin: 28px 0; }
figure img, figure video { display: block; width: 100%; height: auto; }
figcaption { margin-top: 8px; font-size: 16px; color: var(--muted); }

/* Text beside a small screenshot, such as a tool's panel. Stacks on narrow screens. */
.split { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 40px; align-items: start; max-width: var(--column); }
.split figure { margin: 4px 0 0; }
.split figure img { width: 246px; }         /* half the screenshot's pixel width, so it stays sharp on high-density screens */
.split.wide figure img { width: 380px; }    /* for screenshots taken at the normal interface scale */
@media (max-width: 760px) { .split { grid-template-columns: 1fr; gap: 20px; } .split figure img { max-width: 100%; height: auto; } }

/* ---------- Studio work on the About page, and spec lists on project pages ---------- */

.section-meta { margin: -6px 0 0; font-size: 16px; color: var(--muted); }

.role-block { margin-top: 30px; }
.role-block h3 { margin: 0; font-size: 21px; font-weight: 600; line-height: 1.35; }
.role-block .meta { margin: 3px 0 10px; font-size: 16px; color: var(--muted); }

/* A two-column list: a short label on the left, the detail on the right. */
.entries { margin: 0; border-top: 1px solid var(--hair); }
.entries > div {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 4px 28px;
  padding: 13px 0;
  border-bottom: 1px solid var(--hair);
}
.entries dt { font-weight: 500; }
.entries dd { margin: 0; color: var(--soft); }

/* A quiet line linking a project to its sibling on another engine. */
.prose .sibling { font-size: 16px; color: var(--muted); }

/* Two images side by side, stacking on phones. */
.figure-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin: 28px 0; }
.figure-grid figure { margin: 0 0 14px; }
@media (max-width: 760px) { .figure-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Charts ----------
   Drawn as inline SVG from the same formulas as the project, coloured from the theme. */

.chart svg { display: block; width: 100%; height: auto; font-family: inherit; overflow: visible; }
.chart .grid { stroke: var(--hair); stroke-width: 1; }
.chart .axis { stroke: var(--rule); stroke-width: 1; }
.chart .mark { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .band { fill: var(--tint); }
.chart .dot { fill: var(--accent); }
.chart .curve { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; }
.chart .curve-2 { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 6 5; }
.chart .tick, .chart .note, .chart .key { fill: var(--muted); font-size: 12px; }
.chart .label { fill: var(--soft); font-size: 13px; }

/* ---------- Diagrams ---------- */

.diagram { margin: 20px 0 8px; overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 640px; height: auto; font-family: inherit; }
.diagram .box { fill: none; stroke: var(--rule); stroke-width: 1; }
.diagram .chip { fill: var(--tint); stroke: var(--hair); stroke-width: 1; }
.diagram .wire { fill: none; stroke: var(--muted); stroke-width: 1; }
.diagram .head { fill: var(--muted); }
.diagram text { fill: var(--text); font-size: 13px; }
.diagram .t-title { font-weight: 600; }
.diagram .t-soft { fill: var(--muted); font-size: 12px; }
.caption { margin: 0; font-size: 16px; color: var(--muted); }

/* ---------- Video ----------
   A poster with a play button. Clicking plays the video in place; from disk it opens YouTube. */

.video { margin: 28px 0 8px; }
.video-link, .video iframe {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--video-bg);
  overflow: hidden;
}
.video-link img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--text);
  background: var(--play-bg);
  color: var(--text);
}
.video-link:hover .video-play, .video-link:focus-visible .video-play { border-color: var(--accent); color: var(--accent); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Footer ---------- */

.foot-place { padding: 6px 22px; display: flex; align-items: center; font-size: 14px; color: var(--muted); }

/* The footer line, with a small black hole for a separator. Clicking it is in js/site.js. */
.foot-note { padding: 14px var(--side); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px; font-size: 15px; color: var(--muted); }
.foot-note .heart { color: var(--accent); }
.foot-note { position: relative; isolation: isolate; }   /* the letters, the hole and its effects stack against each other only */
.egg-side { white-space: nowrap; }
.egg-ch { display: inline-block; position: relative; z-index: 3; white-space: pre; }

/* The black hole: black, with a teal rim and a soft teal glow. */
.egg-dot {
  position: relative;
  z-index: 2;
  width: 10px;
  height: 10px;
  padding: 0;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: #05080a;
  box-shadow: 0 0 5px 1px rgba(99, 197, 206, 0.45);
  cursor: pointer;
  transition: box-shadow 0.3s ease;
}
.egg-dot::before { content: ""; display: block; width: 28px; height: 28px; margin: -10px; border-radius: 50%; }   /* a bigger target for fingers */
.egg-dot:hover, .egg-dot:focus-visible, .egg-dot.is-awake { box-shadow: 0 0 8px 2px rgba(99, 197, 206, 0.65); }
.egg-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.is-swallowing .egg-dot { transition: none; }

/* Its effects: smoke behind the hole, the ring of light in front. Drawn in js/site.js. */
.egg-fx { position: absolute; pointer-events: none; }
.egg-smoke { z-index: 1; }
.egg-ring { z-index: 4; }

main:focus { outline: none; }   /* the content is focused quietly on load for keyboard scrolling; no ring for that */

/* ---------- Fixed frame on larger screens ----------
   The frame fills the window and stays put. Only the content scrolls, and the tile rail
   scrolls on its own once there are more tiles than fit. The header and footer always show.
   Phones and very short windows keep the normal page scroll below. */

@media (min-width: 761px) and (min-height: 560px) {
  html, body { height: 100%; overflow: hidden; }
  .sheet {
    height: calc(100vh - 2 * var(--edge));
    height: calc(100dvh - 2 * var(--edge));
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .rail, main {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--hair) transparent;
  }

}

/* ---------- Small screens ----------
   One column: name, page title, content, footer. The tiles move into a full-screen menu
   behind the Projects button, laid out like Windows Phone's live tiles. */

@media (max-width: 760px) {
  :root { --edge: 10px; }
  .sheet { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .pagehead { order: 3; padding: 14px 18px 16px; }
  main { order: 4; padding: 26px 18px 40px; }
  .foot-place { order: 5; padding: 12px 18px; justify-content: center; }
  .foot-note { order: 6; flex-direction: column; padding: 12px 18px 18px; font-size: 14px; gap: 6px; }
  .masthead .role, .pagehead h1 { font-size: 24px; }
  body { font-size: 17px; }
  .lead { font-size: 20px; }
  h2 { font-size: 22px; }
  .role-block h3 { font-size: 19px; }
  .entries > div { grid-template-columns: minmax(0, 1fr); }

  /* The header stays at the top while reading, with the menu button on its left. */
  .masthead {
    order: 1;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--menu-glass);
    box-shadow: inset 0 1px 0 var(--glass-hi), 0 1px 0 var(--glass-rule);
  }
  .masthead .role { font-size: 21px; }
  .masthead { justify-content: flex-start; gap: 12px; }
  .theme-toggle { margin-left: auto; }
  .menu-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: none;
    padding: 9px 10px 6px;
    border: 1px solid var(--rule);
    background: none;
    color: var(--text);
    font: inherit;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
  }
  .menu-icon { display: flex; flex-direction: column; gap: 4px; width: 22px; }
  .menu-icon i { display: block; height: 1.5px; background: currentColor; }
  .menu-button:active { color: var(--accent); border-color: var(--accent); }

  /* The menu itself: hidden until opened, then it covers the screen. */
  .rail { order: 2; display: none; }
  html.menu-open, html.menu-open body { overflow: hidden; }
  html.menu-open .rail {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 16px 36px;
    background: var(--menu-glass);
  }
  .menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0 -16px 6px;
    padding: 12px 16px;
    background: var(--menu-glass);
    -webkit-backdrop-filter: blur(22px) saturate(135%);
    backdrop-filter: blur(22px) saturate(135%);
    box-shadow: 0 1px 0 var(--glass-rule);
  }
  .menu-title { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
  .menu-close { display: flex; padding: 9px; border: 1px solid var(--rule); background: none; color: var(--text); cursor: pointer; }

  /* Tiles: two square columns, with some tiles twice as wide. */
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; perspective: 1200px; }
  .tiles > li.is-wide { grid-column: span 2; }
  .is-wide .tile-box { aspect-ratio: 2 / 1; }
  .is-wide .tile-img, .is-wide img.tile-line { object-fit: contain; }   /* the renders are transparent, so the sides are just glass */
  .tile { position: relative; }
  .tile-box { border-color: var(--hair); }
  .tile[aria-current] .tile-box { border-color: var(--accent); background: none; }
  .tile-name { position: absolute; left: 10px; bottom: 7px; margin: 0; font-size: 14px; color: var(--text); text-shadow: 0 1px 3px var(--name-shadow); }
  .tile[aria-current] .tile-name { color: var(--accent-hi); }

  /* Group names as big lowercase words, the Windows Phone way. */
  .rail-group { margin: 18px 0 2px; font-size: 26px; font-weight: 300; letter-spacing: 0; text-transform: lowercase; color: var(--soft); }
  .rail-group:not(:first-child) { margin-top: 22px; }
  .rail-group:first-child { margin-top: 8px; }
  .rail-group::after { display: none; }

  /* Opening: everything turns in from the left edge, one after another. */
  html.menu-open .tiles > li { animation: menu-turn 0.42s cubic-bezier(0.1, 0.9, 0.2, 1) backwards; animation-delay: calc(var(--i) * 32ms); transform-origin: 0 50%; }
  @keyframes menu-turn { from { opacity: 0; transform: rotateY(-70deg) translateX(-12px); } to { opacity: 1; transform: none; } }

  /* The menu opens on the renders. Then each tile flips over to its line art, like a live tile.
     The current page's tile keeps its render and doesn't flip. */
  .tile-img { transition: none; opacity: 1; }
  .tile-line, .tile[aria-current] .tile-line { opacity: 0; }
  .tile.is-flipped .tile-box { animation: tile-flip 0.5s ease-in-out; }
  .tile.is-flipped .tile-img { opacity: 0; animation: tile-front 0.5s step-end; }
  .tile.is-flipped .tile-line { opacity: 0.85; animation: tile-back 0.5s step-end; }
  @keyframes tile-flip { 0% { transform: none; } 50% { transform: rotateX(90deg); } 50.01% { transform: rotateX(-90deg); } 100% { transform: none; } }
  @keyframes tile-front { 0% { opacity: 1; } 50% { opacity: 0; } }
  @keyframes tile-back { 0% { opacity: 0; } 50% { opacity: 0.85; } }
}

@media (prefers-reduced-motion: reduce) {
  .tile-img { transition: none; }
  .theme-toggle svg { transition: none; }
  html.menu-open .tiles > li, .tile.is-flipped .tile-box, .tile.is-flipped .tile-img, .tile.is-flipped .tile-line { animation: none; }
}

/* Formulas on technical pages: a quiet block of monospace lines, with comments dimmed. */
.formula { max-width: var(--column); margin: 20px 0 24px; padding: 14px 18px; overflow-x: auto;
           font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 15px; line-height: 1.75;
           color: var(--text); background: var(--tint); border-left: 2px solid var(--accent); white-space: pre; }
.formula .c { color: var(--muted); }
/* The small "why it's built this way" heading above a section's decisions. */
h3.why { margin: 30px 0 4px; font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 760px) { .formula { font-size: 12.5px; padding: 12px 14px; } }

/* Inline code and short formulas. */
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.92em; color: var(--accent-hi); background: var(--tint); padding: 2px 7px; }

/* Desktop at 90%: every size from above, scaled down a tenth. Phones keep their own sizes. */
@media (min-width: 761px) {
  :root {
    --rail: clamp(288px, 21.6vw, 414px);
    --side: clamp(25px, 2.7vw, 43px);
    --edge: 18px;
  }
  body { font-size: 17px; }
  .masthead .name { font-size: 17px; }
  .masthead .role { font-size: 24px; }
  .pagehead h1 { font-size: 29px; }
  .pagehead .meta { font-size: 14.5px; }
  .theme-toggle { width: 31px; height: 27px; }
  .rail { padding: clamp(20px, 1.53vw, 25px); }
  .tiles { gap: clamp(16px, 1.26vw, 22px) clamp(14px, 1.13vw, 20px); }
  .tile-name { margin-top: 6px; font-size: clamp(12px, 0.86vw, 13.5px); }
  .rail-group, .work .work-group { font-size: 12px; }
  .lead { font-size: 21px; }
  h2 { margin: 43px 0 9px; font-size: 22.5px; }
  .work .w-title { font-size: 18px; }
  .work .w-meta, .section-meta, .role-block .meta, .prose .sibling,
  figcaption, .caption, .contact-button { font-size: 14.5px; }
  .tools li { font-size: 12.5px; }
  .contact-hint, .foot-note { font-size: 13.5px; }
  .tools::before { font-size: 11px; }
  .role-block h3 { font-size: 19px; }
  .entries > div { grid-template-columns: 180px minmax(0, 1fr); gap: 4px 25px; padding: 12px 0; }
  .split figure img { width: 221px; }
  .split.wide figure img { width: 342px; }
  .foot-place { font-size: 12.5px; }
  .formula { font-size: 13.5px; }
  h3.why { font-size: 12px; }
}

/* ---------- Page layouts for longer write-ups ----------
   Used on Behind the Site: a pull line, a number strip, text beside an image, colour swatches,
   and short notes side by side. Each one stacks into a single column on phones. */

/* One line that sums up a section, set large with a teal rule. */
.pull { max-width: 900px; margin: 6px 0 30px; padding-left: 20px; border-left: 2px solid var(--accent); font-size: 23px; font-weight: 300; line-height: 1.45; color: var(--text); }

/* A strip of big numbers, each with a short label. */
.stats { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 40px; padding: 0; max-width: var(--column); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.stats li { padding: 14px 0 16px; font-size: 16px; color: var(--muted); }
.stats li + li { padding-left: 24px; border-left: 1px solid var(--hair); }
.stats b { display: block; font-size: 42px; font-weight: 300; line-height: 1.1; color: var(--text); }

/* Text beside an image or a video. Add "flip" to put the picture on the left. */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; max-width: var(--column); margin: 40px 0; }
.feature.flip .feature-text { order: 2; }
.feature figure { margin: 0; }

.feature h3, .notes h3, h3.sub { margin: 0 0 8px; font-size: 20px; font-weight: 500; line-height: 1.3; }
.feature p { margin: 0 0 14px; color: var(--soft); }
.feature p:last-child { margin-bottom: 0; }

/* A smaller heading with a line of text, above something visual. */
h3.sub { margin-top: 44px; }
.sub-text { max-width: 900px; margin: 0 0 18px; color: var(--soft); }

/* Colour swatches: a row per theme. */
.swatches { display: grid; grid-template-columns: 70px repeat(6, minmax(0, 1fr)); gap: 14px 14px; align-items: start; max-width: var(--column); margin: 0 0 40px; }
.sw-label { padding-top: 12px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sw { display: block; font-size: 15px; line-height: 1.35; color: var(--soft); }
.sw i { display: block; height: 46px; margin-bottom: 7px; background: linear-gradient(var(--c), var(--c)), var(--under, transparent); border: 1px solid var(--hair); }   /* --under: what a see-through colour sits on */
.sw em { display: block; font-style: normal; font-size: 13px; color: var(--muted); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

/* The frame diagram. */
.frame-fig svg { display: block; width: 100%; height: auto; font-family: inherit; }
.frame-fig .fr-sheet { fill: url(#fr-glow); }
.frame-fig .g-a { stop-color: #2e3c49; }
.frame-fig .g-base { stop-color: #182229; }
.frame-fig .g-b { stop-color: #253141; }
:root[data-theme="light"] .frame-fig .g-a { stop-color: #c0d1d6; }
:root[data-theme="light"] .frame-fig .g-base { stop-color: #e3e7e3; }
:root[data-theme="light"] .frame-fig .g-b { stop-color: #dcd9ce; }
.frame-fig .fr-box rect { fill: var(--glass); stroke: var(--glass-rule); stroke-width: 1; }
.frame-fig .fr-fill rect { fill: var(--glass); stroke: var(--glass-rule); stroke-width: 1; }
.frame-fig .fr-base { fill: none; stroke: var(--glass-rule); stroke-width: 1; stroke-dasharray: 3 4; }
.frame-fig text { fill: var(--muted); font-size: 14px; text-anchor: middle; }
.frame-fig .fr-op { fill: var(--text); font-size: 24px; font-weight: 300; }
.feature figure.frame-fig figcaption { margin-top: 10px; }

/* Short notes, two side by side. */
.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; max-width: var(--column); margin: 40px 0 0; border-top: 1px solid var(--hair); }
h3.sub + .notes { margin-top: 14px; }   /* notes straight under a small heading sit close to it */
.notes > div { padding-top: 18px; }
.notes p { margin: 0 0 12px; color: var(--soft); }
.specimen { display: flex; gap: 22px; font-size: 40px; line-height: 1.1; color: var(--text) !important; }

@media (max-width: 760px) {
  .pull { font-size: 20px; padding-left: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats li:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats li:nth-child(n+3) { border-top: 1px solid var(--hair); }
  .stats b { font-size: 34px; }
  .feature, .feature.flip { grid-template-columns: minmax(0, 1fr); gap: 18px; margin: 32px 0; }
  .feature.flip .feature-text { order: 0; }
  .swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .sw-label { grid-column: 1 / -1; padding-top: 6px; }
  .notes { grid-template-columns: minmax(0, 1fr); }
}

/* A phone recording: kept narrow, beside wider text. */
.feature.phone { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.feature.phone.flip { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
.feature.phone figure { justify-self: center; width: 100%; max-width: 300px; }
.feature video { display: block; width: 100%; height: auto; background: var(--video-bg); }

/* Three short notes in a row. */
.notes.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; }

@media (max-width: 760px) {
  .feature.phone, .feature.phone.flip { grid-template-columns: minmax(0, 1fr); }
  .feature.phone figure { max-width: 260px; }
  .notes.three { grid-template-columns: minmax(0, 1fr); }
}

/* A piece of code beside what it produces. */
.code-result { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: start; max-width: var(--column); margin: 0 0 40px; }
.code-result .formula { margin: 0; }
.result { display: grid; gap: 22px; }
.result figure { margin: 0; }
.result-label { display: block; margin-bottom: 8px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tile-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 360px; }
.tile-pair img, .tile-pair svg { display: block; width: 100%; height: auto; aspect-ratio: 1; border: 1px solid var(--rule); }
.tile-pair svg.pair-line { position: static; opacity: 1; }
.result .work { max-width: none; }

/* Numbered steps in a row. */
.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; max-width: var(--column); margin: 0 0 40px; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 14px 0 0 52px; color: var(--soft); border-top: 1px solid var(--hair); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 12px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--accent); color: var(--accent); font-size: 18px; }
.steps b { display: block; font-weight: 500; color: var(--text); }

@media (max-width: 760px) {
  .code-result { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}

/* Images compared side by side, each with a small label. */
.compare { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.compare figure { margin: 0; }
.compare img, .feature img.square { display: block; width: 100%; height: auto; }
.compare.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 40px; }
.compare.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature figure img.square { max-width: 400px; margin: 0 auto; }

@media (max-width: 760px) {
  .compare.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}

/* Screen recordings: narrow ones beside text, two rail clips side by side, wide strips across. */
.feature figure.narrow { justify-self: center; width: 100%; max-width: 300px; }
.feature figure.narrow.small { max-width: 220px; }
.compare.clips { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 460px; justify-self: center; width: 100%; }
.compare.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: var(--column); margin: 0 0 40px; }
.compare video, .wide-clip video { display: block; width: 100%; height: auto; background: var(--video-bg); }
.wide-clip { max-width: var(--column); margin: 0 0 36px; }
.feature .note { font-size: 15px; color: var(--muted); }

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

/* A number strip straight after text. */
.prose + .stats { margin-top: 28px; }

/* Four steps in a row, and a grid of short notes that runs to several rows. */
.steps.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 24px; }
.notes.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 0; margin-top: 0; }
.notes.grid > div { border-top: 1px solid var(--hair); padding-bottom: 6px; }
.notes.three > div:nth-child(n+4) { border-top: 1px solid var(--hair); margin-top: 6px; }

@media (max-width: 760px) {
  .steps.four { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .notes.grid { grid-template-columns: minmax(0, 1fr); }
  .notes.three > div:nth-child(n+4) { margin-top: 0; }
}

/* Two options side by side, each with a short line of what it runs on. */
.notes.versus { margin: 0 0 18px; border-top: 0; gap: 0 24px; }
.notes.versus > div { padding: 16px 20px 6px; background: var(--tint); border-top: 2px solid var(--accent); }
.note-meta { font-size: 15px; color: var(--muted) !important; margin-bottom: 8px !important; }
@media (max-width: 760px) { .notes.versus { gap: 14px; } }

/* Text beside a tall panel screenshot. The text column also carries what follows, such as a grid of
   images or a numbered tour of the panel, so the space beside the screenshot is filled. */
.side-shot { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 36px; align-items: start; max-width: var(--column); margin: 0 0 28px; }
.side-shot .panel-shot { margin: 4px 0 0; }
.side-shot .panel-shot img { display: block; width: 246px; height: auto; }
.side-shot .panel-shot.wide img { width: 380px; }
.side-shot .prose p { margin: 0 0 16px; }
.figure-grid.tight { margin: 22px 0 0; }
.side-shot h3.sub { margin-top: 0; }
.tour { list-style: none; counter-reset: tour; margin: 4px 0 18px; padding: 0; }
.tour li { counter-increment: tour; position: relative; padding: 10px 0 10px 44px; border-top: 1px solid var(--hair); color: var(--soft); }
.tour li:last-child { border-bottom: 1px solid var(--hair); }
.tour li::before { content: counter(tour); position: absolute; left: 0; top: 11px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--accent); color: var(--accent); font-size: 14px; }
.tour b { display: block; font-weight: 500; color: var(--text); }
@media (max-width: 760px) {
  .side-shot { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .side-shot .panel-shot img, .side-shot .panel-shot.wide img { max-width: 100%; }
}

/* A tile's line art on a page: the lines at rest, the render fading in under them on hover. */
.line-demo { position: relative; aspect-ratio: 1; width: 100%; max-width: 400px; margin: 0 auto; border: 1px solid var(--hair); cursor: pointer; outline-offset: 3px; }
.line-demo img.demo-render { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.3s ease; }
.line-demo .tile-line { opacity: 1; }
.line-demo.is-on img.demo-render { opacity: 1; }
:root[data-theme="light"] .line-demo svg.tile-line { transition: stroke 0.3s ease; }
:root[data-theme="light"] .line-demo.is-on svg.tile-line { stroke: #fff; }
:root[data-theme="light"] .line-demo.is-on svg.tile-line [fill]:not([fill="none"]) { fill: #fff; }
/* A tile shown over each theme's colour, whichever theme the page is in. */
.on-theme { display: block; aspect-ratio: 1; outline: 1px solid var(--hair); outline-offset: 4px; }
.on-theme.dark { background: #212f3a; }
.on-theme.light { background: #eef0ec; }
.compare .on-theme img { outline: none; }
.line-demo-caption { max-width: 400px; margin: 10px auto 0; font-size: 15px; color: var(--muted); }

/* A row of four images, such as the sketches tried for a tile. */
.compare.four { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: var(--column); margin: 0 0 10px; }
.compare.four + .caption { margin-bottom: 40px; }
@media (max-width: 760px) { .compare.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Two images on top of each other with a divider you drag, such as the same page in both themes. */
.compare-slider { position: relative; margin: 0; overflow: hidden; touch-action: pan-y; user-select: none; }
.compare-slider img { display: block; width: 100%; height: auto; pointer-events: none; }
.compare-slider .slider-top { position: absolute; inset: 0; height: 100%; clip-path: inset(0 0 0 var(--pos)); }
.slider-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; }
.slider-handle::after { content: "‹ ›"; position: absolute; top: 50%; left: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--accent); border-radius: 50%; background: var(--ground); color: var(--accent); font-size: 18px; line-height: 1; letter-spacing: 2px; }
.compare-slider input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare-slider:has(input:focus-visible) .slider-handle::after { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Desktop at 90%, like the rest of the site. */
@media (min-width: 761px) {
  .pull { font-size: 21px; }
  .stats li { font-size: 14.5px; }
  .stats b { font-size: 38px; }
  .feature h3, .notes h3, h3.sub { font-size: 18px; }
  .sw { font-size: 13.5px; }
  .sw em, .sw-label { font-size: 12px; }
  .specimen { font-size: 36px; }
  .side-shot .panel-shot img { width: 221px; }
  .side-shot .panel-shot.wide img { width: 342px; }
  .result-label { font-size: 12px; }
  .steps li::before { font-size: 16px; }
}

/* ---------- Picture frames ----------
   Every image and video in a page's figures gets a hairline with a thin gap around it, like a mat in a frame.
   It's drawn as an outline, so it takes no space and doesn't change the layout. Tiles keep their own borders. */
main figure img, main figure video,
.video-link, .video iframe, .compare-slider {
  outline: 1px solid var(--hair);
  outline-offset: 4px;
}
.video-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.compare-slider img, .line-demo img, .tile-pair img, .video-link img { outline: none; }   /* these frame themselves */
.figure-grid { gap: 0 24px; }   /* room for the frames side by side */

/* Less transparency asked for · the phone header and menu go solid too. */
@media (prefers-reduced-transparency: reduce) {
  .masthead, html.menu-open .rail, .menu-head { background: var(--ground); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
