/* =============================================================
   SMASH Labs Theme Override
   Dark purple / monospace / starfield aesthetic
   ============================================================= */

/* ── Variables ────────────────────────────────────────────── */
:root {
  --bg:            #07000d;
  --bg-alt:        #0d0018;
  --bg-surface:    #130020;
  --purple:        #8b2be2;
  --purple-bright: #a855f7;
  --purple-pale:   #c084fc;
  --glow:          rgba(168, 85, 247, 0.25);
  --glow-strong:   rgba(168, 85, 247, 0.45);
  --text:          rgba(255, 255, 255, 0.87);
  --text-muted:    rgba(255, 255, 255, 0.45);
  --border:        rgba(139, 43, 226, 0.22);
  --border-hover:  rgba(168, 85, 247, 0.5);
}

/* ── Font: Monospace everywhere (exclude .icon to preserve FontAwesome) ── */
body *:not(.icon):not([class*="fa-"]) {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace !important;
}
body {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace !important;
}

/* ── Canvas starfield ─────────────────────────────────────── */
#starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ── Base ─────────────────────────────────────────────────── */
html { background-color: var(--bg); }

body {
  background-color: var(--bg) !important;
  color: var(--text) !important;
}

a {
  color: var(--purple-bright) !important;
  border-bottom-color: var(--border) !important;
}
a:hover {
  color: var(--purple-pale) !important;
  border-bottom-color: var(--purple-bright) !important;
}

p { color: var(--text) !important; }
strong, b { color: #fff !important; }

/* ── Section / Wrapper backgrounds ───────────────────────── */
.wrapper.style1,
.wrapper.fullscreen {
  background-color: transparent !important;
  background-image: none !important;
}
.wrapper.style2 {
  background-color: rgba(13, 0, 24, 0.92) !important;
}
.wrapper.style3 {
  background-color: rgba(16, 0, 32, 0.9) !important;
}
.wrapper.style1-alt {
  background-color: rgba(10, 0, 20, 0.96) !important;
}

/* Clear the intro.svg from the hero */
#intro {
  background-image: none !important;
  background-color: transparent !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Binary rain canvas confined to hero */
#binary-bg {
  position: absolute !important;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
}

/* Hero content stays above binary canvas */
#intro .inner {
  position: relative !important;
  z-index: 1 !important;
}

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
  background-color: rgba(10, 0, 20, 0.97) !important;
  border-right: 1px solid var(--border);
}

/* Full-height flex column so nav fills remaining space below logo */
#sidebar > .inner {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  padding: 0 !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
}

#sidebar .inner > nav {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}

#sidebar nav ul {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-evenly !important;
  height: 100% !important;
  margin: 0 !important;
}

.sidebar-logo {
  display: block;
  padding: 0;
  flex-shrink: 0;
  position: relative;
  border-bottom: 2px solid var(--purple);
  box-shadow: 0 2px 24px rgba(139, 43, 226, 0.4);
}

.sidebar-logo img {
  width: 100%;
  max-width: none;
  height: auto;
  display: block;
  object-fit: cover;
  opacity: 0.95;
  -webkit-mask-image: linear-gradient(to bottom, black 40%, rgba(0,0,0,0.55) 72%, transparent 95%);
  mask-image: linear-gradient(to bottom, black 40%, rgba(0,0,0,0.55) 72%, transparent 95%);
  transition: opacity 0.2s ease;
}

.sidebar-logo img:hover {
  opacity: 1;
}

#sidebar .inner nav ul li {
  border-top-color: var(--border) !important;
}

#sidebar nav ul li a {
  color: var(--text-muted) !important;
  font-size: 0.82em !important;
  letter-spacing: 0.14em !important;
  text-transform: none !important;
  font-weight: 400 !important;
  padding: 0 1.5em !important;
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
}

#sidebar nav ul li a:hover,
#sidebar nav ul li a.active {
  color: var(--purple-bright) !important;
  background-color: rgba(168, 85, 247, 0.06) !important;
}

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  color: #fff !important;
  font-weight: 500 !important;
}

h1 {
  font-size: 3.2em !important;
  letter-spacing: -0.02em !important;
  line-height: 1.1 !important;
}

/* Section headings styled like terminal comments */
.wrapper > .inner > h2 {
  color: var(--purple-bright) !important;
  font-size: 1.1em !important;
  letter-spacing: 0.15em !important;
  font-weight: 400 !important;
  text-transform: none !important;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75em;
  margin-bottom: 1.5em;
}

.wrapper > .inner > p {
  color: var(--text-muted) !important;
  font-size: 0.9em !important;
  line-height: 1.8 !important;
}

/* Cursor blink */
.cursor {
  color: var(--purple-bright);
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Hero lead paragraph */
.lead {
  font-size: 1.05em !important;
  color: rgba(255, 255, 255, 0.7) !important;
  line-height: 1.9 !important;
  max-width: 560px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.button .fa {
  margin-right: 0.5em;
  font-size: 1.1em;
}
.button,
input[type="submit"],
input[type="reset"],
input[type="button"] {
  background-color: transparent !important;
  border: 1px solid var(--purple) !important;
  color: var(--purple-bright) !important;
  border-radius: 2px !important;
  font-size: 0.7em !important;
  letter-spacing: 0.15em !important;
  text-transform: lowercase !important;
  transition: all 0.2s ease !important;
  padding: 0.9em 2em !important;
}

.button:hover,
input[type="submit"]:hover {
  background-color: rgba(139, 43, 226, 0.18) !important;
  border-color: var(--purple-bright) !important;
  color: var(--purple-pale) !important;
  box-shadow: 0 0 12px var(--glow) !important;
}

.button.primary {
  background-color: var(--purple) !important;
  border-color: var(--purple) !important;
  color: #fff !important;
}
.button.primary:hover {
  background-color: var(--purple-bright) !important;
  border-color: var(--purple-bright) !important;
  box-shadow: 0 0 20px var(--glow-strong) !important;
}

/* ── Feature Cards (Services & AI sections) ───────────────── */
.features {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  border-top-color: var(--border) !important;
}

.features section {
  border-top-color: var(--border) !important;
  /* Preserve template's 7em left pad so absolutely-positioned icon doesn't overlap text */
  padding: 3.5em 3em 1.5em 7em !important;
  background-color: rgba(19, 0, 32, 0.6) !important;
  border: 1px solid var(--border) !important;
  border-radius: 2px !important;
  margin: 0 !important;
  position: relative !important;
  width: 100% !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.features section:hover {
  border-color: var(--border-hover) !important;
  box-shadow: 0 0 18px var(--glow) !important;
}

.features section h3 {
  font-size: 0.85em !important;
  letter-spacing: 0.1em !important;
  text-transform: none !important;
  color: #fff !important;
  font-weight: 500 !important;
}

.features section p {
  font-size: 0.78em !important;
  color: var(--text-muted) !important;
  line-height: 1.75 !important;
}

.icon.major::before {
  color: var(--purple-bright) !important;
  text-shadow: 0 0 12px var(--glow-strong) !important;
}

/* ── Forms ────────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  background-color: rgba(19, 0, 32, 0.7) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  border-radius: 2px !important;
  font-size: 0.8em !important;
}
input::placeholder, textarea::placeholder { color: var(--text-muted) !important; }
input:focus, textarea:focus {
  border-color: var(--purple) !important;
  box-shadow: 0 0 0 2px var(--glow) !important;
  outline: none !important;
}
label {
  color: var(--text-muted) !important;
  font-size: 0.72em !important;
  letter-spacing: 0.1em !important;
  text-transform: lowercase !important;
}

/* Contact list */
.contact li {
  border-top-color: var(--border) !important;
}
.contact li h3 {
  color: var(--purple-bright) !important;
  font-size: 0.7em !important;
  letter-spacing: 0.15em !important;
  text-transform: lowercase !important;
  font-weight: 400 !important;
}

/* ── Client Logo Grid ─────────────────────────────────────── */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5em 2em;
  align-items: center;
  margin: 2.5em 0;
  padding: 2em;
  border: 1px solid var(--border);
  background-color: rgba(19, 0, 32, 0.4);
  border-radius: 2px;
}

.client-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8em;
}

.client-logo img {
  max-width: 130px;
  max-height: 40px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(1) brightness(4) opacity(0.55);
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.client-logo:hover img {
  filter: grayscale(0) brightness(1.1) opacity(0.95);
}

/* Dark/black logos need invert to become white */
.client-logo.logo-dark img {
  filter: invert(1) grayscale(1) brightness(3) opacity(0.55);
}
.client-logo.logo-dark:hover img {
  filter: invert(1) grayscale(0) brightness(1.1) opacity(0.95);
}

/* ── Project: Maestro marquee card ───────────────────────── */
.project-marquee {
  position: relative;
  border: 1px solid var(--purple);
  border-radius: 2px;
  padding: 2.5em;
  margin-bottom: 3em;
  background: linear-gradient(135deg,
    rgba(139, 43, 226, 0.08) 0%,
    rgba(19, 0, 32, 0.8) 60%
  );
  box-shadow: 0 0 30px rgba(139, 43, 226, 0.12), inset 0 0 30px rgba(139, 43, 226, 0.05);
}

.project-badge {
  display: inline-block;
  background-color: var(--purple);
  color: #fff;
  font-size: 0.6em;
  letter-spacing: 0.2em;
  text-transform: none;
  padding: 0.3em 0.9em;
  border-radius: 1px;
  margin-bottom: 1em;
}

.project-marquee h3 {
  font-size: 1.6em !important;
  letter-spacing: -0.01em !important;
  margin-bottom: 0.6em !important;
}

.project-marquee h3 a {
  color: #fff !important;
  border-bottom: none !important;
  text-decoration: none;
}
.project-marquee h3 a:hover {
  color: var(--purple-bright) !important;
  text-shadow: 0 0 16px var(--glow-strong);
}

.project-marquee p {
  font-size: 0.88em !important;
  color: rgba(255,255,255,0.65) !important;
  line-height: 1.8 !important;
  margin-bottom: 1.5em !important;
}

/* Maestro card two-column layout */
.project-marquee {
  display: flex;
  align-items: center;
  gap: 2.5em;
}

.project-marquee-content {
  flex: 1;
  min-width: 0;
}

.project-marquee-logo {
  flex-shrink: 0;
  width: 240px;
}

.project-marquee-logo img {
  width: 100%;
  height: auto;
  border: 1px solid var(--purple);
  border-radius: 12px;
  display: block;
}

/* ── Project: Legacy OpenRCE ──────────────────────────────── */
.project-legacy {
  border-top: 1px solid var(--border);
  padding-top: 2.5em;
  margin-top: 1em;
}

.project-legacy h4 {
  color: var(--purple-bright) !important;
  font-size: 0.85em !important;
  letter-spacing: 0.12em !important;
  font-weight: 400 !important;
  text-transform: lowercase !important;
  margin-bottom: 0.5em !important;
}

.project-legacy .muted {
  font-size: 0.78em !important;
  color: var(--text-muted) !important;
  margin-bottom: 2em !important;
}

.legacy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2em;
}

.legacy-item {
  border: 1px solid var(--border);
  border-left: 3px solid rgba(168, 85, 247, 0.35);
  padding: 1.2em 1.4em;
  background-color: rgba(10, 0, 20, 0.5);
  border-radius: 1px;
  transition: border-color 0.2s ease;
}

.legacy-item:hover {
  border-left-color: var(--purple-bright);
}

.legacy-item a {
  display: block;
  font-size: 0.9em !important;
  font-weight: 600 !important;
  color: rgba(255,255,255,0.8) !important;
  border-bottom: none !important;
  margin-bottom: 0.5em;
  letter-spacing: 0.05em;
}
.legacy-item a:hover { color: var(--purple-pale) !important; }

.legacy-item span {
  font-size: 0.72em;
  color: var(--text-muted);
  line-height: 1.7;
  display: block;
}

/* ── Footer ───────────────────────────────────────────────── */
#footer.wrapper.style1-alt {
  border-top: 1px solid var(--border);
}

#footer .menu {
  display: flex;
  align-items: center;
  gap: 1.5em;
  flex-wrap: wrap;
}

#footer .menu li {
  display: flex !important;
  align-items: center;
  gap: 0.5em;
  font-size: 0.7em !important;
  color: var(--text-muted) !important;
  border-left-color: var(--border) !important;
}

.tx-flag {
  display: inline-block;
  width: 22px;
  height: 15px;
  border-radius: 1px;
  vertical-align: middle;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15);
}

/* ── Scrollex fade animations ─────────────────────────────── */
.wrapper.fade-up.inactive {
  opacity: 0;
  transform: translateY(1.5em);
}
.wrapper.fade-up {
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.features.inactive > section {
  opacity: 0;
  transform: translateY(1em);
}
.features > section {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Stagger feature card animations */
.features > section:nth-child(1) { transition-delay: 0.05s; }
.features > section:nth-child(2) { transition-delay: 0.10s; }
.features > section:nth-child(3) { transition-delay: 0.15s; }
.features > section:nth-child(4) { transition-delay: 0.20s; }
.features > section:nth-child(5) { transition-delay: 0.25s; }
.features > section:nth-child(6) { transition-delay: 0.30s; }

/* ── Split layout (contact) ───────────────────────────────── */
.split.style1 {
  border-top-color: var(--border) !important;
}
.split.style1 > * {
  border-left-color: var(--border) !important;
}

/* ── Mobile Hamburger Menu ────────────────────────────────── */
#nav-toggle {
  display: none;
  position: fixed;
  top: 0.7em;
  right: 0.85em;
  z-index: 10001;
  background: rgba(19, 0, 32, 0.97);
  border: 1px solid var(--border);
  border-radius: 2px;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

#nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--purple-bright);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 2px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 980px) {
  h1 { font-size: 2.2em !important; }
  .client-grid { grid-template-columns: repeat(3, 1fr); }
  .legacy-grid { grid-template-columns: 1fr; }
  .project-marquee { padding: 1.8em; }
  /* Keep 2-column grid (override template's display:block fallback) */
  .features {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 736px) {
  h1 { font-size: 1.8em !important; }
  /* Two-column logo grid on mobile */
  .client-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8em;
    padding: 0.5em 0;
  }
  .client-logo {
    width: 100%;
    justify-content: center;
  }
  .client-logo img {
    max-width: 100px;
    max-height: 32px;
  }
  /* One-line layout: [icon] [title .............. +/-] */
  .features section {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    padding: 0.8em 1em !important;
    min-height: 58px !important;
    cursor: pointer;
    user-select: none;
  }

  /* Pull icon into normal flow, compact size */
  .features section .icon.major {
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: 2em !important;
    height: 2em !important;
    line-height: 2em !important;
    font-size: 0.85em !important;
    margin: 0 0.8em 0 0 !important;
    flex-shrink: 0 !important;
  }

  /* h3 fills remaining row width */
  .features section h3 {
    flex: 1 !important;
    min-width: 0 !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  /* Collapsible tiles: hide body by default, show on .open */
  .features section p {
    display: none;
    width: 100% !important;
    margin: 0 !important;
    padding: 0.5em 0 0.4em !important;
  }
  .features section.open p {
    display: block;
  }

  /* Expand / collapse indicator */
  .features section h3::after {
    content: '+';
    color: var(--purple-bright);
    font-size: 1.1em;
    font-weight: 300;
    flex-shrink: 0;
    margin-left: 0.75em;
    opacity: 0.55;
    transition: opacity 0.2s ease;
  }
  .features section.open h3::after {
    content: '−';
    opacity: 1;
  }

  /* Show hamburger */
  #nav-toggle { display: flex; }

  /* Sidebar becomes slide-in panel */
  #sidebar {
    display: block !important;
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    height: 100% !important;
    width: 100% !important;
    transform: translateX(-105%) !important;
    transition: transform 0.3s ease !important;
    z-index: 10000 !important;
    overflow-y: auto !important;
    text-align: left !important;
    line-height: normal !important;
    background: rgba(7, 0, 13, 0.99) !important;
    border-right: 1px solid var(--border) !important;
    padding: 0 !important;
  }

  /* Full-height flex column: logo pinned top, nav fills remaining space */
  #sidebar > .inner {
    flex-direction: column !important;
    height: 100% !important;
    line-height: normal !important;
    padding: 0 !important;
    display: flex !important;
  }

  /* Nav flex-fills the space below the logo */
  #sidebar nav {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    line-height: normal !important;
    width: 100%;
  }

  #sidebar nav ul {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    justify-content: space-evenly !important;
    height: auto !important;
    margin: 0 !important;
  }

  #sidebar nav ul li {
    display: flex !important;
    align-items: center !important;
    height: auto !important;
    line-height: normal !important;
    margin: 0 !important;
    padding: 0 !important;
    border-top: 1px solid var(--border) !important;
  }

  #sidebar nav a {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 60px !important;
    height: auto !important;
    line-height: normal !important;
    padding: 0 2em !important;
    font-size: 1em !important;
    letter-spacing: 0.12em !important;
  }

  /* Open state */
  body.nav-open #sidebar { transform: translateX(0) !important; }

  /* Backdrop overlay */
  body.nav-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 9999;
  }

  /* Hamburger -> X animation */
  body.nav-open #nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open #nav-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open #nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Hide Maestro logo on mobile */
  .project-marquee-logo { display: none; }

  /* No sidebar offset on mobile */
  #wrapper { margin-top: 0 !important; padding-top: 0 !important; }
}

@media (max-width: 480px) {
  .features {
    grid-template-columns: 1fr !important;
  }
}
