/* ==========================================================================
   DESIGN SYSTEM - ALGEBRA WITHIN
   ========================================================================== */

/* Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@300;400;600;700;900&display=swap');

:root {
  /* Color Palette */
  --bg-primary: #0a0a0c;
  --bg-surface-1: #121215;
  --bg-surface-2: #1a1a1f;
  --bg-surface-3: #222228;
  
  --border-muted: rgba(255, 255, 255, 0.05);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(255, 255, 255, 0.3);
  
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #66666e;
  
  --accent-color: #ffffff;
  --accent-rgb: 255, 255, 255;
  
  /* Glitch Accent Colors */
  --glitch-red: #ff0055;
  --glitch-cyan: #00ffcc;
  
  /* Fonts */
  --font-header: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-medium: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* ==========================================================================
   CRT MONITOR OVERLAY & ANALOG DISTORTION
   ========================================================================== */

/* Outer screen bezel mask */
body::after {
  content: " ";
  display: block;
  position: fixed;
  top: 0; left: 0; bottom: 0; right: 0;
  box-shadow: 
    inset 0 0 80px rgba(0,0,0,0.85), 
    inset 0 0 30px rgba(0,0,0,0.9);
  z-index: 10002; /* Positioned above all elements, including preloader */
  pointer-events: none;
}

#crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.5) 100%), /* Lens Vignette */
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.12) 50%), /* Micro scanlines (horizontal pixel division) */
    linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02)); /* RGB Phosphor Subpixel Grid (vertical pixel division) */
  background-size: 100% 100%, 100% 4px, 6px 100%;
  z-index: 10001; /* Positioned above preloader (9999) and glitch overlay (9998) */
  pointer-events: none;
  opacity: 0.92;
}

/* Content wrapper that experiences horizontal wiggling & periodic random tearing glitches */
.crt-screen-content {
  width: 100%;
  min-height: 100%;
  animation: crt-jitter 0.25s infinite;
  transform: scale(1.002);
}

.crt-screen-content.is-glitching {
  animation: 
    crt-jitter 0.25s infinite,
    crt-glitch-burst 0.3s ease-in-out;
}

/* Convergence error - Red/Cyan RGB bleed shadows on text elements */
h1, h2, h3, h4, .btn, .nav-tab-item button {
  text-shadow: 1.5px 0 1px rgba(0, 255, 204, 0.35), -1.5px 0 1px rgba(255, 0, 85, 0.35) !important;
}



/* Keyframes */

/* Micro analog sync wiggle (horizontal jitter) */
@keyframes crt-jitter {
  0% { transform: translate(0, 0); }
  5% { transform: translate(-0.4px, 0.2px); }
  10% { transform: translate(0.4px, -0.2px); }
  15% { transform: translate(-0.2px, 0.1px); }
  20% { transform: translate(0.2px, -0.1px); }
  25% { transform: translate(0.5px, 0.3px); }
  30% { transform: translate(-0.5px, -0.3px); }
  35% { transform: translate(-0.3px, 0.2px); }
  40% { transform: translate(0.3px, -0.2px); }
  45% { transform: translate(0px, 0px); }
  100% { transform: translate(0, 0); }
}

/* Single short sync tear / horizontal distortion glitch (simulates signal interference) */
@keyframes crt-glitch-burst {
  0%, 100% {
    transform: translate(0, 0) skew(0deg);
    filter: none;
  }
  20% {
    transform: translate(-0.49px, 0.098px) skew(0.35deg);
    filter: contrast(1.5) saturate(1.2) hue-rotate(30deg);
  }
  40% {
    transform: translate(0.588px, -0.147px) skew(-0.42deg);
    filter: contrast(1.8) saturate(1.5) invert(0.05);
  }
  60% {
    transform: translate(-0.196px, 0.049px) skew(0.07deg);
    filter: contrast(1.3);
  }
  80% {
    transform: translate(0.735px, -0.098px) skew(-0.56deg);
    filter: hue-rotate(-60deg) contrast(1.6);
  }
}

/* Subtle phosphor glow flicker */
@keyframes crt-flicker {
  0% { opacity: 0.995; }
  50% { opacity: 1; }
  100% { opacity: 0.995; }
}

body {
  animation: crt-flicker 0.15s infinite;
}


/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-surface-3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================================================
   PRELOADER & GLITCH OVERLAY
   ========================================================================== */

#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--bg-primary);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

/* Dynamic chromatic aberration wrapper */
.logo-wrapper {
  position: relative;
  width: 600px;
  max-width: 85%;
  height: 220px;
  display: flex;
  justify-content: center;
  align-items: center;
  mix-blend-mode: screen;
}

.logo-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: invert(1); /* Invert white background to black, black shapes to white */
  mix-blend-mode: screen; /* Blend out black backgrounds */
}

/* Color splitting */
.logo-layer.red {
  background-image: url('images/algebrawithin_logo1.svg');
  filter: invert(1) sepia(1) saturate(10) hue-rotate(-50deg);
  /* animation: glitch-color-red 4s infinite steps(1); */
}

.logo-layer.cyan {
  background-image: url('images/algebrawithin_logo1.svg');
  filter: invert(1) sepia(1) saturate(10) hue-rotate(130deg);
  /* animation: glitch-color-cyan 4s infinite steps(1); */
}

.logo-layer.main {
  background-image: url('images/algebrawithin_logo1.svg');
  /* animation: glitch-main 4s infinite ease-in-out; */
}

/* Preloader progress bar */
.loader-bar-container {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
  margin-top: 40px;
  position: relative;
  overflow: hidden;
  border-radius: 1px;
}

.loader-bar {
  width: 0%;
  height: 100%;
  background: var(--text-primary);
  box-shadow: 0 0 8px #fff;
  animation: loader-fill 4s forwards linear;
}

/* Preloader glitch keyframes */
@keyframes loader-fill {
  0% { width: 0%; }
  30% { width: 40%; }
  33% { width: 35%; } /* glitch delay */
  60% { width: 75%; }
  85% { width: 90%; }
  100% { width: 100%; }
}

@keyframes glitch-color-red {
  0%, 19%, 21%, 23%, 25%, 39%, 41%, 59%, 61%, 89%, 91%, 100% {
    transform: translate(0, 0);
    opacity: 0.8;
  }
  20% { transform: translate(-8px, 4px); opacity: 1; }
  22% { transform: translate(6px, -2px); opacity: 1; }
  24% { transform: translate(-3px, -5px); opacity: 1; }
  40% { transform: translate(10px, -6px); opacity: 1; }
  60% { transform: translate(-7px, 3px); opacity: 1; }
  90% { transform: translate(8px, 5px); opacity: 1; }
}

@keyframes glitch-color-cyan {
  0%, 19%, 21%, 23%, 25%, 39%, 41%, 59%, 61%, 89%, 91%, 100% {
    transform: translate(0, 0);
    opacity: 0.8;
  }
  20% { transform: translate(8px, -4px); opacity: 1; }
  22% { transform: translate(-6px, 2px); opacity: 1; }
  24% { transform: translate(4px, 5px); opacity: 1; }
  40% { transform: translate(-10px, 6px); opacity: 1; }
  60% { transform: translate(7px, -3px); opacity: 1; }
  90% { transform: translate(-8px, -5px); opacity: 1; }
}

@keyframes glitch-main {
  0%, 19%, 21%, 23%, 25%, 39%, 41%, 59%, 61%, 89%, 91%, 100% {
    transform: scale(1) translate(0, 0);
    filter: invert(1);
  }
  20% { transform: scale(1.02) translate(-2px, 1px); filter: invert(1) contrast(1.5); }
  22% { transform: scale(0.98) translate(1px, -1px); }
  24% { transform: scale(1.04) translate(-3px, 2px); }
  40% { transform: scale(1.01) translate(3px, -2px); }
  60% { transform: scale(0.97) translate(-1px, 2px); }
  90% { transform: scale(1.03) translate(2px, 1px); }
}

/* Glitch transition overlay */
#glitch-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--bg-primary);
  z-index: 9998;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  opacity: 0;
}

#glitch-overlay.active {
  opacity: 1;
  pointer-events: all;
  animation: overlay-glitch-active 0.5s steps(1) forwards;
}

@keyframes overlay-glitch-active {
  0% {
    background-color: var(--bg-primary);
    transform: translate(0, 0) skew(0deg);
  }
  10% {
    background-color: var(--bg-surface-2);
    transform: translate(-5px, 2px) skew(2deg);
    box-shadow: inset 10px 0 20px var(--glitch-red);
  }
  20% {
    background-color: var(--bg-primary);
    transform: translate(4px, -3px) skew(-1deg);
  }
  30% {
    background-color: #000;
    transform: translate(-10px, 5px) skew(5deg);
    box-shadow: inset -10px 0 20px var(--glitch-cyan);
  }
  40% {
    background-color: var(--bg-surface-1);
    transform: translate(7px, -2px) skew(-3deg);
  }
  50% {
    background-color: var(--bg-primary);
    transform: translate(-2px, 4px) skew(1deg);
  }
  60% {
    background-color: #ffffff;
    transform: translate(6px, -4px) skew(-2deg);
  }
  70% {
    background-color: var(--bg-surface-3);
    transform: translate(-4px, 1px) skew(4deg);
  }
  80% {
    background-color: var(--bg-primary);
    transform: translate(3px, -1px) skew(0deg);
  }
  100% {
    background-color: var(--bg-primary);
    transform: translate(0, 0) skew(0deg);
  }
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 52px;
  z-index: 1000;
  background: rgba(10, 10, 12, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4%;
  transition: background var(--transition-fast);
}

.logo-container {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.logo-mini {
  height: 24px;
  width: auto;
  filter: invert(1); /* Invert mini logo */
  mix-blend-mode: screen;
}

nav {
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-tabs {
  display: flex;
  list-style: none;
  height: 100%;
  align-items: center;
  gap: 8px;
}

.nav-tab-item button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-header);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 8px 18px;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-tab-item button::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0%;
  height: 1px;
  background-color: var(--text-primary);
  transition: all var(--transition-fast);
  transform: translateX(-50%);
}

.nav-tab-item button:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.nav-tab-item.active button {
  color: var(--text-primary);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-item.active button::after {
  width: 40%;
}

/* Mobile Nav Toggles */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--text-primary);
  margin: 4px 0;
  transition: all var(--transition-fast);
}

/* Active hamburger states */
.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -5px);
}

/* ==========================================================================
   MAIN CONTENT & SECTIONS
   ========================================================================== */

main {
  margin-top: 52px;
  min-height: calc(100vh - 52px);
  position: relative;
}

.content-section {
  display: none; /* Controlled by active class */
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  padding: 60px 4% 100px 4%;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.content-section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Page Section Headers */
.section-header {
  margin-bottom: 50px;
  position: relative;
}

.section-header h1 {
  font-family: var(--font-header);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-bottom: 12px;
  line-height: 1.1;
  background: linear-gradient(180deg, #fff 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.6;
}

/* ==========================================================================
   PLUGINS SECTION
   ========================================================================== */

.plugins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 30px;
}

.plugin-card {
  background-color: transparent;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  transition: all var(--transition-medium);
  display: flex;
  flex-direction: column;
  position: relative;
}

.plugin-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.03);
  opacity: 0;
  transition: opacity var(--transition-medium);
  pointer-events: none;
}

/* Hover effect on plugin cards removed per user request */

/* Mock GUI Interface in card */
.plugin-preview {
  height: 220px;
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-muted);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gui-mockup {
  width: 85%;
  height: 80%;
  background: #0f0f12;
  border: 1px solid #2a2a30;
  border-radius: 6px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

.gui-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #1f1f25;
  padding-bottom: 5px;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-header);
}

.gui-body {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-grow: 1;
  padding: 10px 0;
}

/* DSP Dial mockup */
.gui-dial-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.gui-dial {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: #1e1e24;
  border: 2px solid #3a3a45;
  position: relative;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.gui-dial::before {
  content: '';
  position: absolute;
  width: 2px;
  height: 16px;
  background: var(--text-primary);
  top: 4px;
  left: calc(50% - 1px);
  transform-origin: bottom center;
  transform: rotate(35deg); /* Dial value */
}

.gui-dial.active {
  border-color: #8a8a93;
}

.gui-dial.active::before {
  background: #fff;
  box-shadow: 0 0 4px #fff;
  transform: rotate(-110deg);
}

.gui-dial-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

/* Oscilloscope waveform mockup */
.gui-scope {
  width: 100%;
  height: 35px;
  border: 1px solid #1f1f25;
  background: #09090b;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.gui-wave {
  width: 200%;
  height: 100%;
  background: repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(255,255,255,0.05) 40px, rgba(255,255,255,0.05) 80px);
  position: absolute;
}

.gui-wave::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: #fff;
  box-shadow: 0 0 8px #fff;
  animation: osc-wave 2s infinite linear;
}

@keyframes osc-wave {
  0% { transform: translateY(-50%) cubic-bezier(0.4, 0, 0.2, 1) scaleY(1); }
  50% { transform: translateY(-50%) scaleY(2.5) skewY(15deg); }
  100% { transform: translateY(-50%) cubic-bezier(0.4, 0, 0.2, 1) scaleY(1); }
}

.plugin-info {
  padding: 25px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.plugin-tag {
  font-family: var(--font-header);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.plugin-title {
  font-family: var(--font-header);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.plugin-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 25px;
  flex-grow: 1;
}

.plugin-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-muted);
  padding-top: 20px;
}

.plugin-price {
  font-family: var(--font-header);
  font-size: 1.25rem;
  font-weight: 600;
}

/* Button UI */
.btn {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border: 1px solid var(--text-primary);
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px 22px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--text-primary);
}

/* ==========================================================================
   MAX FOR LIVE SECTION
   ========================================================================== */

.m4l-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
}

.m4l-showcase {
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 40px;
}

.m4l-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.tag-badge {
  background: var(--bg-surface-3);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--border-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.m4l-showcase h2 {
  font-family: var(--font-header);
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.m4l-showcase p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 1rem;
  margin-bottom: 30px;
}

.m4l-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.feature-item {
  display: flex;
  gap: 12px;
}

.feature-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  margin-top: 8px;
  flex-shrink: 0;
  box-shadow: 0 0 8px #fff;
}

.feature-text h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.feature-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.m4l-sidebar {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.m4l-card {
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 30px;
}

.m4l-card h3 {
  font-family: var(--font-header);
  font-size: 1.25rem;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-muted);
  padding-bottom: 10px;
}

.specs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.specs-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.specs-list li span:first-child {
  color: var(--text-secondary);
}

.specs-list li span:last-child {
  font-weight: 500;
}

/* ==========================================================================
   TEMPLATES SECTION
   ========================================================================== */

.templates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.template-card {
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 35px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.template-badge {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.template-card h2 {
  font-family: var(--font-header);
  font-size: 2rem;
  margin-bottom: 15px;
}

.template-details {
  display: flex;
  gap: 30px;
  margin: 20px 0;
  padding: 15px 0;
  border-top: 1px solid var(--border-muted);
  border-bottom: 1px solid var(--border-muted);
}

.detail-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-col span:first-child {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.detail-col span:last-child {
  font-size: 1rem;
  font-weight: 500;
}

/* ==========================================================================
   MUSIC SECTION
   ========================================================================== */

.music-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 50px;
  align-items: start;
}

.music-artwork-wrapper {
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.vinyl-disk {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, #222 10%, #000 12%, #111 13%, #000 20%, #151515 21%, #000 30%, #1c1c1c 31%, #000 40%, #1f1f1f 42%, #000 50%, #151515 51%, #000 65%, #222 66%, #000 95%);
  margin: 0 auto 30px auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spin 20s infinite linear;
  animation-play-state: paused;
}

.vinyl-disk.playing {
  animation-play-state: running;
}

.vinyl-label {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--bg-surface-3);
  border: 4px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.vinyl-label img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: invert(1);
  mix-blend-mode: screen;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.music-title-info {
  margin-top: 15px;
}

.music-title-info h3 {
  font-family: var(--font-header);
  font-size: 1.6rem;
  margin-bottom: 5px;
}

.music-title-info p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.music-embed-container {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.soundcloud-embed {
  background: transparent;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  padding: 10px;
}

.music-upcoming {
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 30px;
}

.upcoming-list {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.upcoming-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-muted);
}

.upcoming-item:last-child {
  border: none;
  padding-bottom: 0;
}

.upcoming-meta h4 {
  font-size: 0.95rem;
  font-weight: 500;
}

.upcoming-meta p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.upcoming-date {
  font-family: var(--font-header);
  font-size: 0.85rem;
  background: var(--bg-surface-2);
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text-secondary);
}

/* ==========================================================================
   MASTERING SECTION
   ========================================================================== */

.mastering-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
}

.mastering-media {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  padding: 25px;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.mastering-service-info {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.service-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  padding: 30px;
}

.service-card h2 {
  font-family: var(--font-header);
  font-size: 1.8rem;
  margin-bottom: 15px;
}

.service-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
  margin-bottom: 25px;
}

/* Audio Player Mock with Interactive Slider */
.audio-slider-mock {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  padding: 20px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.slider-track {
  width: 100%;
  position: relative;
  height: 35px;
  display: flex;
  align-items: center;
  cursor: ew-resize;
  background: #0f0f12;
  border: 1px solid var(--border-muted);
  border-radius: 4px;
  overflow: hidden;
}

.waveform-bg {
  position: absolute;
  left: 0;
  width: 100%;
  height: 60%;
  background-image: linear-gradient(90deg, var(--text-muted) 2px, transparent 2px);
  background-size: 8px 100%;
  opacity: 0.2;
}

.waveform-active {
  position: absolute;
  left: 0;
  height: 60%;
  background-image: linear-gradient(90deg, #fff 2px, transparent 2px);
  background-size: 8px 100%;
  width: 50%;
  border-right: 2px solid #fff;
  transition: width 0.05s linear;
}

.slider-overlay-text {
  position: absolute;
  font-size: 0.8rem;
  pointer-events: none;
  font-family: var(--font-header);
  letter-spacing: 0.05em;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 15px;
}

.slider-overlay-text.unmastered {
  left: 0;
  color: var(--text-muted);
}

.slider-overlay-text.mastered {
  right: 0;
  color: #fff;
}

.mastering-contact {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  padding: 30px;
}

.mastering-contact h3 {
  font-family: var(--font-header);
  font-size: 1.25rem;
  margin-bottom: 20px;
}

.contact-email-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-muted);
  border-radius: 6px;
  padding: 12px 20px;
}

.email-text {
  font-family: var(--font-header);
  font-size: 1.05rem;
  color: #fff;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

footer {
  border-top: 1px solid var(--border-muted);
  padding: 60px 4% 80px 4%;
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  text-align: center;
}

.footer-logo {
  height: 40px;
  width: auto;
  filter: invert(1);
  mix-blend-mode: screen;
}

.footer-links {
  display: flex;
  gap: 30px;
  list-style: none;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-header);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color var(--transition-fast);
}

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

.copyright {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE QUERIES
   ========================================================================== */

@media (max-width: 1024px) {
  .m4l-layout {
    grid-template-columns: 1fr;
  }
  
  .templates-grid {
    grid-template-columns: 1fr;
  }
  
  .music-layout {
    grid-template-columns: 1fr;
  }
  
  .mastering-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  header {
    padding: 0 6%;
  }

  .menu-toggle {
    display: block;
  }

  nav {
    position: fixed;
    top: 52px;
    left: 0;
    width: 100%;
    height: calc(100vh - 52px);
    background-color: rgba(10, 10, 12, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform var(--transition-medium), opacity var(--transition-medium);
    pointer-events: none;
    z-index: 999;
  }

  nav.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-tabs {
    flex-direction: column;
    justify-content: center;
    width: 100%;
    padding: 40px 0;
    gap: 30px;
  }

  .nav-tab-item button {
    font-size: 1.5rem;
  }

  .section-header h1 {
    font-size: 2.25rem;
  }

  .plugins-grid {
    grid-template-columns: 1fr;
  }

  .vinyl-disk {
    width: 220px;
    height: 220px;
  }

  .vinyl-label {
    width: 80px;
    height: 80px;
  }
}

/* ==========================================================================
   EDIT MODE CONTROLS
   ========================================================================== */
#edit-mode-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10005;
  display: flex;
  gap: 10px;
}

#edit-mode-controls .btn {
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  font-size: 0.75rem;
  padding: 8px 16px;
}

.editable-active {
  outline: 1px dashed var(--border-focus);
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s;
  cursor: text;
}

.editable-active:hover {
  outline: 1px dashed var(--glitch-cyan);
  background: rgba(0, 255, 204, 0.05);
}

/* ==========================================================================
   LATEST UPDATES COMPONENT & EDIT CONTROLS
   ========================================================================== */
#updates-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

#updates-list li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

#updates-list li:last-child {
  margin-bottom: 0;
}

#updates-list li::before {
  content: '•';
  margin-right: 5px;
  color: var(--text-secondary);
}

#updates-list a {
  color: inherit;
  text-decoration: none;
  flex-grow: 1;
  transition: color 0.2s;
}

#updates-list a:hover {
  color: var(--text-primary);
}

.add-update-btn {
  background: rgba(0, 255, 204, 0.1);
  color: var(--glitch-cyan);
  border: 1px solid var(--glitch-cyan);
  border-radius: 4px;
  width: 20px;
  height: 20px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  margin-left: 10px;
  vertical-align: middle;
}

.entry-controls {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.entry-controls button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-focus);
  color: var(--text-secondary);
  border-radius: 3px;
  width: 22px;
  height: 22px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.entry-controls button:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.delete-update-btn:hover {
  background: rgba(255, 0, 85, 0.2) !important;
  border-color: var(--glitch-red) !important;
  color: var(--glitch-red) !important;
}

/* ==========================================================================
   PLUGIN BUILDER CONTROLS
   ========================================================================== */
.plugin-builder-controls {
  display: flex;
  gap: 8px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.5);
  border-top: 1px solid var(--border-muted);
  justify-content: center;
}

.plugin-builder-controls button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-focus);
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plugin-builder-controls button:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.plugin-builder-controls .delete-plugin-btn:hover {
  background: rgba(255, 0, 85, 0.2);
  border-color: var(--glitch-red);
  color: var(--glitch-red);
}

.add-plugin-btn {
  background: rgba(0, 255, 204, 0.1);
  color: var(--glitch-cyan);
  border: 1px solid var(--glitch-cyan);
  border-radius: 4px;
  width: 24px;
  height: 24px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  margin-left: 15px;
  vertical-align: middle;
}

/* ==========================================================================
   PLUGINS GRID & CARD
   ========================================================================== */
.plugins-grid {
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: 100%;
}

.plugin-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
}

.plugin-media-area:not(:empty) {
  border-bottom: 1px solid var(--border-muted);
}

.plugin-info {
  padding: 30px;
}

.plugin-title {
  font-family: var(--font-header);
  font-size: 2rem;
  margin-bottom: 15px;
  outline: none;
}

.plugin-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
  min-height: 60px;
  width: 100%;
  outline: none;
}

/* ==========================================================================
   PLUGIN BUILDER MODULAR BLOCKS
   ========================================================================== */
.plugin-blocks-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 30px;
}

.builder-block {
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.builder-block.editable-active {
  padding: 10px;
  border: 1px dashed transparent;
  border-radius: 6px;
}

/* Hover highlight removed per user request */

/* Center buttons inside builder blocks */
.block-content .btn {
  margin: 0 auto;
  display: block;
  width: fit-content;
}

.block-edit-controls {
  position: absolute;
  top: -15px;
  right: -10px;
  display: flex;
  gap: 5px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-muted);
  border-radius: 4px;
  padding: 3px;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s;
}

.builder-block.editable-active:hover .block-edit-controls {
  opacity: 1;
}

.block-edit-controls button, .block-edit-controls span {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 3px;
}

.block-edit-controls button:hover, .block-edit-controls span:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.block-edit-controls .drag-handle {
  cursor: grab;
}

.block-edit-controls .drag-handle:active {
  cursor: grabbing;
}

.block-edit-controls .delete-block-btn:hover {
  color: var(--glitch-red);
  background: rgba(255, 0, 85, 0.2);
}

.builder-block.drag-over,
.plugin-card.drag-over {
  border-top: 2px solid var(--glitch-cyan);
}

.builder-block.drag-over-bottom,
.plugin-card.drag-over-bottom {
  border-bottom: 2px solid var(--glitch-cyan);
}


