:root {
  --bg-color: #1a1a1a;
  --section-bg: #2a2a2a;
  --text-color: #e0e0e0;
  --neon-color: #ff00ff;
  --canvas-bg: #0a0a0a;
  --grid-color: #330033;
}

html {
  scroll-behavior: smooth;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neon-color);
  box-shadow: 0 0 10px var(--neon-color);
}

::selection {
  background: var(--neon-color);
  color: #000;
}

::-moz-selection {
  background: var(--neon-color);
  color: #000;
}

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.8s ease, color 0.8s ease;
  overflow-x: hidden;
}

body.a11y-font * {
  font-family: Arial, Helvetica, sans-serif !important;
  text-shadow: none !important;
}

body.a11y-no-anim *,
body.a11y-no-anim *::before,
body.a11y-no-anim *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

body.a11y-no-anim #matrixCanvas,
body.a11y-no-anim #kawaiiOv,
body.a11y-no-anim #crtOverlayElement {
  display: none !important;
}

body.a11y-large-text {
  font-size: 1.3rem !important;
}

body.a11y-large-text h1 {
  font-size: 2.5rem !important;
}

body.a11y-large-text h2 {
  font-size: 2rem !important;
}

body.a11y-large-text input,
body.a11y-large-text select,
body.a11y-large-text textarea,
body.a11y-large-text button {
  font-size: 1.2rem !important;
}

body.a11y-spaced * {
  letter-spacing: 0.12em !important;
  word-spacing: 0.15em !important;
  line-height: 2 !important;
}

body.a11y-contrast {
  --bg-color: #ffffff !important;
  --section-bg: #eeeeee !important;
  --text-color: #000000 !important;
  --neon-color: #000000 !important;
  --canvas-bg: #ffffff !important;
  --grid-color: #999999 !important;
}

body.a11y-contrast * {
  text-shadow: none !important;
  box-shadow: none !important;
}

body.a11y-contrast .crt-overlay {
  display: none !important;
}

body.a11y-contrast .project-card,
body.a11y-contrast .status-grid,
body.a11y-contrast .status-item {
  background: #ffffff !important;
  border-color: #000000 !important;
}

body.a11y-contrast input,
body.a11y-contrast select,
body.a11y-contrast textarea,
body.a11y-contrast button {
  background: #ffffff !important;
  color: #000000 !important;
  border: 2px solid #000000 !important;
}

body.a11y-contrast .toggle-slider {
  background-color: #cccccc !important;
  border: 2px solid #000000 !important;
}

body.a11y-contrast input:checked + .toggle-slider {
  background-color: #000000 !important;
}

body.a11y-contrast #a11yMenu,
body.a11y-contrast #modMenu {
  background: #ffffff !important;
  border: 3px solid #000000 !important;
  color: #000000 !important;
}

body.a11y-contrast .mod-tab-content {
  background: #f4f4f4 !important;
}

body.a11y-contrast #a11yMenu h3,
body.a11y-contrast .mod-row label {
  color: #000000 !important;
}

#a11yBtn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  will-change: transform;
  transform: translateZ(0);
  font-size: 28px;
  font-family: Arial, sans-serif;
  font-weight: bold;
  background: #0055ff;
  color: #ffffff;
  border: 3px solid #ffffff;
  border-radius: 50%;
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  user-select: none;
  box-shadow: 0 0 15px rgba(0,85,255,0.6);
  transition: transform 0.2s;
}

#a11yBtn:hover {
  transform: scale(1.1);
}

#a11yBtn:focus-visible {
  outline: 3px solid #ffcc00;
  outline-offset: 3px;
}

#a11yMenu {
  display: none;
  position: fixed;
  bottom: 85px;
  right: 20px;
  background: #111;
  border: 2px solid #0055ff;
  padding: 16px;
  border-radius: 14px;
  z-index: 10002;
  flex-direction: column;
  gap: 6px;
  color: #fff;
  width: 280px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.9);
  overflow: visible;
}

header {
  border-bottom: 2px solid var(--neon-color);
  margin-bottom: 40px;
  text-align: center;
  user-select: none;
  cursor: pointer;
  transition: text-shadow 0.3s ease;
  outline: none;
}

header:focus h1,
header:hover h1 {
  text-shadow: 0 0 15px var(--neon-color);
}

h1,
h2 {
  color: var(--neon-color);
  margin-bottom: 20px;
  transition: color 0.3s ease;
  font-family: 'Fira Code', 'Share Tech Mono', monospace;
}

section {
  margin-bottom: 40px;
  background: var(--section-bg);
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.6);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  position: relative;
  z-index: 2;
}

section:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.8);
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  margin-bottom: 20px;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

li:hover {
  color: var(--neon-color);
  text-shadow: 0 0 8px var(--neon-color);
}

b {
  color: var(--neon-color);
  transition: color 0.3s ease;
}

footer {
  margin-top: 60px;
  text-align: center;
  border-top: 1px solid #444;
  padding-top: 30px;
  position: relative;
  z-index: 2;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

@media (max-width: 600px) {
  .project-grid {
    grid-template-columns: 1fr;
  }

  body {
    padding: 20px 15px;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.2rem; }

  section {
    padding: 15px;
    margin-bottom: 24px;
  }

  .status-grid {
    grid-template-columns: 1fr;
    padding: 15px;
    gap: 10px;
  }

  .status-item {
    font-size: 1rem;
  }

  #modMenu {
    width: 92vw;
    left: 4vw;
    margin-left: 0;
    top: 5%;
    max-height: 85vh;
  }

  #a11yMenu {
    width: calc(100vw - 30px);
    right: 10px;
    left: 10px;
    padding: 12px;
    gap: 4px;
    bottom: 80px;
  }

  .jump-btn {
    max-width: 100%;
    padding: 14px 20px;
  }

  .controls-wrapper {
    gap: 8px;
  }

  canvas {
    max-width: 100%;
  }

  /* Nexus preview card on mobile */
  #nexusLive .project-card {
    height: 320px !important;
  }

  #nexusLive .project-card > div:first-child {
    font-size: 0.65rem !important;
    flex-wrap: wrap;
    gap: 4px;
  }

  #nexus-preview-log {
    font-size: 0.72rem !important;
    padding: 10px !important;
  }

  #nexusLive .project-card > div:last-child {
    flex-wrap: wrap;
    gap: 6px;
  }

  #nexus-ping-input {
    min-width: 0;
    width: 100% !important;
  }
}

.project-card {
  background: #0d0d0d;
  border: 1px solid #1e1e1e;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.project-card:hover {
  border-color: #333;
  box-shadow: 0 0 18px rgba(255,0,255,0.07);
}

.card-bar {
  background: #111;
  border-bottom: 1px solid #1e1e1e;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.card-bar h3 {
  margin: 0;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: #999;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: normal;
}

.card-body {
  padding: 16px 18px 18px;
}

.card-body p {
  font-size: 0.9rem;
  line-height: 1.75;
  color: #c0c0c0;
  margin: 0;
}

.pulse-indicator {
  color: var(--neon-color);
  animation: pulse 1.5s infinite;
  margin-right: 10px;
  will-change: opacity;
}

@keyframes pulse {
  0%   { opacity: 1; }
  50%  { opacity: 0.3; }
  100% { opacity: 1; }
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 15px;
  background: #111;
  padding: 20px;
  border: 1px solid var(--neon-color);
  border-radius: 5px;
}

.status-item {
  display: flex;
  align-items: center;
  font-weight: bold;
  font-size: 1.1em;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 10px;
  background: #555;
  transition: background 0.3s, box-shadow 0.3s;
}

.status-online {
  background: #00ff00;
  box-shadow: 0 0 8px #00ff00;
}

.status-offline {
  background: #ff0000;
  box-shadow: 0 0 8px #ff0000;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.status-loading {
  background: #666;
  animation: statusPulse 1.2s ease-in-out infinite;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  padding: 12px;
  background: var(--canvas-bg);
  color: var(--text-color);
  border: 1px solid #444;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  transition: outline 0.3s ease;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: 3px solid var(--neon-color);
  outline-offset: 2px;
}

.contact-form button {
  background: var(--neon-color);
  color: #000;
  padding: 15px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  font-size: 1.1rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.contact-form button:hover:not(:disabled) {
  box-shadow: 0 0 15px var(--neon-color);
}

.contact-form button:active:not(:disabled) {
  transform: scale(0.97);
}

@keyframes shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(3px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(3px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(1px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.shake-effect {
  animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes terrifyingTear {
  0% { transform: skewX(0deg); filter: invert(0) hue-rotate(0deg) contrast(1); }
  5% { transform: skewX(10deg); filter: invert(1) hue-rotate(90deg) contrast(3); }
  10% { transform: skewX(-10deg); filter: invert(0) hue-rotate(0deg) contrast(1); }
  50% { transform: skewX(0deg); filter: invert(0); }
  95% { transform: skewX(0deg) scale(1); filter: invert(0); }
  100% { transform: skewX(20deg) scale(1.05); filter: invert(1) contrast(5) blur(2px); }
}

.nuke-terrifying {
  animation: terrifyingTear 1.5s infinite;
}

@keyframes crt-flicker {
  0% { opacity: 0.8; }
  5% { opacity: 0.95; }
  10% { opacity: 0.8; }
  15% { opacity: 1; }
  50% { opacity: 0.9; }
  100% { opacity: 0.85; }
}

.game-container {
  text-align: center;
  position: relative;
  padding-bottom: 30px;
  user-select: none;
  -webkit-user-select: none;
}

.game-screen-wrapper {
  position: relative;
  display: inline-block;
  margin: 20px auto;
  max-width: 100%;
}

.crt-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,0.25) 50%),
    linear-gradient(90deg, rgba(255,0,0,0.06), rgba(0,255,0,0.02), rgba(0,0,255,0.06));
  background-size: 100% 4px, 3px 100%;
  pointer-events: none;
  z-index: 10;
  animation: crt-flicker 0.15s infinite;
  display: none;
}

canvas {
  display: block;
  background: var(--canvas-bg);
  border: 2px solid var(--neon-color);
  width: 100%;
  max-width: 400px;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  cursor: crosshair;
  box-shadow: 0 0 15px rgba(255,0,255,0.2);
}

.controls-wrapper {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 15px;
}

.jump-btn {
  background-color: #111;
  color: var(--neon-color);
  border: 2px solid var(--neon-color);
  padding: 15px 30px;
  font-size: 1.2em;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 2px;
  flex: 1;
  max-width: 200px;
}

.jump-btn:hover {
  background-color: var(--neon-color);
  color: #000;
  box-shadow: 0 0 15px var(--neon-color);
}

.jump-btn:active {
  transform: scale(0.95);
}

.game-mode-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 auto 12px;
  max-width: 420px;
}

.game-tab-btn {
  background: #111;
  color: var(--neon-color);
  border: 2px solid var(--neon-color);
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  flex: 1 1 auto;
  min-width: 0;
}

.game-tab-btn:hover {
  background: var(--neon-color);
  color: #000;
  box-shadow: 0 0 10px rgba(255, 0, 255, 0.35);
}

.game-tab-btn.active {
  background: var(--neon-color);
  color: #000;
  box-shadow: 0 0 12px rgba(255, 0, 255, 0.5);
}

#terminalOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  color: #00ff00;
  font-family: monospace;
  padding: 20px;
  z-index: 9999;
  overflow-y: auto;
  font-size: 1.2em;
  line-height: 1.5;
}

#modMenu {
  display: none;
  position: fixed;
  top: 10%;
  left: 50%;
  margin-left: -170px;
  background: rgba(10,10,10,0.97);
  border: 2px solid var(--neon-color);
  padding: 0;
  z-index: 10000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 15px rgba(255,0,0,0.5);
  color: #fff;
  width: 340px;
  border-radius: 10px;
  max-height: 90vh;
  flex-direction: column;
  transition: border-color 0.3s, box-shadow 0.3s;
  will-change: transform;
}

#modMenuHeader {
  cursor: move;
  padding: 15px;
  margin: 0;
  background: rgba(30,0,0,0.8);
  border-bottom: 2px solid #ff0000;
  border-radius: 8px 8px 0 0;
  text-align: center;
  font-size: 1.1em;
  letter-spacing: 2px;
}

.mod-tabs {
  display: flex;
  border-bottom: 1px solid #444;
  background: rgba(0,0,0,0.5);
  overflow-x: auto;
  scrollbar-width: none;
}

.mod-tabs::-webkit-scrollbar {
  display: none;
}

.mod-tab-btn {
  flex: 1;
  background: transparent;
  color: #888;
  border: none;
  padding: 10px 5px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.8em;
  transition: 0.3s;
  text-transform: uppercase;
  white-space: nowrap;
}

.mod-tab-btn:hover {
  color: #fff;
}

.mod-tab-btn.active {
  color: var(--neon-color);
  border-bottom: 2px solid var(--neon-color);
  text-shadow: 0 0 8px var(--neon-color);
}

.mod-tab-content {
  display: none;
  padding: 15px 20px;
  overflow-y: auto;
  max-height: calc(90vh - 120px);
}

.mod-tab-content.active {
  display: block;
}

.mod-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.9em;
  gap: 10px;
}

#a11yMenu .mod-row {
  margin-bottom: 0;
  font-size: 0.85em;
}

.a11y-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.a11y-opt {
  background: #1c1c1c;
  border: 1px solid #2a2a2a;
  color: #aaa;
  padding: 9px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.78em;
  font-family: Arial, sans-serif;
  text-align: center;
  font-weight: bold;
  letter-spacing: 0.2px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  user-select: none;
  line-height: 1.25;
  position: relative;
}

.a11y-opt:hover {
  border-color: #0055ff;
  background: #1f2533;
  color: #fff;
}

.a11y-opt.active {
  background: #0055ff;
  border-color: #0055ff;
  color: #fff;
}

/* Custom hover tooltip — pulls description from data-tip */
.a11y-opt[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 190px;
  background: #000;
  color: #fff;
  border: 1px solid #0055ff;
  font-size: 0.72rem;
  font-weight: normal;
  text-align: left;
  letter-spacing: normal;
  padding: 6px 8px;
  border-radius: 5px;
  line-height: 1.35;
  white-space: normal;
  z-index: 10003;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.7);
}

.a11y-opt[data-tip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #0055ff;
  z-index: 10003;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
}

/* Left column (odd-indexed): anchor tooltip at button's left edge */
.a11y-grid > .a11y-opt:nth-child(odd):not(.a11y-opt-full)[data-tip]::after {
  left: 0;
  transform: none;
}
.a11y-grid > .a11y-opt:nth-child(odd):not(.a11y-opt-full)[data-tip]::before {
  left: 18px;
  transform: none;
}

/* Right column (even-indexed): anchor tooltip at button's right edge */
.a11y-grid > .a11y-opt:nth-child(even):not(.a11y-opt-full)[data-tip]::after {
  left: auto;
  right: 0;
  transform: none;
}
.a11y-grid > .a11y-opt:nth-child(even):not(.a11y-opt-full)[data-tip]::before {
  left: auto;
  right: 18px;
  transform: none;
}

.a11y-opt[data-tip]:hover::after,
.a11y-opt[data-tip]:focus-visible::after,
.a11y-opt[data-tip]:hover::before,
.a11y-opt[data-tip]:focus-visible::before {
  opacity: 1;
  visibility: visible;
}

.a11y-opt-full {
  grid-column: 1 / -1;
}

.nuke-btn {
  background: #ff0000;
  color: #fff;
  width: 100%;
  padding: 10px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  margin-top: 10px;
  transition: box-shadow 0.2s, filter 0.2s;
}

.nuke-btn:hover {
  box-shadow: 0 0 10px currentColor;
  filter: brightness(1.2);
}

.nuke-btn:active {
  transform: scale(0.95);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #333;
  transition: .3s;
  border-radius: 22px;
  border: 1px solid #555;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: #aaa;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #111;
  border-color: var(--neon-color);
  box-shadow: 0 0 8px var(--neon-color) inset;
}

input:checked + .toggle-slider:before {
  transform: translateX(22px);
  background-color: var(--neon-color);
  box-shadow: 0 0 10px var(--neon-color);
}

input[type=range] {
  -webkit-appearance: none;
  width: 120px;
  background: transparent;
}

input[type=range]:focus {
  outline: none;
}

input[type=range]:focus-visible {
  outline: 2px solid var(--neon-color);
  outline-offset: 3px;
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: #222;
  border-radius: 3px;
  border: 1px solid #444;
}

input[type=range]::-webkit-slider-thumb {
  border: 1px solid var(--neon-color);
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #000;
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -6px;
  box-shadow: 0 0 8px var(--neon-color);
  transition: 0.2s;
}

input[type=range]::-webkit-slider-thumb:hover {
  background: var(--neon-color);
}

#matrixCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  border: none;
  background: transparent;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
  display: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  will-change: transform;
  transform: translateZ(0);
}

@keyframes kawaiiGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Skip to main content */
.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  background: #0055ff;
  color: #fff;
  padding: 10px 20px;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-weight: bold;
  font-size: 1rem;
  z-index: 99999;
  text-decoration: none;
  border: 2px solid #fff;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 10px;
  outline: 3px solid #ffcc00;
  outline-offset: 2px;
}

/* Screen-reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Enhanced focus-visible mode */
body.a11y-focus *:focus-visible {
  outline: 3px solid #ffcc00 !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 0 6px rgba(255, 204, 0, 0.25) !important;
}

/* Color blind friendly mode — swaps magenta/red/green for a blue/amber palette */
body.a11y-colorblind {
  --neon-color: #0099cc;
  --grid-color: #003355;
}
body.a11y-colorblind .status-online {
  background: #0099cc !important;
  box-shadow: 0 0 8px #0099cc !important;
}
body.a11y-colorblind .pulse-indicator {
  color: #0099cc;
}
body.a11y-colorblind .project-card {
  border-color: #0099cc !important;
}
body.a11y-colorblind .contact-form button {
  background: #0099cc;
}

/* ── Sticky Navigation ── */
/* ── Header identity ── */
.header-sub {
  font-size: 0.8rem;
  color: #666;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 1px;
  margin: 6px 0 0;
}
body.a11y-contrast .header-sub { color: #333 !important; }

/* ── Active project badge ── */
.card-active-badge {
  margin-left: auto;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  color: #0f0;
  border: 1px solid #0f0;
  border-radius: 3px;
  padding: 1px 6px;
  animation: activePulse 2s ease-in-out infinite;
  white-space: nowrap;
}
@keyframes activePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px rgba(0,255,0,0.4); }
  50%       { opacity: 0.6; box-shadow: none; }
}

.card-active-badge.is-online  { color: #0f0;    border-color: #0f0; background: transparent; }
.card-active-badge.is-offline { color: #ff4444; border-color: #ff4444; background: transparent; animation: none; box-shadow: none; }
.card-active-badge.is-ongoing { color: #ffcc00; border-color: #ffcc00; background: transparent; animation: ongoingPulse 1.6s ease-in-out infinite; }
@keyframes ongoingPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(255,204,0,0.5); }
  50%       { opacity: 0.55; box-shadow: none; }
}

/* ── Infrastructure service details ── */
.status-details {
  margin-top: 16px;
  border-top: 1px solid #1e1e1e;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.status-detail-row {
  font-size: 0.83rem;
  color: #777;
  line-height: 1.5;
}
.status-detail-row b {
  color: #aaa;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

/* ── Section accent colors ── */
section[data-accent] {
  border-top: 2px solid var(--section-accent, var(--neon-color));
}
section[data-accent] > h2 {
  color: var(--section-accent, var(--neon-color));
}
section[data-accent="cyan"]   { --section-accent: #00e5ff; }
section[data-accent="green"]  { --section-accent: #00ff88; }
section[data-accent="orange"] { --section-accent: #ff9100; }
body.a11y-contrast section[data-accent] {
  border-top-color: #000 !important;
}
body.a11y-contrast section[data-accent] > h2 {
  color: #000 !important;
}

/* ── Project card tags ── */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 14px;
}
.card-tag {
  font-size: 0.68rem;
  font-family: 'Share Tech Mono', monospace;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(255,0,255,0.1);
  border: 1px solid rgba(255,0,255,0.35);
  color: var(--neon-color);
  letter-spacing: 0.5px;
}
.card-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--neon-color);
  text-decoration: none;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.5px;
  transition: text-shadow 0.2s;
}
.card-link:hover { text-shadow: 0 0 8px var(--neon-color); }
body.a11y-contrast .card-tag {
  background: #eee !important;
  border-color: #000 !important;
  color: #000 !important;
}
body.a11y-contrast .card-link { color: #000 !important; }

/* project grid stays at 2 cols */

/* ── Tech tip ── */
#techTipText { line-height: 1.7; }

/* ── Form success state ── */
#formSuccess {
  display: none;
  text-align: center;
  padding: 30px 20px;
  border: 1px solid #00ff88;
  border-radius: 8px;
  background: rgba(0,255,136,0.06);
}
#formSuccess h3 {
  color: #00ff88;
  font-family: 'Fira Code', monospace;
  margin-bottom: 8px;
}
#formSuccess p { color: #aaa; font-size: 0.9rem; }

/* ── Accessibility: Word Spacing ── */
body.a11y-word-space p,
body.a11y-word-space li,
body.a11y-word-space label,
body.a11y-word-space button,
body.a11y-word-space input,
body.a11y-word-space textarea,
body.a11y-word-space select { word-spacing: 0.18em; letter-spacing: 0.03em; }

/* ── Accessibility: Pause Background ── */
body.a11y-no-bg #matrixCanvas { display: none !important; }

body.a11y-underline-links a { text-decoration: underline !important; text-underline-offset: 3px; }

body.a11y-large-tap button,
body.a11y-large-tap input[type="checkbox"] + .toggle-slider,
body.a11y-large-tap a.card-link,
body.a11y-large-tap .skip-link,
body.a11y-large-tap .a11y-opt {
  min-height: 44px !important;
  min-width: 44px !important;
}

body.a11y-no-bg #kawaiiOv     { display: none !important; }


