/* ============================================
   Boolean Logic — Binary Aesthetic Theme
   ============================================ */

:root {
  --bg-primary: #0a0a0a;
  --bg-darker: #050505;
  --bg-card: #111111;
  --accent: #00ff88;
  --accent-dim: #00cc6a;
  --accent-glow: rgba(0, 255, 136, 0.15);
  --text-primary: #e0e0e0;
  --text-muted: #888888;
  --border-color: #1a1a1a;
  --font-mono: 'Courier New', 'Consolas', monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
}

/* Binary Rain Canvas */
#binaryRain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.07;
}

/* Utility Classes */
.text-accent {
  color: var(--accent) !important;
}

.text-muted-light {
  color: var(--text-muted) !important;
}

.bg-darker {
  background-color: var(--bg-darker) !important;
}

.py-6 {
  padding-top: 6rem;
  padding-bottom: 6rem;
}

/* Section Label */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
}

/* Navigation */
.navbar {
  background: rgba(5, 5, 5, 0.85) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
  padding: 1rem 0;
}

.navbar.scrolled {
  padding: 0.5rem 0;
  background: rgba(5, 5, 5, 0.95) !important;
}

.navbar-brand {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  letter-spacing: 1px;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted) !important;
  letter-spacing: 1px;
  padding: 0.5rem 1rem !important;
  transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent) !important;
}

/* Buttons */
.btn-accent {
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-weight: 700;
  border: none;
  transition: all 0.3s ease;
}

.btn-accent:hover {
  background: var(--accent-dim);
  color: #000;
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-2px);
}

.btn-outline-light {
  font-family: var(--font-mono);
  font-weight: 700;
  border-width: 2px;
  transition: all 0.3s ease;
}

.btn-outline-light:hover {
  transform: translateY(-2px);
}

/* Hero Section */
#hero {
  position: relative;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

/* Hero Logo */
.hero-logo {
  max-width: 220px;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 0 30px rgba(0, 255, 136, 0.15));
  animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
  0% { filter: drop-shadow(0 0 20px rgba(0, 255, 136, 0.1)); }
  100% { filter: drop-shadow(0 0 40px rgba(0, 255, 136, 0.25)); }
}

@media (max-width: 768px) {
  .hero-logo {
    max-width: 160px;
  }
}

.binary-badge {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 3px;
  opacity: 0.7;
}

#hero h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
  letter-spacing: -1px;
}

.typed-text {
  font-family: var(--font-mono);
  color: var(--accent);
}

.cursor {
  font-family: var(--font-mono);
  color: var(--accent);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.scroll-indicator {
  animation: bounce 2s infinite;
  color: var(--text-muted);
}

.binary-scroll {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* Logic Gate Visual */
.logic-gate-visual {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

/* Animated Logic Gates */
.gate-anim {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  width: 100%;
  max-width: 400px;
  transition: all 0.3s ease;
}

.gate-anim:hover {
  border-color: var(--accent);
  box-shadow: 0 0 25px var(--accent-glow);
}

.gate-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.gate-wire {
  stroke: #333;
  stroke-width: 2;
}

.gate-wire-dot {
  fill: #333;
}

.gate-shape {
  fill: rgba(0, 255, 136, 0.05);
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.gate-label-text {
  fill: var(--accent);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
}

.bit-particle {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  dominant-baseline: middle;
}

.bit-particle.bit-a {
  animation: bitFlowA 3s ease-in-out infinite;
}

.bit-particle.bit-b {
  animation: bitFlowB 3s ease-in-out infinite;
}

.bit-particle.bit-out {
  animation: bitFlowOut 3s ease-in-out infinite;
}

.bit-particle[data-val="1"] {
  fill: var(--accent);
}

.bit-particle[data-val="0"] {
  fill: var(--text-muted);
}

@keyframes bitFlowA {
  0% { transform: translateX(0); opacity: 0; }
  10% { opacity: 1; }
  45% { transform: translateX(75px); opacity: 1; }
  55% { transform: translateX(75px); opacity: 0; }
  100% { transform: translateX(75px); opacity: 0; }
}

@keyframes bitFlowB {
  0% { transform: translateX(0); opacity: 0; }
  15% { opacity: 1; }
  50% { transform: translateX(75px); opacity: 1; }
  60% { transform: translateX(75px); opacity: 0; }
  100% { transform: translateX(75px); opacity: 0; }
}

@keyframes bitFlowOut {
  0% { transform: translateX(0); opacity: 0; }
  55% { transform: translateX(0); opacity: 0; }
  65% { transform: translateX(0); opacity: 1; }
  85% { transform: translateX(60px); opacity: 1; }
  95% { transform: translateX(60px); opacity: 0; }
  100% { transform: translateX(60px); opacity: 0; }
}

/* Floating Light Bulbs */
.floating-bulb {
  position: absolute;
  font-size: 1.8rem;
  color: rgba(0, 255, 136, 0.15);
  pointer-events: none;
  z-index: 1;
  animation: bulbPulse 4s ease-in-out infinite;
}

.floating-bulb .bi {
  filter: drop-shadow(0 0 8px rgba(0, 255, 136, 0));
  transition: all 0.5s ease;
}

.floating-bulb.bulb-on {
  color: rgba(0, 255, 136, 0.6);
}

.floating-bulb.bulb-on .bi {
  filter: drop-shadow(0 0 15px rgba(0, 255, 136, 0.5));
}

@keyframes bulbPulse {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 0.7; transform: translateY(-8px); }
}

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Service Cards */
.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.service-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-5px);
}

.service-bit {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  opacity: 0.4;
}

.service-icon {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(0, 255, 136, 0.1);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  border: 1px solid rgba(0, 255, 136, 0.2);
}

/* Stack Cards */
.stack-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  position: relative;
  transition: all 0.3s ease;
}

.stack-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-5px);
}

.stack-icon {
  font-size: 2rem;
  color: var(--accent);
}

.stack-bit {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  opacity: 0.3;
}

/* Truth Table */
.truth-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
}

.table-dark {
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--border-color);
}

.table-dark th {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  background: rgba(0, 255, 136, 0.05);
}

.table-dark td {
  font-family: var(--font-mono);
  font-size: 1rem;
  vertical-align: middle;
  padding: 0.75rem;
}

.input-cell {
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.input-cell:hover {
  color: var(--accent);
  background: rgba(0, 255, 136, 0.1) !important;
}

.output-cell[data-value="1"] {
  color: var(--accent);
  font-weight: 700;
}

.output-cell[data-value="0"] {
  color: var(--text-muted);
}

/* Boole Portrait */
.boole-portrait {
  display: flex;
  justify-content: center;
}

.portrait-frame {
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
  position: relative;
  box-shadow: 0 0 40px var(--accent-glow);
  width: 280px;
}

.portrait-binary {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  opacity: 0.3;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.portrait-binary span {
  display: block;
}

.portrait-text {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.portrait-dates {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
}

/* Boole Quote */
.boole-quote {
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  padding: 1.5rem;
  border-radius: 0 8px 8px 0;
}

.boole-quote blockquote {
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.boole-quote cite {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
}

/* Contact */
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2.5rem;
}

.form-control {
  background: var(--bg-primary) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 15px var(--accent-glow) !important;
}

.form-control::placeholder {
  color: #444 !important;
}

.form-label {
  font-family: var(--font-mono);
}

/* Footer */
footer {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.footer-binary {
  font-family: var(--font-mono);
  letter-spacing: 2px;
}

/* Code Elements */
code {
  color: var(--accent);
  background: rgba(0, 255, 136, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85em;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--accent-dim);
  border-radius: 3px;
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .py-6 {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  .portrait-frame {
    width: 220px;
    padding: 1.5rem;
  }

  .contact-card {
    padding: 1.5rem;
  }

  .gate-anim {
    padding: 0.75rem 1rem;
    max-width: 100%;
  }

  .floating-bulb {
    font-size: 1.2rem;
  }
}
