:root {
  color-scheme: dark;
  --bg: #0a0a0f;
  --bg-2: #101018;
  --bg-3: #1a1a26;
  --surface: #22223a;
  --text: #e8e8f0;
  --text-muted: #6b6b80;
  --cyan: #00f0ff;
  --pink: #ff0055;
  --gold: #ffd700;
  --orange: #ff4f1f;
  --acid: #00ff88;
  --line: rgba(232,232,240,0.06);
  --line-strong: rgba(232,232,240,0.1);
  --glow-cyan: rgba(0,240,255,0.1);
  --glow-pink: rgba(255,0,85,0.08);
  --glow-gold: rgba(255,215,0,0.06);
  --glow-acid: rgba(0,255,136,0.06);
  --display: "Archivo Black", sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --radius: 12px;
  --radius-sm: 8px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 50% at 20% 20%, rgba(0,240,255,0.03) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(255,0,85,0.03) 0%, transparent 60%);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
::selection { background: rgba(0,240,255,0.2); color: var(--text); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 2px; }
body::after {
  content: ''; position: fixed; inset: 0; z-index: 9998;
  pointer-events: none; opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Particle Canvas ── */
#particle-canvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; opacity: 0.5;
}
/* ── Scanlines ── */
.scanlines {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.06) 2px, rgba(0,0,0,0.06) 4px);
}
/* ── Vignette ── */
.vignette {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.6) 100%);
}

/* ── Flash Messages ── */
.flash-stack {
  position: fixed; top: 1rem; left: 50%; z-index: 100;
  width: min(520px, calc(100% - 2rem));
  transform: translateX(-50%);
  display: grid; gap: .5rem;
}
.flash {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(10,10,15,0.9);
  backdrop-filter: blur(12px);
  font-size: .75rem;
  animation: flash-in .35s ease-out;
}
.flash span { color: var(--orange); font-weight: 700; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-12px) scale(.97); } }

/* ── Shared ── */
.overline {
  margin: 0; font-size: .62rem; font-weight: 500;
  letter-spacing: .22em; color: var(--text-muted);
}
.section-number {
  font-family: var(--display);
  font-size: 1rem; color: var(--cyan); opacity: .5; line-height: 1;
}
.section-label { display: flex; align-items: center; gap: 1.2rem; }
.section-label h2 {
  margin: .2rem 0 0;
  font-family: var(--display);
  font-size: clamp(2.2rem, 4.5vw, 4.5rem);
  line-height: .88; letter-spacing: -.02em;
  text-transform: uppercase; color: var(--text);
}
.section-head {
  display: flex; align-items: end; justify-content: space-between; gap: 2rem;
  margin-bottom: 3rem;
}
.section-head > p {
  width: 320px; margin: 0;
  color: var(--text-muted); font-size: .78rem; line-height: 1.6;
}

/* ── Authentication Screen ── */
.auth-screen {
  position: relative; z-index: 5;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(380px, .7fr);
}
.auth-terminal {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column;
  padding: clamp(1.5rem, 3vw, 3rem);
  background: var(--bg-2);
  overflow: hidden;
}
.auth-terminal::before {
  content: ''; position: absolute; top: -30%; right: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,240,255,0.05) 0%, transparent 60%);
  pointer-events: none;
}
.auth-brand {
  position: relative; z-index: 2;
  margin-top: auto; padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.nexus-mark {
  font-family: var(--display);
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: .84; letter-spacing: .04em;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nexus-sub {
  display: block; font-size: .6rem; letter-spacing: .2em;
  color: var(--text-muted); margin-top: .4rem;
}
.nexus-wordmark {
  font-family: var(--display);
  font-size: 1.6rem; letter-spacing: .04em;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.nexus-tag {
  font-size: .65rem; letter-spacing: .12em;
  color: var(--text-muted); margin-left: .3rem;
}
.nexus-dot { color: var(--text-muted); font-size: 1rem; margin: 0 .15rem; }

/* ── Terminal ── */
.terminal-viewport {
  position: relative; z-index: 2;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  overflow: hidden;
}
.terminal-bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .65rem .8rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.terminal-dot { width: 8px; height: 8px; border-radius: 50%; }
.terminal-dot.red { background: #ff5c5c; }
.terminal-dot.yellow { background: #ffb320; }
.terminal-dot.green { background: var(--acid); }
.terminal-title {
  margin-left: auto; font-size: .6rem;
  color: var(--text-muted); letter-spacing: .1em;
}
.terminal-body {
  padding: 1.2rem;
  font-size: .78rem; line-height: 1.8;
}
.terminal-body .line {
  opacity: 0;
  animation: terminal-line .3s ease-out forwards;
  white-space: nowrap; overflow: hidden;
}
.terminal-body .line:nth-child(1) { animation-delay: .3s; }
.terminal-body .line:nth-child(2) { animation-delay: 1.2s; }
.terminal-body .line:nth-child(3) { animation-delay: 2.4s; }
.terminal-body .line:nth-child(4) { animation-delay: 3.8s; }
.terminal-body .line:nth-child(5) { animation-delay: 5.4s; }
.terminal-body .line:nth-child(6) { animation-delay: 7.2s; }
@keyframes terminal-line {
  from { opacity: 0; max-width: 0; }
  to { opacity: 1; max-width: 100%; }
}
.terminal-body .blink {
  animation: terminal-line .3s ease-out forwards, blink-text 1s steps(1) infinite !important;
  animation-delay: 7.2s, 7.2s !important;
}
@keyframes blink-text { 50% { opacity: .3; } }
.terminal-body .prompt { color: var(--cyan); margin-right: .6rem; }
.terminal-body .accent { color: var(--orange); font-weight: 700; }

/* ── Auth Panel ── */
.auth-panel {
  position: relative; z-index: 5;
  min-height: 100vh;
  display: grid; place-items: center;
  padding: clamp(1.5rem, 3vw, 3rem);
  background: var(--bg);
  border-left: 1px solid var(--line);
}
.auth-panel::before {
  content: ''; position: absolute; top: -20%; right: -20%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,0,85,0.05) 0%, transparent 60%);
  pointer-events: none;
}
.login-card {
  position: relative; z-index: 2;
  width: min(100%, 400px);
  padding: 2rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(16,16,24,0.7);
  backdrop-filter: blur(20px);
}
.login-badge {
  font-size: .58rem; letter-spacing: .22em;
  color: var(--cyan); opacity: .5; margin-bottom: .5rem;
}
.login-icon { color: var(--text-muted); margin-bottom: .8rem; }
.login-card h2 {
  margin: 0 0 .4rem;
  font-family: var(--display);
  font-size: 2.8rem; line-height: .9;
  letter-spacing: -.01em; text-transform: uppercase;
}
.login-desc {
  margin: 0 0 1.5rem; font-size: .72rem;
  color: var(--text-muted); line-height: 1.5;
}
.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field span { font-size: .62rem; letter-spacing: .15em; color: var(--text-muted); }
.field input {
  width: 100%; min-height: 3rem;
  padding: .8rem .9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.3);
  color: var(--text); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0,240,255,0.08);
}
.field input:disabled { opacity: .4; cursor: not-allowed; }
.field input::placeholder { color: rgba(232,228,218,0.2); }
.pass-wrap { position: relative; }
.pass-hint {
  position: absolute; right: .9rem; top: 50%; transform: translateY(-50%);
  font-size: .55rem; letter-spacing: .1em; color: var(--text-muted); opacity: .4;
}
.notice {
  padding: .7rem .8rem; margin-bottom: 1rem;
  border: 1px solid rgba(255,79,31,0.3);
  border-radius: var(--radius-sm);
  background: rgba(255,79,31,0.08);
  color: var(--orange);
  font-size: .65rem; letter-spacing: .08em;
}
.login-foot {
  margin: 1.2rem 0 0; font-size: .6rem;
  color: var(--text-muted); text-align: center; letter-spacing: .06em;
}

/* ── Buttons ── */
.button {
  position: relative;
  display: inline-flex; align-items: center;
  gap: 1.2rem;
  min-height: 3rem; padding: .8rem 1.2rem;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700; font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  transition: all .25s cubic-bezier(.4,0,.2,1);
}
.button-primary {
  color: var(--bg);
  background: linear-gradient(135deg, var(--cyan), #00b8cc);
}
.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,240,255,0.25);
}
.btn-arrow { transition: transform .25s ease; }
.button:hover .btn-arrow { transform: translateX(4px); }

/* ── Portal Shell ── */
.portal-shell { position: relative; z-index: 5; }
.portal-header {
  position: sticky; top: 0; z-index: 50;
  height: 64px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center; gap: 2rem;
  padding: 0 clamp(1rem, 3vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(16px) saturate(1.4);
}
.masthead { display: flex; align-items: center; }
.primary-nav { display: flex; align-items: center; gap: 2rem; }
.nav-link {
  position: relative; display: flex; flex-direction: column;
  align-items: center;
  font-size: .65rem; letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .25s;
}
.nav-link:hover { color: var(--text); }
.nav-underline {
  display: block; width: 0; height: 1px;
  margin-top: 2px;
  background: var(--cyan);
  transition: width .35s ease;
}
.nav-link:hover .nav-underline { width: 100%; }
.header-right { display: flex; align-items: center; gap: 1rem; }
.user-badge {
  font-size: .6rem; letter-spacing: .12em;
  padding: .35rem .7rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--text-muted);
}
.signout {
  padding: .45rem .8rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: transparent;
  font-size: .62rem; letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: all .2s;
}
.signout:hover {
  color: var(--pink);
  border-color: var(--pink);
  box-shadow: 0 0 20px rgba(255,0,85,0.08);
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 480px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(340px, .6fr);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero-grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px; opacity: .5;
}
.hero::after {
  content: ''; position: absolute; top: -15%; left: 10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(0,240,255,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.hero-main {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(3rem, 6vw, 5rem) clamp(2rem, 5vw, 4rem);
  border-right: 1px solid var(--line);
}
.hero-breadcrumb {
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: 1.2rem;
  font-size: .6rem; letter-spacing: .15em; color: var(--text-muted);
}
.crumb-active { color: var(--cyan); }
.crumb-sep { color: var(--text-muted); opacity: .4; }
.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: clamp(4.5rem, 9vw, 9rem);
  line-height: .84; letter-spacing: -.02em;
  text-transform: uppercase;
}
.gradient-text {
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-lede {
  max-width: 540px; margin: 0;
  color: var(--text-muted);
  font-size: clamp(.85rem, 1.1vw, 1rem); line-height: 1.65;
}
.hero-actions {
  margin-top: 2.5rem;
  display: flex; align-items: center; gap: 3rem;
}
.hero-actions .button-primary { min-width: 180px; }
.hero-stats { display: flex; gap: 1.8rem; }
.stat-block { text-align: center; }
.stat-value {
  display: block;
  font-family: var(--display);
  font-size: 2rem; line-height: 1;
  letter-spacing: -.02em;
  color: var(--cyan);
  text-shadow: 0 0 20px rgba(0,240,255,0.15);
}
.stat-label {
  font-size: .55rem; letter-spacing: .12em;
  color: var(--text-muted); text-transform: uppercase;
}

/* ── Health Panel ── */
.health-panel {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 2.5rem);
  background: var(--bg-2);
  overflow: hidden;
}
.health-panel::before {
  content: ''; position: absolute; bottom: -20%; right: -20%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(0,255,136,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.health-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 1rem;
}
.health-label {
  font-size: .58rem; letter-spacing: .2em; color: var(--text-muted);
}
.health-state {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .6rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
}
.status-pulse {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; }
  50% { box-shadow: 0 0 0 5px transparent; }
}
.health-up { color: var(--acid); }
.health-slow { color: #ffb320; }
.health-down { color: #ff5c5c; }
.health-metric {
  display: flex; align-items: baseline; gap: .3rem;
  margin-top: 1.5rem;
}
.health-number {
  font-family: var(--display);
  font-size: clamp(4rem, 7vw, 6rem);
  line-height: .8; letter-spacing: -.02em;
  color: var(--text);
  text-shadow: 0 0 30px rgba(0,240,255,0.1);
}
.health-divider { color: var(--text-muted); font-size: 1.2rem; opacity: .4; }
.health-total {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: .9; color: var(--text-muted);
}
.health-unit {
  font-size: .55rem; letter-spacing: .12em;
  color: var(--text-muted); text-transform: uppercase; margin-left: .3rem;
}
.health-bar {
  height: 3px; margin: 1.5rem 0;
  background: var(--surface);
  overflow: hidden; border-radius: 2px;
}
.health-fill {
  display: block;
  width: var(--fill);
  min-width: 1%; height: 100%;
  background: linear-gradient(90deg, var(--acid), #00ffaa);
  transition: width .6s ease;
}
.health-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0; padding-top: .5rem;
  border-top: 1px solid var(--line);
}
.health-details div { padding: .6rem 0 0; }
.health-details dt {
  font-size: .55rem; letter-spacing: .15em;
  color: var(--text-muted); margin-bottom: .05rem;
}
.health-details dd { margin: 0; font-size: .85rem; font-weight: 500; }
.health-error { color: var(--orange); font-size: .65rem; margin: .5rem 0 0; }
.health-refresh {
  position: absolute; top: 1rem; right: 1rem;
  color: var(--text-muted); opacity: .3;
  cursor: pointer; transition: opacity .2s;
}
.health-refresh:hover { opacity: 1; color: var(--cyan); }

/* ── Featured Section ── */
.featured-section {
  position: relative; z-index: 5;
  padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 3vw, 3rem);
  max-width: 1500px; margin: 0 auto;
}
.featured-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  background: var(--line);
}
.featured-card {
  position: relative;
  grid-column: span 3;
  min-height: 340px;
  display: flex; flex-direction: column;
  padding: 1.8rem;
  background: var(--bg-2);
  overflow: hidden;
  transition: all .35s cubic-bezier(.25,.46,.45,.94);
  animation: card-in .5s both;
  animation-delay: calc(var(--i) * 80ms);
}
.featured-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 50%, rgba(0,240,255,0.02));
  transition: opacity .4s; opacity: 0;
}
.featured-card:hover::before { opacity: 1; }
.featured-card:hover {
  transform: translateY(-4px);
  background: var(--bg-3);
}
.featured-card:focus-within { outline: 2px solid var(--cyan); outline-offset: -2px; z-index: 2; }
.card-glow {
  position: absolute; top: -50%; right: -50%;
  width: 100%; height: 100%;
  background: radial-gradient(circle at center, rgba(0,240,255,0.06), transparent 60%);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.featured-card:hover .card-glow { opacity: 1; }
.card-index {
  font-size: .6rem; color: var(--text-muted);
  opacity: .4; font-weight: 500;
}
.card-top {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  margin-top: 1.8rem;
}
.tool-group {
  font-size: .58rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-muted);
}
.tool-status {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .55rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--acid);
}
.tool-status::before {
  content: ""; width: 5px; height: 5px;
  border-radius: 50%; background: currentColor;
}
.tool-status.internal { color: #ffb320; }
.card-name {
  margin: auto 0 1rem;
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.5vw, 2.8rem);
  line-height: .92; letter-spacing: -.02em;
  text-transform: uppercase;
  color: var(--text);
}
.card-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: .7rem; line-height: 1.5;
}
.card-bottom {
  display: flex; align-items: end; justify-content: space-between; gap: 1rem;
  margin-top: 1.2rem;
}
.card-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag {
  padding: .15rem .4rem;
  font-size: .52rem; letter-spacing: .06em;
  color: var(--text-muted);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
}
.launch-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform .25s ease, color .25s;
}
.featured-card:hover .launch-arrow {
  transform: translate(6px, -4px);
  color: var(--cyan);
}

/* ── Catalog Section ── */
.catalog-section { position: relative; z-index: 5; margin-top: 2px; }
.catalog-strip {
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--pink), var(--gold));
  opacity: .4;
}
.catalog-inner {
  padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 3vw, 3rem);
  max-width: 1500px; margin: 0 auto;
}
.catalog-head {
  display: grid;
  grid-template-columns: 1fr minmax(300px, .7fr);
  align-items: start; gap: 3rem;
  margin-bottom: .5rem;
}
.search-wrap {
  display: flex; align-items: center; gap: .8rem;
  padding: 0 0 .5rem;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color .3s;
}
.search-wrap:focus-within { border-bottom-color: var(--cyan); }
.search-glyph {
  color: var(--text-muted); opacity: .3;
  font-family: var(--mono); font-size: 1rem;
}
.search-wrap input {
  width: 100%; padding: .7rem 0;
  border: 0; outline: 0;
  color: var(--text); background: transparent;
  font-size: .85rem;
}
.search-wrap input::placeholder { color: rgba(232,228,218,0.15); }
kbd {
  min-width: 24px; padding: .1rem .35rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--bg-3);
  font-family: var(--mono);
  font-size: .6rem; text-align: center;
  color: var(--text-muted);
}
.filter-bar {
  display: flex; flex-wrap: wrap;
  gap: 1px; margin-top: 2rem;
  background: var(--line);
}
.filter-button {
  display: flex; align-items: center; gap: .5rem;
  padding: .7rem 1rem; border: 0;
  color: var(--text-muted); background: var(--bg);
  font-size: .62rem; letter-spacing: .15em;
  text-transform: uppercase;
  cursor: pointer; transition: all .25s;
}
.filter-button sup { font-size: .5rem; color: var(--text-muted); opacity: .4; }
.filter-button:hover { color: var(--text); background: var(--bg-3); }
.filter-button.active {
  color: var(--cyan); background: var(--bg-3);
  box-shadow: inset 0 -1px 0 var(--cyan);
}
.filter-button.active sup { color: var(--cyan); opacity: .6; }

.catalog-meta {
  display: flex; justify-content: space-between;
  margin: 1.8rem 0 .7rem;
  font-size: .58rem; letter-spacing: .12em; color: var(--text-muted);
}
.catalog-hint { opacity: .4; }
.catalog-board { display: grid; gap: 2px; }
.catalog-bay {
  display: grid;
  grid-template-columns: minmax(140px, .22fr) 1fr;
  gap: 2px;
  background: var(--line);
  animation: bay-in .45s both;
  animation-delay: calc(var(--bay) * 60ms);
}
.bay-head {
  display: flex; flex-direction: column;
  padding: 1.2rem 1.2rem 1rem;
  background: var(--bg-2);
}
.bay-index {
  font-size: .55rem; color: var(--text-muted);
  opacity: .3; font-weight: 500;
  margin-bottom: auto;
}
.bay-head h3 {
  margin: .5rem 0;
  font-family: var(--display);
  font-size: clamp(1.1rem, 2vw, 2.2rem);
  line-height: .9; letter-spacing: -.01em;
  text-transform: uppercase; color: var(--text);
}
.bay-count {
  font-size: .55rem; letter-spacing: .1em;
  color: var(--text-muted); text-transform: uppercase;
}
.bay-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px; background: var(--line);
}
.tool-card {
  position: relative;
  min-height: 260px;
  display: flex; flex-direction: column;
  padding: 1.2rem;
  background: var(--bg);
  overflow: hidden;
  transition: all .3s cubic-bezier(.25,.46,.45,.94);
  animation: card-in .4s both;
  animation-delay: calc(var(--i) * 40ms);
}
.tool-card-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(0,240,255,0.015));
  opacity: 0; transition: opacity .4s; pointer-events: none;
}
.tool-card:hover .tool-card-bg { opacity: 1; }
.tool-card:hover {
  transform: translateY(-3px);
  background: var(--bg-3);
}
.tool-card:focus-within { outline: 2px solid var(--cyan); outline-offset: -2px; z-index: 2; }
.tool-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  margin-bottom: 1rem;
}
.tool-number {
  font-size: .55rem; color: var(--text-muted);
  opacity: .4; font-weight: 500; letter-spacing: .08em;
}
.tool-card .tool-status { color: var(--acid); }
.tool-card .tool-status.internal { color: #ffb320; }
.tool-name {
  margin: 0 0 .6rem;
  font-family: var(--display);
  font-size: clamp(1.1rem, 1.5vw, 1.7rem);
  line-height: .92; letter-spacing: -.01em;
  text-transform: uppercase; color: var(--text);
}
.tool-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: .65rem; line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.tool-card-foot {
  display: flex; align-items: end; justify-content: space-between; gap: 1rem;
  margin-top: auto; padding-top: .8rem;
  border-top: 1px solid var(--line);
}
.tool-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.tool-tags span {
  padding: .12rem .35rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: .5rem; text-transform: uppercase;
  color: var(--text-muted);
}
.tool-arrow {
  font-size: 1rem; color: var(--text-muted);
  opacity: .4; transition: all .25s;
}
.tool-card:hover .tool-arrow {
  transform: translate(4px, -3px);
  opacity: 1; color: var(--cyan);
}
.empty-state {
  grid-column: 1 / -1;
  padding: 3rem 1rem;
  border: 1px dashed var(--line-strong);
  color: var(--text-muted);
  font-size: .68rem; text-align: center;
}
@keyframes card-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes bay-in { from { opacity: 0; transform: translateY(16px); } }

/* ── Footer ── */
.portal-footer {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: 2rem clamp(1rem, 3vw, 3rem);
  border-top: 1px solid var(--line);
  max-width: 1500px; margin: 0 auto;
  font-size: .6rem; letter-spacing: .08em;
  color: var(--text-muted);
}
.back-top { color: var(--text-muted); transition: color .2s; }
.back-top:hover { color: var(--cyan); }

/* ── Log Viewer ── */
.logs-page { position: relative; z-index: 5; padding: 0 clamp(1rem, 3vw, 3rem); max-width: 1500px; margin: 0 auto; }
.logs-shell { padding-bottom: 3rem; }
.logs-head {
  min-height: 260px;
  display: flex; align-items: end; justify-content: space-between; gap: 2rem;
  padding: 3rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
}
.logs-head h1 {
  margin: .3rem 0 0;
  font-family: var(--display);
  font-size: clamp(2.5rem, 5vw, 5rem);
  line-height: .88; letter-spacing: -.02em;
  text-transform: uppercase;
}
.container-name { display: grid; justify-items: end; gap: .6rem; max-width: 50%; }
.container-name code { color: var(--text-muted); text-align: right; overflow-wrap: anywhere; font-size: .75rem; }
.log-window {
  margin-top: 1.5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.5);
}
.log-window pre {
  max-height: 65vh; margin: 0; padding: 1rem;
  overflow: auto; white-space: pre-wrap;
  color: var(--acid);
  font-family: var(--mono);
  font-size: .72rem; line-height: 1.7;
}
.log-line { display: block; padding: 0 .3rem; }
.log-line:hover { background: rgba(0,255,136,0.06); color: var(--text); }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-terminal { min-height: 55vh; }
  .auth-panel { min-height: auto; padding-block: 4rem; border-left: 0; border-top: 1px solid var(--line); }
  .terminal-body .line { white-space: normal; }
  .hero { grid-template-columns: 1fr; }
  .hero-main { border-right: 0; border-bottom: 1px solid var(--line); }
  .health-panel { min-height: 360px; }
  .health-metric { margin-top: 1rem; }
  .featured-card { grid-column: span 6; min-height: 300px; }
  .catalog-bay { grid-template-columns: 120px 1fr; }
  .bay-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-head { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 760px) {
  .portal-shell, .logs-shell { width: 100%; }
  .portal-header {
    height: auto; min-height: 60px;
    grid-template-columns: auto 1fr auto;
    gap: .8rem; padding: 0 .8rem;
  }
  .primary-nav { gap: 1rem; }
  .user-badge { display: none; }
  .auth-terminal { padding: 1rem; min-height: 50vh; }
  .auth-panel { padding: 2.5rem 1rem; }
  .login-card { padding: 1.5rem; }
  .terminal-body { font-size: .68rem; }
  .hero { min-height: auto; }
  .hero-main { padding: 3rem 1rem; }
  .hero h1 { font-size: clamp(3rem, 15vw, 5rem); }
  .hero-actions { flex-direction: column; align-items: stretch; gap: 1.5rem; }
  .hero-stats { justify-content: center; }
  .health-panel { min-height: 320px; padding: 1.5rem; }
  .section-head { flex-direction: column; align-items: start; }
  .section-head > p { width: auto; }
  .featured-card { min-height: 280px; grid-column: span 12; }
  .catalog-inner { padding: 2rem .8rem; }
  .catalog-bay { grid-template-columns: 1fr; }
  .bay-head { min-height: 90px; }
  .bay-head h3 { margin-top: auto; }
  .bay-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 240px; }
  .catalog-hint { display: none; }
  .portal-footer { flex-direction: column; align-items: start; gap: .8rem; padding: 1.5rem .8rem; }
  .logs-head { flex-direction: column; align-items: start; justify-content: end; min-height: 220px; }
  .container-name { max-width: 100%; justify-items: start; }
  .container-name code { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
