/* 123 Cheese dev tools: a plain terminal. System mono, no glow, scanlines or flicker. */
:root {
  --bg: #0b0b0c;
  --ink: #e8e8ea;
  --dim: #8b8b90;
  --faint: rgba(255, 255, 255, 0.08);
  --yellow: #f7c63d; /* prompt, from the studio's three dots */
  --red: #e8322a;
  --blue: #6f95ff;   /* the studio blue, lifted for contrast on black */
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh;
  background: var(--bg); color: var(--ink);
  font: 12.5px/1.65 var(--mono);
  -webkit-font-smoothing: antialiased;
}
.term { max-width: 84ch; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 16px max(48px, env(safe-area-inset-bottom)); }
@media (min-width: 720px) { .term { padding-top: 48px; padding-left: 32px; padding-right: 32px; } }

/* Title bar: where you are and the way out */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 14px; margin-bottom: 28px; border-bottom: 1px solid var(--faint); color: var(--dim); font-size: 12px; }
.bar .dots { display: inline-flex; gap: 6px; margin-right: 10px; vertical-align: -1px; }
.bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.bar a { color: var(--dim); }

/* Prompt lines are the headings */
h1, h2 { margin: 28px 0 8px; font: inherit; font-weight: 400; color: var(--ink); }
b, strong { font-weight: 400; } /* the terminal has one weight */
h1 { margin-top: 0; }
/* Prompt: guest@123cheese ~/path $  (user in studio yellow, path in studio blue, $ white) */
.ps { color: var(--ink); font-weight: 400; user-select: none; }
.ps .u { color: var(--ink); }
.ps .p { color: var(--blue); }
@media (max-width: 480px) { .ps .p { display: none; } } /* keep commands on one line on phones */
.ps::after { content: " "; }
p, ul, ol, dl { margin: 0 0 8px; }
ul, ol { padding-left: 3ch; }
li::marker { color: var(--dim); }
.dim { color: var(--dim); }
.out { padding-left: 2ch; }
ul.out, ol.out { padding-left: 4ch; } /* markers line up under the text above */

a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; border-radius: 2px; }
@media (hover: hover) and (pointer: fine) { a:hover { color: var(--ink); } }

/* Tool listing, like `ls -l` */
.ls { display: grid; grid-template-columns: max-content 1fr; gap: 4px 3ch; padding-left: 2ch; }
.ls dt a { font-weight: 400; }
@media (max-width: 480px) { .ls { grid-template-columns: 1fr; gap: 0; } .ls dd { margin: 0 0 10px; } }
.ls dd { margin: 0; color: var(--dim); }

/* Commands to copy */
.cmd { position: relative; margin: 8px 0 12px; padding: 12px 64px 12px 14px; border: 1px solid var(--faint); border-radius: 6px; background: rgba(255, 255, 255, 0.03); }
.cmd code { display: block; white-space: pre-wrap; word-break: break-word; font: inherit; }
.cmd code::before { content: "$ "; color: var(--ink); user-select: none; }
.copy {
  position: absolute; top: 6px; right: 6px; min-width: 52px; min-height: 32px;
  appearance: none; border: 1px solid var(--faint); border-radius: 4px; background: var(--bg);
  color: var(--dim); font: 12px var(--mono); cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .copy:hover { color: var(--ink); } }

table { width: 100%; border-collapse: collapse; margin: 4px 0 8px; }
th, td { text-align: left; vertical-align: top; padding: 6px 2ch 6px 0; border-bottom: 1px solid var(--faint); }
th { color: var(--dim); font-weight: 400; }
.scroll { overflow-x: auto; }

/* Resting prompt with a cursor. A plain blink, nothing more. */
.cursor { display: inline-block; width: 1ch; height: 1.2em; margin-left: 2px; vertical-align: -0.2em; background: var(--ink); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* Session playback: commands type out, then their output appears. Only when JS opts in. */
.playing .step { visibility: hidden; }
.playing .step.shown { visibility: visible; }
.typing::after { content: ""; display: inline-block; width: 1ch; height: 1.2em; margin-left: 1px; vertical-align: -0.2em; background: var(--ink); }

/* The live prompt and its scrollback */
.shell { margin-top: 28px; }
.log .entry { margin-bottom: 10px; }
.log p { margin: 0; }
.log pre { margin: 2px 0 0; padding-left: 2ch; font: inherit; white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.prompt-line { display: flex; align-items: baseline; gap: 0; }
.prompt-line .ps { white-space: nowrap; }
/* The real input is invisible; .typed mirrors it and .block is the cursor. */
.prompt-line .line { position: relative; flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-all; cursor: text; }
.prompt-line input {
  position: absolute; inset: 0; width: 100%; margin: 0; padding: 0; border: 0; outline: 0;
  background: transparent; color: transparent; caret-color: transparent; opacity: 0;
  font: inherit; font-size: max(16px, 1em); /* 16px+ keeps iOS from zooming in on focus */
}
.prompt-line .block { display: inline-block; width: 1ch; height: 1.2em; vertical-align: -0.2em; box-shadow: inset 0 0 0 1px var(--dim); }
.prompt-line:focus-within .block { box-shadow: none; background: var(--ink); animation: blink 1.1s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) { .prompt-line:focus-within .block { animation: none; } }
.prompt-line:focus-within .ps .u { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); }

/* SSH banner: the studio's three dots as plain text */
.motd pre { margin: 12px 0; font: inherit; line-height: 1.45; white-space: pre; overflow-x: auto; color: var(--ink); }
.motd .sysinfo { color: var(--dim); }
.motd .sysinfo a { color: var(--blue); }
.motd .r { color: var(--red); }
.motd .y { color: var(--yellow); }
.motd .b { color: var(--blue); }

/* In the flex prompt a trailing space would collapse; use a fixed one. */
.prompt-line .ps::after { content: "\00a0"; }
[data-last-login] { white-space: pre; } /* keep Terminal's double space in "Oct  1" */

.bar .nav { display: inline-flex; gap: 2ch; }
/* Power off: the whole window squashes to a bright line, pinches to a dot, fades. */
body.off { animation: power-off 540ms cubic-bezier(0.55, 0, 0.45, 1) forwards; }
@keyframes power-off {
  0%   { transform: scale(1, 1); filter: brightness(1); opacity: 1; }
  45%  { transform: scale(1, 0.004); filter: brightness(2.6); opacity: 0; } /* the line takes over from here */
  100% { transform: scale(1, 0.004); opacity: 0; }
}
/* The bright line and dot a CRT leaves behind, full width, edge to edge. */
.crt-line {
  position: fixed; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; z-index: 10;
  background: #fff; box-shadow: 0 0 14px 3px rgba(255, 255, 255, 0.55);
  opacity: 0; pointer-events: none;
  animation: off-line 540ms cubic-bezier(0.55, 0, 0.45, 1) forwards;
}
@keyframes off-line {
  0%, 38% { opacity: 0; transform: scaleX(1); }
  45%     { opacity: 1; transform: scaleX(1); }
  75%     { opacity: 1; transform: scaleX(0.005); }
  100%    { opacity: 0; transform: scaleX(0); }
}

/* ---------- Pixel dots in the title bar ---------- */
.bar .dots svg { width: 10px; height: 10px; display: block; }

/* ---------- pulse --features: a bulleted list, pixel icons as the bullets ---------- */
.caps { list-style: none; margin: 6px 0 12px; padding: 0 0 0 2ch; }
/* The icon is the bullet: 12px, so each icon pixel is one screen pixel. */
.caps li { display: grid; grid-template-columns: 12px 14ch 1fr; column-gap: 1.5ch; align-items: center; padding: 1px 0; }
.caps li .px { width: 12px; height: 12px; }
.caps .ft { color: var(--ink); }
@media (max-width: 480px) { .caps li { grid-template-columns: 12px 13ch 1fr; column-gap: 1ch; } }
.px { display: block; image-rendering: pixelated; }
/* Icons assemble pixel by pixel in a diagonal sweep, once, when the grid scrolls in. */
.caps.pending .px rect { opacity: 0; }
/* Visible by default; the animation only hides a pixel until its turn (fill: backwards), so the end state can never be lost. */
.caps.in .px rect { animation: px-in 40ms linear backwards; animation-delay: calc(var(--d) * 16ms + 60ms); }
.caps.in li:nth-child(2) .px rect { animation-delay: calc(var(--d) * 16ms + 140ms); }
.caps.in li:nth-child(3) .px rect { animation-delay: calc(var(--d) * 16ms + 220ms); }
.caps.in li:nth-child(4) .px rect { animation-delay: calc(var(--d) * 16ms + 300ms); }
.caps.in li:nth-child(5) .px rect { animation-delay: calc(var(--d) * 16ms + 380ms); }
.caps.in li:nth-child(6) .px rect { animation-delay: calc(var(--d) * 16ms + 460ms); }
@keyframes px-in { from { opacity: 0; } to { opacity: 1; } }

/* Title bar stays on one line: the title truncates, the links never break. */
.bar > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .nav { flex-shrink: 0; white-space: nowrap; }
.links { display: flex; gap: 3ch; }

/* ---------- Thinner, tighter secondary type ---------- */
.dim, .cap p.dim, .lede { font-weight: 300; letter-spacing: -0.015em; }

/* ---------- open ~/dev/pulse/gallery: a bento, wider than the terminal column ---------- */
.bento {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
  width: min(980px, calc(100vw - 32px)); margin: 12px 0 8px 50%; transform: translateX(-50%);
}
.tile {
  position: relative; margin: 0; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--faint); border-radius: 14px; background: rgba(255, 255, 255, 0.02);
  transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 420ms;
}
@media (hover: hover) and (pointer: fine) { .tile:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.16); } }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:hover { transform: none; } }
.tile img { display: block; width: 100%; height: 100%; min-height: 0; flex: 1; object-fit: cover; }
.tile canvas { position: absolute; image-rendering: pixelated; }
.t-desk { grid-column: span 4; }
.t-desk img { aspect-ratio: 1470 / 1070; }
.t-hover { grid-column: span 2; }
.t-specs { grid-column: span 2; justify-content: center; }
.t-specs pre { margin: 0; padding: 18px 20px; font: inherit; font-size: 11.5px; font-weight: 300; letter-spacing: -0.015em; line-height: 1.75; white-space: pre; overflow-x: auto; color: var(--ink); }
.t-specs .k { color: var(--dim); }
.t-specs .k:first-child { color: var(--ink); font-weight: 400; }
.t-bar { grid-column: span 4; }
.t-bar img { aspect-ratio: 2000 / 667; }
@media (max-width: 720px) {
  .bento { grid-template-columns: 1fr; }
  .t-desk, .t-specs, .t-hover, .t-bar { grid-column: span 1; }
  .t-hover img { aspect-ratio: 1470 / 1070; }
}
