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

:root {
  --samsung-blue: #1428A0;
  --electric-cyan: #00B4D8;
  --bg-deep: #0A0E27;
  --bg-panel: rgba(20, 30, 60, 0.85);
  --text-primary: #FFFFFF;
  --text-secondary: #B0B8C8;
  --danger: #FF6B6B;
  --era-amber: #D4A047;
  --era-teal: #2CB5A0;
  --era-blue: #3B7DD8;
  --era-indigo: #6C5CE7;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(10,14,39,0.5); }
::-webkit-scrollbar-thumb { background: var(--samsung-blue); border-radius: 3px; }

/* Star field background */
.star-field {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: white;
  animation: twinkle var(--dur) ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.1; }
  100% { opacity: var(--max-opacity, 0.7); }
}

/* Glow effects */
.glow-text {
  text-shadow: 0 0 20px rgba(20,40,160,0.6), 0 0 40px rgba(0,180,216,0.3);
}

.glow-line {
  box-shadow: 0 0 12px rgba(20,40,160,0.6), 0 0 24px rgba(0,180,216,0.2);
}

.glow-border {
  border: 1px solid rgba(0,180,216,0.2);
  box-shadow: 0 0 8px rgba(20,40,160,0.15);
}

/* Frosted glass */
.frosted {
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: rgba(10, 14, 39, 0.75);
}

/* Timeline pulse */
.timeline-line {
  background: linear-gradient(90deg, var(--samsung-blue), var(--electric-cyan), var(--samsung-blue));
  background-size: 200% 100%;
  animation: pulseLine 4s ease-in-out infinite;
}

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

/* Device node float */
.device-node {
  animation: floatNode 3s ease-in-out infinite;
}

.device-node:nth-child(even) {
  animation-delay: -1.5s;
}

@keyframes floatNode {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Hover glow on nodes */
.node-circle {
  transition: all 0.3s ease;
}

.node-circle:hover {
  transform: scale(1.15);
  box-shadow: 0 0 20px rgba(0,180,216,0.5), 0 0 40px rgba(20,40,160,0.3);
}

/* Modal animations */
.modal-overlay {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Emulator boot animation */
.boot-screen {
  animation: bootFade 2s ease-in-out;
}

@keyframes bootFade {
  0% { opacity: 0; }
  30% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.boot-loading-bar {
  animation: loadBar 2s ease-in-out;
}

@keyframes loadBar {
  0% { width: 0; }
  100% { width: 100%; }
}

/* Shutdown animation */
.shutdown-anim {
  animation: shutdown 0.8s ease-in forwards;
}

@keyframes shutdown {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scaleY(0.01) scaleX(1); }
  100% { opacity: 0; transform: scaleY(0) scaleX(0); }
}

/* Parallax hero */
.hero-parallax {
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
}

/* Pill toggle */
.pill-active {
  background: var(--samsung-blue);
  color: white;
  box-shadow: 0 0 12px rgba(20,40,160,0.5);
}

.pill-inactive {
  background: rgba(20,30,60,0.6);
  color: var(--text-secondary);
}

.pill-inactive:hover {
  background: rgba(30,40,80,0.8);
  color: white;
}

/* CTA glow button */
.cta-btn {
  background: linear-gradient(135deg, var(--samsung-blue), var(--electric-cyan));
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.cta-btn:hover {
  box-shadow: 0 0 30px rgba(0,180,216,0.4), 0 0 60px rgba(20,40,160,0.2);
  transform: translateY(-2px);
}

.cta-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}

/* Fun facts ticker */
.ticker-text {
  animation: tickerFade 8s ease-in-out infinite;
}

@keyframes tickerFade {
  0%, 10% { opacity: 0; }
  15%, 85% { opacity: 1; }
  90%, 100% { opacity: 0; }
}

/* Emulator phone frame */
.phone-frame {
  background: linear-gradient(145deg, #1a1a2e, #0d0d1a);
  border: 2px solid rgba(60,60,80,0.6);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
}

.phone-screen {
  background: #000;
  overflow: hidden;
}

/* Emulator button */
.emu-btn {
  background: rgba(40,40,60,0.8);
  border: 1px solid rgba(80,80,100,0.4);
  transition: all 0.15s ease;
}

.emu-btn:active {
  transform: scale(0.95);
  background: rgba(60,60,80,0.8);
}

/* Minimap */
.minimap-viewport {
  border: 2px solid var(--electric-cyan);
  background: rgba(0,180,216,0.1);
  transition: left 0.1s linear;
}

/* Category crossfade */
.crossfade-enter {
  animation: crossIn 0.4s ease-out;
}

@keyframes crossIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Era section colors */
.era-early { background: rgba(212,160,71,0.05); border-top: 2px solid rgba(212,160,71,0.3); }
.era-sgh { background: rgba(44,181,160,0.05); border-top: 2px solid rgba(44,181,160,0.3); }
.era-touchwiz { background: rgba(59,125,216,0.05); border-top: 2px solid rgba(59,125,216,0.3); }
.era-modern { background: rgba(108,92,231,0.05); border-top: 2px solid rgba(108,92,231,0.3); }

/* Responsive */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: block !important; }
}

@media (min-width: 769px) {
  .show-mobile { display: none !important; }
}

/* Monospace for specs */
.mono { font-family: 'JetBrains Mono', monospace; }

/* Tooltip */
.tooltip {
  position: absolute;
  background: rgba(10,14,39,0.95);
  border: 1px solid rgba(0,180,216,0.3);
  border-radius: 8px;
  padding: 8px 12px;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* Search input */
.search-input {
  background: rgba(20,30,60,0.6);
  border: 1px solid rgba(0,180,216,0.2);
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--electric-cyan);
  box-shadow: 0 0 12px rgba(0,180,216,0.2);
}