/* ══════════════════════════════════════════════════════════
   MR//OS — Mike Rotenberg's portfolio, dressed as a Kanban board
   ══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tokens ─────────────────────────────────────────────── */
/* Default theme: ACID — near-black, warm ink, acid-lime signal colour. */
:root {
  --bg:        #0b0b0c;
  --panel:     #111113;
  --panel-2:   #18181b;
  --line:      #27272c;
  --line-hi:   #44444d;
  --ink:       #ece8e1;
  --ink-dim:   #b9b4aa;
  --ink-mute:  #8d8a84;

  --cyan:      #6fe3ff;
  --magenta:   #ff6fb5;
  --lime:      #d4ff4f;
  --amber:     #ffb84a;
  --violet:    #a79bff;
  --red:       #ff6b5e;

  --primary:   var(--lime);
  --on-primary:#0b0b0c;
  --grid:      rgba(236, 232, 225, 0.035);

  --font-ui:   'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-crt:  'VT323', 'IBM Plex Mono', ui-monospace, monospace;

  --top-h:     52px;
  --status-h:  28px;
  --side-w:    216px;
  --ease:      cubic-bezier(0.2, 0.9, 0.3, 1);
  --notch:     polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
}

[data-theme="synth"] {
  --bg: #0a0914; --panel: #11101f; --panel-2: #19172e; --line: #2c2752; --line-hi: #4a4288;
  --ink: #eeebff; --ink-dim: #b0abd6; --ink-mute: #8782b3;
  --cyan: #2ef2ff; --magenta: #ff3fa4; --lime: #b8ff3d; --amber: #ffb224; --violet: #a685ff; --red: #ff5468;
  --primary: var(--cyan);
  --grid: rgba(140, 120, 255, 0.07);
}
[data-theme="phosphor"] {
  --bg: #030a05; --panel: #07130b; --panel-2: #0c1d12; --line: #17402a; --line-hi: #2a7049;
  --ink: #d4ffe0; --ink-dim: #8fd6a6; --ink-mute: #63a57a;
  --cyan: #3dff84; --magenta: #c8ffd8; --lime: #3dff84; --amber: #d9ff5e; --violet: #2fe0b0;
  --primary: #3dff84;
  --grid: rgba(61, 255, 132, 0.06);
}
[data-theme="amber"] {
  --bg: #0b0703; --panel: #150d04; --panel-2: #201507; --line: #47310f; --line-hi: #7d5718;
  --ink: #ffe9bf; --ink-dim: #d6ae6e; --ink-mute: #a8834a;
  --cyan: #ffb000; --magenta: #ffe2a6; --lime: #ffd24a; --amber: #ff8a1f; --violet: #ffc56b;
  --primary: #ffb000;
  --grid: rgba(255, 176, 0, 0.06);
}

[data-accent="violet"]  { --accent: var(--violet); }
[data-accent="cyan"]    { --accent: var(--cyan); }
[data-accent="amber"]   { --accent: var(--amber); }
[data-accent="lime"]    { --accent: var(--lime); }
[data-accent="magenta"] { --accent: var(--magenta); }

[data-type="epic"]  { --type: var(--violet); }
[data-type="story"] { --type: var(--lime); }
[data-type="task"]  { --type: var(--cyan); }
[data-type="bug"]   { --type: var(--red); }

/* ── Base ───────────────────────────────────────────────── */
html { scroll-behavior: smooth; color-scheme: dark; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
kbd {
  font-family: var(--font-mono); font-size: 10px; line-height: 1;
  padding: 3px 5px; border: 1px solid var(--line); color: var(--ink-mute);
  border-radius: 2px;
}
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0; white-space: nowrap;
}
.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 300;
  background: var(--primary); color: var(--on-primary);
  padding: 8px 14px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

::selection { background: var(--primary); color: var(--on-primary); }

/* CRT overlay: scanlines + vignette. Toggle with the CRT button. */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0,0,0,0.20) 2px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.45) 100%);
}
.no-crt body::after { display: none; }

/* ── Shared bits ────────────────────────────────────────── */
.led {
  display: inline-block; width: 8px; height: 8px; flex: none;
  background: var(--lime); box-shadow: 0 0 10px var(--lime);
  animation: blink 2.4s steps(1) infinite;
}
@keyframes blink { 0%, 78% { opacity: 1; } 79%, 100% { opacity: 0.3; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 0 14px;
  font-family: var(--font-ui); font-weight: 600; font-size: 13px;
  letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid var(--line-hi); background: var(--panel);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, transform 0.15s;
}
.btn:hover { border-color: var(--primary); box-shadow: 0 0 18px -6px var(--primary); color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn-primary, .hero-cta .btn { clip-path: var(--notch); }
.btn-primary {
  background: var(--primary); border-color: var(--primary); color: var(--on-primary);
  box-shadow: 0 0 22px -8px var(--primary);
}
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--on-primary); box-shadow: 0 0 26px -6px var(--primary); }

.tool-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 10px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-dim); border: 1px solid var(--line); background: transparent;
  transition: border-color 0.15s, color 0.15s;
}
.tool-btn:hover { border-color: var(--primary); color: var(--primary); }
.tool-btn[aria-pressed="true"] { color: var(--primary); border-color: var(--line-hi); }
.swatch {
  width: 10px; height: 10px;
  background: linear-gradient(135deg, var(--primary) 50%, var(--magenta) 50%);
}

.icon-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center;
  color: var(--ink-dim); border: 1px solid transparent; font-size: 14px;
}
.icon-btn:hover { color: var(--primary); border-color: var(--line-hi); }

/* Portrait: 1-bit ordered-dither canvas (main.js) over a duotone <img> fallback */
.portrait {
  position: relative; display: block; overflow: hidden; flex: none;
  background: var(--primary); isolation: isolate;
}
.portrait img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.2) brightness(1.02);
  mix-blend-mode: multiply;
}
.portrait canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  image-rendering: pixelated; background: var(--bg);
}
.portrait--sm { width: 44px; height: 44px; box-shadow: 0 0 0 1px var(--line-hi); }

.avatar {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  object-fit: cover; filter: grayscale(1) contrast(1.1);
  box-shadow: 0 0 0 1px var(--line-hi);
}

/* ── App shell ──────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  grid-template-rows: var(--top-h) 1fr;
  min-height: 100vh;
  padding-bottom: var(--status-h);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--bg);
  background-attachment: fixed;
}

/* Top bar */
.topbar {
  grid-column: 1 / -1; position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  height: var(--top-h); padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--primary); flex: none; }
.brand svg { filter: drop-shadow(0 0 6px var(--primary)); }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: 0.06em; color: var(--ink); }
.brand-name i { font-style: normal; color: var(--primary); }

.crumbs {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute);
  white-space: nowrap;
}
.crumbs i { font-style: normal; color: var(--line-hi); }
.crumbs b { color: var(--ink); font-weight: 500; }

.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  width: 230px; height: 32px; padding: 0 8px 0 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-mute);
  transition: border-color 0.15s, box-shadow 0.15s, width 0.2s var(--ease);
}
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 18px -8px var(--primary); width: 280px; }
.search input {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink);
}
.search input::placeholder { color: var(--ink-mute); }
.search input::-webkit-search-cancel-button { filter: invert(1); opacity: 0.6; }
.topbar-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.topbar .btn { min-height: 32px; }

/* Sidebar */
.sidebar {
  position: sticky; top: var(--top-h); align-self: start;
  height: calc(100vh - var(--top-h) - var(--status-h));
  display: flex; flex-direction: column; gap: 22px;
  padding: 18px 12px; overflow-y: auto;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
.project { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.project-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.project-text strong { font-weight: 600; font-size: 14px; }
.project-text span { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); }

.side-label {
  padding: 0 8px 6px; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute);
}
.views { display: flex; flex-direction: column; gap: 2px; }
.views a, .views button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 36px; padding: 0 8px; text-align: left;
  font-weight: 500; font-size: 14px; color: var(--ink-dim);
  border-left: 2px solid transparent;
  transition: background 0.12s, color 0.12s;
}
.views a span, .views button span { flex: 1; }
.views em { font-style: normal; color: var(--ink-mute); font-size: 12px; }
.views a:hover, .views button:hover { background: var(--panel-2); color: var(--ink); }
.views a.active {
  color: var(--primary); border-left-color: var(--primary);
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 14%, transparent), transparent);
}

.availability {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 10px; border: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.3; color: var(--ink-dim);
  transition: border-color 0.15s;
}
.availability b { color: var(--primary); font-weight: 600; }
.availability:hover { border-color: var(--primary); }

/* Main */
main { position: relative; min-width: 0; padding: 26px 28px 56px; }
main > * { position: relative; }

/* Animated ordered-dither field behind the hero (drawn by main.js) */
.dither-field {
  position: absolute; top: 0; right: 0; left: 0; width: 100%; height: 420px;
  image-rendering: pixelated; pointer-events: none; opacity: 0.9;
  -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 26px;
}
.eyebrow {
  display: flex; align-items: center; gap: 9px; margin-bottom: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-mute);
}
.hero h1 {
  position: relative; display: inline-block;
  font-size: clamp(2.3rem, 5.4vw, 4.2rem); font-weight: 700; line-height: 0.98;
  letter-spacing: -0.01em; text-transform: uppercase;
  text-shadow: 2px 0 0 color-mix(in srgb, var(--magenta) 75%, transparent), -2px 0 0 color-mix(in srgb, var(--cyan) 75%, transparent), 0 0 30px var(--bg);
}
.hero h1::after {
  content: ''; display: inline-block; width: 0.5em; height: 0.82em; margin-left: 0.12em;
  background: var(--primary); box-shadow: 0 0 16px var(--primary);
  vertical-align: baseline; transform: translateY(0.06em);
  animation: cursor 1.1s steps(1) infinite;
}
@keyframes cursor { 50% { opacity: 0; } }
.glitch:hover { animation: glitch 0.42s steps(2) 1; }
@keyframes glitch {
  0%   { transform: translate(0); }
  20%  { transform: translate(-3px, 1px) skewX(-6deg); text-shadow: 5px 0 0 var(--magenta), -5px 0 0 var(--cyan); }
  40%  { transform: translate(3px, -1px); clip-path: inset(18% 0 34% 0); }
  60%  { transform: translate(-2px, 0) skewX(4deg); clip-path: inset(58% 0 6% 0); }
  80%  { transform: translate(2px, 1px); clip-path: none; }
  100% { transform: translate(0); }
}
.hero-role {
  margin-top: 10px; font-size: 1.1rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--primary);
}
.hero-role i { font-style: normal; color: var(--ink-mute); }
.hero-goal { margin-top: 8px; max-width: 78ch; color: var(--ink-dim); text-shadow: 0 0 12px var(--bg), 0 0 4px var(--bg); }
.hero-goal b {
  display: inline-block; margin-right: 8px; padding: 1px 7px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--amber); border: 1px solid currentColor;
  vertical-align: 2px;
}
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── View bar ───────────────────────────────────────────── */
.viewbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; min-height: 32px; }
.view-title { font-size: 1.15rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.viewbar-hint { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); letter-spacing: 0.04em; }
.hint-touch { display: none; }
#reset-btn { margin-left: auto; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button {
  height: 30px; padding: 0 12px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-dim); border: 1px solid var(--line); background: var(--panel);
  transition: all 0.12s;
}
.filters button:hover { border-color: var(--line-hi); color: var(--ink); }
.filters button[aria-pressed="true"] {
  background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600;
  box-shadow: 0 0 18px -8px var(--primary);
}

/* ── Board ──────────────────────────────────────────────── */
.board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr);
  gap: 12px; align-items: start;
  overflow-x: auto; padding: 4px 2px 18px; margin: 0 -2px;
  scrollbar-color: var(--line-hi) transparent;
}
.column {
  display: flex; flex-direction: column; min-width: 0;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  border: 1px solid var(--line); border-top: 2px solid var(--accent);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.column-head { display: flex; align-items: center; gap: 8px; padding: 11px 12px 2px; }
.column-head h3 {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.column-count {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute);
  padding: 0 6px; border: 1px solid var(--line); line-height: 18px;
}
.column-wip { letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.column-hint {
  display: flex; justify-content: space-between; gap: 8px; padding: 0 12px 8px;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute);
}
.column.over-wip { border-color: var(--red); box-shadow: 0 0 24px -8px var(--red); }
.column.over-wip .column-wip { color: var(--red); animation: blink 0.9s steps(1) infinite; }
.column.drop-target { border-color: var(--accent); box-shadow: 0 0 28px -10px var(--accent), inset 0 0 40px -28px var(--accent); }

.column-body { display: flex; flex-direction: column; gap: 8px; padding: 4px 8px 10px; min-height: 96px; }
.column-empty {
  margin: auto 0; padding: 18px 8px; text-align: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute);
  border: 1px dashed var(--line);
}
.column-body:not(.is-empty) .column-empty,
.placeholder ~ .column-empty { display: none; }

/* Cards */
.card {
  position: relative; display: flex; flex-direction: column; gap: 7px;
  padding: 11px 11px 9px;
  background: var(--panel-2);
  border: 1px solid var(--line); border-left: 3px solid var(--type);
  cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform 0.16s var(--ease), border-color 0.16s, box-shadow 0.16s;
  animation: card-in 0.4s var(--ease) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } }
.card:hover, .card:focus-within {
  transform: translateY(-2px);
  border-color: var(--type);
  box-shadow: 0 10px 28px -14px var(--type), 0 0 0 1px color-mix(in srgb, var(--type) 30%, transparent);
}
/* HUD corner ticks on hover */
.card::before, .card::after {
  content: ''; position: absolute; width: 9px; height: 9px; pointer-events: none;
  border: 0 solid var(--type); opacity: 0; transition: opacity 0.16s;
}
.card::before { top: -4px; right: -4px; border-width: 2px 2px 0 0; }
.card::after  { bottom: -4px; right: -4px; border-width: 0 2px 2px 0; }
.card:hover::before, .card:hover::after, .card:focus-within::before, .card:focus-within::after { opacity: 1; }

.card-title { font-size: 14.5px; font-weight: 600; line-height: 1.28; }
.card-title a::after { content: ''; position: absolute; inset: 0; } /* whole card is the link */
.card-title a:focus-visible { outline: none; }
.card:has(a:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.card-period { font-family: var(--font-mono); font-size: 11px; color: var(--type); letter-spacing: 0.04em; }
.card-summary { font-size: 13px; line-height: 1.45; color: var(--ink-dim); }
.card[data-resolved] .card-key { text-decoration: line-through; }

.card-cover { margin: -11px -11px 4px -11px; height: 132px; }
.card-cover .portrait { width: 100%; height: 100%; }
.card-cover img { object-position: 50% 22%; }
.card-cover::after {
  content: 'ID // MR-1'; position: absolute; left: 8px; top: 8px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  padding: 2px 6px; background: rgba(5,4,11,0.78); color: var(--ink);
}

.labels { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; }
.labels li {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 6px; color: var(--ink-dim);
  background: color-mix(in srgb, var(--type, var(--primary)) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--type, var(--primary)) 30%, transparent);
  white-space: nowrap;
}
.labels li.more { border-style: dashed; background: none; }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mini-stats div { padding: 4px 2px 5px; text-align: center; border: 1px solid var(--line); background: var(--panel); }
.mini-stats b { display: block; font-family: var(--font-crt); font-size: 26px; line-height: 1; font-weight: 400; color: var(--lime); }
.mini-stats span { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mute); }

.card-foot {
  display: flex; align-items: center; gap: 7px; margin-top: 3px;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute);
}
.card-foot .spacer { flex: 1; }
.type-ico { width: 16px; height: 16px; flex: none; color: var(--type); }
.prio { width: 14px; height: 14px; flex: none; }
.prio[data-p="highest"] { color: var(--red); }
.prio[data-p="high"]    { color: var(--amber); }
.prio[data-p="medium"]  { color: var(--amber); }
.prio[data-p="low"]     { color: var(--cyan); }
.points {
  min-width: 20px; padding: 0 5px; text-align: center; line-height: 17px;
  border-radius: 9px; background: var(--panel); border: 1px solid var(--line); color: var(--ink-dim);
}
.flag { color: var(--red); font-size: 12px; }

/* Drag & drop */
.card.ghost {
  position: fixed; z-index: 120; margin: 0; pointer-events: none; cursor: grabbing;
  transform: rotate(3deg) scale(1.03); transition: none; animation: none;
  border-color: var(--type);
  box-shadow: 0 24px 50px -12px rgba(0,0,0,0.8), 0 0 34px -6px var(--type);
}
.placeholder {
  border: 1px dashed var(--accent);
  background: repeating-linear-gradient(-45deg, transparent 0 6px, color-mix(in srgb, var(--accent) 12%, transparent) 6px 12px);
}
body.dragging, body.dragging * { cursor: grabbing !important; }
body.dragging .card:not(.ghost) { transform: none; box-shadow: none; }

/* ── Timeline ───────────────────────────────────────────── */
.gantt { overflow-x: auto; border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 82%, transparent); }
.gantt-inner { position: relative; min-width: 760px; padding: 0 20px 22px; }
.gantt-axis { position: relative; height: 40px; border-bottom: 1px solid var(--line); }
.gantt-axis span {
  position: absolute; bottom: 8px; transform: translateX(-50%);
  font-family: var(--font-crt); font-size: 20px; line-height: 1; color: var(--ink-mute);
}
.gantt-axis span.now { color: var(--ink); }
.gantt-rows { position: relative; padding: 18px 0 6px; }
.gantt-grid { position: absolute; inset: 0; pointer-events: none; }
.gantt-grid i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); opacity: 0.6; }
.gantt-row { position: relative; height: 64px; }
.bar {
  position: absolute; top: 8px; height: 48px; min-width: 60px;
  display: flex; flex-direction: column; justify-content: center; padding: 0 12px;
  overflow: hidden; white-space: nowrap;
  background: color-mix(in srgb, var(--type) 16%, var(--panel-2));
  border: 1px solid var(--type); border-left-width: 3px;
  transition: transform 0.16s var(--ease), box-shadow 0.16s;
  transform-origin: left center;
  animation: bar-in 0.7s var(--ease) both;
}
@keyframes bar-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.bar:hover, .bar:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 28px -12px var(--type); }
.bar b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.bar span { font-family: var(--font-mono); font-size: 11px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; }
.bar--live {
  background:
    repeating-linear-gradient(-45deg, transparent 0 10px, color-mix(in srgb, var(--type) 10%, transparent) 10px 20px),
    color-mix(in srgb, var(--type) 16%, var(--panel-2));
  background-size: 28.28px 100%, auto;
  animation: bar-in 0.7s var(--ease) both, stripes 1.4s linear infinite;
}
@keyframes stripes { to { background-position: 28.28px 0, 0 0; } }
.bar--ghost {
  --type: var(--magenta);
  background: none; border-style: dashed; color: var(--magenta);
}
.bar--ghost span { color: inherit; opacity: 0.8; }
.gantt-today {
  position: absolute; top: 0; bottom: 0; width: 2px; background: var(--magenta);
  box-shadow: 0 0 12px var(--magenta); pointer-events: none;
}
.gantt-today::before {
  content: 'TODAY'; position: absolute; bottom: 0; left: 50%; transform: translate(-50%, 100%);
  padding: 1px 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  background: var(--magenta); color: #05040b; font-weight: 600;
}
.gantt-note { margin-top: 12px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); }

/* ── Reports ────────────────────────────────────────────── */
.reports { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.panel { border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 82%, transparent); padding: 16px; }
.panel-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mute);
}
.stat { border-top: 2px solid var(--accent); }
.stat-num {
  font-family: var(--font-crt); font-size: clamp(4rem, 8vw, 6.4rem); line-height: 0.8;
  color: var(--accent); text-shadow: 0 0 22px color-mix(in srgb, var(--accent) 60%, transparent);
  font-variant-numeric: tabular-nums;
}
.stat-label { margin-top: 12px; font-size: 14px; font-weight: 500; color: var(--ink-dim); line-height: 1.3; }
.panel--skills { grid-column: span 2; }
.panel--vitals { grid-column: span 2; display: flex; flex-direction: column; }
.skill-list { list-style: none; display: grid; gap: 7px; }
.skill-list li { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; }
.skill-list .meter { display: flex; gap: 2px; height: 10px; }
.skill-list .meter i { flex: 1; background: var(--primary); opacity: 0.12; }
.skill-list .meter i.on { opacity: 1; box-shadow: 0 0 6px var(--primary); }
.skill-list em { font-style: normal; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--lime); }
.vitals-screen { position: relative; flex: 1; min-height: 170px; border: 1px solid var(--line); background: var(--bg); overflow: hidden; }
.vitals-screen svg { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--lime); filter: drop-shadow(0 0 5px var(--lime)); }
.vitals-screen path { stroke-dasharray: 1200; animation: ecg 3.2s linear infinite; }
@keyframes ecg { from { stroke-dashoffset: 1200; } to { stroke-dashoffset: -1200; } }
.vitals-read { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 12px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); }
.vitals-read b { color: var(--lime); font-weight: 500; }

/* ── Dialogs ────────────────────────────────────────────── */
.dialog {
  margin: auto; padding: 0; width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line-hi); border-top: 2px solid var(--type, var(--primary));
  box-shadow: 0 30px 80px -20px #000, 0 0 60px -24px var(--type, var(--primary));
  overflow: hidden;
}
.dialog[open] { display: flex; flex-direction: column; animation: dialog-in 0.22s var(--ease); }
.dialog--create { width: min(520px, calc(100vw - 32px)); }
.dialog--create form { display: flex; flex-direction: column; min-height: 0; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } }
.dialog::backdrop { background: rgba(4, 3, 10, 0.78); backdrop-filter: blur(3px); }

.dialog-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 20px;
  border-bottom: 1px solid var(--line); flex: none;
}
.dialog-head h2 { font-size: 15px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.dialog-head .icon-btn:last-child { margin-left: auto; }
.dialog-head .icon-btn + .icon-btn { margin-left: 0; }
.issue-path { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute); min-width: 0; }
.issue-path b { color: var(--type); font-weight: 500; }
.issue-tools { margin-left: auto; display: flex; gap: 4px; }

.dialog-body { padding: 20px; overflow-y: auto; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); flex: none; }

.issue { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 28px; }
.issue-main h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; line-height: 1.15; margin-bottom: 6px; }
.issue-period { font-family: var(--font-mono); font-size: 13px; color: var(--type); margin-bottom: 4px; }
.issue-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.issue-h {
  margin: 22px 0 8px; font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mute);
}
.issue-main p { color: var(--ink-dim); margin-bottom: 10px; max-width: 66ch; font-size: 15.5px; line-height: 1.62; }
.issue-portrait { float: right; width: 148px; height: 176px; margin: 4px 0 12px 18px; }
.issue-portrait img { object-position: 50% 20%; }

.criteria { list-style: none; display: grid; gap: 6px; }
.criteria li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 500; }
.criteria li::before {
  content: '✓'; display: grid; place-items: center; width: 16px; height: 16px; flex: none;
  background: var(--lime); color: #05040b; font-size: 11px; font-weight: 700;
}
.issue-main .labels li { font-size: 11.5px; padding: 4px 9px; }
.issue-main .mini-stats { grid-template-columns: repeat(4, 1fr); }
.issue-main .mini-stats b { font-size: 44px; }
.issue-main .mini-stats div { padding: 10px 6px; }
.issue-main .mini-stats span { font-size: 10px; display: block; margin-top: 4px; line-height: 1.35; }

.activity { list-style: none; display: grid; gap: 6px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute); }
.activity li { display: flex; gap: 10px; }
.activity time { color: var(--line-hi); flex: none; }
.activity b { color: var(--ink-dim); font-weight: 500; }

.issue-side { display: flex; flex-direction: column; gap: 14px; }
.fields { border: 1px solid var(--line); background: var(--panel-2); }
.fields > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); min-height: 40px; }
.fields > div:last-child { border-bottom: 0; }
.fields dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute); }
.fields dd { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; min-width: 0; }
.status-select {
  width: 100%; height: 34px; padding: 0 10px;
  font-family: var(--font-ui); font-weight: 600; font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase;
  background: color-mix(in srgb, var(--accent) 16%, var(--panel)); color: var(--accent);
  border: 1px solid var(--accent);
}
.status-select option { background: var(--panel); color: var(--ink); }
.status-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute); display: block; margin-bottom: 6px; }

/* Create form */
.form-note { font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute); margin-bottom: 16px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 5px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.field > span em { font-style: normal; color: var(--magenta); margin-left: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; background: var(--bg); border: 1px solid var(--line);
  font-family: var(--font-ui); font-size: 15px; outline: 0; resize: vertical;
}
.field select { height: 40px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 18px -8px var(--primary); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-mute); opacity: 0.75; }
.field.invalid input { border-color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.turnstile:empty { display: none; }
.turnstile { margin-bottom: 12px; min-height: 65px; }
.form-status { min-height: 1.4em; font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute); }
.form-status[data-tone="err"] { color: var(--red); }
.form-status[data-tone="busy"] { color: var(--amber); }
button[type="submit"]:disabled { opacity: 0.55; cursor: progress; }

/* ── Terminal ───────────────────────────────────────────── */
.terminal {
  position: fixed; left: 0; right: 0; bottom: var(--status-h); z-index: 70;
  height: min(44vh, 400px); display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 2px solid var(--lime);
  box-shadow: 0 -20px 60px -20px #000;
  font-family: var(--font-crt); font-size: 20px; line-height: 1.2;
  animation: term-in 0.22s var(--ease);
}
@keyframes term-in { from { transform: translateY(100%); } }
.term-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 6px 2px 14px; border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--ink-mute);
}
.term-out { flex: 1; overflow-y: auto; padding: 10px 14px 4px; color: var(--ink-dim); white-space: pre-wrap; overflow-wrap: anywhere; }
.term-out .cmd { color: var(--ink); }
.term-out .cmd::before { content: 'visitor@mr-os:~$ '; color: var(--lime); }
.term-out .ok { color: var(--lime); }
.term-out .hi { color: var(--primary); }
.term-out .err { color: var(--red); }
.term-out a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.term-form { display: flex; align-items: center; gap: 8px; padding: 4px 14px 10px; }
.term-form label { color: var(--lime); white-space: nowrap; }
.term-form input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font: inherit; color: var(--ink); caret-color: var(--lime); }

/* ── Status bar ─────────────────────────────────────────── */
.statusbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; gap: 14px; height: var(--status-h); padding-right: 12px;
  background: var(--panel); border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ink-mute);
  white-space: nowrap;
}
.sb-mode { align-self: stretch; display: flex; align-items: center; padding: 0 12px; background: var(--primary); color: var(--on-primary); font-weight: 600; letter-spacing: 0.12em; }
.sb-ecg { flex: 1; min-width: 40px; height: 18px; color: var(--lime); opacity: 0.8; }
.sb-ecg path { stroke-dasharray: 300; animation: ecg-sm 2.6s linear infinite; }
@keyframes ecg-sm { from { stroke-dashoffset: 300; } to { stroke-dashoffset: -300; } }
.sb-btn { font: inherit; letter-spacing: inherit; color: inherit; }
.sb-btn:hover { color: var(--primary); }
.sb-clock { color: var(--ink-dim); font-variant-numeric: tabular-nums; }

/* ── Toasts ─────────────────────────────────────────────── */
.toasts { position: fixed; right: 16px; bottom: calc(var(--status-h) + 14px); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; max-width: min(380px, calc(100vw - 32px));
  padding: 10px 14px; background: var(--panel-2);
  border: 1px solid var(--line-hi); border-left: 3px solid var(--tone, var(--primary));
  box-shadow: 0 14px 40px -14px #000, 0 0 30px -14px var(--tone, var(--primary));
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5; color: var(--ink);
  animation: toast-in 0.28s var(--ease);
}
.toast.out { opacity: 0; transform: translateX(16px); transition: all 0.25s; }
.toast a, .toast button { color: var(--tone, var(--primary)); text-decoration: underline; text-underline-offset: 3px; font: inherit; margin-left: 4px; white-space: nowrap; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } }

/* ── Boot screen ────────────────────────────────────────── */
.boot {
  position: fixed; inset: 0; z-index: 250; padding: clamp(20px, 6vw, 64px);
  background: #030208; color: var(--lime);
  font-family: var(--font-crt); font-size: clamp(18px, 2.6vw, 26px); line-height: 1.25;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: opacity 0.35s;
}
.boot pre { font: inherit; white-space: pre-wrap; text-shadow: 0 0 10px color-mix(in srgb, var(--lime) 70%, transparent); }
.boot-skip { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mute); }
.boot.done { opacity: 0; pointer-events: none; }

/* ── Mobile tab bar & noscript ──────────────────────────── */
.tabbar { display: none; }
.noscript { margin-top: 24px; padding: 20px; border: 1px solid var(--line-hi); background: var(--panel); max-width: 70ch; }
.noscript h2 { font-size: 1.2rem; margin-bottom: 10px; }
.noscript p { color: var(--ink-dim); margin-bottom: 8px; }
.noscript a { color: var(--primary); text-decoration: underline; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1180px) {
  :root { --side-w: 56px; }
  .sidebar { padding: 14px 6px; align-items: stretch; }
  .project { justify-content: center; padding: 0; }
  .project-text, .side-label, .views span, .views kbd, .views em, .availability span:last-child { display: none; }
  .views a, .views button { justify-content: center; padding: 0; }
  .availability { justify-content: center; padding: 12px 0; }
  .crumbs span, .crumbs i { display: none; }
}

@media (max-width: 860px) {
  .issue { grid-template-columns: 1fr; gap: 20px; }
  .reports { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  :root { --status-h: 52px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .statusbar, .crumbs, .search kbd, #theme-name { display: none; }
  .topbar { gap: 8px; padding: 0 12px; }
  .search { flex: 1; width: auto; min-width: 0; }
  .search:focus-within { width: auto; }
  .tool-btn { padding: 0 8px; }
  #create-btn { padding: 0 10px; }
  main { padding: 20px 16px 40px; }
  .hero { margin-bottom: 20px; }
  .hero-role { font-size: 0.95rem; }
  .viewbar-hint { flex-basis: 100%; }
  .hint-mouse { display: none; }
  .hint-touch { display: inline; }
  .dither-field { height: 250px; opacity: 0.45; }
  .hero-role, .eyebrow { text-shadow: 0 0 8px var(--bg), 0 0 3px var(--bg); }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; flex-basis: calc(100% + 32px); scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: none; height: 34px; }
  .card-cover { height: 190px; }

  .board {
    grid-auto-columns: 84vw; margin: 0 -16px; padding: 4px 16px 18px;
    scroll-snap-type: x mandatory; scroll-padding: 0 16px;
  }
  .column { scroll-snap-align: start; }
  body.dragging .board { scroll-snap-type: none; }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: var(--status-h);
    display: grid; grid-template-columns: 1fr 1fr 1fr 56px;
    background: var(--panel); border-top: 1px solid var(--line-hi);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a, .tabbar button {
    display: grid; place-items: center;
    font-weight: 600; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute);
    border-top: 2px solid transparent; margin-top: -1px;
  }
  .tabbar button { font-family: var(--font-mono); color: var(--lime); border-left: 1px solid var(--line); }
  .tabbar a.active { color: var(--primary); border-top-color: var(--primary); }

  .dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-left: 0; border-right: 0; }
  .dialog--create { width: 100vw; }
  .dialog--create form { height: 100%; }
  .dialog--create .dialog-body { flex: 1; }
  .dialog-body { padding: 16px; }
  .issue-portrait { width: 104px; height: 124px; }
  .issue-main .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .skill-list li { grid-template-columns: minmax(0, 1fr) 64px auto; }
  .terminal { height: 56vh; font-size: 18px; }
  .toasts { left: 16px; right: 16px; align-items: stretch; }
  .toast { max-width: none; }
}

@media (max-width: 520px) {
  .reports { grid-template-columns: 1fr 1fr; gap: 8px; }
  .panel { padding: 12px; }
  .panel--skills, .panel--vitals { grid-column: 1 / -1; }
  .brand-name { display: none; }
  #crt-btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .vitals-screen path, .sb-ecg path { stroke-dasharray: none; }
}
