/* Site styles — graph-paper desktop, split headline, dock navigation.
   Brutalist: hard 1.5px ink borders, hard offset shadows, no radii, no blur. */

:root {
  --paper: #E6E4DC;
  --ink: #111111;
  --muted: #57554F;
  --grid: rgba(17, 17, 17, .055);
  --grid-major: rgba(17, 17, 17, .09);

  /* flat fills behind images — never used for text */
  --orange: #FF6A2B;
  --acid: #D9F24B;
  --sky: #BCD6EA;
  --blush: #F6CFE0;
  --lilac: #CFC3EE;

  /* the sticky note in the projects pop-up: a physical sheet, so it keeps dark
     writing in both themes */
  --note: #E6DDAE;           /* a muted, slightly aged yellow */
  --note-ink: #111111;
  --note-muted: #4F4A36;

  /* the star logo next to the name (graphic only, never text) */
  --star: #8C2E28;

  --line: 1.5px;
  --border: var(--line) solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --pad: clamp(16px, 5vw, 88px);

  --sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  color-scheme: light;
}

/* dark theme: same structure, paper and ink swapped. The fills stay as they are
   because they only sit behind black 1-bit images. */
html[data-theme="dark"] {
  --paper: #151514;
  --ink: #E6E4DC;
  --muted: #A19E95;
  --star: #BE3F36;          /* lighter red so the star keeps 3:1 on dark paper */
  --grid: rgba(230, 228, 220, .05);
  --grid-major: rgba(230, 228, 220, .09);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  /* graph paper, shared by the page and the view-switch veil */
  --graph:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  --graph-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  background-color: var(--paper);
  background-image: var(--graph);
  background-size: var(--graph-size);
  background-position: -1px -1px;
  font: 400 17px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
p { margin: 0; }
img { max-width: 100%; }

.mono {
  font: 400 12px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 50;
  padding: 8px 12px; background: var(--ink); color: var(--paper);
  font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em;
}
.skip:focus { top: 16px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ----------------------------------------------------------------- top -- */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px clamp(16px, 3.4vw, 48px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 24px;          /* keeps the header 72px tall */
  white-space: nowrap;
  text-decoration: none;
  font: 500 15px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .22em;
}
/* The icon is a file, assets/img/mark.svg, used as a mask and filled with
   the --star red (a lighter red in dark mode). */
.brand-mark {
  flex: none;
  width: 24px;
  height: 24px;
  background: var(--star);
  -webkit-mask: url("img/mark.svg") center / contain no-repeat;
  mask: url("img/mark.svg") center / contain no-repeat;
}
.ext { display: flex; gap: clamp(12px, 2vw, 28px); }
.ext a {
  padding: 4px 2px;
  text-decoration: none;
  font: 400 13px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .16em;
}
.ext a:hover { background: var(--ink); color: var(--paper); }
@media (max-width: 560px) {
  .brand { gap: 8px; font-size: 13px; letter-spacing: .12em; }
  .brand-mark { width: 20px; height: 20px; }
  .ext a { font-size: 12px; letter-spacing: .1em; }
}

/* --------------------------------------------------------------- views -- */
.js .view { display: none; }
.js .view.is-active { display: block; }
/* View switch: the content never animates. Animating the view itself (slide or
   fade) made the browser move it to its own layer and back, and the pixelated
   1-bit images shifted by a pixel each time, so the dither jittered. Instead a
   blank sheet of the same graph paper sits over the new view and fades away. */
main { position: relative; }
.js main.is-switching::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background-color: var(--paper);
  background-image: var(--graph);
  background-size: var(--graph-size);
  background-position: -1px -1px;
  background-attachment: fixed; /* lines up with the page's own grid */
  animation: veil .28s cubic-bezier(.2, .7, .2, 1) forwards;
}
@keyframes veil { from { opacity: 1; } to { opacity: 0; } }

.view:not(.view-home) {
  max-width: 1400px;
  margin-inline: auto;
  padding: 24px var(--pad) 180px;
}
.view-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 36px;
  border-bottom: var(--border);
}
.view-head h2 {
  margin: 0;
  font: italic 400 clamp(48px, 6vw, 80px)/.9 var(--serif);
  letter-spacing: -.01em;
}
.view-head h2:focus { outline: none; }

/* ---------------------------------------------------------------- home -- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: clamp(16px, 2.6vw, 44px);
  min-height: calc(100svh - 190px);
  padding: 24px var(--pad) 120px;
  --hl: clamp(44px, 6.4vw, 112px);
}
.side { position: relative; display: flex; flex-direction: column; gap: 14px; }
.side-l { justify-self: end; }
.side-r { justify-self: start; }

.hello {
  position: absolute;
  left: .1em;
  bottom: 100%;
  margin-bottom: 10px;
  font: 400 16px/1 var(--mono);
  letter-spacing: .04em;
}
.hl { white-space: nowrap; }
.hl-a {
  font: 400 var(--hl)/1 var(--sans);
  letter-spacing: -.045em;
}
.hl-b {
  font: 400 calc(var(--hl) * 1.2)/calc(1 / 1.2) var(--serif);
  letter-spacing: -.015em;
  transform: translateY(.05em);
}
.cap {
  padding-left: .15em;
  font: 400 15px/1.3 var(--mono);
  letter-spacing: .03em;
  color: var(--muted);
}
.cap a { color: var(--ink); text-underline-offset: 3px; }

.object { margin: 0; width: clamp(220px, 27vw, 400px); }
.object-btn {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  cursor: grab;
  touch-action: none;
  background:
    linear-gradient(var(--ink), var(--ink)) left top / 16px var(--line) no-repeat,
    linear-gradient(var(--ink), var(--ink)) left top / var(--line) 16px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right top / 16px var(--line) no-repeat,
    linear-gradient(var(--ink), var(--ink)) right top / var(--line) 16px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left bottom / 16px var(--line) no-repeat,
    linear-gradient(var(--ink), var(--ink)) left bottom / var(--line) 16px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 16px var(--line) no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / var(--line) 16px no-repeat;
}
.object-btn:active { cursor: grabbing; }
.object-btn canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
.object-cap {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font: 400 11px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--muted);
}

/* small screens: keep the sentence together, object underneath */
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    justify-items: center;
    align-content: start;
    row-gap: 0;
    min-height: auto;
    padding-top: clamp(24px, 6vh, 56px);
    padding-bottom: 150px;
    text-align: center;
    --hl: clamp(44px, 13.5vw, 76px);
  }
  .side { display: contents; }
  .hello { position: static; order: 1; margin: 0 0 12px; }
  .hl-a { order: 2; }
  .hl-b { order: 3; transform: none; margin-top: -.06em; }
  .object { order: 4; width: min(66vw, 280px); margin: 22px 0 18px; }
  .side-l .cap { order: 5; }
  .side-r .cap { order: 6; margin-top: 4px; }
}

/* ------------------------------------------------------------ projects -- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 32px);
}
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }

.card {
  background: var(--paper);
  border: var(--border);
  transition: transform .12s ease-out, box-shadow .12s ease-out;
}
.card:hover,
.card:focus-within {
  transform: translate(-4px, -4px);
  box-shadow: 8px 8px 0 var(--ink);
}
.card-link { display: block; padding: 10px 10px 22px; text-decoration: none; }
.card-link:focus-visible { outline: none; }
.card-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--fill, var(--sky));
  border: var(--border);
}
.card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 6px 0;
  font: 400 12px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.client { display: inline-flex; align-items: center; gap: 8px; }
.sq { display: inline-block; width: 10px; height: 10px; background: var(--fill); border: var(--border); }
.tag { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px 4px; border: var(--border); }
.tag-live::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--orange);
  border: 1px solid var(--ink);
  animation: blink 1.2s steps(2, jump-none) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.card-title {
  margin: 12px 6px 0;
  font: italic 400 clamp(36px, 3.6vw, 52px)/1 var(--serif);
  letter-spacing: -.01em;
}
.card-desc { margin: 8px 6px 0; max-width: 46ch; font-size: 15px; color: var(--muted); }

/* ------------------------------------------------------------- writing -- */
.writing {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}
.writing-fig { position: sticky; top: 24px; margin: 0; }
.writing-fig img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--lilac);
  border: var(--border);
  box-shadow: var(--shadow);
  image-rendering: pixelated;
}
.writing-fig figcaption { margin-top: 14px; }
.credit { font-size: .78em; letter-spacing: .1em; }   /* artist credit: smaller than the caption */
.writing-list { list-style: none; margin: 0; padding: 0; border-top: var(--border); }
.writing-list a {
  display: grid;
  grid-template-columns: 6ch 1fr auto 1.2em;
  align-items: baseline;
  gap: 20px;
  padding: 18px 0;
  border-bottom: var(--border);
  text-decoration: none;
}
.writing-list a:hover,
.writing-list a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  box-shadow: -12px 0 0 var(--ink), 12px 0 0 var(--ink);
  outline: none;
}
.writing-list a:hover .nk, .writing-list a:focus-visible .nk { color: inherit; }
.writing-list time { font: 400 13px/1 var(--mono); letter-spacing: .06em; }
.nt { font-size: clamp(19px, 1.7vw, 24px); font-weight: 450; letter-spacing: -.02em; line-height: 1.2; }
.nk { font: 400 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.writing-list .arr { text-align: right; }
@media (max-width: 820px) {
  .writing { grid-template-columns: 1fr; }
  .writing-fig { position: static; max-width: 420px; }
  .writing-list a { grid-template-columns: 6ch 1fr 1.2em; row-gap: 6px; }
  .nk { grid-column: 2; grid-row: 2; }
  .writing-list .arr { grid-column: 3; grid-row: 1; }
}

/* ------------------------------------------------------------- profile -- */
.profile {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: start;
}
.portrait { margin: 0; }
/* a real photo in its own colours, scaled smoothly (unlike the pixelated 1-bit images) */
.portrait picture { display: block; }
.portrait img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 3 / 4;
  border: var(--border);
  box-shadow: var(--shadow);
}
.portrait figcaption { margin-top: 14px; }
/* the bouncy 67: a see-through canvas over the whole window. Clicks pass through
   it; site.js-style listeners on the page pick up drags that start on the 67. */
.sixseven { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; }
.sixseven[hidden], html:not(.js) .sixseven { display: none; }
html.is-over-67, html.is-over-67 * { cursor: grab !important; }
html.is-grabbing-67, html.is-grabbing-67 * { cursor: grabbing !important; user-select: none; }
.profile-body { max-width: 680px; }
.profile-body > p { margin-bottom: 1em; max-width: 58ch; }
.lede {
  font: 400 clamp(30px, 3.2vw, 44px)/1.08 var(--serif);
  letter-spacing: -.01em;
  text-wrap: balance;
}
.lede em { font-style: italic; }
.sub {
  margin: 44px 0 0;
  padding-bottom: 10px;
  border-bottom: var(--border);
  color: var(--ink);
}
.cv { list-style: none; margin: 0; padding: 0; }
.cv li {
  display: grid;
  grid-template-columns: 11ch 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 13px 0;
  border-bottom: 1px solid var(--ink);
}
.yr { font: 400 13px/1 var(--mono); letter-spacing: .04em; }
.role { font-weight: 500; }
.org { font: 400 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 16px 0 0; padding: 0; }
.chips li {
  padding: 7px 10px 6px;
  background: var(--paper);
  border: var(--border);
  font: 400 12px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
}
@media (max-width: 820px) {
  .profile { grid-template-columns: 1fr; }
  .portrait { max-width: 320px; }
  .cv li { grid-template-columns: 9ch 1fr; }
  .org { grid-column: 2; }
}

/* ---------------------------------------------------------------- dock -- */
.dock {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 30;
  display: flex;
  transform: translateX(-50%);
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow);
}
.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 78px;
  padding: 10px 14px 9px;
  text-decoration: none;
  border-right: var(--border);
}
.dock-item:last-child { border-right: 0; }
.dock-item svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
  transition: transform .15s cubic-bezier(.3, 1.6, .5, 1);
}
.dock-item span { padding: 2px 6px 1px; font: 400 12px/1 var(--mono); letter-spacing: .04em; }
.dock-item:hover { background: var(--acid); color: #111111; } /* acid is light in both themes */
.dock-item:hover svg { transform: translateY(-3px); }
.dock-item[aria-current="page"] span { background: var(--ink); color: var(--paper); }
.dock-item:focus-visible { outline-offset: -5px; }
@media (max-width: 400px) {
  .dock-item { min-width: 0; padding-inline: 7px; }
  .dock-item span { padding-inline: 4px; font-size: 11px; letter-spacing: .02em; }   /* "projects" and "writings" fit at 360 px */
  .dock-item svg { width: 26px; height: 26px; }
}

.stamp {
  position: fixed;
  right: clamp(16px, 3.4vw, 48px);
  bottom: 26px;
  z-index: 5;
  font-size: 11px;
  letter-spacing: .16em;
}
@media (max-width: 1100px) { .stamp { display: none; } }

/* dark-mode switch: bottom right, just above the "last updated" stamp */
.theme-toggle {
  position: fixed;
  right: clamp(16px, 3.4vw, 48px);
  bottom: 54px;
  z-index: 31;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 6px;
  color: var(--ink);
  background: var(--paper);
  border: var(--border);
  box-shadow: 3px 3px 0 var(--ink);
  font: 400 11px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .16em;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--ink); color: var(--paper); }
.theme-toggle .tt-box { width: 9px; height: 9px; border: 1.5px solid currentColor; }
.theme-toggle[aria-pressed="true"] .tt-box { background: currentColor; }
html:not(.js) .theme-toggle { display: none; }
@media (max-width: 1100px) { .theme-toggle { bottom: 26px; } }
/* phones: the dock fills the bottom edge, so sit just above it */
@media (max-width: 640px) { .theme-toggle { bottom: 102px; } }

@media (prefers-reduced-motion: reduce) {
  .js main.is-switching::after { display: none; }
  .card, .dock-item svg { transition: none; }
  .tag-live::before { animation: none; }
}

/* without JS the canvas stays blank: hide the object, keep the sentence */
html:not(.js) .object { display: none; }

/* ------------------------------------------------------ projects pop-up -- */
/* A window (title bar, hard border, offset shadow) on the same graph paper as
   the pages, with the project's image on the left and its write-up on a
   sticky note on the right.
   Opening: the window is revealed from the centre with clip-path, which uncovers
   it without moving it (moving the 1-bit image would make its dither jitter),
   and the note, which is only text, drops into place on top. */
.card-link { cursor: pointer; }
.win {
  width: min(1188px, calc(100vw / var(--z) - 32px));
  max-height: calc(100svh / var(--z) - 40px);
  padding: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: var(--graph);
  background-size: var(--graph-size);
  background-position: -1px -1px;
  background-attachment: fixed;         /* grid lines up with the page behind */
  border: var(--border);
  box-shadow: 8px 8px 0 var(--ink);
  overflow: auto;
}
.win::backdrop { background: var(--paper); opacity: .72; }
.win-bar {
  position: sticky; top: 0; z-index: 1;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 10px 13px;
  background: var(--paper);
  border-bottom: var(--border);
}
.win-file { grid-column: 2; min-width: 0; margin: 0; font: 500 13px/1.3 var(--mono); letter-spacing: .08em; text-align: center; overflow-wrap: anywhere; }   /* long filenames wrap on phones */
.win-close {
  grid-column: 3; justify-self: end;
  width: 28px; height: 28px; padding: 0;
  font: 400 19px/1 var(--mono); color: var(--ink);
  background: var(--paper); border: var(--border); cursor: pointer;
}
.win-close:hover { background: var(--ink); color: var(--paper); }
.win-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);   /* the picture at its card's size; the note takes the rest */
  gap: clamp(24px, 4.4vw, 72px);
  align-items: center;
  padding: clamp(20px, 4.4vw, 64px);
}
/* The pop-up shows the whole 1-bit image at the same scale as its card (site.js
   sets the frame's width and shape from the picture), so the dither dots are the
   same size in both places. In a narrow window the frame is capped and the
   picture is scaled down to fit, still whole. Videos play in the same frame. */
.win-media { position: relative; box-sizing: content-box; margin: 0; width: 480px; max-width: min(calc(100% - 2 * var(--line)), 54vw); aspect-ratio: 4 / 3; overflow: hidden; background: var(--fill, var(--sky)); border: var(--border); }
.win-media img { position: absolute; left: 0; top: 0; display: block; max-width: none; image-rendering: pixelated; }
/* video cards: the dithered picture shows first, then the video fades in on top,
   letterboxed in black where its shape differs from the picture's.
   Only the video layer changes opacity, so the 1-bit picture never moves. */
.win-media iframe, .win-media video {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; object-fit: contain;
  opacity: 0; transition: opacity .45s ease;
}
.win-media.is-playing iframe, .win-media.is-playing video { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .win-media iframe, .win-media video { transition: none; } }

/* the sticky note: larger title and padding; the details and description are set smaller */
.paper {
  position: relative;
  padding: 42px 32px 32px;
  color: var(--note-ink);
  background: var(--note);
  border: 1px solid var(--note-ink);
  box-shadow: 6px 6px 0 var(--ink);
  transform: rotate(-1.5deg);
}
.paper-tape {
  position: absolute; top: -14px; left: 50%;
  width: 116px; height: 28px; margin-left: -58px;
  background: rgba(255, 255, 255, .5);
  border: 1px dashed rgba(17, 17, 17, .35);
  transform: rotate(3deg);
}
.paper-title { margin: 0 0 17px; font: italic 400 clamp(38px, 3.6vw, 53px)/1 var(--serif); letter-spacing: -.01em; }
.paper-meta { display: grid; grid-template-columns: auto 1fr; gap: 7px 19px; margin: 0 0 22px; padding: 12px 0; border-block: 1px solid var(--note-ink); }
.paper-meta dt { font: 400 9.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--note-muted); }
.paper-meta dd { margin: 0; text-align: right; font-size: 12.25px; }
.paper-text p { margin: 0 0 .8em; font-size: 15.2px; line-height: 1.55; }
.paper-status { margin: 17px 0 0; font: 400 11.2px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--note-muted); }
.paper-status a, .paper-text a { color: var(--note-ink); text-decoration: underline; text-underline-offset: 3px; }
.paper-status a:hover, .paper-text a:hover { background: var(--note-ink); color: var(--note); text-decoration: none; }
.paper-status a::after { content: " ↗"; }

/* opening animation (added by site.js each time the window opens) */
.win.is-opening { animation: win-reveal .26s cubic-bezier(.2, .7, .2, 1); }
.win.is-opening::backdrop { animation: win-wash .2s ease-out; }
.win.is-opening .paper { animation: paper-drop .42s cubic-bezier(.25, 1.4, .45, 1) .12s backwards; }
@keyframes win-reveal { from { clip-path: inset(48% 48% 48% 48%); } to { clip-path: inset(-12px -12px -12px -12px); } }
@keyframes win-wash { from { opacity: 0; } }
@keyframes paper-drop { from { opacity: 0; transform: translateY(-22px) rotate(-7deg); } }

@media (max-width: 760px) {
  .win-body { grid-template-columns: minmax(0, 1fr); }
  .win-media { max-width: calc(100% - 2 * var(--line)); }   /* one column: the picture can use the full width */
  .paper { transform: rotate(-1deg); }
}
@media (prefers-reduced-motion: reduce) {
  .win.is-opening, .win.is-opening::backdrop, .win.is-opening .paper { animation: none; }
  .paper, .paper-tape { transform: none; }
}

/* ---------------------------------------------------------------- scale -- */
/* The whole site is zoomed by --z, which depends on the window's width:
   110% on phones, tablets and big screens (an FHD 1920 px monitor), but 88% on
   laptop-width windows (a MacBook's 1280-1600 px), where 110% felt too big, and
   99% in between. Media queries still see the real window width.
   The dithered object on the home page is a further 1.15/1.1 on top. */
:root { --z: 1.1; }
@media (min-width: 1000px) { :root { --z: .88; } }
@media (min-width: 1600px) { :root { --z: .99; } }
@media (min-width: 1800px) { :root { --z: 1.1; } }
html { zoom: var(--z); }
.object { width: calc(clamp(220px, 27vw, 400px) * 1.15 / 1.1); }
@media (max-width: 820px) {
  .object { width: calc(min(66vw, 280px) * 1.15 / 1.1); }
}
/* zoom also enlarges heights given in viewport units, so divide those back down
   to keep the home page exactly one screen tall */
body { min-height: calc(100svh / var(--z)); }
.hero { min-height: calc(100svh / var(--z) - 190px); }
@media (max-width: 820px) { .hero { min-height: auto; } }
/* phones: at 110% the name and the three links need a little less spacing to share a row */
@media (max-width: 560px) {
  .brand { letter-spacing: .08em; }
  .ext { gap: 8px; }
  .ext a { letter-spacing: .05em; padding-inline: 1px; }
}
@media (max-width: 380px) {
  .brand { font-size: 12px; gap: 6px; }
  .brand-mark { width: 18px; height: 18px; }
  .ext a { font-size: 11px; }
}
/* the top bar (name, star and links) is a further 10% larger than the rest;
   phones only have room for a little of that, so they get less */
.top { zoom: 1.1; }
@media (max-width: 560px) { .top { zoom: 1.04; } }
@media (max-width: 380px) { .top { zoom: 1; } }

