/* ======================================================
   Leonardo Pereira — "LEO_OS v3" HUD Interface
   2Advanced-inspired command console. Zero dependencies.
   ====================================================== */

/* --- Design Tokens --- */
:root {
  --bg:        #05080F;
  --bg2:       #081120;
  --panel:     rgba(9, 19, 36, 0.62);
  --panel-hi:  rgba(13, 28, 52, 0.72);
  --line:      rgba(55, 185, 241, 0.30);
  --line-dim:  rgba(55, 185, 241, 0.12);
  --cyan:      #37B9F1;
  --cyan-hi:   #7FDBFF;
  --steel:     #8DA2BC;
  --steel-dim: #54657E;
  --white:     #EAF4FF;
  --amber:     #FFB454;
  --green:     #4ade80;
  --red:       #F0506E;
  --violet:    #6A26CD;

  --glow-cyan:  rgba(55, 185, 241, 0.18);
  --glow-faint: rgba(55, 185, 241, 0.07);

  --topbar-h: 52px;
  --ticker-h: 34px;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: clamp(1.25rem, 3vw, 2rem);
  --space-lg: clamp(2rem, 5vw, 3.5rem);
  --space-xl: clamp(3rem, 8vw, 5.5rem);

  --font-display: 'Rajdhani', 'Avenir Next Condensed', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* chamfered panel corners */
  --chamfer: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: calc(var(--topbar-h) + 24px);
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 70% at 50% -10%, rgba(13, 35, 66, 0.55), transparent 60%),
    radial-gradient(ellipse 80% 50% at 80% 110%, rgba(20, 18, 48, 0.5), transparent 60%);
  background-attachment: fixed;
  color: var(--steel);
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.7;
  overflow-x: hidden;
}

::selection {
  background: rgba(55, 185, 241, 0.45);
  color: var(--white);
}

/* --- Background Canvas --- */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --- Scanlines + CRT flicker --- */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9990;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.016) 0px,
    rgba(255, 255, 255, 0.016) 1px,
    transparent 1px,
    transparent 3px
  );
  animation: crt-flicker 8s infinite;
}

@keyframes crt-flicker {
  0%, 100% { opacity: 1; }
  92%      { opacity: 1; }
  92.5%    { opacity: 0.65; }
  93%      { opacity: 1; }
  96%      { opacity: 1; }
  96.3%    { opacity: 0.8; }
  96.6%    { opacity: 1; }
}

/* --- Film Grain --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  z-index: 9991;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* --- HUD Corner Brackets --- */
.hud-corner {
  position: fixed;
  width: 26px;
  height: 26px;
  z-index: 9989;
  pointer-events: none;
  opacity: 0.7;
}

.hud-corner--tl { top: calc(var(--topbar-h) + 8px); left: 8px;  border-top: 1px solid var(--cyan); border-left: 1px solid var(--cyan); }
.hud-corner--tr { top: calc(var(--topbar-h) + 8px); right: 8px; border-top: 1px solid var(--cyan); border-right: 1px solid var(--cyan); }
.hud-corner--bl { bottom: calc(var(--ticker-h) + 8px); left: 8px;  border-bottom: 1px solid var(--cyan); border-left: 1px solid var(--cyan); }
.hud-corner--br { bottom: calc(var(--ticker-h) + 8px); right: 8px; border-bottom: 1px solid var(--cyan); border-right: 1px solid var(--cyan); }

/* --- Top Status Bar --- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0 var(--space-md);
  background: linear-gradient(to bottom, rgba(5, 10, 20, 0.92), rgba(5, 10, 20, 0.78));
  border-bottom: 1px solid var(--line-dim);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}

.topbar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--cyan) 30%, var(--cyan) 70%, transparent);
  opacity: 0.35;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover { color: var(--cyan-hi); }

.brand-mark {
  width: 10px;
  height: 10px;
  background: var(--cyan);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow: 0 0 10px var(--cyan);
  animation: mark-pulse 3s ease-in-out infinite;
}

@keyframes mark-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.brand-name { font-weight: 700; letter-spacing: 0.15em; }
.brand-ver  { color: var(--steel-dim); }

.topnav {
  display: flex;
  gap: 2px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.topnav::-webkit-scrollbar { display: none; }

.topnav a {
  color: var(--steel);
  text-decoration: none;
  padding: 6px 12px;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, text-shadow 0.2s ease;
  text-transform: uppercase;
}

.topnav a .n { color: var(--steel-dim); margin-right: 4px; }

.topnav a:hover {
  color: var(--cyan-hi);
  background: var(--glow-faint);
}

.topnav a.active {
  color: var(--cyan);
  background: var(--glow-faint);
  text-shadow: 0 0 8px var(--glow-cyan);
  box-shadow: inset 0 -1px 0 var(--cyan);
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
  color: var(--steel-dim);
}

.topbar-status .clock { color: var(--cyan); min-width: 8ch; text-align: right; }
.topbar-status .coords { display: inline-block; }

.snd-toggle, .term-toggle {
  background: none;
  border: 1px solid var(--line-dim);
  color: var(--steel);
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-transform: uppercase;
  white-space: nowrap;
}

.snd-toggle:hover, .term-toggle:hover {
  color: var(--cyan-hi);
  border-color: var(--line);
  box-shadow: 0 0 12px -4px var(--cyan);
}

.snd-toggle.on { color: var(--green); border-color: rgba(74, 222, 128, 0.4); }

/* --- Bottom Ticker --- */
.ticker {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--ticker-h);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  align-items: center;
  background: linear-gradient(to top, rgba(5, 10, 20, 0.92), rgba(5, 10, 20, 0.78));
  border-top: 1px solid var(--line-dim);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--steel-dim);
}

.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
  will-change: transform;
}

.ticker-track span { padding-right: 4em; }
.ticker-track .hl { color: var(--cyan); }

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* --- Layout --- */
.site {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: calc(var(--topbar-h) + var(--space-lg)) var(--space-md) calc(var(--ticker-h) + var(--space-lg));
}

/* --- Modules (chamfered HUD panels) --- */
.module {
  position: relative;
  margin-bottom: var(--space-lg);
  clip-path: var(--chamfer);
  background: linear-gradient(135deg, var(--line) 0%, var(--line-dim) 40%, var(--line-dim) 60%, var(--line) 100%);
  padding: 1px;
  opacity: 0.95;
}

.module-body {
  clip-path: var(--chamfer);
  background:
    linear-gradient(160deg, var(--panel-hi), var(--panel) 40%),
    var(--bg2);
  padding: var(--space-md) var(--space-md) var(--space-lg);
  position: relative;
  overflow: hidden;
}

/* faint blueprint grid inside panels */
.module-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--glow-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--glow-faint) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.35;
  pointer-events: none;
}

/* sweep shine across panel on reveal */
.module-body::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60%;
  left: -80%;
  background: linear-gradient(100deg, transparent, rgba(127, 219, 255, 0.05), transparent);
  pointer-events: none;
}

.module.in .module-body::after {
  animation: panel-sweep 1.4s ease-out 0.3s 1;
}

@keyframes panel-sweep {
  to { left: 130%; }
}

/* --- Module Header --- */
.module-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: var(--space-md);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-dim);
}

.module-head .mod-id { color: var(--steel-dim); }

.module-head .led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: led-blink 2.4s steps(1) infinite;
  flex-shrink: 0;
}

@keyframes led-blink {
  0%, 100% { opacity: 1; }
  85%      { opacity: 0.25; }
  92%      { opacity: 1; }
  96%      { opacity: 0.25; }
}

.module-head .head-fill {
  flex: 1;
  height: 5px;
  background: repeating-linear-gradient(
    90deg,
    var(--line-dim) 0px, var(--line-dim) 1px,
    transparent 1px, transparent 7px
  );
  opacity: 0.7;
}

.module-head .head-end { color: var(--steel-dim); letter-spacing: 0.05em; }

/* --- Profile (hero) module --- */
.profile-greeting {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: var(--space-sm);
  min-height: 1em;
}

.profile-name {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: var(--space-sm);
  position: relative;
}

.profile-name .accent { color: var(--cyan); text-shadow: 0 0 24px var(--glow-cyan); }

/* glitch effect */
.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.glitch.glitching::before {
  opacity: 0.8;
  color: var(--cyan);
  transform: translate(-2px, -1px);
  clip-path: inset(15% 0 60% 0);
  animation: glitch-shift 0.18s steps(2) 2;
}

.glitch.glitching::after {
  opacity: 0.8;
  color: var(--red);
  transform: translate(2px, 1px);
  clip-path: inset(60% 0 12% 0);
  animation: glitch-shift 0.18s steps(2) 2 reverse;
}

@keyframes glitch-shift {
  0%   { clip-path: inset(15% 0 60% 0); }
  50%  { clip-path: inset(48% 0 28% 0); }
  100% { clip-path: inset(70% 0 8% 0); }
}

.profile-role {
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  color: var(--steel);
  max-width: 54ch;
  margin-bottom: var(--space-sm);
  min-height: 1em;
}

.profile-role a { color: var(--cyan); }
.profile-role .flag { font-size: 0.9em; }

.profile-bio {
  font-size: clamp(0.92rem, 1.8vw, 1.02rem);
  color: var(--steel);
  max-width: 60ch;
  min-height: 1em;
}

/* data readout row under hero */
.profile-readout {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  margin-top: var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--steel-dim);
  opacity: 0;
  transition: opacity 1s ease;
}

.profile-readout--visible { opacity: 1; }

.profile-readout .ro b {
  display: block;
  color: var(--cyan);
  font-weight: 400;
  margin-top: 2px;
}

.profile-readout .ro .ok { color: var(--green); }

/* spinning reticle decoration */
.reticle {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 110px;
  height: 110px;
  opacity: 0.5;
  pointer-events: none;
}

.reticle svg { width: 100%; height: 100%; }
.reticle .r-spin    { animation: spin 14s linear infinite; transform-origin: center; }
.reticle .r-spin-rev { animation: spin 9s linear infinite reverse; transform-origin: center; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Telemetry: readouts + skill bars --- */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-dim);
  border: 1px solid var(--line-dim);
  margin-bottom: var(--space-md);
}

.tele-cell {
  background: rgba(5, 10, 20, 0.75);
  padding: var(--space-sm) var(--space-md);
  text-align: center;
}

.tele-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.04em;
  min-height: 1.35em;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.6vw, 2.4rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: 0 0 18px var(--glow-cyan);
}

.tele-value [data-to],
.tele-value [data-live-counter] {
  display: inline-block;
  min-width: 1.15em;
  text-align: right;
  transform-origin: 50% 70%;
}

.tele-value [data-live-counter="coffees"] { min-width: 4.2em; }
.tele-value [data-live-counter="lines"] { min-width: 5.9em; }

.tele-number--tick {
  animation: tele-number-tick 180ms cubic-bezier(0.2, 0.9, 0.1, 1);
}

@keyframes tele-number-tick {
  0% {
    opacity: 0.3;
    transform: translateY(0.35em) skewX(-5deg) scaleY(0.85);
    filter: blur(2px);
    text-shadow: 0 0 24px rgba(127, 219, 255, 0.65);
  }
  58% {
    opacity: 1;
    transform: translateY(-0.08em) skewX(2deg) scaleY(1.08);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) skewX(0) scaleY(1);
    filter: blur(0);
  }
}

.tele-value .unit {
  display: inline-block;
  color: var(--cyan);
  font-size: 0.6em;
  transform: translateY(0);
}

.tele-value .unit--delayed {
  opacity: 0;
  transform: translateY(0.34em);
  transition: opacity 0.34s ease, transform 0.34s ease;
}

.tele-value .unit--visible {
  opacity: 1;
  transform: translateY(0);
}

.tele-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel-dim);
  margin-top: 2px;
}

.bars { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm) var(--space-lg); }

.bar-row { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em; }

.bar-row .bar-head {
  display: flex;
  justify-content: space-between;
  color: var(--steel);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.bar-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 0.48em;
}

.signal-gem {
  display: inline-block;
  flex: 0 0 1em;
  width: 1em;
  height: 1em;
  color: var(--cyan-hi);
  transform-origin: 50% 58%;
  filter: drop-shadow(0 0 5px rgba(55, 185, 241, 0.55));
  animation: signal-gem-float 2.6s ease-in-out infinite;
}

.signal-gem--ruby {
  color: var(--red);
  filter: drop-shadow(0 0 6px rgba(240, 80, 110, 0.58));
}

.signal-gem--ai {
  color: var(--cyan-hi);
  animation-delay: -0.85s;
}

.signal-gem svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.signal-gem path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 30;
  animation: signal-gem-trace 2.6s linear infinite;
}

.signal-gem path + path {
  opacity: 0.72;
  stroke-dasharray: 22;
  animation-delay: -0.35s;
}

@keyframes signal-gem-float {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); opacity: 0.78; }
  50% { transform: translateY(-0.12em) rotate(4deg) scale(1.07); opacity: 1; }
}

@keyframes signal-gem-trace {
  0% { stroke-dashoffset: 30; opacity: 0.28; }
  35% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -30; opacity: 0.48; }
}

.bar-row .bar-pct { color: var(--cyan); }

.bar-track {
  height: 8px;
  background: rgba(55, 185, 241, 0.07);
  border: 1px solid var(--line-dim);
  position: relative;
  overflow: hidden;
}

.bar-track::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px, transparent 9px,
    rgba(5, 10, 20, 0.9) 9px, rgba(5, 10, 20, 0.9) 11px
  );
  z-index: 2;
  pointer-events: none;
}

.bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(55, 185, 241, 0.5), var(--cyan));
  box-shadow: 0 0 12px var(--glow-cyan);
  transition: width 1.3s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--bd, 0s);
}

.bar-fill--0 { --w: 100%; --bd: 0s; }
.bar-fill--1 { --w: 100%; --bd: 0.1s; }
.bar-fill--2 { --w: 100%; --bd: 0.2s; }
.bar-fill--3 { --w: 100%; --bd: 0.3s; }
.bar-fill--4 { --w: 100%; --bd: 0.4s; }
.bar-fill--5 { --w: 100%; --bd: 0.5s; }

.module.in .bar-fill { width: var(--w, 0%); }

/* --- Mission Log (timeline) --- */
.log-intro {
  font-size: 0.95rem;
  max-width: 64ch;
  margin-bottom: var(--space-md);
}

.log-intro a { color: var(--cyan); }
.log-intro a:hover { color: var(--cyan-hi); }

.log {
  position: relative;
  padding-left: 26px;
}

.log::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(to bottom, var(--cyan), var(--line-dim));
}

.log-entry {
  position: relative;
  padding-bottom: var(--space-md);
}

.log-entry:last-child { padding-bottom: 0; }

.log-entry::before {
  content: '';
  position: absolute;
  left: -25px;
  top: 7px;
  width: 7px;
  height: 7px;
  background: var(--bg);
  border: 1px solid var(--cyan);
  transform: rotate(45deg);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.log-entry:hover::before {
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.log-entry--now::before {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.6);
}

.log-stamp {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--steel-dim);
}

.log-stamp .now-flag {
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.35);
  padding: 0 6px;
  margin-left: 8px;
}

.log-role {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  margin: 1px 0;
}

.log-role a { color: var(--white); text-decoration: none; transition: color 0.2s ease, text-shadow 0.2s ease; }
.log-role a:hover { color: var(--cyan-hi); text-shadow: 0 0 12px var(--glow-cyan); }
.log-role .at { color: var(--steel-dim); font-weight: 500; }

.log-desc {
  font-size: 0.9rem;
  color: var(--steel);
  max-width: 58ch;
  line-height: 1.6;
}

/* --- Deployments (projects) --- */
.deploy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.deploy-card {
  position: relative;
  display: block;
  text-decoration: none;
  clip-path: var(--chamfer);
  background: linear-gradient(135deg, var(--line), var(--line-dim));
  padding: 1px;
  transition: transform 0.3s ease;
}

.deploy-card:hover { transform: translateY(-3px); }

.deploy-inner {
  clip-path: var(--chamfer);
  background: rgba(5, 10, 20, 0.85);
  padding: var(--space-md);
  height: 100%;
  position: relative;
  overflow: hidden;
}

.deploy-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    420px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    var(--glow-faint),
    transparent 45%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.deploy-card:hover .deploy-inner::before { opacity: 1; }

.deploy-id {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--steel-dim);
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}

.deploy-id .status-live { color: var(--green); }

.deploy-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 4px;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.deploy-card:hover .deploy-title {
  color: var(--cyan-hi);
  text-shadow: 0 0 14px var(--glow-cyan);
}

.deploy-desc {
  font-size: 0.88rem;
  color: var(--steel);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid var(--line-dim);
  background: var(--glow-faint);
  padding: 2px 8px;
  margin: 0 6px 6px 0;
}

/* --- Labs --- */
.labs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-lg);
}

.lab-item {
  position: relative;
  display: block;
  padding: 0.58rem 0.85rem 0.62rem;
  border-bottom: 1px solid rgba(55, 185, 241, 0.10);
  color: var(--steel);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.24s ease, box-shadow 0.24s ease, transform 0.24s ease;
}

.lab-item::before {
  content: '';
  position: absolute;
  inset: 0 -10px;
  background: linear-gradient(90deg, rgba(55, 185, 241, 0.10), transparent 72%);
  opacity: 0;
  transition: opacity 0.24s ease;
  pointer-events: none;
}

.lab-item:hover {
  border-color: rgba(55, 185, 241, 0.34);
  box-shadow: inset 2px 0 0 var(--cyan);
  transform: translateX(3px);
}

.lab-item:hover::before { opacity: 1; }

.lab-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 4ch minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: baseline;
  text-transform: uppercase;
}

.lab-num {
  color: var(--steel-dim);
  text-decoration: underline;
  text-decoration-color: rgba(55, 185, 241, 0.16);
  text-underline-offset: 0.28em;
  font-variant-numeric: tabular-nums;
  transition: color 0.24s ease, text-decoration-color 0.24s ease;
}

.lab-title {
  color: var(--white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.24s ease, text-shadow 0.24s ease;
}

.lab-type {
  display: inline-block;
  color: var(--cyan);
  border: 1px solid var(--line-dim);
  background: var(--glow-faint);
  padding: 2px 8px;
  line-height: 1.25;
  white-space: nowrap;
  transition: color 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.lab-item[href*="/experiments/"] .lab-type {
  color: var(--green);
  border-color: rgba(74, 222, 128, 0.18);
  background: rgba(74, 222, 128, 0.07);
}

.lab-item[href*="github.com"] .lab-type {
  color: #d8bf74;
  border-color: rgba(255, 180, 84, 0.18);
  background: rgba(255, 180, 84, 0.07);
}

.lab-arrow {
  color: var(--cyan);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.lab-desc {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 2px;
  padding-left: calc(4ch + 0.75rem);
  color: var(--steel-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.24s ease;
}

.lab-item:hover .lab-num {
  color: var(--cyan);
  text-decoration-color: var(--cyan);
}

.lab-item:hover .lab-title {
  color: var(--cyan-hi);
  text-shadow: 0 0 12px var(--glow-cyan);
}

.lab-item:hover .lab-type {
  color: var(--cyan-hi);
  border-color: var(--line);
  box-shadow: 0 0 12px -3px var(--cyan);
}

.lab-item[href*="/experiments/"]:hover .lab-type {
  color: #9fffc1;
  border-color: rgba(74, 222, 128, 0.36);
  box-shadow: 0 0 12px -3px rgba(74, 222, 128, 0.8);
}

.lab-item[href*="github.com"]:hover .lab-type {
  color: var(--amber);
  border-color: rgba(255, 180, 84, 0.36);
  box-shadow: 0 0 12px -3px rgba(255, 180, 84, 0.75);
}

.lab-item:hover .lab-desc { color: var(--steel); }

.lab-item:hover .lab-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* --- Comms (connect) --- */
.comms-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.comms-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-sm) var(--space-md);
  clip-path: var(--chamfer);
  background: linear-gradient(135deg, var(--line), var(--line-dim));
  text-decoration: none;
  transition: transform 0.25s ease;
}

.comms-item:hover { transform: translateY(-3px); }

.comms-inner {
  position: absolute;
  inset: 1px;
  clip-path: var(--chamfer);
  background: rgba(5, 10, 20, 0.88);
  transition: background 0.25s ease;
}

.comms-item:hover .comms-inner { background: rgba(9, 22, 40, 0.92); }

.comms-item > span {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  transition: color 0.25s ease;
}

.comms-item:hover > span { color: var(--cyan-hi); }

.comms-item .sig {
  margin-left: auto;
  color: var(--cyan);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.comms-item:hover .sig { opacity: 1; transform: translateX(0); }

.comms-note {
  margin-top: var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
  text-align: center;
}

.comms-note b,
.eot b {
  color: var(--cyan-hi);
  font-weight: 700;
}

/* --- Footer --- */
.eot {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--steel-dim);
  padding: var(--space-md) 0;
}

.eot .line {
  display: block;
  width: 120px;
  height: 1px;
  margin: 0 auto var(--space-sm);
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

.eot .hl { color: var(--cyan); }

/* --- Crosshair Cursor --- */
.xhair {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
  mix-blend-mode: screen;
}

.xhair--visible { opacity: 1; }

.xhair .ring {
  position: absolute;
  top: -14px;
  left: -14px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(55, 185, 241, 0.7);
  border-radius: 50%;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.xhair .h, .xhair .v {
  position: absolute;
  background: rgba(55, 185, 241, 0.9);
}

.xhair .h { width: 9px; height: 1px; top: 0; left: -4.5px; }
.xhair .v { width: 1px; height: 9px; left: 0; top: -4.5px; }

.xhair--hover .ring {
  transform: scale(1.6);
  border-color: var(--cyan-hi);
}

@media (hover: none) {
  .xhair { display: none; }
}

/* --- Terminal Palette --- */
.palette {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 13vh var(--space-sm) 0;
  background: rgba(3, 6, 12, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.palette--open { opacity: 1; pointer-events: auto; }

.palette-window {
  width: 100%;
  max-width: 580px;
  clip-path: var(--chamfer);
  background: linear-gradient(135deg, var(--line), var(--line-dim));
  padding: 1px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.palette--open .palette-window { transform: translateY(0) scale(1); }

.palette-win-inner {
  clip-path: var(--chamfer);
  background: rgba(4, 9, 18, 0.96);
}

.palette-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-dim);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--steel-dim);
}

.palette-titlebar .led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.palette-titlebar .palette-close {
  margin-left: auto;
  background: none;
  border: 1px solid var(--line-dim);
  color: var(--steel-dim);
  font-family: inherit;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  padding: 2px 8px;
}

.palette-titlebar .palette-close:hover { color: var(--white); border-color: var(--line); }

.palette-output {
  max-height: 290px;
  overflow-y: auto;
  padding: 12px 16px 4px;
  line-height: 1.75;
  color: var(--steel);
  overscroll-behavior: contain;
}

.palette-output:empty { padding: 0; }
.palette-output .out-cmd { color: var(--white); }
.palette-output .out-cmd::before { content: '> '; color: var(--cyan); }
.palette-output .out-accent { color: var(--cyan); }
.palette-output .out-ok { color: var(--green); }
.palette-output .out-warn { color: var(--amber); }
.palette-output .out-denied { color: var(--red); }
.palette-output a { color: var(--cyan); }

.palette-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

.palette-prompt { color: var(--cyan); }

.palette-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--white);
  font-family: inherit;
  font-size: inherit;
  caret-color: var(--cyan);
}

.palette-hint {
  padding: 8px 16px;
  border-top: 1px solid var(--line-dim);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--steel-dim);
}

.palette-fab {
  position: fixed;
  right: 14px;
  bottom: calc(var(--ticker-h) + 14px);
  z-index: 1001;
  width: 44px;
  height: 44px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  border: none;
  background: rgba(9, 22, 40, 0.9);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 1rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

@media (hover: none) {
  .palette-fab { display: flex; }
}

/* --- Preloader / Uplink Sequence --- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-family: var(--font-mono);
  color: var(--steel);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  transition: opacity 0.6s ease;
  cursor: pointer;
}

.preloader--done { opacity: 0; pointer-events: none; }

.preloader-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--white);
}

.preloader-title .hl { color: var(--cyan); }

.preloader-bar {
  width: min(420px, 70vw);
  height: 14px;
  border: 1px solid var(--line);
  padding: 2px;
  position: relative;
}

.preloader-bar-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    90deg,
    var(--cyan) 0px, var(--cyan) 6px,
    transparent 6px, transparent 9px
  );
  box-shadow: 0 0 14px var(--glow-cyan);
}

.preloader-status {
  min-height: 1.2em;
  text-transform: uppercase;
  color: var(--steel-dim);
}

.preloader-pct { color: var(--cyan); font-variant-numeric: tabular-nums; }

.preloader-noise {
  width: min(520px, 78vw);
  min-height: 4.8em;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  color: var(--steel-dim);
  text-transform: uppercase;
  opacity: 0.78;
  filter: drop-shadow(0 0 8px rgba(55, 185, 241, 0.12));
}

.boot-word {
  display: inline-block;
  min-width: 5ch;
  padding: 1px 4px;
  border: 1px solid rgba(55, 185, 241, 0.10);
  background: rgba(55, 185, 241, 0.035);
  animation: boot-jitter 0.18s steps(2, end) infinite;
}

.boot-word.hot {
  color: var(--cyan-hi);
  border-color: rgba(55, 185, 241, 0.32);
  text-shadow: 0 0 10px var(--glow-cyan);
}

@keyframes boot-jitter {
  0%   { transform: translate(0, 0); opacity: 0.72; }
  33%  { transform: translate(-1px, 1px); opacity: 1; }
  66%  { transform: translate(1px, -1px); opacity: 0.86; }
  100% { transform: translate(0, 0); opacity: 0.76; }
}

.preloader-skip {
  position: absolute;
  bottom: 28px;
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--steel-dim);
  animation: skip-fade 1s ease 1.2s both;
}

@keyframes skip-fade { from { opacity: 0; } to { opacity: 1; } }

.preloader-grant {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--green);
  text-shadow: 0 0 18px rgba(74, 222, 128, 0.5);
  opacity: 0;
}

.preloader-grant--show { animation: grant-flash 0.5s steps(2) 3 both; }

@keyframes grant-flash {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.2; }
}

/* --- Typing --- */
.type-line { min-height: 1em; }

.cursor-blink {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  background: var(--cyan);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink-cursor 0.4s step-end infinite;
}

@keyframes blink-cursor { 50% { opacity: 0; } }

/* --- Site hidden until uplink done --- */
.site--hidden { opacity: 0; }

.site--reveal { animation: site-fade-in 0.7s ease-out forwards; }

@keyframes site-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Reveal on scroll --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--d, 0s);
}

.reveal.in { opacity: 0.9; transform: translateY(0); }

/* modules unfold slightly differently */
.module.reveal { transform: translateY(30px) scale(0.99); }
.module.reveal.in { transform: translateY(0) scale(1); }

/* --- Responsive: tablets --- */
@media (max-width: 900px) {
  .telemetry-grid { grid-template-columns: repeat(2, 1fr); }
  .comms-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-status .coords { display: none; }
  .reticle { width: 80px; height: 80px; opacity: 0.3; }
}

/* --- Responsive: phones --- */
@media (max-width: 600px) {
  .bars { grid-template-columns: 1fr; }
  .deploy-grid { grid-template-columns: 1fr; }
  .labs-grid { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .topbar { gap: var(--space-sm); }
  .topbar-status { margin-left: auto; }
  .topbar-status .clock { min-width: 0; }
  .module-body { padding: var(--space-sm) var(--space-sm) var(--space-md); }
  .log { padding-left: 22px; }
  .log-entry::before { left: -21px; }
  .hud-corner { display: none; }
  .profile-readout { gap: var(--space-sm) var(--space-md); }
}

/* --- Accessibility: reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .ticker-track { animation: none; }
  .module.in .bar-fill, .bar-fill { transition: none; }
}
