.article-hero {
  padding: 80px 0 70px;
  background: radial-gradient(circle at 20% 10%, rgba(15, 23, 42, 0.06), transparent 45%),
    linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--border-light);
}

.hero-split-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: start;
}

.article-hero-heading {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

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

.breadcrumb span {
  color: #94a3b8;
}

.article-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-hero h1 {
  font-size: clamp(2.2rem, 3vw + 1.2rem, 3.2rem);
  line-height: 1.1;
  margin: 18px 0 16px;
  color: var(--brand-dark);
  letter-spacing: -0.02em;
}

.article-hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.article-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.article-takeaways {
  margin: 18px 0 0;
  padding-left: 18px;
  color: var(--text-muted);
  max-width: 760px;
}

.article-takeaways li {
  margin: 8px 0;
}

.article-takeaways strong {
  color: var(--brand-dark);
}

.article-hero-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  width: 100%;
}

.article-hero-card.article-hero-preview-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.article-hero-preview-wrap {
  width: 100%;
  padding: 0;
  margin-top: 0;
  display: block;
}

.article-hero-preview-foot {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.preview-scroll-hint {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.template-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.template-preview-title {
  font-weight: 700;
  color: var(--brand-dark);
}

.template-preview-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.template-mock {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: #ffffff;
  margin-bottom: 18px;
}

.template-mock .app-window {
  width: 100%;
  box-shadow: none;
  border: none;
  border-radius: 0;
}

.template-mock .window-body {
  height: 520px;
}

.template-mock .preview-sidebar {
  width: 180px;
  font-size: 0.75rem;
}

.template-mock .preview-main {
  position: relative;
}

.template-mock .preview-notepad {
  padding-bottom: 52px;
}

.mock-overlay {
  position: absolute;
  inset: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 2;
  border-radius: 16px;
}

.mock-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.04);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.template-mock:hover .mock-overlay::before,
.mock-overlay:focus-visible::before {
  opacity: 1;
}

.mock-overlay span {
  position: absolute;
  right: 16px;
  bottom: 16px;
  background: #111111;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  z-index: 1;
  pointer-events: none;
}

.mock-overlay:focus-visible {
  outline: 2px solid var(--brand-dark);
  outline-offset: -2px;
}

.template-dialog {
  border: none;
  padding: 0;
  border-radius: 16px;
  width: min(520px, 92vw);
  margin: auto;
}

.template-dialog::backdrop {
  background: rgba(15, 23, 42, 0.4);
}

.template-dialog-shell {
  padding: 24px;
}

.template-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.template-dialog-sub {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin-bottom: 16px;
}

.template-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.template-dialog-foot {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.article-hero-card h3 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.article-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.article-stat {
  background: var(--bg-slate);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.article-stat strong {
  display: block;
  color: var(--brand-dark);
  font-size: 1rem;
}

.article-hero-code {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  overflow: auto;
  white-space: pre-wrap;
}

.article-body-section {
  padding: 70px 0 90px;
}

.article-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
}

.article-body article h2 {
  font-size: 1.7rem;
  margin: 24px 0 12px;
}

.article-body article h3 {
  font-size: 1.2rem;
  margin: 18px 0 10px;
}

.article-body article p {
  color: var(--text-main);
  margin-bottom: 16px;
}

.article-body article ul {
  margin: 16px 0 24px 0;
  padding-left: 20px;
  list-style: disc;
  color: var(--text-main);
}

.article-body article ul li {
  margin-bottom: 10px;
}

.callout {
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(15, 23, 42, 0.04);
  padding: 16px 18px;
  border-radius: 12px;
  color: #1f2937;
  margin: 20px 0;
}

.code-block {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 14px;
  padding: 18px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  overflow: auto;
  margin: 16px 0 24px;
}

.eq-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: #0f172a;
  margin: 16px 0 24px;
  overflow-x: auto;
  text-align: center;
}

.eq-card.eq-card-accent {
  border-left: 4px solid var(--brand-dark);
}

.damping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 16px 0 24px;
}

.damping-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
}

.damping-card-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  margin-bottom: 10px;
}

.badge-warn {
  background: #fef3c7;
  color: #92400e;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-neutral {
  background: #f1f5f9;
  color: #475569;
}

.aside-card.aside-card-muted {
  background: var(--bg-slate);
  box-shadow: none;
}

.template-steps {
  margin: 16px 0 24px 22px;
  color: var(--text-muted);
}

.template-steps li {
  margin-bottom: 10px;
}

.template-steps strong {
  color: var(--brand-dark);
}

.template-checklist {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.template-check {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.template-check strong {
  display: block;
  color: var(--brand-dark);
  margin-bottom: 4px;
}

.worked-example {
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(15, 23, 42, 0.03);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 18px 0 24px;
}

.example-step {
  margin: 0 0 8px;
  color: var(--text-main);
}

.example-interpretation {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.educational-table-wrap {
  overflow-x: auto;
  margin: 14px 0 24px;
}

.educational-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
}

.educational-table th,
.educational-table td {
  border-bottom: 1px solid var(--border-light);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.educational-table th {
  background: var(--bg-slate);
  color: var(--brand-dark);
  font-size: 0.9rem;
}

.educational-table tr:last-child td {
  border-bottom: none;
}

.references-list {
  margin: 12px 0 24px 18px;
  color: var(--text-main);
}

.references-list li {
  margin-bottom: 10px;
}

.reference-note {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.article-aside {
  position: relative;
}

.toc,
.aside-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 12px 30px -24px rgba(15, 23, 42, 0.25);
}

.toc {
  position: sticky;
  top: 110px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toc-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.toc a {
  color: var(--text-main);
  font-size: 0.95rem;
}

.aside-card {
  margin-top: 16px;
}

.aside-card h4 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.aside-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.article-cta {
  padding: 70px 0 90px;
  background: var(--bg-slate);
  border-top: 1px solid var(--border-light);
}

.article-cta .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}

.article-cta h2 {
  font-size: 2rem;
  color: var(--brand-dark);
}

.article-cta p {
  color: var(--text-muted);
  max-width: 520px;
}

@media (max-width: 980px) {
  .template-preview-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .template-mock .preview-sidebar {
    width: 160px;
  }

  .template-mock .window-body {
    height: 460px;
  }

  .article-body {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }
}

@media (min-width: 980px) {
  .hero-split-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }

  .hero-split-layout .article-hero-heading {
    max-width: none;
    margin: 0;
  }

  .hero-split-layout .article-hero-card.article-hero-preview-card {
    max-width: none;
    margin: 0;
  }
}

@media (max-width: 640px) {
  .article-hero {
    padding: 60px 0 50px;
  }

  .article-hero-grid {
    grid-template-columns: 1fr;
  }

  .template-mock .preview-sidebar {
    display: none;
  }

  .template-mock .window-body {
    height: 420px;
  }

  .article-body-section {
    padding: 50px 0 70px;
  }
}

.article-single .hero-split-layout {
  grid-template-columns: 1fr;
}

.article-single .article-hero-heading {
  max-width: 820px;
  margin: 0;
}
