@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* Only the day-mode art uses 500, so night visitors never download it. */
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* Night is the default. Day applies once picked (main.js remembers the choice). */
:root {
  --bg: #0f1624;
  --fg: #e9eef5;
  --dim: #8b98aa;
  --coral: #7fe0c3;
  --lorenz: #c9954a;
  --lorenz-head: #ffffff;
  --art-weight: 400;
  color-scheme: dark;
}
/* Day: thin glyphs fade on a light page, so the art uses heavier strokes and deeper ink. */
:root[data-mode="day"] {
  --bg: #f6f7f5;
  --fg: #18212b;
  --dim: #66717d;
  --coral: #112a50;
  --lorenz: #6e3a00;
  --lorenz-head: #18212b;
  --art-weight: 500;
  color-scheme: light;
}

[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  transition: background-color .5s, color .5s;
}
body {
  font-family: "Geist", "Helvetica Neue", Arial, sans-serif;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { opacity: .7; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 6px 4px;
  cursor: pointer;
  min-height: 32px;
  opacity: .6;
}
button[aria-pressed="true"] { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* One full-bleed viewport. svh keeps the height stable while mobile toolbars come and go. */
.page {
  --pad: clamp(16px, 3.4vw, 48px);
  --pp: clamp(12px, 1.6vw, 22px);
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  cursor: crosshair;
  touch-action: manipulation;
}

.art {
  position: absolute;
  margin: 0;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: var(--art-weight);
  line-height: 1.12;
  white-space: pre;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  transition: color .5s;
}
.probe { left: 0; top: 0; display: block; visibility: hidden; }
.coral { left: 0; top: 0; color: var(--coral); }
/* The Lorenz grid is a fixed 200 x 64 and is allowed to overflow small screens. */
.lorenz { inset: 0; display: flex; align-items: center; justify-content: center; }
.lorenz-trace { color: var(--lorenz); }
.lorenz-heads { color: var(--lorenz-head); }

.content {
  position: relative;
  height: 100%;
  box-sizing: border-box;
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  pointer-events: none;
}

/* Patches: text sits on the page color so the art stops around it. */
.patch, .caption {
  background: var(--bg);
  transition: background-color .5s, color .5s;
}
.patch { pointer-events: auto; cursor: auto; }

.hdr {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px 24px;
}
.name {
  order: 1;
  margin: -4px -10px;
  padding: 4px 10px;
  font-size: clamp(22px, 1.2vw + 14px, 28px);
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.modes {
  order: 2;
  display: flex;
  gap: 8px;
  padding: 0 8px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 13px;
}
@media (max-width: 640px) {
  .hdr { flex-direction: column; justify-content: flex-start; gap: 10px; }
  .modes { order: 0; margin-left: -12px; }
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
.intro {
  max-width: 46ch;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: var(--pp);
  margin: calc(-1 * var(--pp));
}
.intro p {
  margin: 0;
  font-size: clamp(16px, 0.5vw + 14px, 20px);
  line-height: 1.5;
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 15px;
  font-weight: 500;
}

.meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 13px;
  color: var(--dim);
  text-align: right;
}
.caption { padding: 4px 8px; }
.caption:empty { display: none; }
.controls { display: flex; gap: 12px; align-items: center; padding: 0 8px; }
.hint { opacity: .8; }
.switch { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

/* 404 */
.page.plain { cursor: auto; }
.lost { display: flex; flex-direction: column; gap: 18px; }
.lost p { margin: 0; font-size: clamp(16px, 0.5vw + 14px, 20px); line-height: 1.5; }
