:root {
  /* Color Palette - Refined Navy & Gold */
  --bg-color: #1a1f3c; 
  --surface-color: #232b4a;
  --glass-color: rgba(35, 43, 74, 0.7);
  --accent-color: #d4af37; /* Reverted to Gold */
  --accent-soft: rgba(212, 175, 55, 0.15);
  --text-primary: #ffffff;
  --text-secondary: #d1d5db;
  --border-color: rgba(212, 175, 55, 0.2);
  
  /* Typography */
  --font-serif: 'Lora', serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Spacing */
  --section-padding: 8rem 2rem;
  --container-width: 1100px;
}

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

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

h1, h2, h3, h4, .logo {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--accent-color);
  text-transform: uppercase;
}

/* Navigation */
.sticky-nav {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 0;
  border-radius: 0;
  border-bottom: 1px solid var(--border-color);
}

.nav-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-serif);
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent-color);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-color);
}

/* Mobile Menu Button */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--accent-color);
  transition: 0.3s;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-color);
}

/* Glassmorphism utility */
.glass {
  background: var(--glass-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

/* Layout */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  width: 100%;
}

/* Hero Section */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 0 2rem;
}

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

.btn-secondary:hover {
  background: var(--accent-color);
  color: #000;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: 
    linear-gradient(rgba(26, 31, 60, 0.8), rgba(26, 31, 60, 0.95)),
    url('https://www.transparenttextures.com/patterns/carbon-fibre.png'), /* Subtle texture */
    radial-gradient(circle at 50% 50%, #232b4a 0%, #1a1f3c 100%);
}

.hero-content {
  text-align: center;
  max-width: 800px;
  animation: fadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: linear-gradient(180deg, #fff 0%, #adb5bd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  font-family: var(--font-serif);
  font-style: italic;
}

.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--accent-color);
  color: #000;
  border: 1px solid var(--accent-color);
}

.btn-primary:hover {
  background-color: transparent;
  color: var(--accent-color);
  box-shadow: 0 0 20px var(--accent-soft);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Narrative Sections */
.narrative-section {
  padding: var(--section-padding);
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-tag {
  color: var(--accent-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  margin-bottom: 1rem;
  display: block;
}

.narrative-section h2 {
  font-size: 3rem;
  margin-bottom: 2rem;
  max-width: 700px;
}

.narrative-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
}

.narrative-text p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  max-width: 600px;
}

.feature-card {
  padding: 2.5rem;
  margin-bottom: 1.5rem;
  transition: transform 0.4s ease, border-color 0.4s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
}

.feature-card h3 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

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

/* Tabs & Content */
.btn-tab {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.btn-tab.active {
  color: var(--accent-color);
  border-bottom: 2px solid var(--accent-color);
}

.btn-tab:hover {
  color: #fff;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.5s ease;
}

.tab-pane.active {
  display: block;
}

.quote-panel {
  line-height: 1.8;
  font-family: var(--font-serif);
  font-size: 1.1rem;
}

/* Feature cards internal tags */
.feature-card .section-tag {
  display: inline-block;
  margin-bottom: 1rem;
  opacity: 0.7;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 2rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  max-width: 800px;
  width: 100%;
  padding: 3rem;
  position: relative;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.close-modal:hover {
  color: #fff;
}

.btn-read-more:hover {
  background: var(--accent-color) !important;
  color: #000 !important;
}

/* Scrollbar for overflow tabs */
.tab-buttons::-webkit-scrollbar {
  height: 4px;
}
.tab-buttons::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

/* Responsive Refinements */
@media (max-width: 1024px) {
  :root {
    --section-padding: 5rem 1.5rem;
  }
  
  .narrative-grid {
    gap: 2rem;
  }
  
  .manuscript-layout {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  
  aside.glass {
    position: static !important;
    width: 100% !important;
  }
  
  .chapter-nav {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding-bottom: 1rem;
    scrollbar-width: none;
  }
  
  .chapter-nav::-webkit-scrollbar {
    display: none;
  }
  
  .chapter-item {
    white-space: nowrap;
    margin-bottom: 0 !important;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background: var(--bg-color);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: 0.4s;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    z-index: 1000;
  }

  .nav-links.active {
    right: 0;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

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

  .narrative-text h2 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding-top: 4rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .btn {
    width: 100%;
    text-align: center;
  }
  
  .hero-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
}
