/* Reset & Base Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-indigo: #6366f1;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #767d8a;
  --border-color: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(17, 24, 39, 0.7);
  --glass-border: rgba(255, 255, 255, 0.05);
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Background Gradients & Glows */
.glow-backdrop {
  position: absolute;
  top: -10%;
  left: 20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(6, 182, 212, 0.05) 50%, rgba(11, 15, 25, 0) 100%);
  z-index: -1;
  pointer-events: none;
  filter: blur(80px);
}

.glow-backdrop-2 {
  position: absolute;
  top: 50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, rgba(59, 130, 246, 0.05) 60%, rgba(11, 15, 25, 0) 100%);
  z-index: -1;
  pointer-events: none;
  filter: blur(60px);
}

/* Typography & Layout */
header {
  padding: 1.5rem 2.5rem;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  letter-spacing: 0;
  white-space: nowrap;
}

.nav-brand-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  margin-right: 0.2rem;
  vertical-align: middle;
}

.brand-link:hover {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

.logo-sep {
  color: var(--text-muted);
  opacity: 0.5;
  font-weight: 400;
  margin: 0 0.25rem;
}

.logo a,
.logo-link,
.logo-link:hover,
.logo-link:focus {
  text-decoration: none !important;
  transition: opacity 0.2s ease, filter 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.logo-link:hover {
  opacity: 0.85;
  filter: brightness(1.2);
}

.logo-text {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  text-decoration: none !important;
}

.nav-links {
  display: flex;
  gap: clamp(0.5rem, 1.4vw, 1.8rem);
  list-style: none;
  align-items: center;
  flex-wrap: nowrap;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: clamp(0.8rem, 0.95vw, 0.92rem);
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.btn-github {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-github:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 6rem 0 4rem;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.badge {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  display: inline-block;
  margin-bottom: 1.5rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.4rem, 4.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.hero-title-text {
  background: linear-gradient(135deg, #ffffff 40%, #e2e8f0 70%, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title-icon {
  width: 1.1em;
  height: 1.1em;
  max-width: 52px;
  max-height: 52px;
  object-fit: contain;
  vertical-align: middle;
  -webkit-text-fill-color: initial;
  filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.45));
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  font-weight: 400;
}

.cta-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-blue));
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.8rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Glassmorphism Card System */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.1);
}

/* ROI Calculator Section */
.calculator-section {
  padding: 4rem 0;
  position: relative;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  margin-top: 2rem;
}

@media (max-width: 900px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
}

.slider-group {
  margin-bottom: 2rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  font-weight: 500;
}

.slider-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.slider-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

input[type="range"] {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 9999px;
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Results Display */
.results-card {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.8), rgba(11, 15, 25, 0.9));
  border: 1px solid rgba(6, 182, 212, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.results-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-cyan));
}

.result-metric {
  margin-bottom: 2rem;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.2rem;
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -1px;
}

.metric-value span {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.badge-roi {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: #22d3ee;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
}

/* Features Grid */
.features-section {
  padding: 6rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-title h2 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
}

.section-title p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  padding: 2rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.2);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: #818cf8;
}

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-card h3 span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* spec compliance section */
.spec-section {
  padding: 4rem 0;
}

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

@media (max-width: 800px) {
  .spec-grid {
    grid-template-columns: 1fr;
  }
}

.spec-list {
  list-style: none;
}

.spec-item {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 1.5rem;
}

.spec-item::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-cyan);
  font-weight: bold;
}

.spec-item h4 {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}

.spec-item p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Quickstart & Commands copy style */
.quickstart-section {
  padding: 4rem 0 8rem;
}

.code-container {
  background: #030712;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-family: monospace;
  font-size: 0.95rem;
  position: relative;
}

.code-text {
  color: #10b981;
}

.btn-copy {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  background: var(--text-secondary);
  color: var(--bg-primary);
}

/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Viewer Showcase */
.viewer-showcase {
  margin: 1rem auto 4rem;
  max-width: 1000px;
  position: relative;
  text-align: center;
  padding: 0 1rem;
}

.viewer-preview-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.12);
  background: var(--bg-secondary);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.viewer-preview-container:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 50px rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.25);
}

.viewer-preview-img {
  width: 100%;
  height: auto;
  display: block;
}

.viewer-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.8rem 1.2rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.viewer-caption span {
  background: linear-gradient(135deg, #ffffff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 600;
}

.viewer-caption code {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.8rem;
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 1100px) {
  header {
    padding: 1.25rem 1.5rem;
  }
  .nav-links {
    gap: 0.6rem;
  }
  .nav-links a {
    font-size: 0.8rem;
  }
  .logo {
    font-size: 1.15rem;
  }
}

@media (max-width: 900px) {
  header {
    flex-wrap: wrap;
    justify-content: center;
    padding: 1rem 1rem;
    gap: 0.8rem;
  }
  .logo {
    width: 100%;
    justify-content: center;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .hero p {
    font-size: 1.05rem;
  }
}

/* Expandable Full System Description Panel & Repixelate Animation */
button.btn-toggle-desc {
  background: rgba(99, 102, 241, 0.15) !important;
  border: 1px solid rgba(99, 102, 241, 0.4) !important;
  color: #a5b4fc !important;
  padding: 0.65rem 1.35rem !important;
  border-radius: 9999px !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2) !important;
  outline: none !important;
  appearance: none !important;
}

button.btn-toggle-desc:hover {
  background: rgba(99, 102, 241, 0.3) !important;
  border-color: var(--accent-cyan) !important;
  color: #ffffff !important;
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.4) !important;
  transform: translateY(-2px) !important;
}

button.btn-toggle-desc.active {
  background: rgba(6, 182, 212, 0.25) !important;
  border-color: var(--accent-cyan) !important;
  color: #ffffff !important;
}

.full-desc-panel,
.full-tools-panel {
  max-width: 960px;
  margin: 2rem auto 2.5rem;
  background: rgba(8, 12, 22, 0.92);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 16px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(6, 182, 212, 0.2);
  max-height: 5000px;
  opacity: 1;
  pointer-events: auto;
  transition: max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, padding 0.4s ease, margin 0.4s ease, border-color 0.4s ease;
}

.full-desc-panel.hidden,
.full-tools-panel.hidden {
  max-height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-color: transparent !important;
  border-width: 0 !important;
  animation: none !important;
}

.phase-in-anim {
  animation: phaseInRepixelate 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes phaseInRepixelate {
  0% {
    opacity: 0;
    filter: blur(20px) contrast(220%) brightness(1.8);
    transform: scale(0.95) translateY(-14px);
  }
  40% {
    opacity: 0.7;
    filter: blur(8px) contrast(140%) brightness(1.3);
    transform: scale(0.99) translateY(-4px);
  }
  100% {
    opacity: 1;
    filter: blur(0px) contrast(100%) brightness(1);
    transform: scale(1) translateY(0);
  }
}

.desc-scan-beam {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), #ffffff, var(--accent-purple), transparent);
  animation: scanBeam 1.2s ease-out forwards;
}

@keyframes scanBeam {
  0% { left: -100%; opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.desc-header {
  margin-bottom: 1.8rem;
  text-align: center;
}

.desc-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.6rem;
}

.desc-header h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
}

.desc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
}

.desc-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.4rem;
  text-align: left;
}

.desc-box h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.6rem;
}

.desc-box p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
