/* === Reset & base === */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root{
  /* Neon palette */
  --neon-cyan: #00e6ff;
  --neon-magenta: #ff2eff;
  --neon-yellow: #ffee55;
  --ink-900: #06080f;
  --ink-800: #0a0e1a;
  --text-main: #e6f0ff;
  --text-dim: #b7c2d0;
}

/* Full-height page with vignette + scanlines */
html, body{
  height: 100%;
  font-family: 'Consolas','Monaco','Courier New',monospace;
  color: var(--text-main);
  background:
    radial-gradient(1200px 600px at 50% 35%,
      #0f1419 0%,
      var(--ink-800) 60%,
      var(--ink-900) 100%);
  position: relative;
}

body{
  display: flex;
  flex-direction: column;
}

/* Vignette glow */
body::before{
  content:"";
  position: fixed; inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 200px 80px rgba(0,0,0,.85);
}

/* Subtle scanlines */
body::after{
  content:"";
  position: fixed; inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.03) 0px,
      rgba(255,255,255,0.03) 1px,
      transparent 2px,
      transparent 4px
    );
  mix-blend-mode: soft-light;
  opacity: .25;
}

/* === Header === */
.site-header{
  padding: 20px 0;
  position: relative;
}

.header-content{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title-link{
  text-decoration: none;
  transition: all 0.3s ease;
}

.site-title-link:hover{
  transform: translateY(-1px);
}

.site-title{
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--neon-cyan);
  letter-spacing: .02em;
  text-shadow:
    0 0 8px rgba(0, 230, 255, .9),
    0 0 18px rgba(0, 230, 255, .6),
    0 0 36px rgba(255, 46, 255, .35);
  margin: 0;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  transition: inherit;
}

.plus-accent {
  color: var(--neon-magenta);
  text-shadow:
    0 0 8px rgba(255, 46, 255, .9),
    0 0 18px rgba(255, 46, 255, .6),
    0 0 36px rgba(255, 46, 255, .35);
}

/* === Main Content === */
.main-content{
  flex: 1;
}

/* === Shell layout === */
.shell-container{
  display:flex; justify-content:center; align-items:flex-start;
  padding: 4vh 16px 0;
  position: relative;
}

.shell-container::before{
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 800px;
  height: 600px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center,
    rgba(0, 230, 255, 0.12) 0%,
    rgba(255, 46, 255, 0.08) 40%,
    rgba(0, 230, 255, 0.04) 70%,
    transparent 100%);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}

.shell-window{
  background: #141927;
  border: 1px solid #2a3550;
  border-radius: 10px;
  padding: 18px 20px;
  width: min(92vw, 720px);
  box-shadow:
    0 0 16px rgba(0,230,255,.25),
    0 0 32px rgba(0,230,255,.15),
    0 0 64px rgba(255,46,255,.08),
    0 0 96px rgba(255,46,255,.04);
  position: relative;
  z-index: 1;
}

/* Lines */
.shell-line{
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.6;
  margin-bottom: 8px;
  color: var(--text-main);
}

.prompt{
  color: var(--neon-cyan);
  margin-right: 10px;
  text-shadow: 0 0 6px rgba(0,230,255,.8);
  animation: promptFlicker 3s ease-in-out infinite;
}

@keyframes promptFlicker{
  0%, 96%, 100% { opacity: 1; }
  97%, 99% { opacity: 0.7; }
  98% { opacity: 0.9; }
}

.processing-text{ margin-right: 6px; color: var(--text-dim); }

/* === Spinner with color cycling === */
.spinner{
  display:inline-block;
  min-width: 1ch;
  animation: spinGlow 2.4s linear infinite;
  will-change: color, text-shadow;
}

/* Color glow cycle cyan -> magenta -> yellow -> white -> cyan */
@keyframes spinGlow{
  0%   { color: var(--neon-cyan); text-shadow: 0 0 6px rgba(0,230,255,.85); }
  25%  { color: var(--neon-magenta); text-shadow: 0 0 6px rgba(255,46,255,.85); }
  50%  { color: var(--neon-yellow); text-shadow: 0 0 6px rgba(255,238,85,.85); }
  75%  { color: #ffffff; text-shadow: 0 0 6px rgba(255,255,255,.6); }
  100% { color: var(--neon-cyan); text-shadow: 0 0 6px rgba(0,230,255,.85); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .spinner{ animation: none; }
  body::after{ opacity: .12; }
}

/* Mobile optimizations */
@media (max-width: 768px){
  /* Reduce visual noise on mobile */
  body::after{ opacity: .1; }
  body::before{ box-shadow: inset 0 0 150px 60px rgba(0,0,0,.7); }
  
  /* Enhanced text readability */
  .shell-line{
    font-size: clamp(16px, 2vw, 18px);
  }
  
  /* Brighter colors for mobile */
  .processing-text{ 
    color: #d0dae8; 
    text-shadow: 0 0 2px rgba(208,218,232,.3);
  }
  
  /* Enhanced glow effects */
  .prompt{
    text-shadow: 0 0 8px rgba(0,230,255,.9);
    margin-right: 8px;
  }
  
  /* Stronger shell window presence */
  .shell-window{
    padding: 20px 18px;
    box-shadow:
      0 0 32px rgba(0,230,255,.25),
      0 0 64px rgba(0,230,255,.15),
      0 0 96px rgba(255,46,255,.1);
  }
}

/* Small screens tweaks */
@media (max-width: 420px){
  .shell-window{ padding: 16px; }
  .prompt{ margin-right: 6px; }
  
  /* Even brighter for very small screens */
  .processing-text{ 
    color: #e2ebf5; 
    text-shadow: 0 0 3px rgba(226,235,245,.4);
  }
}

/* === Lab Button === */
.lab-button-container{
  display: flex;
  justify-content: center;
  margin: 40px 0 20px;
  position: relative;
  z-index: 1;
}

.lab-button{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  background: rgba(20, 25, 40, 0.9);
  border: 2px solid var(--neon-cyan);
  border-radius: 12px;
  color: var(--neon-cyan);
  text-decoration: none;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow:
    0 0 20px rgba(0, 230, 255, 0.4),
    0 0 40px rgba(0, 230, 255, 0.2),
    0 0 80px rgba(255, 46, 255, 0.1),
    inset 0 0 20px rgba(0, 230, 255, 0.1);
}

.button-text{
  position: relative;
  z-index: 2;
  text-shadow: 0 0 8px rgba(0, 230, 255, 0.8);
}

.button-glow{
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, 
    var(--neon-cyan), 
    var(--neon-magenta), 
    var(--neon-cyan));
  border-radius: 14px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lab-button::before{
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(0, 230, 255, 0.2), 
    transparent);
  transition: left 0.6s ease;
  z-index: 1;
}

.lab-button:hover{
  transform: translateY(-3px);
  border-color: var(--neon-magenta);
  color: var(--neon-magenta);
  box-shadow:
    0 0 30px rgba(255, 46, 255, 0.6),
    0 0 60px rgba(255, 46, 255, 0.4),
    0 0 120px rgba(0, 230, 255, 0.2),
    inset 0 0 30px rgba(255, 46, 255, 0.2);
}

.lab-button:hover .button-glow{
  opacity: 0.8;
}

.lab-button:hover .button-text{
  text-shadow: 0 0 12px rgba(255, 46, 255, 0.9);
}

.lab-button:hover::before{
  left: 100%;
}

.lab-button:active{
  transform: translateY(-1px);
}

/* === Lab Page === */
.lab-container{
  padding: 4vh 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.lab-content{
  position: relative;
  z-index: 1;
}

.lab-title{
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  color: var(--neon-cyan);
  text-align: center;
  margin-bottom: 1rem;
  text-shadow:
    0 0 10px rgba(0, 230, 255, .9),
    0 0 20px rgba(0, 230, 255, .6),
    0 0 40px rgba(255, 46, 255, .35);
}

.lab-description{
  text-align: center;
  margin-bottom: 3rem;
  font-size: 1.2rem;
  color: var(--text-dim);
}

.lab-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
  margin-bottom: 3rem;
}

.lab-item-link{
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.3s ease;
}

.lab-item{
  background: rgba(20, 25, 40, 0.8);
  border: 1px solid rgba(42, 53, 80, 0.6);
  border-radius: 12px;
  padding: 24px;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
  box-shadow:
    0 0 16px rgba(0, 230, 255, 0.1),
    0 0 32px rgba(0, 230, 255, 0.05);
}

.lab-item:hover,
.lab-item-link:hover .lab-item{
  transform: translateY(-4px);
  border-color: var(--neon-cyan);
  box-shadow:
    0 0 24px rgba(0, 230, 255, 0.2),
    0 0 48px rgba(0, 230, 255, 0.1),
    0 0 96px rgba(255, 46, 255, 0.05);
}

.lab-item-link:hover{
  cursor: pointer;
}

.lab-item-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.lab-item h3{
  color: var(--text-main);
  font-size: 1.4rem;
  margin: 0;
  text-shadow: 0 0 4px rgba(230, 240, 255, 0.5);
}

.lab-item p{
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
}

.status-badge{
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.active{
  background: rgba(0, 230, 255, 0.2);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 230, 255, 0.4);
  text-shadow: 0 0 4px rgba(0, 230, 255, 0.6);
}

.status-badge.research{
  background: rgba(255, 46, 255, 0.2);
  color: var(--neon-magenta);
  border: 1px solid rgba(255, 46, 255, 0.4);
  text-shadow: 0 0 4px rgba(255, 46, 255, 0.6);
}

.status-badge.planning{
  background: rgba(255, 238, 85, 0.2);
  color: var(--neon-yellow);
  border: 1px solid rgba(255, 238, 85, 0.4);
  text-shadow: 0 0 4px rgba(255, 238, 85, 0.6);
}

.status-badge.cooking{
  background: rgba(255, 140, 0, 0.2);
  color: #ff8c00;
  border: 1px solid rgba(255, 140, 0, 0.4);
  text-shadow: 0 0 4px rgba(255, 140, 0, 0.6);
}

.status-badge.thinking{
  background: rgba(138, 43, 226, 0.2);
  color: #8a2be2;
  border: 1px solid rgba(138, 43, 226, 0.4);
  text-shadow: 0 0 4px rgba(138, 43, 226, 0.6);
}

.status-badge.randomizing{
  background: rgba(255, 20, 147, 0.2);
  color: #ff1493;
  border: 1px solid rgba(255, 20, 147, 0.4);
  text-shadow: 0 0 4px rgba(255, 20, 147, 0.6);
}

.status-badge.live{
  background: rgba(0, 255, 127, 0.2);
  color: #00ff7f;
  border: 1px solid rgba(0, 255, 127, 0.4);
  text-shadow: 0 0 4px rgba(0, 255, 127, 0.6);
}

.back-button-container{
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.back-button{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: rgba(20, 25, 40, 0.9);
  border: 2px solid var(--text-dim);
  border-radius: 12px;
  color: var(--text-dim);
  text-decoration: none;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow:
    0 0 16px rgba(183, 194, 208, 0.2),
    inset 0 0 16px rgba(183, 194, 208, 0.05);
}

.back-button:hover{
  transform: translateY(-2px);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow:
    0 0 24px rgba(0, 230, 255, 0.3),
    0 0 48px rgba(0, 230, 255, 0.15),
    inset 0 0 24px rgba(0, 230, 255, 0.1);
}

.back-button .button-text{
  position: relative;
  z-index: 2;
}

/* === GitHub Widget === */
.github-widget{
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.2s ease;
}

.github-widget a{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(17, 23, 38, 0.6);
  border: 1px solid rgba(42, 53, 80, 0.4);
  color: var(--text-dim);
  text-decoration: none;
  backdrop-filter: blur(4px);
  box-shadow: 0 0 12px rgba(0, 230, 255, 0.08);
}

.github-widget:hover{
  opacity: 1;
  transform: translateY(-2px);
}

.github-widget:hover a{
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 24px rgba(0, 230, 255, 0.2);
}

.github-widget svg{
  transition: all 0.2s ease;
}

/* === Footer === */
.site-footer{
  padding: 20px 0;
  text-align: center;
}

.copyright{
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0.6;
  text-shadow: 0 0 4px rgba(183, 194, 208, 0.3);
  transition: opacity 0.3s ease;
}

.copyright:hover{
  opacity: 0.9;
}

@media (max-width: 768px){
  .header-content{
    padding: 0 16px;
  }
  
  .site-title{
    font-size: clamp(1.5rem, 5vw, 2rem);
  }
  
  .shell-container{
    padding: 2vh 16px 0;
  }
  
  .lab-button-container{
    margin: 32px 16px 20px;
  }
  
  .lab-button{
    padding: 14px 28px;
    font-size: 15px;
    border-radius: 10px;
    min-height: 44px;
    box-shadow:
      0 0 16px rgba(0, 230, 255, 0.3),
      0 0 32px rgba(0, 230, 255, 0.15),
      0 0 64px rgba(255, 46, 255, 0.08),
      inset 0 0 16px rgba(0, 230, 255, 0.08);
  }
  
  .lab-button:hover{
    box-shadow:
      0 0 24px rgba(255, 46, 255, 0.5),
      0 0 48px rgba(255, 46, 255, 0.3),
      0 0 96px rgba(0, 230, 255, 0.15),
      inset 0 0 24px rgba(255, 46, 255, 0.15);
  }
  
  .github-widget a{
    width: 36px;
    height: 36px;
  }
  
  .github-widget svg{
    width: 18px;
    height: 18px;
  }
  
  .copyright{
    font-size: 11px;
    opacity: 0.5;
  }
  
  /* Lab page mobile */
  .lab-container{
    padding: 2vh 16px;
  }
  
  .lab-grid{
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .lab-item{
    padding: 20px;
  }
  
  .lab-item-header{
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .back-button{
    padding: 12px 20px;
    font-size: 13px;
  }
}