/**
 * Śabda-ALM v3 Shared Design System
 * "Manuscript at dusk" — illuminated digital palm-leaf meets research instrument
 * Ink #0E1020 + Saffron #E8A13A + Devanagari + Spectral Serif
 */

:root {
  --ink: #0E1020;
  --panel: #16182B;
  --line: #2A2E4C;
  --saffron: #E8A13A;
  --amber: #F2D9A8;
  --parchment: #E7E3D6;
  --muted: #9195B8;
  --accent-gold: #D4AF37;
  --success: #4CB07A;
  --warning: #C0392B;
  --accent-dark: #14110f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(135deg, #0E1020 0%, #16182B 50%, #0E1020 100%);
  color: var(--parchment);
  font-family: "Spectral", serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 6rem;
}

/* Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(14, 16, 32, 0.98), rgba(14, 16, 32, 0.92));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
}

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

.nav-logo {
  font-family: "Noto Serif Devanagari", serif;
  font-size: 1.8rem;
  color: var(--saffron);
  text-shadow: 0 0 32px rgba(232, 161, 58, 0.4);
  text-decoration: none;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.nav-logo:hover {
  text-shadow: 0 0 48px rgba(232, 161, 58, 0.6);
}

.nav-menu {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-menu a {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  color: var(--muted);
  text-decoration: none;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
}

.nav-menu a:hover {
  color: var(--saffron);
  background: rgba(232, 161, 58, 0.08);
}

.nav-menu a.active {
  color: var(--saffron);
  background: rgba(232, 161, 58, 0.15);
  border: 1px solid rgba(232, 161, 58, 0.4);
}

.nav-menu a:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 2px;
}

/* Main container */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Hero section */
.hero {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.glyph {
  font-family: "Noto Serif Devanagari", serif;
  font-size: clamp(2.5rem, 8vw, 4rem);
  color: var(--saffron);
  text-shadow: 0 0 60px rgba(232, 161, 58, 0.3);
  margin: 0;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.05em;
}

h1 {
  font-family: "Spectral", serif;
  font-weight: 600;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  margin: 0.8rem 0 0.5rem;
  color: var(--parchment);
  letter-spacing: -0.01em;
}

.sub {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 60ch;
  margin: 0.5rem auto 0;
  line-height: 1.6;
}

/* Cards & sections */
.card, section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.card h2, section h2 {
  margin-top: 0;
  margin-bottom: 1.2rem;
  color: var(--parchment);
  font-size: 1.6rem;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.8rem;
  position: relative;
}

.card h2::before, section h2::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 3rem;
  background: linear-gradient(90deg, var(--saffron), transparent);
}

/* Left-border accent (illuminated margin) */
.accent-left {
  border-left: 4px solid var(--saffron);
  padding-left: 1.5rem;
}

/* Buttons */
.btn {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 0.95rem;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  display: inline-block;
}

.btn:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 2px;
}

.btn.primary {
  background: linear-gradient(135deg, var(--saffron), var(--amber));
  color: var(--accent-dark);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232, 161, 58, 0.3);
}

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

.btn.secondary:hover {
  border-color: var(--saffron);
  color: var(--saffron);
  background: rgba(232, 161, 58, 0.05);
}

/* Tags */
.tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  font-weight: 500;
  display: inline-block;
  color: var(--muted);
}

.tag.active {
  color: var(--saffron);
  border-color: var(--saffron);
  background: rgba(232, 161, 58, 0.1);
}

/* Typography */
h2 {
  color: var(--parchment);
  font-weight: 600;
}

h3 {
  color: var(--parchment);
  font-weight: 500;
  margin-top: 1.5rem;
}

p {
  line-height: 1.7;
  color: var(--parchment);
}

em, .highlight {
  color: var(--saffron);
  font-style: normal;
  font-weight: 500;
}

code {
  font-family: "IBM Plex Mono", monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: var(--amber);
  font-size: 0.9em;
}

pre {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--amber);
}

a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid rgba(242, 217, 168, 0.3);
  transition: all 0.2s ease;
}

a:hover {
  color: var(--saffron);
  border-bottom-color: var(--saffron);
}

/* Status indicators */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-badge.open {
  background: rgba(76, 176, 122, 0.15);
  color: var(--success);
  border: 1px solid var(--success);
}

.status-badge.mixed {
  background: rgba(212, 175, 55, 0.15);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
}

.status-badge.failed {
  background: rgba(192, 57, 43, 0.15);
  color: var(--warning);
  border: 1px solid var(--warning);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
  margin-top: 3rem;
}

footer a {
  color: var(--amber);
}

footer a:hover {
  color: var(--saffron);
}

/* Utility classes */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--muted);
}

.gap-1 { gap: 1rem; }
.gap-2 { gap: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

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

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

.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

.fade-in-up {
  animation: fadeInUp 0.5s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 0.8rem 0;
  }

  .nav-container {
    flex-direction: column;
    gap: 1rem;
    padding: 0 1rem;
  }

  .nav-logo {
    font-size: 1.4rem;
  }

  .nav-menu {
    width: 100%;
    justify-content: center;
  }

  main {
    padding: 1.5rem 1rem;
  }

  .card, section {
    padding: 1.5rem;
  }

  .glyph {
    font-size: 2.5rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  .hero {
    margin-bottom: 2rem;
    padding: 1.5rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}
