/* The Runbook Index: Institutional Architectural Interface (Light Theme) */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800&family=Dancing+Script:wght@600;700&display=swap');

:root {
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-dark: #0f172a;
  --border-hairline: #e2e8f0;
  --border-subtle: #cbd5e1;
  --border-focus: #0284c7;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --accent-blue: #0284c7;
  --accent-green: #16a34a;
  --accent-amber: #d97706;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Institutional Ledger Table (Light) */
.ledger-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.ledger-table th {
  background-color: #f1f5f9;
  color: #475569;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-hairline);
  border-top: 1px solid var(--border-hairline);
}

.ledger-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: middle;
  background-color: #ffffff;
}

.ledger-row {
  transition: background-color 0.15s ease;
}

.ledger-row:hover td {
  background-color: #f8fafc;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Buttons */
.btn-primary-spec {
  background-color: #0f172a;
  border: 1px solid #0f172a;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary-spec:hover {
  background-color: #1e293b;
  border-color: #1e293b;
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.12), 0 2px 4px -2px rgba(15, 23, 42, 0.08);
}

.btn-spec {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-spec:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
}

.btn-accent {
  background-color: #0284c7;
  border: 1px solid #0284c7;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-accent:hover {
  background-color: #0369a1;
  border-color: #0369a1;
  box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.2);
}

/* Dual Mode Switch Animation */
@keyframes modeFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mode-switch-panel {
  animation: modeFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Card hover lift */
.card-lift {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}
.card-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 24px -6px rgba(15, 23, 42, 0.08), 0 6px 10px -4px rgba(15, 23, 42, 0.04);
}

/* Subtle Scroll Reveal Animations */
.scroll-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.scroll-reveal.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }

/* Interactive Hover Windows (Opens & Animates on Hover) */
.hover-window-card {
  position: relative;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.hover-window-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: #38bdf8;
  box-shadow: 0 20px 30px -10px rgba(2, 132, 199, 0.12), 0 10px 15px -5px rgba(15, 23, 42, 0.05);
}

.hover-window-card .window-drawer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, margin-top 0.3s ease;
  margin-top: 0;
}

.hover-window-card:hover .window-drawer,
.hover-window-card.is-active .window-drawer {
  max-height: 260px;
  opacity: 1;
  margin-top: 14px;
}

/* Automation Scanline Keyframe */
@keyframes scanlineAnim {
  0% { transform: translateY(-100%); opacity: 0; }
  30% { opacity: 0.8; }
  70% { opacity: 0.8; }
  100% { transform: translateY(300%); opacity: 0; }
}

.scanline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, #38bdf8, #818cf8, transparent);
  animation: scanlineAnim 3.5s infinite linear;
  pointer-events: none;
}

/* Glowing Border Pill */
.glow-pill {
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.25);
}

/* FAQ Accordion Styling */
.faq-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, padding 0.3s ease;
}

.faq-item.is-open .faq-content {
  max-height: 350px;
  opacity: 1;
  padding-top: 8px;
}

.faq-item.is-open .faq-chevron {
  transform: rotate(180deg);
}

.faq-chevron {
  transition: transform 0.25s ease;
}

/* Authentic Signature Typography */
.font-signature {
  font-family: 'Dancing Script', 'Brush Script MT', 'Segoe Script', cursive;
}

/* Bilateral MNDA Execution Modal Backdrop & Card */
.mnda-modal-backdrop {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mnda-modal-card {
  animation: modalEnter 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Printable Executed MNDA Certificate Window */
@media print {
  body * {
    visibility: hidden;
  }
  #mnda-print-certificate, #mnda-print-certificate * {
    visibility: visible;
  }
  #mnda-print-certificate {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 24px;
    background: white;
    color: black;
  }
}
