/* Canonical bottom-nav: 3 pill links at the foot of every post. Targets
   both anchor patterns in the wild (plain <a> direct child, and the
   legacy .pill-btn class) so visual treatment is identical regardless
   of which post template the page started life on. */
.bottom-nav {
  margin: 0 0 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}
.bottom-nav > a,
.bottom-nav .pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(51, 65, 85, 0.2);
  background: rgba(255, 255, 255, 0.85);
  color: #1e293b;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.bottom-nav > a:hover,
.bottom-nav .pill-btn:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(15, 118, 110, 0.45);
  color: #0f766e;
}
.bottom-nav > a.linkedin,
.bottom-nav .pill-btn.linkedin {
  background: #0a66c2;
  border-color: #0a66c2;
  color: #ffffff;
}
.bottom-nav > a.linkedin:hover,
.bottom-nav .pill-btn.linkedin:hover {
  background: #0959a8;
  border-color: #0959a8;
  color: #ffffff;
}
.bottom-nav > a.rss,
.bottom-nav .pill-btn.rss {
  background: #ea580c;
  border-color: #ea580c;
  color: #ffffff;
}
.bottom-nav > a.rss:hover,
.bottom-nav .pill-btn.rss:hover {
  background: #c2410c;
  border-color: #c2410c;
  color: #ffffff;
}

/* Reading progress bar — pinned at the very top of every post page. */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 200;
  background: rgba(15, 118, 110, 0.08);
  pointer-events: none;
}
.reading-progress-fill {
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #0f766e, #14b8a6 70%, #ea580c 110%);
  box-shadow: 0 1px 4px rgba(15, 118, 110, 0.4);
  transition: transform 0.08s linear;
}
@media (prefers-reduced-motion: reduce) {
  .reading-progress-fill { transition: none; }
}

/* Skip-to-content link: visually hidden until keyboard-focused. */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 100;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0.75rem;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Honor user's reduced-motion preference: disable all animations,
   transitions, and smooth scrolling so vestibular sensitivities and
   battery-conscious users get a still page. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.post-toc {
  position: fixed;
  right: max(1rem, calc((100vw - 1100px) / 2));
  top: 96px;
  width: 260px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 0.9rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  z-index: 8;
}

.post-toc-title {
  margin: 0 0 0.55rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f766e;
}

.post-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.post-toc-link {
  color: #334155;
  text-decoration: none;
  line-height: 1.35;
  font-size: 0.86rem;
  padding: 0.28rem 0.36rem;
  border-radius: 8px;
  display: block;
}

.post-toc-link:hover,
.post-toc-link.is-active {
  background: rgba(15, 118, 110, 0.1);
  color: #0f172a;
}

.post-toc-link.depth-3 {
  margin-left: 0.7rem;
  font-size: 0.82rem;
}

@media (max-width: 1320px) {
  .post-toc {
    display: none;
  }
}

/* Shared component styling for long-form cornerstone posts */
.hero-card h1 em {
  color: #0f766e;
  font-style: normal;
}

/* .section-comment is an alias of .section-label — unified rule below. */

article .callout {
  margin: 1.1rem 0 1.5rem;
  border-left: 4px solid #0f766e;
  border-radius: 0 12px 12px 0;
  padding: 0.9rem 1rem;
  background: rgba(15, 118, 110, 0.07);
  color: #0f3342;
}

article .callout strong {
  color: #0f172a;
}

article .numbered-cards {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin: 1rem 0 1.4rem;
}

article .n-card {
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 1rem;
  background: #f8fbff;
}

article .n-card .n-num {
  position: absolute;
  top: 0.55rem;
  right: 0.8rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.45rem;
  color: rgba(15, 118, 110, 0.35);
}

article .n-card h4 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  line-height: 1.3;
}

article .n-card p {
  margin: 0;
  font-size: 0.94rem;
}

article .timeline {
  position: relative;
  margin: 1rem 0 1.5rem;
  padding-left: 1.35rem;
  border-left: 2px solid rgba(15, 118, 110, 0.28);
}

article .tl-item {
  position: relative;
  margin-bottom: 1.05rem;
}

article .tl-item:last-child {
  margin-bottom: 0;
}

article .tl-item::before {
  content: "";
  position: absolute;
  left: -1.74rem;
  top: 0.34rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #0f766e;
  border: 2px solid #fff;
}

article .tl-phase {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #0f766e;
  margin-bottom: 0.2rem;
}

article .tl-item h4 {
  margin: 0 0 0.28rem;
  font-size: 1rem;
}

article .tl-item p {
  margin: 0;
  font-size: 0.94rem;
}

article .compare-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 1rem 0 1.35rem;
}

article .compare-col {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 1rem;
}

article .compare-col.bad {
  background: #fff7f7;
  border-color: rgba(239, 68, 68, 0.25);
}

article .compare-col.good {
  background: #f2fbf5;
  border-color: rgba(34, 197, 94, 0.28);
}

article .compare-col h4 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
}

article .compare-col ul {
  margin: 0;
  padding-left: 1.1rem;
}

article .compare-col li {
  margin-bottom: 0.35rem;
}

article .layer-stack {
  margin: 1rem 0 1.4rem;
  display: grid;
  gap: 0.42rem;
}

article .layer {
  display: flex;
  flex-wrap: wrap;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

article .layer-label {
  width: 180px;
  max-width: 100%;
  padding: 0.7rem 0.85rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
}

article .layer-content {
  flex: 1;
  min-width: 240px;
  padding: 0.7rem 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

article .chip {
  border-radius: 999px;
  padding: 0.2rem 0.52rem;
  font-size: 0.74rem;
  line-height: 1.35;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #ffffff;
  color: #334155;
}

article .new-badge {
  border-radius: 999px;
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: #c2410c;
  color: #fff;
  padding: 0.1rem 0.35rem;
}

article .layer.l-experience .layer-label {
  background: #e0f2fe;
  color: #075985;
}

article .layer.l-experience .layer-content {
  background: #f0f9ff;
}

article .layer.l-control .layer-label {
  background: #fef3c7;
  color: #92400e;
}

article .layer.l-control .layer-content {
  background: #fffbeb;
}

article .layer.l-governance .layer-label {
  background: #dcfce7;
  color: #166534;
}

article .layer.l-governance .layer-content {
  background: #f0fdf4;
}

article .layer.l-infra .layer-label {
  background: #e2e8f0;
  color: #334155;
}

article .layer.l-infra .layer-content {
  background: #f8fafc;
}

article .layer.l-gateway .layer-label {
  background: #ede9fe;
  color: #5b21b6;
}

article .layer.l-gateway .layer-content {
  background: #f5f3ff;
}

article .layer.l-domain .layer-label {
  background: #fee2e2;
  color: #991b1b;
}

article .layer.l-domain .layer-content {
  background: #fef2f2;
}

article .layer.l-ai .layer-label {
  background: #fde68a;
  color: #78350f;
}

article .layer.l-ai .layer-content {
  background: #fffbeb;
}

article .layer.l-platform .layer-label {
  background: #dbeafe;
  color: #1e3a8a;
}

article .layer.l-platform .layer-content {
  background: #eff6ff;
}

article .layer.l-compute .layer-label {
  background: #e0e7ff;
  color: #312e81;
}

article .layer.l-compute .layer-content {
  background: #eef2ff;
}

article .maturity-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 1rem 0 1.35rem;
}

article .m-cell {
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.9rem;
  text-align: center;
}

article .m-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.45rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

article .m-level.red {
  background: #fee2e2;
  color: #991b1b;
}

article .m-level.amber {
  background: #ffedd5;
  color: #9a3412;
}

article .m-level.green {
  background: #dcfce7;
  color: #166534;
}

article .m-level.l1 {
  background: #dbeafe;
  color: #1e3a8a;
}

article .m-level.l2 {
  background: #c7d2fe;
  color: #4338ca;
}

article .m-level.l3 {
  background: #fef3c7;
  color: #92400e;
}

article .m-level.l4 {
  background: #fee2e2;
  color: #991b1b;
}

article .m-level.essential {
  background: #dcfce7;
  color: #166534;
}

article .m-level.important {
  background: #e0f2fe;
  color: #075985;
}

article .m-level.advanced {
  background: #fef3c7;
  color: #92400e;
}

article .m-cell h5 {
  margin: 0 0 0.3rem;
  font-size: 0.92rem;
}

article .m-cell p {
  margin: 0;
  font-size: 0.85rem;
}

article .risk-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.35rem;
  font-size: 0.92rem;
}

article .risk-table th {
  text-align: left;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #475569;
  border-bottom: 2px solid rgba(148, 163, 184, 0.5);
  padding: 0.58rem;
}

article .risk-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  padding: 0.58rem;
  vertical-align: top;
}

article .risk-tag {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

article .risk-tag.critical {
  background: #fee2e2;
  color: #991b1b;
}

article .risk-tag.high {
  background: #ffedd5;
  color: #9a3412;
}

article .risk-tag.medium {
  background: #e0f2fe;
  color: #075985;
}

article .flow-diagram {
  margin: 1rem 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

article .flow-node {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #f8fafc;
  padding: 0.5rem 0.75rem;
  font-size: 0.83rem;
  text-align: center;
}

article .flow-node.highlight {
  background: #ecfeff;
  border-color: rgba(8, 145, 178, 0.4);
  font-weight: 600;
}

article .flow-arrow {
  color: #0891b2;
  font-size: 1rem;
  line-height: 1;
}

article .metric-cards {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 1rem 0 1.4rem;
}

article .metric-card {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.85rem 0.9rem;
}

article .metric-card .m-num {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: #0f766e;
  margin-bottom: 0.2rem;
}

article .metric-card .m-label {
  display: block;
  font-size: 0.85rem;
  color: #334155;
}

article .hybrid-diagram {
  margin: 1rem 0 1.4rem;
  display: grid;
  gap: 0.8rem;
  align-items: stretch;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
}

article .h-zone {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 0.9rem;
}

article .h-zone.private {
  background: #f0f9ff;
}

article .h-zone.public {
  background: #fff7ed;
}

article .h-zone h4 {
  margin: 0 0 0.45rem;
  font-size: 0.96rem;
}

article .h-item {
  margin-bottom: 0.45rem;
  font-size: 0.86rem;
}

article .h-item:last-child {
  margin-bottom: 0;
}

article .h-bridge {
  min-width: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

article .bridge-line {
  width: 2px;
  flex: 1;
  min-height: 22px;
  background: rgba(148, 163, 184, 0.7);
}

article .bridge-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0f766e;
  text-align: center;
}

article .checklist {
  list-style: none;
  margin: 1rem 0 1.4rem;
  padding: 0;
}

article .check-item {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

article .check-item:last-child {
  border-bottom: 0;
}

article .check-icon {
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
}

article .check-icon.yes {
  background: #dcfce7;
  color: #166534;
}

article .check-icon.gap {
  background: #fee2e2;
  color: #991b1b;
}

article .check-text {
  font-size: 0.9rem;
}

article .verdict {
  margin: 1.4rem 0 1rem;
  border: 1px solid rgba(15, 118, 110, 0.35);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  background: linear-gradient(145deg, #f0fdf4, #ecfeff 70%);
}

article .verdict .v-label {
  margin-bottom: 0.45rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f766e;
}

article .verdict p {
  margin: 0;
}

/* ── Section labels ── */
article .section-label,
article .section-comment,
.section-label,
.section-comment {
  display: block;
  margin: 1.4rem 0 0.5rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: #0f766e;
}

/* ── Pullquote ── */
article .pullquote,
.pullquote {
  margin: 1.5rem 0;
  padding: 18px 24px;
  border-left: 4px solid #0f766e;
  border-radius: 0 6px 6px 0;
  background: rgba(255, 245, 243, 1);
  color: #0f172a;
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.55;
}

/* ── Bottom Line Card ── */
article .bottomline-card,
.bottomline-card {
  margin: 1.4rem 0 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(15, 118, 110, 0.35);
  border-radius: 14px;
  background: linear-gradient(145deg, #f0fdf4, #ecfeff 70%);
  text-align: left;
}

article .bottomline-label,
.bottomline-label {
  margin-bottom: 0.45rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.69rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0f766e;
}

article .bottomline-card p,
.bottomline-card p {
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: 1.6;
}

.related-posts {
  margin: 2rem 0 1.4rem;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(236, 244, 255, 0.9));
}

.related-head h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
}

.related-head p {
  margin: 0.3rem 0 0;
  color: #475569;
  font-size: 0.9rem;
}

.related-grid {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(255, 255, 255, 0.94);
}

.related-card h4 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.35;
}

.related-card h4 a {
  color: #0f172a;
  text-decoration: none;
}

.related-card h4 a:hover {
  color: #0f766e;
}

.related-excerpt {
  margin: 0;
  color: #475569;
  font-size: 0.88rem;
}

.related-meta {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.related-link {
  margin-top: auto;
  display: inline-flex;
  width: fit-content;
  padding: 0.4rem 0.66rem;
  border-radius: 999px;
  border: 1px solid rgba(51, 65, 85, 0.22);
  background: rgba(255, 255, 255, 0.9);
  color: #334155;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.related-link:hover {
  border-color: rgba(15, 118, 110, 0.45);
  color: #0f766e;
}

@media (max-width: 980px) {
  article .hybrid-diagram {
    grid-template-columns: 1fr;
  }

  article .h-bridge {
    min-height: 48px;
    flex-direction: row;
  }

  article .bridge-line {
    height: 2px;
    width: 30px;
    min-height: 2px;
  }
}

@media (max-width: 700px) {
  article .layer-label {
    width: 100%;
  }

  article .layer-content {
    min-width: 0;
  }
}
