html {
  scroll-behavior: smooth;
}

body.insight-page {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(204, 67, 61, 0.18), transparent 28rem),
    linear-gradient(180deg, #0a0b0c 0%, #111315 58%, #0a0b0c 100%);
  color: #ffffff;
  font-family: "Nunito Sans", Arial, sans-serif;
}

.writing-site-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 2rem 3rem;
}

.writing-site-nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin: 0 auto;
  padding: 1rem;
  border: 0.5px solid #505457;
  border-radius: 28px;
  background-color: rgba(36, 41, 45, 0.49);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(100px);
  -webkit-backdrop-filter: blur(100px);
}

.writing-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.writing-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 3.35rem;
  min-width: 3.35rem;
  height: 3.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.writing-menu-btn img {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  opacity: 0.72;
  transition: opacity 0.2s ease;
}

.writing-menu-btn:hover img,
.writing-menu-btn[aria-expanded="true"] img {
  opacity: 1;
}

.writing-site-links {
  display: flex;
  align-items: center;
  gap: 5rem;
  margin: 0 auto 0 0;
  padding-left: 1.9rem;
}

.writing-site-links a {
  color: #a7a9ab;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s ease;
}

.writing-site-links a:hover {
  color: #ffffff;
}

.writing-book-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  height: 3.75rem;
  box-sizing: border-box;
  padding: 0 1.3rem;
  border-radius: 15px;
  background-color: #cc433d;
  color: #ffffff;
  font-size: 18px;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.25s ease,
    transform 0.2s ease;
}

.writing-book-btn img {
  display: block;
  width: 1.625rem;
}

.writing-book-btn:hover {
  background-color: #000;
  color: #ffffff;
  transform: translateY(-1px);
}

.insight-hero,
.insight-list-hero {
  max-width: 940px;
  margin: 0 auto;
  padding: 12rem 1.25rem 4rem;
  text-align: center;
}

.insight-back-link,
.insight-eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.35rem;
  color: #d93f3f;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.insight-title {
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 600;
  line-height: 1.12;
}

.insight-subtitle {
  max-width: 780px;
  margin: 1.4rem auto 0;
  color: #b7b7b7;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.75;
}

.insight-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.7rem;
}

.insight-meta span,
.insight-tag,
.insight-card-tag {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0 0.72rem;
  border: 1px solid rgba(204, 67, 61, 0.32);
  border-radius: 999px;
  background: rgba(204, 67, 61, 0.08);
  color: #d93f3f;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.insight-body {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.25rem 8rem;
}

.insight-body h2 {
  margin: 4rem 0 1rem;
  color: #ffffff;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 600;
  line-height: 1.2;
}

.insight-body p,
.insight-body li {
  color: #b7b7b7;
  font-size: 1.08rem;
  line-height: 1.9;
}

.insight-body p {
  margin: 0 0 1.25rem;
}

.insight-body ul {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0 2rem;
  padding-left: 1.25rem;
}

.insight-body li::marker {
  color: #d93f3f;
}

.insight-body strong {
  color: #ffffff;
}

.insight-body h3 {
  margin: 2.25rem 0 0.75rem;
  color: #ffffff;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 600;
  line-height: 1.3;
}

.insight-tldr {
  margin: 0 0 1rem;
  padding: 1.5rem 1.75rem;
  border: 0.5px solid rgba(204, 67, 61, 0.32);
  border-radius: 20px;
  background: rgba(204, 67, 61, 0.06);
}

.insight-body .insight-tldr h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.insight-tldr ol {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding-left: 1.25rem;
}

.insight-tldr li::marker {
  color: #d93f3f;
  font-weight: 700;
}

.insight-figure {
  margin: 2rem 0;
}

.insight-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.insight-table-wrap {
  margin: 1.5rem 0 2rem;
  overflow-x: auto;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
}

.insight-body table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
}

.insight-body th,
.insight-body td {
  padding: 0.85rem 1.1rem;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
  color: #b7b7b7;
  font-size: 0.98rem;
  line-height: 1.6;
  text-align: left;
  vertical-align: top;
}

.insight-body th {
  background: rgba(204, 67, 61, 0.1);
  color: #ffffff;
  font-weight: 700;
}

.insight-body tbody tr:last-child td {
  border-bottom: 0;
}

.insight-body td:first-child {
  color: #ffffff;
  font-weight: 600;
}

.insight-post-nav {
  margin-top: 4rem;
}

.insight-post-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.35rem 1.6rem;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(29, 33, 36, 0.5);
  color: #ffffff;
  text-decoration: none;
  transition:
    border-color 0.25s ease,
    transform 0.25s ease;
}

.insight-post-nav-prev {
  justify-content: flex-start;
}

.insight-post-nav-link:hover {
  border-color: rgba(204, 67, 61, 0.42);
  color: #ffffff;
  transform: translateY(-2px);
}

.insight-nav-label {
  display: block;
  margin-bottom: 0.4rem;
  color: #d93f3f;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.insight-nav-title {
  display: block;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 600;
  line-height: 1.3;
}

.insight-nav-icon {
  flex: 0 0 auto;
  color: #d93f3f;
}

.insight-list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 1.25rem 8rem;
}

.insight-list-card {
  display: flex;
  min-height: 20rem;
  flex-direction: column;
  padding: 1.5rem;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(29, 33, 36, 0.5);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  color: #ffffff;
  text-decoration: none;
  backdrop-filter: blur(80px);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.insight-list-card:hover {
  border-color: rgba(204, 67, 61, 0.42);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
  color: #ffffff;
  transform: translateY(-2px);
}

.insight-card-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.45rem;
}

.insight-card-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(17, 19, 21, 0.95);
  color: #ffffff;
}

.insight-card-arrow i {
  transform: rotate(-45deg);
}

.insight-list-card h2 {
  margin: 0 0 0.9rem;
  color: #ffffff;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 700;
  line-height: 1.22;
}

.insight-list-card p {
  margin: 0;
  color: #b7b7b7;
  font-size: 0.98rem;
  line-height: 1.65;
}

.insight-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 2rem;
  color: #a7a5a5;
  font-size: 0.88rem;
}

.writing-page-footer {
  display: flex;
  justify-content: center;
  padding: 1.25rem 0.625rem;
  background: #0e0d0d;
  color: #ffffff;
  font-size: 1rem;
}

.writing-page-footer em {
  color: #ff544c;
}

@media (max-width: 1100px) {
  .writing-site-links {
    gap: 2rem;
  }

  .insight-list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .writing-site-nav {
    padding: 0.8rem 1rem;
  }

  .writing-site-nav-inner {
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 1.2rem;
    border-radius: 16px;
  }

  .writing-menu-btn {
    display: inline-flex;
    width: 2.8rem;
    min-width: 2.8rem;
    height: 2.8rem;
  }

  .writing-site-links {
    display: none;
    position: absolute;
    top: calc(100% + 0.65rem);
    left: 0;
    right: 0;
    z-index: 20;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    margin: 0;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background-color: rgba(18, 18, 18, 0.96);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(16px);
  }

  .writing-site-links.open {
    display: flex;
  }

  .writing-site-links a {
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    font-size: 0.96rem;
  }

  .writing-site-links a:hover {
    background-color: rgba(217, 63, 63, 0.14);
  }

  .writing-nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-left: auto;
  }

  .writing-book-btn {
    height: auto;
    padding: 0.65rem 0.9rem;
    font-size: 0.86rem;
  }

  .writing-book-btn img {
    width: 1rem;
  }

  .insight-hero,
  .insight-list-hero {
    padding-top: 10rem;
  }

  .insight-list-grid {
    grid-template-columns: 1fr;
  }

  .insight-body p,
  .insight-body li {
    font-size: 1rem;
  }
}

@media (max-width: 520px) {
  .writing-site-nav {
    padding: 0.75rem 0.8rem;
  }

  .writing-site-nav-inner {
    min-height: 3.9rem;
    box-sizing: border-box;
    padding: 0.55rem 0.7rem;
  }

  .writing-menu-btn {
    width: 2.55rem;
    min-width: 2.55rem;
    height: 2.55rem;
  }

  .writing-book-btn {
    height: auto;
    min-height: 2.75rem;
    box-sizing: border-box;
    padding: 0 1rem;
    border-radius: 12px;
  }

  .insight-title {
    font-size: clamp(2rem, 9vw, 2.65rem);
  }
}

/* Code blocks and stacked post navigation */
.insight-body pre {
  margin: 1.5rem 0 2rem;
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: #d6d6d6;
  font-size: 0.9rem;
  line-height: 1.6;
}

.insight-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.insight-body p code,
.insight-body li code {
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.insight-post-nav {
  display: grid;
  gap: 1rem;
}
