/* ============================================
   NEON PROTOCOL — Reusable Components
   Terminal, cards, panels, buttons, etc.
   ============================================ */

/* ── Logo Block ── */

.logo-block {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
}

.logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.logo-triangle {
  width: 0; height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-bottom: 28px solid var(--primary);
  position: relative;
  filter: drop-shadow(0 0 8px rgba(204, 151, 255, 0.5));
}

.logo-triangle::after {
  content: '';
  position: absolute;
  top: 8px; left: -8px;
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 14px solid var(--surface);
}

.logo-main {
  font-family: 'OffBit', var(--font-headline);
  font-size: clamp(36px, 7vw, 64px);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 6px;
  text-shadow: 0 0 30px rgba(204, 151, 255, 0.3);
  position: relative;
}

.logo-glitch {
  font-family: 'OffBit', var(--font-headline);
  font-size: clamp(36px, 7vw, 64px);
  font-weight: 700;
  letter-spacing: 6px;
  position: absolute;
  top: 0; left: 0; right: 0;
}

.logo-glitch:nth-child(1) { color: rgba(204, 151, 255, 0.2); transform: translate(-2px, -2px); }
.logo-glitch:nth-child(2) { color: rgba(255, 113, 102, 0.15); transform: translate(3px, 2px); }

.logo-name-wrap { position: relative; display: inline-block; }

.logo-subtitle {
  font-family: var(--font-headline);
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 8px;
  text-indent: 8px;
  margin-top: 10px;
}

.logo-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(204, 151, 255, 0.4), transparent);
  margin-top: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Terminal Window ── */

.terminal {
  border: var(--ghost-border);
  background: var(--surface-container-high);
  border-radius: var(--radius-none);
  width: min(92vw, 680px);
  backdrop-filter: var(--blur-md);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.terminal-chrome {
  color: var(--on-surface-variant);
  font-size: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(71, 70, 86, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-container-low);
}

.terminal-dots { display: flex; gap: 6px; }
.terminal-dots span { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.terminal-dots span:nth-child(1) { background: var(--tertiary); }
.terminal-dots span:nth-child(2) { background: var(--warning); }
.terminal-dots span:nth-child(3) { background: var(--success); }

.terminal-title {
  flex: 1;
  text-align: center;
  font-size: 11px;
  letter-spacing: 1px;
  font-family: var(--font-mono);
}

.terminal-body {
  padding: 20px 24px;
  overflow-y: auto;
  max-height: 50vh;
}

/* ── Terminal Prompt ── */

.prompt { color: var(--primary); font-weight: 500; }
.prompt-dir { color: var(--warning); }
.prompt-sep { color: var(--on-surface-variant); }
.prompt-line { font-size: 13px; color: var(--on-surface); line-height: 1.8; }
.input-line { font-size: 13px; color: var(--on-surface); display: flex; align-items: center; }
.cmd-output { color: var(--on-surface); font-size: 13px; padding: 2px 0; white-space: pre-wrap; line-height: 1.6; }

#cmd-input {
  background: transparent;
  border: none;
  color: var(--on-surface);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  width: 1ch;
  max-width: 60%;
  caret-color: transparent;
}

.cursor {
  color: var(--primary);
  animation: cursorBlink 1.06s step-end infinite;
  margin-left: 1px;
  font-size: 13px;
}

.cursor.typing { display: none; }

/* ── Nav Listing (Terminal) ── */

.nav-listing { margin: 10px 0; }

.nav-entry {
  display: block;
  text-decoration: none;
  font-size: 13px;
  color: var(--on-surface);
  line-height: 2.2;
  padding-left: var(--space-md);
  transition: transform var(--transition-fast), background-position var(--transition-base);
  position: relative;
  background: linear-gradient(90deg, transparent, rgba(204, 151, 255, 0.04), transparent);
  background-size: 200% 100%;
  background-position: -100% 0;
  border-radius: var(--radius-none);
}

.nav-entry:hover {
  transform: translateX(4px);
  background-position: 100% 0;
}

.nav-entry::after {
  content: attr(data-flavor);
  position: absolute;
  left: 16px; bottom: -14px;
  font-size: 9px;
  color: var(--primary);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.nav-entry:hover::after { opacity: 0.6; }

.perms { color: rgba(255,255,255,0.25); }
.arrow { color: var(--primary); font-weight: bold; }

.nav-name.portal { color: var(--tertiary); text-shadow: 0 0 8px rgba(255, 113, 102, 0.3); }
.nav-name.thehub { color: var(--info); text-shadow: 0 0 8px rgba(78, 205, 196, 0.3); }
.nav-name.tools { color: var(--warning); text-shadow: 0 0 8px rgba(254, 188, 46, 0.3); }
.redacted-text { color: var(--surface-container-low); }
.nav-desc { color: rgba(255,255,255,0.2); font-size: 11px; }

/* ── Cards (Portal) ── */

.card {
  background: var(--surface-container-high);
  border: var(--ghost-border);
  border-radius: var(--radius-none);
  padding: 1.5rem 1rem;
  text-align: center;
  text-decoration: none;
  color: var(--on-surface);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(204, 151, 255, 0.05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card:hover {
  border: var(--ghost-border-hover);
  transform: translateY(-3px);
  box-shadow: var(--glow-sm);
}

.card:hover::before { opacity: 1; }

.card .icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card .icon svg {
  width: 100%;
  height: 100%;
  stroke: var(--primary);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card .label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.card .sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--on-surface-variant);
  margin-top: 0.3rem;
  letter-spacing: 0.08em;
  position: relative;
  z-index: 1;
}

.card .badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.5rem;
  padding: 2px 6px;
  border-radius: var(--radius-none);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 1;
  font-family: var(--font-mono);
}

.badge.admin {
  background: rgba(255, 113, 102, 0.15);
  color: var(--tertiary);
  border: 1px solid rgba(255, 113, 102, 0.2);
}

.card.secret { display: none; }
.card.secret.revealed {
  display: block;
  animation: fadeReveal 0.6s ease forwards;
}

/* ── Panels (Bio) ── */

.bio-panel {
  background: var(--surface-container-high);
  border: var(--ghost-border);
  border-radius: var(--radius-none);
  padding: var(--space-lg);
  backdrop-filter: var(--blur-md);
}

.panel-title {
  font-family: var(--font-headline);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(71, 70, 86, 0.2);
}

.bio-field { font-size: 12px; line-height: 2; }
.bio-label { color: var(--primary); font-weight: 600; }
.bio-value { color: rgba(255,255,255,0.7); }
.bio-status { color: var(--success); }

.bio-text {
  font-size: 12px;
  line-height: 1.8;
  color: rgba(255,255,255,0.5);
  margin-top: 12px;
}

/* ── Skill Bars ── */

.skill-section { margin-top: var(--space-md); }

.skill-title {
  font-family: var(--font-headline);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.skill-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

.skill-name {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  width: 140px;
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.skill-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--surface-variant);
  border-radius: var(--radius-none);
  overflow: hidden;
  position: relative;
}

.skill-bar {
  height: 100%;
  border-radius: var(--radius-none);
  background: linear-gradient(90deg, var(--primary-dim), var(--primary));
  position: relative;
  width: 0;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-bar::after {
  content: '';
  position: absolute;
  right: 0; top: 0;
  width: 3px; height: 100%;
  background: #fff;
  opacity: 0.6;
}

.skill-pct {
  font-size: 11px;
  color: var(--primary);
  width: 36px;
  text-align: right;
  font-weight: 600;
}

/* ── Neural Scan ── */

.neural-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.neural-title {
  font-family: var(--font-headline);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  margin-bottom: 16px;
  align-self: flex-end;
}

.neural-canvas {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  position: relative;
}

.neural-canvas canvas { width: 100%; height: 100%; }

.neural-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(204, 151, 255, 0.05) 49.5%, rgba(204, 151, 255, 0.05) 50.5%, transparent 50.5%) 0 0 / 30px 30px,
    linear-gradient(0deg, transparent 49.5%, rgba(204, 151, 255, 0.05) 49.5%, rgba(204, 151, 255, 0.05) 50.5%, transparent 50.5%) 0 0 / 30px 30px;
  pointer-events: none;
}

.scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(204, 151, 255, 0.4), transparent);
  animation: scanMove 3s linear infinite;
  pointer-events: none;
}

/* ── Back Links ── */

.back-link, .back {
  position: relative;
  z-index: 1;
  margin-top: 30px;
  color: var(--on-surface-variant);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: color var(--transition-base);
}

.back-link:hover, .back:hover {
  color: var(--primary);
  text-shadow: var(--glow-primary);
}

/* ── Status Bar ── */

.status-bar {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  font-size: 11px;
  color: rgba(255,255,255,0.15);
  letter-spacing: 1px;
}

/* ── Hint Text ── */

.hint {
  color: rgba(255,255,255,0.1);
  font-size: 10px;
  letter-spacing: 3px;
  text-align: right;
  margin-top: var(--space-md);
  position: relative;
  z-index: 1;
  width: min(92vw, 680px);
  text-transform: none;
}

/* ── Glitch Animations ── */

@keyframes glitch-flicker {
  0%, 92%, 94%, 100% { transform: translate(0); opacity: 1; }
  92.5% { transform: translate(-3px, 1px); opacity: 0.8; }
  93% { transform: translate(3px, -1px); opacity: 0.9; }
  93.5% { transform: translate(-1px, 0); opacity: 0.7; }
}

@keyframes glitch-ghost-1 {
  0%, 92%, 94%, 100% { transform: translate(-2px, -2px); opacity: 1; }
  92.5% { transform: translate(4px, -2px); opacity: 0.6; }
  93% { transform: translate(-4px, 2px); opacity: 0.8; }
  93.5% { transform: translate(2px, 1px); opacity: 0.5; }
}

@keyframes glitch-ghost-2 {
  0%, 92%, 94%, 100% { transform: translate(3px, 2px); opacity: 1; }
  92.5% { transform: translate(-2px, 3px); opacity: 0.7; }
  93% { transform: translate(5px, -1px); opacity: 0.5; }
  93.5% { transform: translate(-3px, -2px); opacity: 0.9; }
}

@keyframes terminalPulse {
  0%, 100% { box-shadow: 0 0 0px transparent; }
  50% { box-shadow: var(--glow-sm); }
}

/* ── Admin Mode ── */

.admin-mode { filter: hue-rotate(20deg) brightness(1.1); }
.admin-mode .terminal {
  border-color: rgba(204, 151, 255, 0.6);
  box-shadow: var(--glow-md);
}

/* ── Site Nav (shared across all pages) ── */

.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 40px;
  background: rgba(13, 13, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(204, 151, 255, 0.08);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 200;
  gap: 8px;
}

.site-nav-home {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: 2px;
  margin-right: 24px;
  white-space: nowrap;
  transition: text-shadow var(--transition-fast);
}

.site-nav-home:hover {
  text-shadow: var(--glow-primary);
}

.site-nav-links {
  display: flex;
  gap: 4px;
}

.site-nav-links a {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--on-surface-variant);
  text-decoration: none;
  text-transform: uppercase;
  padding: 6px 12px;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.site-nav-links a:hover,
.site-nav-links a.active {
  color: var(--primary);
  background: rgba(204, 151, 255, 0.06);
  text-shadow: none;
}

.site-nav-links a.active {
  border-bottom: 1px solid var(--primary);
}

/* ── Responsive ── */

@media (max-width: 600px) {
  .logo-main, .logo-glitch { font-size: 28px !important; letter-spacing: 4px; }
  .logo-subtitle { font-size: 10px; letter-spacing: 4px; }
  .logo-triangle { border-left-width: 10px; border-right-width: 10px; border-bottom-width: 18px; }
  .logo-triangle::after { top: 5px; left: -5px; border-left-width: 5px; border-right-width: 5px; border-bottom-width: 9px; }
  .terminal { width: 96vw; }
  .terminal-body { padding: 14px 16px; }
  .nav-entry { font-size: 12px; }
  .perms { display: none; }
  #cmd-input { max-width: 50%; }
  .scanlines { display: none; }
  .hint { font-size: 8px; }
  .circuit-bg::after { display: none; }

  .bio-container { grid-template-columns: 1fr; }
  .neural-canvas { max-width: 200px; }
  .skill-name { width: 100px; font-size: 10px; }

  .site-nav { padding: 0 12px; gap: 4px; }
  .site-nav-home { margin-right: 12px; font-size: 10px; letter-spacing: 1px; }
  .site-nav-links a { padding: 6px 8px; font-size: 9px; letter-spacing: 1px; }
}
