/* 0xhalfbloodprince — landing page ("glimpse").
   Everything on this page is laid out on a 7.2 x 13 px cell grid by glimpse.js,
   so the chrome here is deliberately small and cell-aligned (12px / 13px mono). */

@font-face { font-family: "Plex Mono"; font-weight: 400; font-style: normal; font-display: block; src: url("assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-style: normal; font-display: block; src: url("assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 600; font-style: normal; font-display: block; src: url("assets/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #0b0b0b;
  --ink: #ebe6db;
  --chrome: #a9a59b;
  --dim: #6f6c64;
  --accent: rgb(235, 230, 219);
  --line: rgb(22, 22, 21);
  --insert: rgb(159, 184, 154);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 400 12px/13px "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  transition: background-color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

.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;
}

.stage { position: fixed; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; }

/* ---------- canvases ---------- */
canvas { position: absolute; display: block; }
.wall { inset: 0; width: 100%; height: 100%; z-index: 1; }
.machine { display: none; z-index: 3; pointer-events: none; }
.tile { inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; display: none; }

/* frosted pane behind the ghost keyboard */
.kb-glass {
  position: absolute; display: none; z-index: 2; pointer-events: none;
  background: transparent;
  -webkit-backdrop-filter: blur(1.6px);
  backdrop-filter: blur(1.6px);
  opacity: 0;
  transition: opacity 0.25s ease;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent), linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent), linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
  mask-composite: intersect;
}
.kb-glass.is-on { opacity: 1; }

/* ---------- header ---------- */
.frame-top { position: absolute; inset: 0 0 auto 0; height: 0; z-index: 6; }

.brand, .switch { position: absolute; top: 38px; display: flex; align-items: center; height: 14px; }

.brand { gap: 10px; color: var(--ink); font-weight: 500; letter-spacing: 0.01em; }
.brand svg { height: 14px; width: auto; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; overflow: visible; }
.brand svg .half { fill: var(--ink); stroke: none; }
.brand span { white-space: nowrap; }

.switch { gap: 22px; color: var(--chrome); }
.switch a { padding: 0 1px; transition: color 0.15s ease; }
.switch a:hover { color: var(--ink); }

/* ---------- vim-ish status + command line ---------- */
.status, .cmdline {
  position: absolute; z-index: 5; height: 13px; line-height: 13px; white-space: pre;
  pointer-events: none; opacity: 0; transition: opacity 0.2s ease;
}
.status.is-on, .cmdline.is-on { opacity: 1; }

.status { display: flex; align-items: center; background: var(--line); color: var(--chrome); overflow: hidden; }
.status .mode { background: var(--accent); color: var(--bg); padding: 0 1ch; font-weight: 600; }
.status.is-insert .mode { background: var(--insert); }
.status .path { margin-left: 1ch; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; }
.status .pos { margin-left: auto; padding-right: 1ch; flex: none; }

.cmdline { display: flex; justify-content: space-between; color: var(--ink); }
.cmdline .cmd { overflow: hidden; text-overflow: clip; }
.cmdline .showcmd { color: var(--dim); padding-right: 1ch; }

.pane-status, .pane-cmd { z-index: 5; }

/* ---------- bottom row ---------- */
.note, .theme-key, .enter {
  position: absolute; z-index: 6; height: 13px; line-height: 13px; white-space: nowrap;
  font: inherit; margin: 0; padding: 0; border: 0; background: none;
}
.note { color: var(--dim); pointer-events: none; }

.theme-key {
  display: inline-flex; align-items: center; gap: 1ch; color: var(--chrome); cursor: pointer;
  transition: color 0.15s ease;
}
.theme-key:hover { color: var(--ink); }
.command-glyph {
  display: inline-block; width: 11px; height: 9px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 9'%3E%3Cpath d='M1 1l3.4 3L1 7' fill='none' stroke='%23000' stroke-width='1.3'/%3E%3Cpath d='M6 8h5' stroke='%23000' stroke-width='1.3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 9'%3E%3Cpath d='M1 1l3.4 3L1 7' fill='none' stroke='%23000' stroke-width='1.3'/%3E%3Cpath d='M6 8h5' stroke='%23000' stroke-width='1.3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.enter {
  padding: 0 1ch; background: var(--ink); color: var(--bg); font-weight: 600; cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.enter:hover { background: var(--accent); }

/* ---------- leaving (black-hole dive) ---------- */
.is-leaving .frame-top, .is-leaving .status, .is-leaving .cmdline, .is-leaving .note,
.is-leaving .theme-key, .is-leaving .enter { opacity: 0; transition: opacity 0.35s ease; pointer-events: none; }
.is-leaving, .is-leaving * { cursor: none !important; }

/* ---------- small screens ---------- */
@media (max-width: 520px) {
  .brand, .switch { top: 26px; }
  .switch { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
