/* ──────────────────────────────────────────────────
   itguy.work — SYSTEMS UNIVERSE
   One continuous 3D space. Chrome is an instrument layer:
   hairlines, mono type, no boxes unless they hold data.
   ────────────────────────────────────────────────── */

:root {
  --void: #010108;
  --cyan: #00e5ff;
  --cyan-dim: #007fa8;
  --gold: #fbbf24;
  --record: #cbd5e1;
  --green: #10b981;
  --text: #c8dff0;
  --muted: #4a6a80;
  --hairline: rgba(0,229,255,0.22);
  --hairline-dim: rgba(0,229,255,0.10);
  --panel-bg: rgba(3,7,22,0.72);
  --font-display: 'Orbitron', 'Courier New', monospace;
  --font-body: 'Rajdhani', 'Trebuchet MS', sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;
}

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

html, body {
  height: 100%;
  background: var(--void);
  overflow: hidden;
}

body {
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--cyan); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

* { scrollbar-width: thin; scrollbar-color: var(--cyan-dim) transparent; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cyan-dim); }

/* ─── ambient layers ─── */
.nebula {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 18% 28%, rgba(124,58,237,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 82% 72%, rgba(0,229,255,0.05) 0%, transparent 70%),
    radial-gradient(ellipse 70% 35% at 55% 45%, rgba(236,72,153,0.04) 0%, transparent 70%);
  animation: nebulaDrift 36s ease-in-out infinite alternate;
}
@keyframes nebulaDrift {
  from { transform: scale(1) rotate(0deg); opacity: 0.7; }
  to   { transform: scale(1.06) rotate(1deg); opacity: 1; }
}

/* ─── the universe canvas ─── */
#universe {
  position: fixed; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

/* hover label that follows the cursor */
.rd-label {
  position: fixed; z-index: 20;
  transform: translate(-50%, -160%);
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em;
  color: #eaffff; white-space: nowrap;
  text-shadow: 0 0 8px rgba(0,229,255,0.8), 0 0 24px rgba(0,229,255,0.4);
  pointer-events: none; opacity: 0; transition: opacity 0.12s;
}
.rd-label.visible { opacity: 1; }

/* ─── instrument corners ─── */
.rd-corner {
  position: fixed; width: 26px; height: 26px; z-index: 10; pointer-events: none;
  border: 0 solid var(--hairline);
}
.rd-corner.tl { top: 14px; left: 14px;   border-top-width: 1px; border-left-width: 1px; }
.rd-corner.tr { top: 14px; right: 14px;  border-top-width: 1px; border-right-width: 1px; }
.rd-corner.bl { bottom: 14px; left: 14px;  border-bottom-width: 1px; border-left-width: 1px; }
.rd-corner.br { bottom: 14px; right: 14px; border-bottom-width: 1px; border-right-width: 1px; }

/* ─── ident block (top-left) ─── */
.rd-ident {
  position: fixed; top: 26px; left: 30px; z-index: 15;
  display: flex; flex-direction: column; gap: 3px;
  pointer-events: none;
}
.rd-ident > * { pointer-events: auto; }
.rd-brand {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  letter-spacing: 0.18em; color: #eaffff; text-align: left;
  text-shadow: 0 0 14px rgba(0,229,255,0.5);
}
.rd-brand-mark { color: var(--cyan); }
.rd-ident-sub {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.26em;
  color: var(--muted);
}

/* cluster legend */
.rd-legend { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; }
.rd-legend-btn {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em;
  color: var(--muted); padding: 2px 6px 2px 0; text-align: left;
  transition: color 0.15s, transform 0.15s;
}
.rd-legend-btn:hover { color: var(--text); transform: translateX(2px); }
.rd-legend-btn.active { color: #eaffff; }
.rd-legend-btn .swatch {
  width: 7px; height: 7px; border-radius: 50%;
  box-shadow: 0 0 6px currentColor; flex: none;
}
.rd-legend-btn.active .swatch { outline: 1px solid rgba(255,255,255,0.7); outline-offset: 2px; }

/* ─── search (top-right) ─── */
.rd-search { position: fixed; top: 30px; right: 30px; z-index: 30; width: 250px; }
.rd-search-input {
  width: 100%;
  background: transparent;
  border: none; border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--text); padding: 6px 2px; outline: none;
}
.rd-search-input::placeholder { color: var(--muted); }
.rd-search-input:focus { border-bottom-color: var(--cyan); box-shadow: 0 1px 0 0 rgba(0,229,255,0.35); }
.rd-search-input::-webkit-search-cancel-button { display: none; }

.rd-search-results {
  position: absolute; top: calc(100% + 8px); right: 0; width: 330px; max-height: 50vh;
  overflow-y: auto; z-index: 40;
  background: var(--panel-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--hairline);
}
.sr-section { padding: 6px 0; }
.sr-section + .sr-section { border-top: 1px solid var(--hairline-dim); }
.sr-section-title {
  display: block; padding: 4px 14px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.22em; color: var(--muted);
}
.sr-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px; cursor: pointer;
  font-family: var(--font-body); font-size: 14px;
}
.sr-row:hover, .sr-row.is-active { background: rgba(0,229,255,0.08); }
.sr-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; box-shadow: 0 0 6px currentColor; }
.sr-text { flex: 1; min-width: 0; }
.sr-sub { display: block; font-size: 11px; color: var(--muted); }
.sr-meta { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); }
.sr-empty { padding: 12px 14px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.search-hit { background: none; color: var(--cyan); }

/* ─── readout panel (right) ─── */
.rd-panel {
  position: fixed; z-index: 25;
  top: 84px; right: 30px; bottom: 84px; width: 372px;
  background: var(--panel-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--hairline);
  border-top: 2px solid var(--cyan);
  padding: 22px 24px 28px;
  overflow-y: auto;
  transform: translateX(calc(100% + 40px));
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.rd-panel.open { transform: translateX(0); }

.rd-panel .close {
  position: absolute; top: 10px; right: 12px;
  font-size: 20px; color: var(--muted); line-height: 1;
}
.rd-panel .close:hover { color: var(--cyan); }

.rd-kicker {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.26em;
  margin-bottom: 6px;
}
.rd-title {
  font-family: var(--font-display); font-size: 21px; font-weight: 700;
  letter-spacing: 0.04em; color: #eaffff; line-height: 1.2;
}
.rd-sub { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 4px; }

.rd-section { margin-top: 20px; }
.rd-section h4 {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.24em;
  color: var(--muted); font-weight: 400; margin-bottom: 8px;
  border-bottom: 1px solid var(--hairline-dim); padding-bottom: 5px;
}
.rd-desc { font-size: 15px; color: var(--text); }
.rd-desc p + p { margin-top: 8px; }

.rd-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.rd-list button {
  display: block; width: 100%; text-align: left;
  padding: 7px 10px; border: 1px solid transparent;
  font-size: 14.5px; color: var(--text);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.rd-list button:hover {
  border-color: var(--hairline); background: rgba(0,229,255,0.05);
  transform: translateX(3px);
}
.rd-list .meta { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--muted); }

.rd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rd-chips .chip {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em;
  padding: 3px 9px; border: 1px solid var(--hairline);
  color: var(--text); transition: all 0.15s;
}
.rd-chips .chip:hover { border-color: var(--cyan); color: #eaffff; box-shadow: 0 0 10px rgba(0,229,255,0.25); }
.rd-chips .chip.static { cursor: default; color: var(--muted); }
.rd-chips .chip.static:hover { border-color: var(--hairline); box-shadow: none; }

.rd-cta {
  display: inline-block; margin-top: 4px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em;
  border: 1px solid var(--cyan-dim); color: var(--cyan);
  padding: 8px 16px; transition: all 0.15s;
}
.rd-cta:hover { background: rgba(0,229,255,0.1); box-shadow: 0 0 16px rgba(0,229,255,0.3); }

.rd-status { display: inline-block; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.18em; padding: 2px 8px; border: 1px solid; margin-left: 8px; vertical-align: 2px; }
.rd-status.live     { color: var(--green); border-color: rgba(16,185,129,0.5); }
.rd-status.wip      { color: var(--gold);  border-color: rgba(251,191,36,0.5); }
.rd-status.archived { color: var(--muted); border-color: rgba(74,106,128,0.5); }

.rd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hairline-dim); border: 1px solid var(--hairline-dim); }
.rd-stat { background: rgba(1,1,8,0.5); padding: 10px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rd-stat b { display: block; font-family: var(--font-display); font-size: 19px; color: var(--cyan); }
.rd-stat i { font-family: var(--font-mono); font-style: normal; font-size: 8.5px; letter-spacing: 0.1em; color: var(--muted); }

.rd-bullets { list-style: none; }
.rd-bullets li { position: relative; padding-left: 16px; margin-bottom: 7px; font-size: 14.5px; }
.rd-bullets li::before { content: '▸'; position: absolute; left: 0; color: var(--cyan-dim); }

.rd-avail {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--green);
}
.rd-avail::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px var(--green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ─── full-size window (profile / projects / service record) ─── */
.rd-window {
  position: fixed; inset: 0; z-index: 45;
  background: rgba(1,1,8,0.82);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  overflow-y: auto;
  padding: 60px 20px;
}
.rd-window-inner {
  position: relative;
  max-width: 1000px; margin: 0 auto;
  background: var(--panel-bg);
  border: 1px solid var(--hairline);
  border-top: 2px solid var(--cyan);
  padding: 34px 38px 44px;
  animation: winIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes winIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rd-window-inner .close {
  position: sticky; top: 0; float: right;
  margin: -16px -20px 0 0;
  font-size: 26px; color: var(--muted); line-height: 1; z-index: 2;
}
.rd-window-inner .close:hover { color: var(--cyan); }

.rd-win-head { margin-bottom: 26px; }
.rd-title-xl { font-size: 30px; }

.rd-win-cols { display: grid; grid-template-columns: 1.25fr 1fr; gap: 36px; }
.rd-win-cols > div > .rd-section:first-child { margin-top: 0; }

.rd-projgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rd-projcard {
  border: 1px solid var(--hairline-dim);
  padding: 20px 22px;
  display: flex; flex-direction: column;
  transition: border-color 0.2s;
}
.rd-projcard:hover { border-color: var(--hairline); }
.rd-projcard .rd-title { font-size: 17px; }
.rd-projcard-actions { margin-top: auto; padding-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

.rd-record { display: flex; flex-direction: column; gap: 26px; }
.rd-rec-item {
  display: grid; grid-template-columns: 130px 1fr; gap: 22px;
  border-top: 1px solid var(--hairline-dim); padding-top: 20px;
}
.rd-rec-period {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em;
  color: var(--record); padding-top: 4px;
}
.rd-rec-item .rd-title { font-size: 17px; }

/* ─── sector nav (bottom-center) ─── */
.rd-nav {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 15; display: flex; gap: 30px; align-items: center;
}
.rd-nav-btn {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.22em;
  color: var(--muted); padding: 6px 2px; position: relative;
  transition: color 0.2s, text-shadow 0.2s;
}
.rd-nav-btn::before {
  content: '◆'; position: absolute; top: -11px; left: 50%; transform: translateX(-50%) scale(0);
  font-size: 7px; color: var(--cyan); transition: transform 0.2s;
}
.rd-nav-btn:hover { color: var(--text); }
.rd-nav-btn.active { color: #eaffff; text-shadow: 0 0 12px rgba(0,229,255,0.6); }
.rd-nav-btn.active::before { transform: translateX(-50%) scale(1); }

/* ─── hint + coords hud ─── */
.rd-hint {
  position: fixed; bottom: 26px; left: 30px; z-index: 12;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em;
  color: var(--muted); transition: opacity 1s;
}
.rd-hint b { color: var(--cyan); font-weight: 400; }
.rd-hint.faded { opacity: 0; }
.rd-hud {
  position: fixed; bottom: 26px; right: 30px; z-index: 12;
  display: flex; flex-direction: column; gap: 3px; align-items: flex-end;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em;
  color: var(--muted); text-align: right;
}
.rd-hud-label { color: var(--cyan-dim); }
.rd-hud-sep { opacity: 0.5; margin: 0 2px; }

/* ─── boot overlay ─── */
.rd-boot {
  position: fixed; inset: 0; z-index: 100;
  background: var(--void);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: opacity 0.7s;
}
.rd-boot.done { opacity: 0; pointer-events: none; }
.rd-boot-lines {
  font-family: var(--font-mono); font-size: 12px; line-height: 2.1;
  color: var(--cyan); min-width: 340px;
}
.rd-boot-lines .dim { color: var(--muted); }
.rd-boot-lines .ok { color: var(--green); }
.rd-boot-lines div {
  overflow: hidden; white-space: nowrap;
  animation: bootline 0.3s steps(40) both;
}
@keyframes bootline { from { max-width: 0; } to { max-width: 100%; } }

/* ─── mobile ─── */
@media (max-width: 760px) {
  .rd-search { top: 22px; right: 16px; width: min(170px, calc(100vw - 190px)); }
  .rd-search-results { width: calc(100vw - 32px); max-width: 330px; }
  .rd-ident { top: 18px; left: 16px; max-width: 150px; }
  .rd-brand { font-size: 13px; }
  .rd-ident-sub { display: none; }
  .rd-legend .rd-legend-btn span.lbl { display: none; }
  .rd-legend { flex-direction: row; gap: 6px; margin-top: 10px; }

  .rd-panel {
    top: auto; left: 12px; right: 12px; bottom: 64px; width: auto;
    max-height: 46vh;
    transform: translateY(calc(100% + 90px));
  }
  .rd-panel.open { transform: translateY(0); }

  .rd-window { padding: 0; }
  .rd-window-inner {
    min-height: 100%; max-width: none; border-left: none; border-right: none;
    padding: 22px 18px 40px;
  }
  .rd-window-inner .close { margin: -6px 0 0 0; font-size: 30px; padding: 4px 8px; }
  .rd-win-cols { grid-template-columns: 1fr; gap: 0; }
  .rd-projgrid { grid-template-columns: 1fr; }
  .rd-rec-item { grid-template-columns: 1fr; gap: 6px; }
  .rd-title-xl { font-size: 24px; }

  .rd-nav {
    bottom: 14px; gap: 6px 14px; flex-wrap: wrap;
    width: 100%; justify-content: center; padding: 0 8px;
  }
  .rd-nav-btn { font-size: 9px; letter-spacing: 0.12em; padding: 4px 2px; }

  .rd-hint { display: none; }
  .rd-hud { display: none; }
  .rd-corner { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nebula { animation: none; }
  .rd-boot-lines div { animation: none; }
}
