:root { color-scheme: dark; font: 14px/1.7 "Courier New", Courier, monospace; letter-spacing: .025em; background: #000; color: #fff; }
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
a:hover, a[aria-current="page"] { text-decoration: underline; text-underline-offset: .2em; }
a:focus-visible, button:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }
.masthead { position: fixed; z-index: 2; top: 0; left: 0; padding: 2em 1ch 1ch 2em; background: #000; color: #fff; white-space: nowrap; }
.rule { width: 23ch; overflow: hidden; white-space: nowrap; letter-spacing: inherit; }
nav a { display: block; width: fit-content; min-height: 24px; }
.skip { position: fixed; top: 0; left: -100vw; z-index: 3; background: #000; padding: 1ch; }
.skip:focus { left: 0; }
.view { min-height: 100svh; }
.editorial { margin: 0; min-height: 100svh; display: grid; place-content: center; padding: 200px 8vw 88px; }
.editorial img { display: block; max-width: 100%; width: auto; height: auto; max-height: 68svh; object-fit: contain; filter: grayscale(1) contrast(1.15); }
.editorial[data-direction="full"] { padding: 0; display: block; }
.editorial[data-direction="full"] img { width: 100%; height: 100svh; max-height: none; object-fit: cover; }
.editorial[data-direction="right"] { justify-content: end; padding-right: 4vw; padding-left: 30vw; }
figcaption { margin-top: 1ch; background: #000; color: #fff; }
.editorial[data-direction="full"] figcaption { position: absolute; bottom: 64px; right: 1ch; max-width: 70vw; }
button { font: inherit; letter-spacing: inherit; background: #000; color: #fff; border: 1px solid #fff; border-radius: 0; padding: 8px 12px; cursor: pointer; }
#playback { position: fixed; right: 12px; bottom: 12px; z-index: 2; }
.text-view { padding: 220px 4vw 60px; }
h1 { font: inherit; margin: 0 0 2em; }
#photographs figure { margin: 0 0 80px; }
#photographs img { max-width: 100%; max-height: 80svh; filter: grayscale(1) contrast(1.15); }
@media (max-width: 600px) {
  .editorial, .editorial[data-direction="right"] { padding: 200px 16px 88px; justify-content: center; }
  .editorial img { max-height: 60svh; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.home-link:hover, body[data-landing="true"] nav a { text-decoration: none; }

.dashboard-heading { position: absolute; top: 220px; left: 4vw; z-index: 1; background: #000; color: #fff; }
body[data-landing="true"] .dashboard-heading { display: none; }

/* A small gallery of public-data instruments. */
.widget-wall { position: relative; padding-top: 270px; padding-bottom: 72px; margin-left: 4vw; width: min(650px, 92vw); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; align-items: start; }
body[data-landing="true"] .widget-wall { display: none; }
body[data-landing="false"] #dashboard > .editorial, body[data-landing="false"] #playback { display: none; }
.instrument { position: relative; border: 1px solid #fff; padding: 15px; min-width: 0; background: #000; }
.instrument::before, .instrument::after { content: '+'; position: absolute; line-height: 1; background: #000; top: -8px; }
.instrument::before { left: -5px; } .instrument::after { right: -5px; }
.instrument h2 { font: inherit; font-size: 11px; letter-spacing: .07em; margin: 0 0 16px; }
.instrument pre { font: inherit; line-height: 1.5; letter-spacing: 0; white-space: pre-wrap; margin: 0 0 16px; overflow-wrap: anywhere; }
.reading-time, .source { font-size: 10px; line-height: 1.5; margin: 0; display: block; }
.source { margin-top: 5px; width: fit-content; }
.instrument-weather { grid-column: 1 / 7; min-height: 254px; }
.instrument-kp { grid-column: 7 / 12; margin-top: 31px; min-height: 220px; }
.instrument-fx { grid-column: 2 / 9; min-height: 205px; }
.instrument-solar { grid-column: 9 / 13; margin-top: 19px; min-height: 205px; }
.instrument-clock { grid-column: 1 / 7; min-height: 135px; }
.secret { grid-column: 8 / 12; margin-top: 8px; padding: 12px; }
.secret summary { cursor: pointer; list-style: none; width: fit-content; }
.secret summary::-webkit-details-marker { display: none; }
.secret summary:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }
.secret a { display: block; margin-top: 10px; }
.refresh-data { grid-column: 1 / -1; justify-self: start; border: 0; padding: 0; font-size: 10px; }
@media (max-width: 540px) {
  .widget-wall { grid-template-columns: 1fr; gap: 22px; }
  .instrument, .secret { grid-column: 1; margin-top: 0; min-height: auto; }
  .instrument-kp, .instrument-clock { width: 86%; justify-self: end; }
  .secret { width: 60%; }
}

/* Compact gallery spacing. */
.widget-wall { gap: 10px; }
.instrument { padding: 10px 12px; }
.instrument h2 { margin-bottom: 10px; }
.instrument pre { line-height: 1.35; margin-bottom: 10px; }
.instrument-weather { min-height: 0; }
.instrument-kp { margin-top: 20px; min-height: 0; }
.instrument-fx { min-height: 0; }
.instrument-solar { margin-top: 10px; min-height: 0; }
.instrument-clock { min-height: 0; }
.secret { margin-top: 4px; padding: 9px 12px; }
.secret a { margin-top: 6px; }
@media (max-width: 540px) {
  .widget-wall { gap: 12px; }
  .instrument, .secret { margin-top: 0; }
}

/* Size frames to their contents rather than fractional grid tracks. */
.widget-wall { width: max-content; max-width: 92vw; grid-template-columns: max-content max-content; column-gap: 12px; }
.instrument { width: max-content; max-width: 100%; }
.instrument-weather, .instrument-fx, .instrument-clock { grid-column: 1; }
.instrument-kp, .instrument-solar, .secret { grid-column: 2; }
.instrument-fx { justify-self: end; }
.instrument-clock { justify-self: start; }
.instrument-solar { justify-self: start; }
.secret { justify-self: center; }
.instrument pre { white-space: pre; }
@media (max-width: 620px) {
  .widget-wall { width: 92vw; grid-template-columns: minmax(0, 1fr); }
  .instrument, .secret { grid-column: 1; width: max-content; max-width: 100%; margin-top: 0; }
  .instrument-kp, .instrument-clock { justify-self: end; }
  .instrument-fx, .instrument-solar, .secret { justify-self: start; }
  .instrument pre { white-space: pre-wrap; }
}

/* Uniform two-column dashboard grid. */
.widget-wall { width: min(500px, 92vw); max-width: 92vw; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.widget-wall .instrument { grid-column: auto; width: 100%; max-width: 100%; margin: 0; justify-self: stretch; min-height: 0; }
.widget-wall .instrument pre { white-space: pre-wrap; }
.widget-wall .secret { padding: 10px 12px; }
@media (max-width: 540px) {
  .widget-wall { grid-template-columns: minmax(0, 1fr); }
}
.instrument-note { margin-top: 9px; font-size: 10px; line-height: 1.5; }
.instrument-note summary { cursor: pointer; }
.instrument-note summary:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }
.instrument-note p { margin: 8px 0 0; }
.instrument a, .instrument-note { overflow-wrap: anywhere; }

/* Fluid gallery: equal-width cards, as many columns as the viewport fits. */
.widget-wall {
  width: auto;
  max-width: none;
  margin-right: 4vw;
  grid-template-columns: repeat(auto-fit, minmax(min(244px, 100%), 1fr));
  gap: 12px;
}

/* Interior pages share an opaque frozen name bar; index retains navigation. */
body[data-landing="false"] .masthead {
  position: sticky;
  top: 0;
  width: 100%;
  padding: 2em;
  border-bottom: 1px solid #fff;
}
body[data-landing="false"] .masthead nav,
body[data-landing="false"] .masthead .rule { display: none; }
body[data-view="dashboard"] #dashboard { padding-top: 28px; }
body[data-view="dashboard"] .dashboard-heading {
  position: static;
  margin: 0 4vw 28px;
}
body[data-view="dashboard"] .widget-wall { padding-top: 0; }
body[data-view="dashboard"] #content,
body[data-view="dashboard"] .instrument,
body[data-view="dashboard"] .instrument a,
body[data-view="dashboard"] summary,
body[data-view="dashboard"] .refresh-data { scroll-margin-top: 100px; }

body[data-landing="false"] .text-view { padding-top: 28px; }
body[data-landing="false"] #content { scroll-margin-top: 100px; }

/* Command-line entry panels. */
.entry-panel { width: 354px; max-width: 100%; }
.entry-form label { display: block; margin-bottom: 8px; }
.entry-row { display: flex; align-items: center; gap: 8px; }
.entry-row input { font: inherit; letter-spacing: 0; width: 20ch; flex: 1; min-width: 0; padding: 10px; border: 0; border-radius: 0; background: #000; color: #fff; caret-color: #fff; }
.entry-row input::placeholder { color: #fff; opacity: 1; }
.entry-row input:focus-visible { outline: 0; }
.entry-row button { padding: 0 12px; border: 0; min-width: 44px; min-height: 44px; flex-shrink: 0; }
.entry-row button:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .entry-row input { caret-animation: manual; } }

/* Temporary card ordering, with pointer and keyboard handles. */
.widget-wall article.instrument h2 { padding-right: 42px; }
.reorder-handle { position: absolute; top: 3px; right: 5px; min-width: 36px; min-height: 28px; padding: 0; border: 0; font-size: 11px; cursor: grab; touch-action: none; user-select: none; }
.is-moving .reorder-handle { cursor: grabbing; }

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

/* The original card marks the landing slot; a noninteractive copy follows the pointer. */
.widget-wall.is-reordering > article.instrument { opacity: .65; }
.widget-wall.is-reordering > article.is-moving { opacity: .25; border-style: dashed; }
.drag-ghost { position: fixed; top: 0; left: 0; z-index: 20; margin: 0; pointer-events: none; overflow: hidden; opacity: 1; max-width: none; }
.drag-ghost h2 { padding-right: 42px; }
.is-reordering, .is-reordering * { cursor: grabbing; user-select: none; }

/* Machine resource directory. */
.machine-link { display: block; width: fit-content; margin-top: 64px; font-size: 11px; }
body[data-landing="false"] .machine-link { display: none; }
.machine-directory { padding: 28px 4vw 72px; max-width: 760px; }
.machine-directory h1 { margin-bottom: 40px; }
.machine-resource { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 20px 0; border-top: 1px solid #fff; }
.machine-resource:last-of-type { border-bottom: 1px solid #fff; }
.machine-resource small { display: block; font-size: 10px; margin-top: 8px; }
.machine-context { margin-top: 48px; }
.machine-context h2 { font: inherit; margin: 0 0 16px; }
.machine-context a { display: block; width: fit-content; }
.machine-draft { margin-top: 48px; font-size: 10px; }

/* Phone layouts and touch targets, including landscape and safe areas. */
html { -webkit-text-size-adjust: 100%; }
@media (max-width: 600px), (pointer: coarse), (max-height: 500px) and (max-width: 950px) {
  .masthead, body[data-landing="false"] .masthead { padding: max(16px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) 12px max(28px, env(safe-area-inset-left)); }
  body[data-landing="true"] .masthead { position: relative; }
  .home-link { display: inline-flex; align-items: center; min-height: 44px; }
  nav a { min-height: 44px; display: flex; align-items: center; }
  .machine-link { min-height: 44px; display: flex; align-items: center; font-size: 12px; margin-top: 36px; }
  .entry-row input { font-size: 16px; min-height: 44px; }
  .entry-row input:focus-visible { outline: 1px dotted #fff; outline-offset: -2px; }
  .reorder-handle { min-width: 44px; min-height: 44px; }
  .widget-wall article.instrument h2 { min-height: 32px; padding-right: 48px; font-size: 12px; }
  .reading-time, .source, .instrument-note, .refresh-data, .machine-resource small { font-size: 12px; }
  .source, .instrument-note summary, .secret summary, .secret a, .refresh-data, .machine-context a { min-height: 44px; display: flex; align-items: center; }
  .secret summary { min-width: 44px; }
  .widget-wall { margin-left: max(4vw, env(safe-area-inset-left)); margin-right: max(4vw, env(safe-area-inset-right)); padding-bottom: max(72px, env(safe-area-inset-bottom)); }
  .text-view, .machine-directory { padding-left: max(4vw, env(safe-area-inset-left)); padding-right: max(4vw, env(safe-area-inset-right)); padding-bottom: max(60px, env(safe-area-inset-bottom)); }
}
@media (max-height: 500px) and (max-width: 950px) {
  body[data-landing="true"] .masthead { position: relative; }
  .masthead, body[data-landing="false"] .masthead { padding-top: 8px; padding-bottom: 8px; padding-left: max(28px, env(safe-area-inset-left)); padding-right: max(28px, env(safe-area-inset-right)); }
}

/* Revealed only after a Privée entry; retain native video and audio controls. */
.privee-video { margin-top:32px; width:100%; max-width:640px; }
.privee-video[hidden] { display:none; }
.privee-video iframe { display:block; width:100%; aspect-ratio:16/9; min-height:200px; border:0; filter:grayscale(1); }
