/* omarhagopian.com -- one stylesheet.
   The page is a flat, neutral foreground; colour lives in hard-edged windows
   and one pixel-edged band per page. See docs/design-direction.md.
   Rules: no italics, radius 0 or 50% only, no shadows. */

/* ---------- Fonts (self-hosted, OFL; from the official geist package) ---------- */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;

  /* Palette: one family, same lightness and chroma (OKLCH fill L .86, ink L .42, deep L .30). */
  --green-fill: #99e89b;
  --green-ink: #295a2c;
  --green-deep: #1d341e;
  --yellow-fill: #e8d34f;
  --yellow-ink: #594d00;
  --yellow-deep: #342e0d;
  --lavender-fill: #dbc2ff;
  --lavender-ink: #554077;
  --lavender-deep: #322843;
  --sky-fill: #84dfff;
  --sky-ink: #005672;
  --sky-deep: #0a3341;
  --blue-fill: #b3d2ff;
  --blue-ink: #314c7e;
  --blue-deep: #202e47;
  --orange-fill: #ffbf88;
  --orange-ink: #713f11;
  --orange-deep: #402713;

  /* Neutrals, very slightly warm. */
  --bg: #f6f5f2;
  --bg-2: #e9e8e4;
  --line: #d2d1cd;
  --text: #171614;
  --text-2: #565552;
  --paper: var(--bg);

  /* Type */
  --font-sans: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --step-5: clamp(3rem, 8vw, 7.5rem);
  --step-4: clamp(2.25rem, 5vw, 4.5rem);
  --step-3: clamp(1.6rem, 3vw, 2.5rem);
  --step-2: 1.375rem;
  --step-1: 1.125rem;
  --step-0: 0.8rem;
  --thin: 200;
  --bold: 750;

  /* Space: 4px base */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  --max: 1280px;
  --gutter: 16px;
  --section: var(--s-8);
  --grout: 1px;
  --pixel: 12px;

  /* Page colour defaults (overridden per page below). */
  --page-a: var(--green-fill);
  --page-a-ink: var(--green-ink);
  --page-a-deep: var(--green-deep);
}

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
    --section: var(--s-10);
    --pixel: 16px;
  }
}

/* Dark: the plane goes near-black; windows keep their fills, big surfaces go deep.
   Same values twice: once for the system setting, once for the manual toggle. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121210;
    --bg-2: #1e1d1a;
    --line: #343330;
    --text: #efeeeb;
    --text-2: #a5a4a1;
  }
  :root:not([data-theme="light"]) body {
    --band: var(--page-a-deep);
    --band-text: var(--text);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121210;
  --bg-2: #1e1d1a;
  --line: #343330;
  --text: #efeeeb;
  --text-2: #a5a4a1;
}

:root[data-theme="dark"] body {
  --band: var(--page-a-deep);
  --band-text: var(--text);
}

/* Each page owns one hue, optionally a second (design-direction section 7). */
[data-page="home"] {
  --page-a: var(--green-fill);
  --page-a-ink: var(--green-ink);
  --page-a-deep: var(--green-deep);
  --page-b: var(--lavender-fill);
  --page-b-ink: var(--lavender-ink);
}
[data-page="photos"] {
  --page-a: var(--sky-fill);
  --page-a-ink: var(--sky-ink);
  --page-a-deep: var(--sky-deep);
}
[data-page="music"] {
  --page-a: var(--lavender-fill);
  --page-a-ink: var(--lavender-ink);
  --page-a-deep: var(--lavender-deep);
  --page-b: var(--blue-fill);
  --page-b-ink: var(--blue-ink);
}
[data-page="djing"] {
  --page-a: var(--orange-fill);
  --page-a-ink: var(--orange-ink);
  --page-a-deep: var(--orange-deep);
  --page-b: var(--yellow-fill);
  --page-b-ink: var(--yellow-ink);
}
[data-page="writing"] {
  --page-a: var(--yellow-fill);
  --page-a-ink: var(--yellow-ink);
  --page-a-deep: var(--yellow-deep);
}
[data-page="off-leash"] {
  --page-a: var(--orange-fill);
  --page-a-ink: var(--orange-ink);
  --page-a-deep: var(--orange-deep);
}
[data-page="o40"] {
  --page-a: var(--green-fill);
  --page-a-ink: var(--green-ink);
  --page-a-deep: var(--green-deep);
}

/* A section's own hue, for the Home doorways. */
.hue-sky { --hue: var(--sky-fill); --hue-ink: var(--sky-ink); }
.hue-lavender { --hue: var(--lavender-fill); --hue-ink: var(--lavender-ink); }
.hue-orange { --hue: var(--orange-fill); --hue-ink: var(--orange-ink); }
.hue-yellow { --hue: var(--yellow-fill); --hue-ink: var(--yellow-ink); }

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  --band: var(--page-a);
  --band-text: var(--page-a-ink);
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-1);
  font-weight: 400;
  line-height: 1.5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* No italics, ever: emphasis is a weight change. */
em,
i,
cite,
dfn,
var,
address {
  font-style: normal;
}
em,
i {
  font-weight: 600;
}

b,
strong {
  font-weight: var(--bold);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: var(--bold);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: var(--s-2) var(--s-3);
  background: var(--text);
  color: var(--bg);
}
.skip-link:focus {
  top: var(--s-2);
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

/* Thin + bold within one line -- the typographic signature. */
.thin {
  font-weight: var(--thin);
}

.display {
  font-size: var(--step-5);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.label {
  font-family: var(--font-mono);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.lead {
  font-size: var(--step-2);
  line-height: 1.45;
  max-width: 40ch;
}

/* Missing copy is visible on purpose -- never shipped silently. */
.todo {
  font-family: var(--font-mono);
  font-size: var(--step-0);
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--text-2);
  border: 1px dashed var(--text-2);
  padding: var(--s-2) var(--s-3);
  max-width: 60ch;
}

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

.site-header {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "mark toggle"
    "nav nav";
  align-items: center;
  gap: var(--s-3) var(--s-4);
  padding-block: var(--s-5) var(--s-4);
}

.wordmark {
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
}

.site-header .wordmark {
  grid-area: mark;
}

.site-nav {
  grid-area: nav;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-5);
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-block;
  padding-block: var(--s-1);
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover {
  color: var(--text);
}
.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: currentColor;
}

.theme-toggle {
  grid-area: toggle;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
}
.theme-toggle[hidden] {
  display: none;
}
/* A small circle, half plane, half ink. */
.theme-toggle__icon {
  width: 16px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

@media (min-width: 720px) {
  .site-header {
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "mark nav toggle";
    padding-block: var(--s-6);
  }
}

/* ---------- Footer: one pixel edge into the page's colour ---------- */

.site-footer {
  margin-top: var(--section);
  color: var(--band);
}

.pixel-edge {
  --cells: 18;
  position: relative;
  height: calc(var(--pixel) * 4);
  margin-bottom: -1px; /* no hairline between edge and band */
  /* the flat bottom step between the two staircases */
  background: linear-gradient(to top, currentColor calc(var(--pixel) + 1px), transparent 0);
}
.pixel-edge svg {
  position: absolute;
  bottom: 0;
  display: block;
  width: calc(var(--pixel) * var(--cells));
  height: 100%;
}
.pixel-edge__left {
  left: 0;
}
.pixel-edge__right {
  right: 0;
  transform: scaleX(-1);
}

.site-footer__band {
  background: var(--band);
  color: var(--band-text);
  padding-block: var(--s-7) var(--s-8);
}

.site-footer__grid {
  display: grid;
  gap: var(--s-5);
}
.site-footer .label {
  color: inherit;
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer a {
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
.site-footer .wordmark {
  font-size: var(--step-3);
  white-space: nowrap;
}

@media (min-width: 720px) {
  .site-footer__grid {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

/* ---------- Window: a hard shape cut into the page, the world behind it ---------- */

.window {
  --shape: inset(0);
  position: relative;
  display: block;
  aspect-ratio: 1;
  margin: 0;
  clip-path: var(--shape);
  background: var(--hue, var(--page-a)); /* flat page colour until there's a photo */
  overflow: clip;
}

/* The world is its own layer, oversized so it can drift without showing edges.
   Later it can become a canvas or a 3D scene without touching the window. */
.window__world {
  position: absolute;
  inset: -12% 0;
  display: block;
  will-change: transform;
}
.window__world img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale 300ms ease;
}

.window--square { --shape: inset(0); }
.window--rect { --shape: inset(0); aspect-ratio: 4 / 5; }
.window--circle { --shape: circle(50%); }
.window--rhombus { --shape: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.window--cut { --shape: polygon(0 0, 82% 0, 100% 18%, 100% 100%, 0 100%); }
.window--step {
  /* top edge is a pixel staircase: 6 columns, 3 steps */
  --shape: polygon(
    0 25%, 16.666% 25%, 16.666% 12.5%, 50% 12.5%, 50% 0, 83.333% 0, 83.333% 12.5%,
    100% 12.5%, 100% 100%, 0 100%
  );
}

/* Pop-out window (circle only): a black-and-white cutout sits in the window
   and leans out over its top edge. The window colour stays flat behind it.
   Set on the figure, as fractions of the window's diameter D:
     --pop-x, --pop-y  image top-left, relative to the window's top-left
     --pop-w           image width
     --pop-r           image height / width
     --pop-line        below this line the image is clipped to the circle;
                       above it, it may leave the window
   The mask (circle + everything above --pop-line) sits on .window__world and
   stays put; the image inside it can move on hover. The white stroke that
   lets dark hair read on a dark page is baked into the image file. */
.window--pop {
  --pop-feather: 0.015; /* soft edge on the circle, as a share of its radius */
  clip-path: none;
  overflow: visible;
  background: none;
  /* headroom for whatever leans out (percentages resolve against the width) */
  margin-top: calc(var(--pop-y) * -100%);
}
/* The colour disc ends just inside the image's soft edge, so no green rim
   shows between the photo and the perimeter. */
.window--pop::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: circle(calc(50% * (1 - var(--pop-feather)) - 1px));
  background: var(--hue, var(--page-a));
}
.window--pop .window__world {
  --wh: calc(var(--pop-w) * var(--pop-r));
  inset: auto;
  left: calc(var(--pop-x) * 100%);
  top: calc(var(--pop-y) * 100%);
  width: calc(var(--pop-w) * 100%);
  aspect-ratio: 1 / var(--pop-r);
  will-change: auto;
  -webkit-mask-image:
    radial-gradient(
      ellipse calc(50% / var(--pop-w)) calc(50% / var(--wh))
        at calc((0.5 - var(--pop-x)) / var(--pop-w) * 100%) calc((0.5 - var(--pop-y)) / var(--wh) * 100%),
      #000 calc(100% * (1 - var(--pop-feather))), transparent 100%
    ),
    linear-gradient(#000 calc(100% - 2%), transparent);
  mask-image:
    radial-gradient(
      ellipse calc(50% / var(--pop-w)) calc(50% / var(--wh))
        at calc((0.5 - var(--pop-x)) / var(--pop-w) * 100%) calc((0.5 - var(--pop-y)) / var(--wh) * 100%),
      #000 calc(100% * (1 - var(--pop-feather))), transparent 100%
    ),
    linear-gradient(#000 calc(100% - 2%), transparent);
  -webkit-mask-size: 100% 100%, 100% calc((var(--pop-line) - var(--pop-y)) / var(--wh) * 100%);
  mask-size: 100% 100%, 100% calc((var(--pop-line) - var(--pop-y)) / var(--wh) * 100%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 0 0;
  mask-position: 0 0;
}
.window--pop .window__world img {
  object-fit: contain;
  transform-origin: 50% 100%;
}
/* Hover: the cutout leans out a little further; its base stays in the window.
   Transform only, on its own layer, so it starts on the first frame. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .window--pop .window__world img {
    will-change: transform;
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .window--pop:hover .window__world img {
    transform: scale(1.03);
  }
}

/* ---------- Tile grid: bathroom tiles, grout not gaps ---------- */

.tiles-wrap {
  container-type: inline-size;
}

.tiles {
  --cols: 2;
  --tile: calc((100cqi - (var(--cols) + 1) * var(--grout)) / var(--cols));
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: var(--tile);
  grid-auto-flow: dense;
  gap: var(--grout);
  padding: var(--grout);
  margin: 0;
  list-style: none;
}

@container (min-width: 640px) {
  .tiles {
    --cols: 4;
  }
}

/* Grout: each tile's 1px outline sits in the 1px gap, so neighbours share one
   line and a missing tile at the end of a row shows the plane, not a grey block. */
.tile,
.entry,
.listing > li {
  outline: var(--grout) solid var(--line);
}

.tile {
  position: relative;
  min-width: 0;
  background: var(--paper);
  overflow: clip;
}
.tile--2x1 { grid-column: span 2; }
.tile--1x2 { grid-row: span 2; }
.tile--2x2 { grid-column: span 2; grid-row: span 2; }

/* Tiles clip their content, so the focus ring sits just inside the tile edge. */
.tile :focus-visible {
  outline-offset: -5px;
}

.tile--empty {
  display: grid;
  place-items: start;
  padding: var(--s-3);
}

.tile__photo {
  display: block;
  width: 100%;
  height: 100%;
}
.tile__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale 300ms ease;
}

@media (hover: hover) {
  .tile__photo:hover img {
    scale: 1.03;
  }
}

/* ---------- Page head ---------- */

/* Phone: title and a small window share the first row; everything else runs
   full width under them. From 720px: 12 columns, text left, window right. */
.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: var(--s-5);
  align-items: center;
  padding-block: var(--s-7) var(--s-8);
}

.page-head h1 {
  font-size: var(--step-4);
  font-weight: var(--thin);
  letter-spacing: -0.03em;
}
.page-head__text {
  display: contents;
}
.page-head__text > *,
.page-head > .todo {
  grid-column: 1 / -1;
}
.page-head__text > h1 {
  grid-column: 1;
  grid-row: 1;
}
.page-head .window {
  grid-column: 2;
  grid-row: 1;
  width: 88px;
}

@media (min-width: 720px) {
  .page-head {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--s-6);
    align-items: end;
  }
  .page-head__text {
    display: block;
    grid-column: 1 / span 8;
  }
  .page-head__text > * + * {
    margin-top: var(--s-5);
  }
  .page-head > .todo {
    grid-column: 1 / span 8;
  }
  .page-head .window {
    grid-column: 10 / span 3;
    grid-row: 1;
    justify-self: end;
    width: 100%;
    max-width: 280px;
  }
}

/* ---------- Home ---------- */

.hero {
  display: grid;
  gap: var(--s-7);
  padding-block: var(--s-6) var(--section);
  /* a pop-out image may be wider than its window; never let it scroll the page */
  overflow-x: clip;
}

.hero h1 {
  font-size: var(--step-4);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 18ch;
}

.hero .window {
  width: min(78vw, 520px);
  justify-self: end;
}

.hero .todo {
  grid-column: 1 / -1;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: center;
    gap: var(--s-6);
  }
  .hero h1 {
    grid-column: 1 / span 6;
  }
  /* The photo gets the weight: half the grid (Omar's Figma exploration). */
  .hero .window {
    grid-column: 7 / span 6;
    width: 100%;
  }
}

/* Doorways: one tile per section, each with a small window in its own hue. */
.door {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: var(--s-4);
  text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease;
}
.door__title {
  font-size: var(--step-3);
  font-weight: var(--thin);
  letter-spacing: -0.03em;
  line-height: 1;
}
/* Quiet: each doorway carries its section's colour as a small window, so the
   four hues never read as a palette (design-direction section 7, rule 3). */
.door .window {
  align-self: flex-end;
  width: clamp(36px, 12cqi, 80px);
}
.tile--2x2 .door .window {
  width: clamp(56px, 18cqi, 160px);
}

@media (min-width: 720px) {
  .door {
    padding: var(--s-5);
  }
}

@media (hover: hover) {
  .door:hover {
    background: var(--hue);
    color: var(--hue-ink);
  }
  .door:hover .window {
    background: var(--hue-ink);
  }
}

/* ---------- Entries (Music, DJing): one tile per recording ---------- */

.entries {
  display: grid;
  gap: var(--grout);
  padding: var(--grout);
}

@media (min-width: 900px) {
  .entries {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.entry {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-4);
  background: var(--paper);
}

@media (min-width: 720px) {
  .entry {
    padding: var(--s-6);
  }
}

.entry h2 {
  font-size: var(--step-3);
  letter-spacing: -0.03em;
}

.entry__head {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.embed {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  margin-top: auto;
  padding: var(--s-4);
  background: var(--bg-2);
}
.embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.embed--audio {
  aspect-ratio: auto;
  min-height: 166px;
}
/* The SoundCloud classic player is a fixed 166px tall. */
.embed--audio iframe {
  height: 166px;
}

/* ---------- Writing ---------- */

.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: var(--grout) solid var(--line);
}
.post-row {
  border-bottom: var(--grout) solid var(--line);
}
.post-row a {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-5) 0;
  text-decoration: none;
}
.post-row__title {
  font-size: var(--step-3);
  font-weight: var(--bold);
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.post-row__summary {
  color: var(--text-2);
}
@media (hover: hover) {
  .post-row a:hover .post-row__title {
    text-decoration: underline;
    text-decoration-color: var(--page-a);
    text-decoration-thickness: 4px;
    text-underline-offset: 0.12em;
  }
}
@media (min-width: 720px) {
  .post-row a {
    grid-template-columns: 9rem 1fr;
    column-gap: var(--s-6);
  }
  .post-row a > :not(time) {
    grid-column: 2;
  }
}
.post-list--empty {
  padding-block: var(--s-6);
  border-bottom: var(--grout) solid var(--line);
}

/* Post: pure reading */
.post {
  width: min(100% - 2 * var(--gutter), 66ch);
  margin-inline: auto;
  padding-block: var(--s-7) 0;
}
.post__head {
  display: grid;
  gap: var(--s-5);
  margin-bottom: var(--s-8);
}
.post__head .window {
  width: 56px;
}
.post__head h1 {
  font-size: var(--step-4);
  font-weight: var(--thin);
  letter-spacing: -0.03em;
}
.post__head h1 strong {
  font-weight: var(--bold);
}
.prose {
  font-size: 1.2rem;
  line-height: 1.6;
}
.prose > * + * {
  margin-top: 1.1em;
}
.prose h2,
.prose h3 {
  margin-top: 2em;
  letter-spacing: -0.02em;
}
.prose h2 {
  font-size: var(--step-3);
}
.prose h3 {
  font-size: var(--step-2);
}
.prose ul,
.prose ol {
  padding-left: 1.2em;
}
.prose blockquote {
  margin-inline: 0;
  padding-left: var(--s-5);
  border-left: 2px solid var(--page-a);
  color: var(--text-2);
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-2);
  padding: 0.1em 0.3em;
}

/* ---------- Plain pages (Off Leash, O40, 404) ---------- */

.listing {
  display: grid;
  gap: var(--grout);
  padding: var(--grout);
  margin: 0;
  list-style: none;
}
@media (min-width: 720px) {
  .listing {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.listing > li {
  display: grid;
  gap: var(--s-3);
  align-content: start;
  padding: var(--s-4);
  background: var(--paper);
}
@media (min-width: 720px) {
  .listing > li {
    padding: var(--s-6);
  }
}
.listing h2 {
  font-size: var(--step-3);
}
.listing__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.facts {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: var(--grout) solid var(--line);
}
.facts > div {
  display: grid;
  gap: var(--s-2);
  padding-block: var(--s-5);
  border-bottom: var(--grout) solid var(--line);
}
.facts dd {
  margin: 0;
}
.facts ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--s-2);
}
@media (min-width: 720px) {
  .facts > div {
    grid-template-columns: 12rem 1fr;
    column-gap: var(--s-6);
  }
}

.section {
  margin-top: var(--section);
}
.section > h2 {
  font-size: var(--step-3);
  font-weight: var(--thin);
  letter-spacing: -0.03em;
  margin-bottom: var(--s-6);
}

.stack > * + * {
  margin-top: var(--s-5);
}

/* ---------- Lightbox ---------- */

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: var(--s-4);
  border: 0;
  background: var(--bg);
  color: var(--text);
}
.lightbox[open] {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
  gap: var(--s-3);
}
.lightbox::backdrop {
  background: var(--bg);
}
.lightbox__figure {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  place-items: center;
  min-height: 0;
  margin: 0;
  touch-action: pan-y;
}
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.lightbox__count {
  grid-row: 1;
  align-self: center;
}
.lightbox__close {
  grid-row: 1;
  grid-column: 2;
}
.lightbox__nav {
  grid-row: 3;
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
}
.lightbox button {
  font: inherit;
  font-family: var(--font-mono);
  font-size: var(--step-0);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-width: 44px;
  min-height: 44px;
  padding: var(--s-2) var(--s-3);
  border: var(--grout) solid var(--line);
  border-radius: 0;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.lightbox button:hover {
  background: var(--page-a);
  color: var(--page-a-ink);
  border-color: var(--page-a);
}

@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] {
    animation: fade-in 150ms ease-out;
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* ---------- Lab ---------- */

.lab-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--s-6);
  align-items: end;
}
.lab-row figure {
  margin: 0;
}
.lab-row figcaption {
  margin-top: var(--s-3);
}
.lab-band {
  color: var(--band);
}
.lab-band__fill {
  height: var(--s-9);
  background: var(--band);
}
.lab-band--b {
  color: var(--page-b);
}
.lab-band--b .lab-band__fill {
  background: var(--page-b);
}

.plain-list {
  display: grid;
  gap: var(--s-3);
  margin: var(--s-5) 0 0;
  padding: 0;
  list-style: none;
}

.o40-second {
  width: min(60vw, 320px);
  margin-left: auto;
}
/* The live page titled its two images; the titles sit under their windows. */
.o40-caption {
  grid-column: 1 / -1;
  justify-self: end;
  text-align: right;
}
.section > .o40-caption {
  margin-top: var(--s-3);
}
@media (min-width: 720px) {
  .page-head > .o40-caption {
    grid-column: 10 / span 3;
    grid-row: 2;
  }
}
.plain-list .todo {
  display: inline;
  padding: 0 var(--s-1);
  border: 0;
  border-bottom: 1px dashed var(--text-2);
}

/* A real embed fills its box edge to edge. */
.embed:has(iframe) {
  padding: 0;
}
