/* ==============================================================================
   🏛️ ODCS (Open Digital Continuity Standard) — Sovereign Master Stylesheet
   Pure CSS3 • Zero Next.js • Zero Framework Overhead • 100% Native Performance
   Designed for Star Programming Language & Haven Language Dual-Engine Stack
   Architect: Anirudha Puthraya · Veyra-Programming
   ============================================================================== */

:root {
  --bg-void: #030712;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-glass: rgba(10, 15, 30, 0.90);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-cyan: rgba(0, 240, 255, 0.35);
  --border-violet: rgba(168, 85, 247, 0.35);
  --border-amber: rgba(251, 191, 36, 0.35);
  --border-emerald: rgba(16, 185, 129, 0.35);
  
  --cyan: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.25);
  --violet: #a855f7;
  --violet-glow: rgba(168, 85, 247, 0.25);
  --emerald: #10b981;
  --amber: #fbbf24;
  --rose: #f43f5e;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg-void);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
}

body.menu-locked {
  overflow: hidden;
}

/* Ambient Background Glow Orbs */
.glow-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb-1 {
  position: absolute;
  top: -10vw;
  left: 20%;
  width: 45vw;
  height: 45vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.07) 0%, transparent 70%);
  filter: blur(80px);
}

.glow-orb-2 {
  position: absolute;
  top: 35vh;
  right: -10vw;
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, transparent 70%);
  filter: blur(90px);
}

.glow-orb-3 {
  position: absolute;
  bottom: 10vh;
  left: -5vw;
  width: 35vw;
  height: 35vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, transparent 70%);
  filter: blur(80px);
}

/* Layout Container */
.page-container {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem 6rem;
}

/* Strict Icon Sizing System (Fixes Oversized Buttons) */
svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0 !important;
  max-width: 100%;
}

.btn svg, .nav-btn svg, .icon-sm {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  flex-shrink: 0 !important;
}

/* Sticky Capsule Header */
.sticky-header {
  position: sticky;
  top: 12px;
  z-index: 999;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto 2rem auto;
  padding: 0 1rem;
}

.header-capsule {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 25px var(--cyan-glow);
  padding: 0.65rem 1.25rem;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #fff;
  min-width: 0;
  flex-shrink: 0;
}

.brand-logo-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25) 0%, rgba(168, 85, 247, 0.25) 100%);
  border: 1.5px solid rgba(0, 240, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 0 15px var(--cyan-glow);
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.brand-sub {
  font-size: 0.62rem;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* Desktop Navigation */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 700;
}

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.38rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  white-space: nowrap;
  font-size: 0.78rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
}

.nav-link-highlight {
  color: var(--cyan);
  font-weight: 800;
}

/* Header Controls & Telemetry Pill */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.telemetry-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem;
  font-size: 0.74rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--emerald);
  white-space: nowrap;
}

.telemetry-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  display: inline-block;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Mobile Hamburger Toggle Button */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 0.85rem;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.16) 0%, rgba(168, 85, 247, 0.16) 100%);
  border: 1.5px solid rgba(0, 240, 255, 0.55);
  border-radius: var(--radius-full);
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.hamburger-btn:hover {
  background: rgba(0, 240, 255, 0.25);
  box-shadow: 0 0 15px var(--cyan-glow);
}

.hamburger-btn.active {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--rose);
  color: var(--rose);
}

/* Mobile Drawer Overlay */
.mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  display: none;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  max-height: calc(85vh - 70px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-drawer.open {
  display: flex;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.65rem 1.25rem;
  min-height: 40px;
  max-height: 48px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}

.btn-sm {
  font-size: 0.78rem;
  padding: 0.4rem 0.85rem;
  min-height: 32px;
  max-height: 36px;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan) 0%, #3b82f6 100%);
  color: #020617;
  border: none;
  box-shadow: 0 4px 20px var(--cyan-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 240, 255, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.btn-violet {
  background: linear-gradient(135deg, var(--violet) 0%, #7c3aed 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px var(--violet-glow);
}

.btn-violet:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(168, 85, 247, 0.45);
}

.btn-amber {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  color: #020617;
  border: none;
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.3);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-cyan {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--border-cyan);
  color: var(--cyan);
}

.badge-violet {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid var(--border-violet);
  color: #c084fc;
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--border-emerald);
  color: var(--emerald);
}

.badge-amber {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid var(--border-amber);
  color: var(--amber);
}

.badge-rose {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: var(--rose);
}

/* Section Header Structure */
.section-header {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 3rem auto;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 1rem;
}

.section-desc {
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  color: var(--text-muted);
  line-height: 1.6;
}

/* Hero Section */
.hero-grid {
  display: grid;
  grid-templateColumns: 1fr;
  gap: 2.5rem;
  margin-bottom: 5rem;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
  }
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-creator-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-full);
  padding: 0.45rem 1rem 0.45rem 0.65rem;
  width: fit-content;
  box-shadow: 0 4px 20px var(--cyan-glow);
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: #fff;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--cyan) 0%, #38bdf8 50%, var(--violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Cards & Glass Containers */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(0, 240, 255, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 20px var(--cyan-glow);
}

/* Star Sovereign UI Studio Layout */
.star-studio-container {
  background: rgba(10, 15, 30, 0.95);
  border: 1.5px solid var(--border-cyan);
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px var(--cyan-glow);
  overflow: hidden;
  margin-bottom: 5rem;
}

.star-studio-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--border-cyan);
}

.star-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 0.2rem;
  gap: 0.2rem;
}

.star-tab-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}

.star-tab-btn.active {
  background: var(--cyan);
  color: #000;
}

/* Code Pre Blocks */
pre.code-block {
  background: #010307;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #38bdf8;
  line-height: 1.6;
  overflow-x: auto;
}

/* Responsive Media Queries */
@media (max-width: 1040px) {
  .desktop-nav {
    display: none !important;
  }
  .hamburger-btn {
    display: inline-flex !important;
  }
}

@media (max-width: 640px) {
  .page-container {
    padding: 0 0.85rem 4rem;
  }
  .brand-sub {
    max-width: 140px;
  }
  .telemetry-pill span:last-child {
    display: none;
  }
  .hero-creator-badge {
    padding: 0.35rem 0.75rem;
  }
}

/* ==============================================================================
   🏆 MILESTONE 1 CELEBRATION & VICTORY SUITE STYLES
   ============================================================================== */
.victory-hero-banner {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(16, 185, 129, 0.12) 50%, rgba(0, 240, 255, 0.15) 100%);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(251, 191, 36, 0.12);
}

.victory-hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.08) 0%, transparent 60%);
  pointer-events: none;
  animation: pulse-glow 6s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); opacity: 0.6; }
  100% { transform: scale(1.05); opacity: 1; }
}

.badge-gold {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid #fbbf24;
  color: #fbbf24;
  font-family: var(--font-mono);
  font-weight: 800;
}

.btn-gold {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #030712;
  border: none;
  font-weight: 800;
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.35);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(251, 191, 36, 0.55);
}

/* Conformance Test Console */
.conformance-console {
  background: #020617;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-top: 1.5rem;
}

.conformance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.conformance-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: all 0.25s ease;
}

.conformance-item.passed {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}

.conformance-item.running {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.08);
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% { border-color: rgba(251, 191, 36, 0.3); }
  50% { border-color: rgba(251, 191, 36, 0.9); }
  100% { border-color: rgba(251, 191, 36, 0.3); }
}

/* ==============================================================================
   📰 FLAGSHIP ARTICLE READER & SPECIFICATION SUITE
   ============================================================================== */
.article-reader-container {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
}

.article-reader-header {
  padding: 2.5rem 2.5rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.05) 0%, transparent 100%);
}

.article-nav-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 2.5rem;
  background: rgba(3, 7, 18, 0.7);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  white-space: nowrap;
}

.article-tab-btn {
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.article-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.article-tab-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan);
  color: var(--cyan);
}

.article-content-body {
  padding: 2.5rem;
  color: #e2e8f0;
  line-height: 1.75;
  font-size: 0.95rem;
}

.article-notice-box {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(0, 240, 255, 0.1) 100%);
  border: 1.5px solid var(--border-violet);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0 2rem;
  box-shadow: 0 8px 30px rgba(168, 85, 247, 0.15);
}

/* Module Search & Catalog Grid */
.module-search-container {
  margin: 1.5rem 0;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.module-search-input {
  flex: 1;
  min-width: 260px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.module-search-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 15px var(--cyan-glow);
}

.module-grid-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
  max-height: 480px;
  overflow-y: auto;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.module-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.2s, border-color 0.2s;
}

.module-card:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
}

.module-card .mod-name {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
}

.module-card .mod-cat {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--cyan);
  text-transform: uppercase;
}

.module-card .mod-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Specification Comparison Table */
.spec-table-container {
  overflow-x: auto;
  margin: 1.75rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.spec-table th {
  background: rgba(0, 0, 0, 0.6);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.spec-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
}

.spec-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
