/* Lexicon-specific styles */

/* Non-sticky nav */
.nav-container {
  position: relative;
  inset: auto;
}

/* Nav brand text */
.nav-brand-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--color-text-primary);
  text-decoration: none;
}

/* ============================================
   Hero Animation — Side-by-side panels
   ============================================ */

.hero-animation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 12px 0;
  width: 116%;
  max-width: none;
  margin-left: -8%;
}

.hero-panel {
  border: 1px solid var(--color-border-level-2);
  border-radius: var(--radius-l);
  overflow: hidden;
  background-color: var(--color-surface);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border-level-2);
  background-color: var(--color-background);
}

.panel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-border-level-3);
}

.panel-filename {
  font-family: var(--font-mono);
  font-size: var(--font-size-s);
  color: var(--color-text-tertiary);
  margin-left: 8px;
}

.panel-body {
  padding: 20px;
  height: 575px;
  overflow: hidden;
}

/* Source code panel (left) */
.hero-panel-source {
  background-color: #1e1e1e;
}

.hero-panel-source .panel-header {
  background-color: #2b2b2b;
  border-bottom-color: #3a3a3a;
}

.hero-panel-source .panel-dot {
  background-color: #555;
}

.hero-panel-source .panel-filename {
  color: #888;
}

.source-code {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: #e6edf3;
  white-space: pre-wrap;
  word-wrap: break-word;
  tab-size: 2;
}

.source-code .yaml-key { color: #7ee787; }
.source-code .yaml-value { color: #a5d6ff; }
.source-code .yaml-delim { color: #8b949e; }
.source-code .md-heading { color: #79c0ff; font-weight: 600; }
.source-code .md-bold { color: #e6edf3; font-weight: 600; }
.source-code .md-ref { color: #d2a8ff; }
.source-code .md-text { color: #c9d1d9; }

/* Typing cursor */
.typing-cursor {
  display: inline-block;
  width: 7px;
  height: 15px;
  background-color: #58a6ff;
  animation: cursor-blink 0.8s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 1px;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Word doc panel (right) */
.panel-body-docx {
  background-color: #e8e8e8;
  padding: 20px;
  display: flex;
  justify-content: center;
}

.docx-page {
  background: white;
  border: 1px solid #d0d0d0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 32px 28px;
  font-family: "Times New Roman", Georgia, serif;
  font-size: 11.5px;
  line-height: 1.6;
  color: #1a1a1a;
  width: 100%;
  max-width: 420px;
  min-height: 280px;
  position: relative;
  overflow: hidden;
}

.docx-element {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.docx-element.visible {
  opacity: 1;
  transform: translateY(0);
}

.docx-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.docx-meta {
  font-size: 10px;
  text-align: left;
  color: #1a1a1a;
  margin-bottom: 16px;
  padding-bottom: 12px;
}

.docx-section-heading {
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 14px;
  margin-bottom: 6px;
}

.docx-clause {
  margin-left: 20px;
  margin-bottom: 4px;
  font-size: 11px;
  line-height: 1.5;
  padding-left: 2.5em;
  text-indent: -2.5em;
}

.docx-clause strong {
  font-weight: 700;
}

.docx-ref {
  color: #0055aa;
  text-decoration: underline;
}

/* DRAFT watermark */
.docx-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-35deg);
  font-size: 64px;
  font-weight: 700;
  color: rgba(200, 0, 0, 0.08);
  letter-spacing: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
  white-space: nowrap;
  font-family: Arial, sans-serif;
}

.docx-watermark.visible {
  opacity: 1;
}

/* ============================================
   Before / After Section
   ============================================ */

.before-after {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  margin-top: 24px;
}

.before-after-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.before-after-panel .card-code-block,
.before-after-panel .docx-preview {
  flex: 1;
}

.before-after-label {
  font-size: var(--font-size-s);
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.before-after .card-code-block {
  padding: 20px;
  border: 1px solid var(--color-border-level-2);
  border-radius: var(--radius-l);
  background-color: var(--color-surface);
  overflow: auto;
}

.before-after .card-code-block pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.code-plain { color: var(--color-text-primary); }
.code-comment { color: var(--color-text-tertiary); }
.code-key { color: #0070c0; }
.code-heading { color: #0055aa; font-weight: 600; }
.code-bold { color: var(--color-text-primary); font-weight: 600; }
.code-ref { color: #7c3aed; }

.before-after-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 40px;
  color: var(--color-text-tertiary);
  font-size: 20px;
}

/* docx preview in before/after */
.docx-preview {
  background-color: #e8e8e8;
  border-radius: var(--radius-l);
  padding: 20px;
  display: flex;
  justify-content: center;
}

.docx-preview-page {
  background: white;
  border: 1px solid #d0d0d0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 28px 24px;
  font-family: "Times New Roman", Georgia, serif;
  font-size: 12px;
  line-height: 1.6;
  color: #1a1a1a;
  width: 100%;
}

.docx-preview-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}

.docx-preview-meta {
  font-size: 10.5px;
  text-align: left;
  color: #1a1a1a;
  margin-bottom: 16px;
  padding-bottom: 12px;
}

.docx-preview-section {
  font-size: 13px;
  font-weight: 700;
  margin-top: 14px;
  margin-bottom: 6px;
}

.docx-preview-clause {
  margin-left: 20px;
  margin-bottom: 6px;
  font-size: 11.5px;
  line-height: 1.5;
  padding-left: 2.5em;
  text-indent: -2.5em;
}

/* ============================================
   Feature Cards — override to vertical layout
   ============================================ */

.cards-with-icons-container {
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.card-with-icon {
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  background-color: var(--color-surface);
  border-radius: var(--radius-l);
  border: 1px solid var(--color-border-level-2);
}

/* ============================================
   Responsive
   ============================================ */

@media screen and (max-width: 1199px) {
  .hero-animation {
    width: 100%;
    margin-left: 0;
  }
}

@media screen and (max-width: 767px) {
  .hero-animation {
    grid-template-columns: 1fr;
  }

  .panel-body {
    height: 280px;
  }

  .before-after {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .before-after-arrow {
    padding-top: 0;
    transform: rotate(90deg);
  }

  .cards-with-icons-container {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 1056px) and (min-width: 768px) {
  .cards-with-icons-container {
    grid-template-columns: repeat(2, 1fr);
  }
}
