@charset "UTF-8";
@font-face { font-family: 'Meie Script'; src: url('./fonts/meie-script.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
:root {
  color-scheme: dark;
  --panel-background: #0c0810;
  /* A plain metal rim under each WebGL rail, so every frame is in place from
     the first paint, before the rails and material have loaded. The rails
     straddle each edge; this is their inner half. */
  --rim: inset 0 0 0 2px #2b2830, inset 0 0 0 6px #7d7885, inset 0 0 0 9px #34303a;
  /* The one hyperlink look, shared with the byline's author name. */
  --link: #aa9bb7;
}
* { box-sizing: border-box; }
/* The scrollbar's space is always kept, so a page tall enough to scroll does
   not narrow the window and shift the whole machine sideways. */
html { min-width: 320px; background: var(--panel-background); scrollbar-gutter: stable; }
body { margin: 0; background: var(--panel-background); color: #d9d5df; font: 20px/1.5 'Times New Roman', Times, serif; }
/* The outer rail straddles the machine's edge and fills most of this
   padding; what shows past it is a thin, dark lip in the rails' own shadow
   tones, so the rail reads as seated in the page's edge. */
.enclosure {
  min-height: 100svh;
  padding: 12px;
  overflow: clip;
  border: 1px solid #07050a;
  background: linear-gradient(135deg, #3a3540, #1b1820 40%, #0e0b11 60%, #2a2630);
  box-shadow: inset 0 0 0 1px #4a4552, inset 0 0 0 2px #0c0a0f;
}
.machine { position: relative; isolation: isolate; display: grid; min-height: calc(100svh - 26px); grid-template-columns: minmax(clamp(44px, 13vw, 72px), 1fr) minmax(0, 636px) minmax(clamp(44px, 13vw, 72px), 1fr); grid-template-rows: 150px minmax(0, 1fr); background: #100a12; }
#matter { position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px); z-index: 4; pointer-events: none; image-rendering: pixelated; }
.chamber {
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 0;
  background: #110d13;
  box-shadow: var(--rim);
  overflow: hidden;
  /* A finger dragged over the flesh presses into it instead of scrolling. */
  touch-action: none;
}
.masthead { position: relative; grid-area: 1 / 2 / 2 / 3; min-width: 0; }
.chamber-top { position: absolute; inset: 0; }
.title-plate { position: absolute; z-index: 3; left: 27px; bottom: 25px; width: min(282px, calc(100% - 54px)); padding: 13px 20px; background: var(--panel-background); box-shadow: var(--rim); }
.chamber-left { grid-area: 1 / 1 / 3 / 2; }
.chamber-right { grid-area: 1 / 3 / 3 / 4; }
.reading-panel { position: relative; z-index: 3; grid-area: 2 / 2 / 3 / 3; display: flex; flex-direction: column; min-width: 0; padding: 25px 27px; background: var(--panel-background); box-shadow: var(--rim); }
/* The page, and a post with a photo, fill the panel's height, so a photo can
   take the height left over (see .post-figure). */
.page { flex: 1 0 auto; display: flex; flex-direction: column; }
.post:has(.post-figure) { flex: 1 0 auto; display: flex; flex-direction: column; container-type: inline-size; }
.post { color: #d9d5df; font: 400 clamp(17px, 15px + 0.6vw, 20px)/1.5 'Times New Roman', Times, serif; overflow-wrap: anywhere; }
.post h2 { margin: 0; min-height: 44px; color: #d9d5df; font: 400 44px/51px 'Meie Script', cursive; }
.post-byline { margin: -6px 0 0; min-height: 24px; font-size: clamp(14px, 12.5px + 0.4vw, 16px); }
/* Every link, anywhere, reads as one: the author's colour, underlined — never
   the browser's default blue. The title and menu opt out with their own
   classes (.title-link, .nav-link), which outrank this bare selector. */
a, .post-author { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-body { margin: 16px 0 0; }
/* Space, not rules, sets the hierarchy: a wider gap after each heading, and
   wider still between posts. */
.post-header + .post-body { margin-top: 30px; }
.post + .post { margin-top: 56px; }
/* Photos ship tiny and dithered and show with hard pixel edges, framed in
   iron like the title and menu (matter.js draws the frame into the figure).
   A photo never makes the page taller than the window: it counts only at its
   own pixel size (--w by --h) and grows into the height left in the panel, up
   to twice that and no wider than the column. The page scrolls only when not
   even its own size fits. */
.post-figure {
  --widest: calc((100cqw - 24px) * var(--h) / var(--w) + 24px);
  position: relative; flex: 1 1 0; align-self: flex-start;
  min-height: min(calc(var(--h) * 1px + 24px), var(--widest));
  max-height: min(calc(var(--h) * 2px + 24px), var(--widest));
  margin: 30px 0 0; padding: 12px; background: var(--panel-background); box-shadow: var(--rim);
}
.post-figure img { display: block; width: auto; height: 100%; image-rendering: pixelated; }
.post-figure .metal-frame { position: absolute; pointer-events: none; image-rendering: pixelated; }
.site-title { position: relative; margin: 0; height: 54px; font: 400 64px/64px 'Meie Script', cursive; color: #d9d5df; white-space: nowrap; user-select: none; -webkit-user-select: none; }
/* The title is also the way home; it keeps the title's own look. */
.title-link { color: inherit; text-decoration: none; outline: none; -webkit-user-drag: none; }
.site-title:has(.title-link:focus-visible) canvas { filter: drop-shadow(0 0 3px #aa9bb799); }
/* The text itself stays real: selectable, copyable, and wrapping as usual.
   Once title.js has drawn its pixel version over it, the glyphs underneath
   go transparent, while selection still highlights them. */
.pixel-text { position: relative; padding-inline: 6px; }
.pixel-text canvas { display: none; position: absolute; left: -10px; top: -10px; pointer-events: none; image-rendering: pixelated; }
.pixel-text.is-rendered canvas { display: block; }
.pixel-text.is-rendered .text-source, .pixel-text.is-rendered .text-source * { -webkit-text-fill-color: transparent; text-decoration-color: transparent; }
.pixel-text ::selection { background: #aa9bb759; -webkit-text-fill-color: transparent; }
/* A page's photos arrive with its words, not ahead of them. */
.text-pending .pixel-text, .text-pending .post-figure { visibility: hidden; }
/* Text appears the way a game's dialogue does: typed out line by line in
   whole steps. title.js builds each canvas's clip from --t and sets the
   timing; with no animation --t rests at 1 and the text shows in full. */
@property --t { syntax: '<number>'; inherits: false; initial-value: 1; }
.pixel-text.is-rendered canvas { animation: type-in var(--type-duration, 620ms) linear var(--type-delay, 0ms) both; }
@keyframes type-in { from { --t: 0; } to { --t: 1; } }
/* Held, not just hidden, until the page is ready: an animation keeps running
   under visibility: hidden, and the typing would be spent before anyone saw
   it. It starts from the first letter when .text-pending lifts. */
.text-pending .pixel-text.is-rendered canvas { animation: none; }

/* Navigation: a menu plate beside the title, sharing its bottom edge but
   only as tall as the links need, like a game's main menu. A
   stepped pixel cursor slides in beside the hovered or current page. */
.nav-plate { position: absolute; z-index: 3; right: 27px; bottom: 25px; display: flex; align-items: center; padding: 9px 16px 9px 10px; background: var(--panel-background); box-shadow: var(--rim); }
.nav-plate ul { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.nav-link { display: block; padding: 4px 6px 4px 20px; color: #bdb3c8; font: 400 17px/1.2 'Times New Roman', Times, serif; letter-spacing: 0.02em; text-decoration: none; outline: none; }
.nav-link::before { content: ''; position: absolute; left: 6px; top: 50%; width: 6px; height: 11px; margin-top: -5px; background: #d9d5df; clip-path: polygon(0 0, 2px 0, 2px 2px, 4px 2px, 4px 4px, 6px 4px, 6px 7px, 4px 7px, 4px 9px, 2px 9px, 2px 11px, 0 11px); opacity: 0; translate: -5px 0; transition: opacity 120ms steps(2), translate 220ms cubic-bezier(0.3, 1.8, 0.5, 1); }
.nav-link canvas { transition: filter 160ms, translate 220ms cubic-bezier(0.3, 1.8, 0.5, 1); }
.nav-link:hover::before, .nav-link:focus-visible::before, .nav-link[aria-current='page']::before { opacity: 1; translate: 0 0; }
.nav-link:hover::before, .nav-link:focus-visible::before { animation: cursor-bob 0.7s steps(2) infinite; }
.nav-link:hover canvas, .nav-link:focus-visible canvas { translate: 2px 0; filter: brightness(1.3) drop-shadow(0 0 3px #aa9bb799); }
.nav-link[aria-current='page'] canvas { filter: brightness(1.3); }
.nav-link:focus-visible { outline: 1px dashed #aa9bb7; outline-offset: -1px; }
.nav-link:active canvas { translate: 2px 1px; }
@keyframes cursor-bob { 50% { translate: 2px 0; } }

/* Changing page swaps only the reading panel: the old page goes at once, and
   the new one fades and settles in while its text types out (nav.js marks it
   .is-arriving). The material, frame and title stay live throughout. */
.page.is-arriving { animation: page-in 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes page-in { from { opacity: 0; translate: 0 6px; } }
@media (prefers-reduced-motion: reduce) {
  .pixel-text.is-rendered canvas, .nav-link::before, .page.is-arriving { animation: none !important; }
  .nav-link::before, .nav-link canvas { transition: none; }
}
.no-webgl .chamber { background: #222 url('./fallback.svg') center / cover; filter: grayscale(1); }
.no-webgl .chamber-top { background-size: auto 260%; }
/* The title and menu plates stand apart on wide screens. */
.masthead-plates { display: contents; }
/* Too narrow for the menu beside the title: the two merge into one plate
   across the whole masthead, the title centered above the menu. */
@media (max-width: 680px) {
  .masthead-plates { position: absolute; z-index: 3; left: 0; right: 0; top: 50%; translate: 0 -50%; display: flex; flex-direction: column; padding: 13px 16px 11px; background: var(--panel-background); box-shadow: var(--rim); }
  .title-plate, .nav-plate { --metal-frame: none; position: static; width: auto; height: auto; padding: 0; background: none; box-shadow: none; }
  .site-title { text-align: center; }
  .nav-plate { justify-content: center; margin-top: 12px; }
  .nav-link { font-size: 18px; }
}
@media (max-width: 560px) {
  .reading-panel { padding: 23px 20px; }
}
