:root {
  --matrix: #00ff66;
  --matrix-dim: rgba(0, 255, 102, 0.7);
  --matrix-dark: rgba(0, 255, 102, 0.3);
  --blood: #ff0033;
  --warning: #ffcc00;
  --static: #aaa;
}

/* Accessibility: disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #000;
  color: #e5e5e5;
  font-family: 'Roboto', sans-serif;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* Digital Rain Canvas */
#matrix {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.3;
}

/* Header */
.header {
  background: rgba(0, 10, 0, 0.8);
  border-bottom: 1px solid var(--matrix);
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(5px);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.8rem;
  color: var(--matrix);
  text-decoration: none;
  text-shadow: 0 0 10px var(--matrix);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--matrix-dim);
  text-decoration: none;
  font-family: 'Share Tech Mono', monospace;
  position: relative;
  padding: 0.5rem 0;
  transition: color 0.3s, text-shadow 0.3s;
}

.nav-links a:hover {
  color: var(--matrix);
  text-shadow: 0 0 10px var(--matrix);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--matrix);
  transition: width 0.3s;
}

.nav-links a:hover::after {
  width: 100%;
}

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

.hero {
  text-align: center;
  padding: 3rem 1rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--matrix);
}

.hero h1 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 3.5rem;
  color: var(--matrix);
  text-shadow: 0 0 10px var(--matrix);
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.hero p {
  max-width: 700px;
  margin: 1rem auto;
  font-size: 1.2rem;
  line-height: 1.6;
}

/* Operations Grid - 1 Big + 2 Below */
.pyramid-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 3rem 0;
}

/* First card spans both columns */
.pyramid-grid .operation-main {
  grid-column: 1 / -1;
}

/* Card Styling */
.operation-card {
  background: rgba(0, 20, 0, 0.3);
  border: 1px solid var(--matrix);
  border-radius: 8px;
  padding: 2rem;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  position: relative;
  overflow: hidden;
}

.operation-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 20px var(--matrix);
  border-color: var(--matrix-dim);
}

.operation-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--matrix), transparent);
  animation: scanline 2s linear infinite;
}

@keyframes scanline {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.operation-card .icon {
  font-size: 3rem;
  color: var(--matrix);
  margin-bottom: 1rem;
  text-align: center;
}

.operation-card h2 {
  font-family: 'Share Tech Mono', monospace;
  color: var(--matrix);
  margin-bottom: 1rem;
  font-size: 1.8rem;
  text-shadow: 0 0 5px rgba(0, 255, 102, 0.5);
}

.operation-card p {
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* Button */
.btn {
  display: inline-block;
  background: transparent;
  border: 2px solid var(--matrix);
  color: var(--matrix);
  padding: 0.8rem 1.5rem;
  font-family: 'Share Tech Mono', monospace;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: color 0.3s, background 0.3s, box-shadow 0.3s;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--matrix);
  opacity: 0.17;
  transform: skewX(-45deg);
  transition: left 0.4s ease;
}

.btn:hover::before {
  left: 200%;
}

.btn:hover {
  color: #000;
  background: var(--matrix);
  box-shadow: 0 0 8px var(--matrix), 0 0 16px var(--matrix);
}

/* Bottom 2 cards side by side */
.pyramid-grid .operation-sub {
  grid-column: span 1;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .pyramid-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .pyramid-grid .operation-main,
  .pyramid-grid .operation-sub {
    grid-column: 1;
  }

  .nav-links {
    gap: 1rem;
  }
}

/* Featured Books */
.featured-books {
  margin: 2.5rem 0 3rem;
}
.books-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.book-card {
  background: rgba(0, 18, 0, 0.35);
  border: 1px solid var(--matrix);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}
.book-cover {
  width: 100%;
  height: 160px;
  background-size: cover;
  background-position: center;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  box-shadow: 0 0 8px rgba(0,0,0,0.6);
  background-color: rgba(0,0,0,0.6);
}
.book-cover.placeholder {
  display:flex;
  align-items:center;
  justify-content:center;
}
.book-cover.placeholder::after {
  content: '\f02d';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 3.2rem;
  color: var(--matrix);
}

.book-cover img {
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:inherit;
}
.book-cover.placeholder img { display:none; }
.book-card h3 {
  color: var(--matrix);
  margin-bottom: 0.4rem;
  font-family: 'Share Tech Mono', monospace;
}
.book-card p {
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}
.book-ctas {
  display:flex;
  gap:0.5rem;
  justify-content:center;
  flex-wrap:wrap;
}

@media (max-width: 1024px) {
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* Spotlight single-feature styles */
.spotlight {
  display:flex;
  align-items:center;
  gap:1rem;
  justify-content:center;
}
.spot-card {
  max-width:760px;
  width:100%;
  background: rgba(0,18,0,0.35);
  border:1px solid var(--matrix);
  padding:1.25rem;
  border-radius:8px;
  text-align:left;
}
.spot-card {
  min-height: 520px;
}
.spot-card .book-cover {
  width:100%;
  height: clamp(300px, 44vw, 820px);
  border-radius:6px;
  margin-bottom:0.75rem;
  background-size: cover;
  background-position: center;
  background-color: rgba(0,0,0,0.6);
}

.spot-card .book-cover img {
  display:block;
  width:100%;
  height:100%;
  object-fit: contain;
  border-radius:inherit;
  background-color:#071107;
}
.spot-nav {
  background:transparent;
  border:1px solid rgba(255,255,255,0.06);
  color:var(--matrix);
  font-size:2rem;
  width:48px;
  height:48px;
  border-radius:6px;
  cursor:pointer;
}

/* Modal */
.modal {
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.6);
  z-index:200;
  visibility:hidden;
  opacity:0;
  transition:opacity 0.2s ease, visibility 0.2s;
}
.modal[aria-hidden="false"] {
  visibility:visible;
  opacity:1;
}
.modal-content {
  background:#071107;
  border:1px solid var(--matrix);
  padding:1.25rem;
  border-radius:8px;
  max-width:720px;
  color:#e6e6e6;
}
.modal-content #quote-text {
  font-size: 1.6rem;
  line-height: 1.4;
  color: #ffffff;
  margin-bottom: 0.6rem;
}
.modal-content #quote-source {
  font-size: 1.05rem;
  color: var(--matrix);
  font-weight: 700;
}
.modal-close {
  background:transparent;
  border:none;
  color:var(--matrix);
  font-size:1.4rem;
  float:right;
  cursor:pointer;
}

@media (max-width: 768px) {
  .spotlight {
    flex-direction:column;
  }
  .spot-nav { display:none; }
}