/* ==========================================================================
   CSS Stylesheet: Personal Website (Black on White Minimal) & Roaming Hebbie
   ========================================================================== */

:root {
  color-scheme: light;
  --bg-primary: #ffffff;
  --text-main: #000000;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html, body {
  background-color: #ffffff !important;
  color: #000000 !important;
  color-scheme: light !important;
  font-family: var(--font-sans);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ==========================================================================
   Website Content Layout: Plain Black on White
   ========================================================================== */

.page-wrapper {
  max-width: 975px;
  margin: 0 auto;
  padding: 60px 24px 100px 24px;
}

header.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 64px;
}

h1.page-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #000000;
  margin: 0;
}

.header-links {
  font-size: 0.95rem;
  color: #000000;
}

.content-section {
  margin: 0 0 80px 0;
}

.content-section:last-child {
  margin-bottom: 0;
}

.content-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #000000;
  text-align: center;
  background: #ffffff;
  border: 1px solid #000000;
  border-radius: 0;
  padding: 10px 16px;
  margin: 0 0 24px 0;
  width: 100%;
  box-sizing: border-box;
}

.content-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #000000;
  margin: 28px 0 0 0;
}

.content-section ul {
  list-style-type: disc;
  padding-left: 20px;
  margin-bottom: 20px;
}

.content-section li {
  color: #000000;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 5px;
}

.content-section li:last-child {
  margin-bottom: 0;
}

.content-section p {
  color: #000000;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 14px;
}

.content-section p:last-child {
  margin-bottom: 0;
}

.content-section p:has(+ ul) {
  margin-bottom: 0;
}

/* Straight black line separators between sections (hidden/deprecated in favor of header boxes) */
hr.section-separator {
  display: none;
}

/* Section content container (padding under section headers) */
.section-content {
  padding: 0 40px;
}

.content-card {
  background: #ffffff;
  border: 1px solid #000000;
  border-radius: 0;
  padding: 16px 20px;
  box-sizing: border-box;
  width: 600px;
  max-width: 100%;
}

/* Alternate cards between right-aligned (starting on right) and left-aligned */
.content-card:nth-child(odd) {
  align-self: flex-end;
}

.content-card:nth-child(even) {
  align-self: flex-start;
}

/* Explicit alignment overrides */
.content-card.align-left {
  align-self: flex-start !important;
}

.content-card.align-right {
  align-self: flex-end !important;
}

.content-card h3,
.content-card .card-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #000000;
  margin-bottom: 0;
}

.content-card ul {
  list-style-type: disc;
  padding-left: 20px;
  margin: 0;
}

.content-card li {
  color: #000000;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 5px;
}

.content-card li:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .section-content {
    padding: 0;
  }

  .content-card {
    width: 100%;
    align-self: stretch !important;
  }
}

a {
  color: #000000;
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration: none;
}

/* ==========================================================================
   Word Token & Eaten Text Styling
   ========================================================================== */

.word-token {
  display: inline;
  position: relative;
  transition: opacity 0.5s ease;
}

/* When a word is eaten by Hebbie: becomes partially translucent */
.word-token.word-eaten {
  opacity: 0.5;
}

/* ==========================================================================
   Hebbie Creature Styles & Visuals
   ========================================================================== */

#organism-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

#organism-overlay-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 998;
}

.organism-creature {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 38px;
  margin-top: -19px;
  margin-left: -22px;
  pointer-events: auto;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transform-origin: center center;
  transition: filter 0.2s;
}

.organism-creature:active,
.organism-creature.dragging {
  cursor: grabbing !important;
}

.organism-creature.dragging {
  filter: none !important;
  z-index: 1000 !important;
}

.organism-body {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Square-ish Rectangle Body */
.organism-blob {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 38px;
  background-color: #e0e0e0;
  border: 2px solid #000000;
  border-radius: 7px;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transition: background-color 0.12s ease;
}

/* Eyes */
.eyes-container {
  display: flex;
  gap: 7px;
  margin-top: 1px;
}

.eye {
  width: 11px;
  height: 11px;
  background: #ffffff;
  border: 1.5px solid #000000;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  box-shadow: none !important;
}

.pupil {
  width: 5px;
  height: 5px;
  background: #000000;
  border-radius: 50%;
  position: absolute;
  top: 1.5px;
  left: 1.5px;
  transition: transform 0.05s ease-out;
}

.eyelid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #e0e0e0;
  border-bottom: 1.5px solid #000000;
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 0.06s ease, background-color 0.12s ease;
}

/* Mouth */
.mouth {
  width: 16px;
  height: 12px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mouth-svg {
  width: 16px;
  height: 12px;
  overflow: visible;
}

/* Particles */
.organism-particle {
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  margin-left: -14px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  font-weight: bold;
  filter: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  z-index: 1000;
}

.organism-particle.particle-zzz {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
  text-shadow: none !important;
  filter: none !important;
  box-shadow: none !important;
  color: #000000 !important;
  letter-spacing: -0.5px;
}

/* Dead State Appearance */
.organism-creature.dead {
  cursor: pointer;
  filter: grayscale(0.85) opacity(0.7);
  transition: transform 0.4s ease, filter 0.4s ease;
}

.organism-creature.dead .organism-blob {
  background-color: #141414 !important;
  border-color: #000000 !important;
  transform: rotate(180deg);
  transition: transform 0.4s ease;
}

.organism-creature.dead .eye {
  background: #262626;
  border-color: #000000;
}

.organism-creature.dead .eyelid {
  display: none;
}

.organism-creature.dead .pupil {
  background: transparent;
  box-shadow: none;
}

.organism-creature.dead .pupil::before,
.organism-creature.dead .pupil::after {
  content: '';
  position: absolute;
  top: 2px;
  left: -1px;
  width: 7px;
  height: 1.5px;
  background: #94a3b8;
}

.organism-creature.dead .pupil::before {
  transform: rotate(45deg);
}

.organism-creature.dead .pupil::after {
  transform: rotate(-45deg);
}

/* Revive Hint Bubble floating above dead body */
.revive-bubble {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 1px solid #000000;
  color: #000000;
  padding: 3px 8px;
  border-radius: 0 !important;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  display: none;
  align-items: center;
  gap: 4px;
  box-shadow: none !important;
  pointer-events: none;
}

.organism-creature.dead .revive-bubble {
  display: flex;
}

/* ==========================================================================
   Debug Inspector & HUD Panel Styles
   ========================================================================== */

/* Toggle button in bottom right */
.debug-toggle-pill {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer;
  color: #000000;
  opacity: 0.25;
  transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

.debug-toggle-pill:hover {
  opacity: 0.85;
  color: #000000;
  transform: scale(1.1);
}

.debug-toggle-pill.active {
  opacity: 1.0;
  color: #000000;
}

.brain-svg-icon {
  width: 22px;
  height: 22px;
  display: block;
}

/* Info toggle button to the left of the brain icon */
.info-toggle-pill {
  position: fixed;
  bottom: 20px;
  right: 58px;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer;
  color: #000000;
  opacity: 0.25;
  transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

.info-toggle-pill:hover {
  opacity: 0.85;
  color: #000000;
  transform: scale(1.1);
}

.info-toggle-pill.active {
  opacity: 1.0;
  color: #000000;
}

.info-svg-icon {
  width: 22px;
  height: 22px;
  display: block;
}

/* About Hebbie Modal */
.info-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.25);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.15s ease;
}

.info-modal-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

.info-modal-panel,
.info-modal-panel * {
  border-radius: 0 !important;
  box-sizing: border-box;
}

.info-modal-panel {
  background: #ffffff;
  color: #000000;
  border: 1px solid #000000;
  width: 560px;
  max-width: 100%;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: none;
  transform: translateY(0);
  transition: transform 0.15s ease;
}

.info-modal-backdrop.hidden .info-modal-panel {
  transform: translateY(8px);
}

.info-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #000000;
  background: #ffffff;
}

.info-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #000000;
  margin: 0;
}

.info-modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #000000;
}

.info-modal-body p {
  margin-bottom: 14px;
}

.info-modal-body p:last-child {
  margin-bottom: 0;
}

.info-modal-body strong {
  font-weight: 600;
  color: #000000;
}

.info-modal-body em {
  font-style: italic;
}

/* Brain Monitor Modal Backdrop & Panel */
.debug-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.25);
  z-index: 10001;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.15s ease;
}

.debug-modal-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

.debug-panel,
.debug-panel * {
  border-radius: 0 !important;
  box-sizing: border-box;
}

.debug-panel {
  position: relative;
  width: 860px;
  max-width: 100%;
  max-height: calc(100vh - 40px);
  background: #ffffff;
  color: #000000;
  border: 1px solid #000000;
  box-shadow: none;
  backdrop-filter: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(0);
  transition: transform 0.15s ease;
}

.debug-modal-backdrop.hidden .debug-panel {
  transform: translateY(8px);
}

.debug-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #000000;
  background: #ffffff;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #000000;
}

.header-title h3 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #000000;
}

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #000000;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 8px;
  transition: all 0.1s;
}

.icon-btn:hover {
  background: #000000;
  color: #ffffff;
}

/* Body Split */
.debug-body {
  display: grid;
  grid-template-columns: 480px 1fr;
  overflow-y: auto;
  flex: 1;
  background: #ffffff;
  color: #000000;
}

.debug-body::-webkit-scrollbar {
  width: 6px;
}

.debug-body::-webkit-scrollbar-track {
  background: #ffffff;
  border-left: 1px solid #000000;
}

.debug-body::-webkit-scrollbar-thumb {
  background: #000000;
}

@media (max-width: 860px) {
  .debug-body {
    grid-template-columns: 1fr;
  }
}

.debug-col {
  padding: 16px 20px;
}

.col-network {
  border-right: 1px solid #000000;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.legend {
  font-size: 0.72rem;
  display: flex;
  gap: 10px;
  text-transform: none;
  color: #000000;
}

.leg-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.leg-box {
  width: 8px;
  height: 8px;
  border: 1px solid #000000;
}

.leg-pos { background: #166534; }
.leg-neg { background: #991b1b; }

.canvas-wrapper {
  background: #ffffff;
  border: 1px solid #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px;
}

#neural-canvas {
  width: 100%;
  height: auto;
  background: #ffffff;
}

/* Action distribution bars */
.action-distribution {
  background: #ffffff;
  padding: 12px;
  border: 1px solid #000000;
}

.action-distribution .sub-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #000000;
  margin-bottom: 8px;
}

.action-bars-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-bar-row {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  gap: 8px;
  color: #000000;
}

.action-bar-row.chosen .bar-name {
  color: #000000;
  font-weight: 700;
}

.bar-name {
  width: 110px;
  color: #000000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  height: 8px;
  background: #ffffff;
  border: 1px solid #000000;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: #000000;
  transition: width 0.1s ease;
}

.action-bar-row.chosen .bar-fill {
  background: #000000;
}

.bar-pct {
  width: 32px;
  text-align: right;
  font-family: var(--font-mono);
  color: #000000;
}

/* Col Controls */
.col-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-section {
  background: #ffffff;
  padding: 12px 14px;
  border: 1px solid #000000;
}

/* Drive meters */
.drive-row {
  margin-bottom: 10px;
}

.drive-row:last-child {
  margin-bottom: 0;
}

.drive-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #000000;
  margin-bottom: 4px;
}

.drive-label .val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #000000;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: #ffffff;
  border: 1px solid #000000;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #000000;
  transition: width 0.15s ease;
}

.reward-pulse-indicator {
  height: 3px;
  background: transparent;
  border-top: 1px solid #000000;
  margin-top: 6px;
  transition: all 0.2s ease;
}

.reward-pulse-indicator.reward-glow {
  background: #000000;
}

.reward-pulse-indicator.pain-glow {
  background: #991b1b;
}

/* Perception Cards */
.perception-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.perc-card {
  background: #ffffff;
  padding: 8px 10px;
  border: 1px solid #000000;
}

.perc-card .label {
  display: block;
  font-size: 0.7rem;
  color: #555555;
  text-transform: uppercase;
  font-weight: 600;
}

.perc-card .value {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #000000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sliders */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slider-row label {
  font-size: 0.75rem;
  color: #000000;
  display: flex;
  justify-content: space-between;
}

.slider-row label span {
  font-family: var(--font-mono);
  color: #000000;
  font-weight: 600;
}

.slider-row input[type="range"] {
  width: 100%;
  accent-color: #000000;
  cursor: pointer;
}

.checkbox-row {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  color: #000000;
}

.checkbox-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  accent-color: #000000;
  cursor: pointer;
}

/* World Model HUD Header & Mode Selectors */
.network-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.network-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.network-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #000000;
}

.mode-toggles {
  display: flex;
  gap: 6px;
}

.btn-micro {
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #000000;
  color: #000000;
  cursor: pointer;
  transition: all 0.1s ease;
}

.btn-micro:hover {
  color: #ffffff;
  background: #000000;
}

.btn-micro.active {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
}

.model-select-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
}

.model-label {
  color: #555555;
}

.btn-pill-model {
  padding: 2px 7px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #000000;
  color: #000000;
  cursor: pointer;
  transition: all 0.1s ease;
}

.btn-pill-model:hover {
  color: #ffffff;
  background: #000000;
}

.btn-pill-model.active {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
}


