/* =====================================================
   Base + Theme (mirrors Project3 vibe)
===================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-color: #0d0d0d;
  --primary-color: #ff4d00;
  /* Orange */
  --secondary-color: #1a1a1a;
  /* Near-black */
  --accent-color: #ff8c00;
  /* Dark orange */
  --text-main: #ffffff;
  --text-muted: #cfcfcf;
  --card-bg: #141414;
  --line-color: #262626;
  --font-family: 'Inter', sans-serif;
  --font-tech: 'Space Mono', monospace;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --transition-medium: 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  overflow-x: hidden;
  cursor: none;
  /* custom cursor */
}

/* Scroll Progress */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  background: var(--primary-color);
  z-index: 10000;
  transition: width .25s ease;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Floating Orbs (Background) */
.floating-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  z-index: -1;
  animation: float 20s infinite ease-in-out;
}

.orb-1 {
  width: 300px;
  height: 300px;
  background: #ff4d00;
  top: -100px;
  left: -100px;
}

.orb-2 {
  width: 200px;
  height: 200px;
  background: #ff8c00;
  bottom: 20%;
  right: -50px;
  animation-delay: -5s;
}

.orb-3 {
  width: 150px;
  height: 150px;
  background: #aaaaaa;
  top: 40%;
  left: 30%;
  animation-delay: -10s;
  opacity: 0.2;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-30px) scale(1.1);
  }
}

/* Common Doc Styles */
.doc-section {
  margin-top: 40px;
  padding-bottom: 40px;
  border-bottom: 1px dashed var(--line-color);
}

.doc-section:last-child {
  border-bottom: none;
}

.two-col-doc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.doc-content {
  display: flex;
  flex-direction: column;
}

.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.doc-header h3 {
  color: var(--primary-color);
  font-size: 1rem;
  margin: 0;
  font-family: var(--font-tech);
}

.doc-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 25px;
}

.tech-list {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}

.tech-list li {
  color: var(--text-main);
  margin-bottom: 12px;
  padding-left: 20px;
  position: relative;
  font-family: var(--font-family);
  font-size: 0.9rem;
  line-height: 1.6;
}

.tech-list li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

.tech-list strong {
  color: var(--primary-color);
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-right: 8px;
}


/* Visualizer Wrapper */
.viz-wrapper {
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: rgba(255, 255, 255, 0.02);
  padding: 15px;
  border-radius: 0;
  border: 1px solid rgba(255, 77, 0, 0.1);
  /* Ensure it stretches with content */
  height: auto;
}

.canvas-container.small {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 77, 0, 0.3);
  border-radius: 0;
  overflow: hidden;
  position: relative;
}

.canvas-container.small canvas,
.canvas-container.small svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Mini Controls for Embedded Viz */
.mini-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* Removed max-height and overflow to allow stretching */
  padding-right: 5px;
}

/* Scrollbar styles kept just in case, but unused if no overflow */
.mini-controls::-webkit-scrollbar {
  width: 4px;
}

.mini-controls::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.mini-controls::-webkit-scrollbar-thumb {
  background: var(--line-color);
  border-radius: 0;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-row label {
  font-family: var(--font-tech);
  font-size: 0.7rem;
  color: var(--accent-color);
  min-width: 40px;
}

.control-row input,
.control-row select {
  background: rgba(0, 0, 0, 0.4) !important;
  border: 1px solid rgba(255, 77, 0, 0.3) !important;
  color: var(--text-main) !important;
  font-family: var(--font-tech);
  padding: 4px 8px;
  border-radius: 0;
  font-size: 0.8rem;
  flex: 1;
}

/* Output Section */
.output-row {
  margin-top: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px dashed var(--primary-color);
  border-radius: 0;
  font-family: var(--font-tech);
  font-size: 0.75rem;
  color: #00ffaa;
  white-space: pre-wrap;
  line-height: 1.4;
}

/* Action Buttons */
.viz-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 5px;
}

.btn-xs {
  background: transparent;
  border: 1px solid rgba(255, 77, 0, 0.3);
  color: var(--accent-color);
  font-family: var(--font-tech);
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.7rem;
  border-radius: 0;
}

.btn-xs:hover {
  background: rgba(255, 77, 0, 0.1);
  border-color: var(--accent-color);
}

.btn-small {
  background: transparent;
  border: 1px solid rgba(255, 77, 0, 0.3);
  color: var(--accent-color);
  font-family: var(--font-tech);
  padding: 8px 16px;
  cursor: pointer;
  transition: all var(--transition-medium);
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.btn-small:hover {
  background: rgba(255, 77, 0, 0.1);
  border-color: var(--accent-color);
  box-shadow: 0 0 10px rgba(255, 77, 0, 0.2);
}

.toggle-xs {
  font-size: 0.75rem;
  font-family: var(--font-tech);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

/* Responsive */
@media (max-width: 900px) {
  .two-col-doc {
    grid-template-columns: 1fr;
  }
}