:root {
  --navy-950: #031624;
  --navy-900: #06243a;
  --text: #f6f3ee;
  --accent: #dc7542;
  --line: rgba(255, 255, 255, 0.15);
  --page: #f3f1ec;
  --ink: #111820;
  --ink-soft: #5d646b;
  --ink-faint: #90959b;
  --rule: rgba(17, 24, 32, 0.12);
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* ---------- Masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 64px);
  background: rgba(243, 241, 236, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.masthead__name {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.masthead__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 160ms ease;
}

.masthead__back:hover {
  color: var(--ink);
}

/* ---------- Article header (mini hero, same DNA as homepage) ---------- */

.article-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  color: var(--text);
  padding: 4.5cqw 8.9cqw 5cqw;
  background:
    radial-gradient(circle at 78% 4%, rgba(74, 131, 193, 0.42), transparent 36%),
    radial-gradient(circle at 40% 60%, rgba(22, 86, 130, 0.3), transparent 46%),
    linear-gradient(118deg, var(--navy-950) 0%, #06243a 42%, #0b3552 73%, #071c2d 100%);
}

.article-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 3cqw 3cqw;
  mask-image: radial-gradient(circle at 70% 20%, black, transparent 75%);
}

.article-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(246, 243, 238, 0.6);
}

.article-hero__eyebrow .accent-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.article-hero h1 {
  margin: 1.1cqw 0 0;
  max-width: 20ch;
  font-size: clamp(2.1rem, 4.6cqw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.article-hero__dek {
  margin: 1.3cqw 0 0;
  max-width: 56ch;
  font-size: clamp(1.02rem, 1.5cqw, 1.28rem);
  line-height: 1.5;
  color: rgba(246, 243, 238, 0.78);
}

.article-hero__meta {
  margin-top: 2cqw;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6em;
  font-size: 0.88rem;
  color: rgba(246, 243, 238, 0.62);
}

.article-hero__meta strong {
  color: rgba(246, 243, 238, 0.92);
  font-weight: 600;
}

.article-hero__meta .sep {
  color: var(--accent);
  opacity: 0.8;
}

.article-hero__meta-linkedin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(246, 243, 238, 0.85);
  flex-shrink: 0;
  transition: background 160ms ease, border-color 160ms ease;
}

.article-hero__meta-linkedin:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
}

.article-hero__meta-linkedin svg {
  width: 13px;
  height: 13px;
}

.article-hero__stats {
  margin-top: 2.6cqw;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  max-width: 760px;
}

.article-hero__stat {
  background: rgba(255, 255, 255, 0.03);
  padding: 1cqw 1.2cqw;
}

.article-hero__stat .num {
  display: block;
  font-size: clamp(1.1rem, 1.7cqw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.article-hero__stat .label {
  display: block;
  margin-top: 0.25em;
  font-size: 0.74rem;
  color: rgba(246, 243, 238, 0.55);
  line-height: 1.35;
}

/* ---------- Body ---------- */

.article-body {
  width: min(720px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(48px, 7vw, 88px) 0 clamp(80px, 10vw, 140px);
}

.article-body p {
  font-size: 1.09rem;
  line-height: 1.72;
  color: #262c33;
  margin: 0 0 1.35em;
}

.article-body h2 {
  margin: 2.6em 0 0.7em;
  font-size: clamp(1.3rem, 2.4vw, 1.65rem);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body strong {
  font-weight: 650;
}

.article-body .lede {
  font-size: 1.24rem;
  line-height: 1.6;
  color: var(--ink);
  font-weight: 450;
}

.pull {
  margin: 2em 0;
  padding-left: 1.3em;
  border-left: 3px solid var(--accent);
  font-size: 1.22rem;
  line-height: 1.5;
  font-weight: 550;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.callout {
  margin: 2.2em 0;
  padding: 1.4em 1.6em;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout--note {
  border-left: 3px solid var(--accent);
}

.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 3em 0;
}

/* ---------- Diagram blocks (native, built for this palette) ---------- */

.diagram {
  margin: 2.4em 0;
  padding: clamp(20px, 3.5vw, 34px);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
}

.diagram p.diagram__caption {
  margin: 14px 0 0;
  font-size: 0.86rem;
  color: var(--ink-faint);
  text-align: center;
  line-height: 1.5;
}

.diagram p.diagram__title {
  margin: 0 0 18px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}

.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
}

.flow__step {
  flex: 1 1 130px;
  min-width: 118px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 16px 10px;
  background: var(--page);
  border: 1px solid var(--rule);
  border-radius: 10px;
}

.flow__step .n {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow__step .t {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.flow__arrow {
  align-self: center;
  color: var(--ink-faint);
  font-size: 1.1rem;
  padding: 0 2px;
}

@media (max-width: 640px) {
  .flow {
    flex-direction: column;
  }
  .flow__arrow {
    transform: rotate(90deg);
    align-self: center;
    padding: 2px 0;
  }
}

.flow--compact .flow__step {
  flex: 1 1 100px;
  min-width: 88px;
  padding: 10px 8px;
  gap: 0;
}

.flow--compact .flow__step .t {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.28;
}

.flow--compact .flow__arrow {
  font-size: 0.9rem;
}

.evo-stage {
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.evo-stage:first-of-type {
  padding-top: 0;
}

.evo-stage:last-of-type {
  padding-bottom: 0;
  border-bottom: none;
}

.evo-stage--highlight {
  margin: 0 -18px;
  padding: 18px;
  background: rgba(220, 117, 66, 0.06);
  border-radius: 12px;
  border-bottom: none;
}

.evo-stage__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.evo-stage__num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--navy-950);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.evo-stage--highlight .evo-stage__num {
  background: var(--accent);
}

.evo-stage__head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.evo-stage__body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.evo-stage__body .flow {
  flex: 1;
  justify-content: flex-start;
}

.evo-stage__stat {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 16px;
  border-left: 1px solid var(--rule);
  min-width: 130px;
}

.evo-stage__stat .label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.evo-stage__stat .val {
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.3;
}

.evo-stage__stat .val--sub {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dotted var(--rule);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.evo-stage__caption {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--ink-faint);
  line-height: 1.45;
}

@media (max-width: 700px) {
  .evo-stage__body {
    flex-direction: column;
    align-items: stretch;
  }
  .evo-stage__stat {
    border-left: none;
    border-top: 1px solid var(--rule);
    padding-left: 0;
    padding-top: 10px;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
  }
  .evo-stage--highlight {
    margin: 0;
  }
}

.numbered-list {
  margin: 0 0 1.35em;
  padding-left: 1.4em;
}

.numbered-list li {
  font-size: 1.09rem;
  line-height: 1.72;
  color: #262c33;
  margin-bottom: 0.9em;
}

.numbered-list li::marker {
  font-weight: 700;
  color: var(--accent);
}

.split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}

.split__col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.split__col .box {
  padding: 14px 16px;
  background: var(--page);
  border: 1px solid var(--rule);
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.split__x {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.3rem;
}

@media (max-width: 640px) {
  .split {
    grid-template-columns: 1fr;
  }
  .split__x {
    transform: rotate(90deg);
  }
}

.grid4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.grid4 .cell {
  padding: 16px;
  background: var(--page);
  border: 1px solid var(--rule);
  border-radius: 10px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.grid4 .cell .sub {
  display: block;
  margin-top: 4px;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--ink-faint);
}

.funnel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.funnel__row {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
}

.funnel__row:not(:last-child) {
  border-bottom: 1px dashed var(--rule);
}

.funnel__row .divider {
  align-self: stretch;
  background: var(--rule);
}

.funnel__row .label {
  font-size: 0.86rem;
  color: var(--ink);
}

.funnel__row .label.right {
  text-align: right;
}

.value-columns {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.value-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.value-col h3 {
  margin: 0 0 4px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}

.value-col .item {
  padding: 11px 14px;
  background: var(--page);
  border: 1px solid var(--rule);
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}

.value-arrow {
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 700;
}

@media (max-width: 700px) {
  .value-columns {
    grid-template-columns: 1fr;
  }
  .value-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }
}

/* ---------- Data table ---------- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.94rem;
}

.data-table th,
.data-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}

.data-table th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.data-table td.num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

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

/* ---------- Author footer / part nav ---------- */

.series-nav {
  margin: 3em 0 0;
  padding: 1.4em 1.6em;
  background: var(--navy-950);
  color: var(--text);
  border-radius: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.series-nav__label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(246, 243, 238, 0.5);
}

.series-nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.series-nav__links a {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  transition: background 160ms ease, border-color 160ms ease;
}

.series-nav__links a:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
}

.series-nav__links a.current {
  background: var(--accent);
  border-color: var(--accent);
}

.byline-footer {
  margin-top: 2.6em;
  padding-top: 1.8em;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 14px;
}

.byline-footer .initials {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--navy-950);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.byline-footer .name {
  font-size: 0.94rem;
  font-weight: 650;
  color: var(--ink);
}

.byline-footer .role {
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.byline-footer__linkedin {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  flex-shrink: 0;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.byline-footer__linkedin:hover {
  background: var(--navy-950);
  border-color: var(--navy-950);
  color: var(--text);
}

.byline-footer__linkedin svg {
  width: 18px;
  height: 18px;
}

.article-body .rules-list {
  margin: 0 0 1.35em;
  padding: 0;
  list-style: none;
}

.article-body .rules-list li {
  position: relative;
  padding: 10px 0 10px 22px;
  font-size: 1.02rem;
  line-height: 1.55;
  color: #262c33;
  border-bottom: 1px solid var(--rule);
}

.article-body .rules-list li:first-child {
  border-top: 1px solid var(--rule);
}

.article-body .rules-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 19px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.article-body .rules-list em {
  font-style: normal;
  font-weight: 650;
  color: var(--ink);
}

.callout--note a {
  color: var(--ink);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.callout__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 1em 0 !important;
}

.callout__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 10px 16px;
  background: var(--navy-950);
  color: var(--text) !important;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none !important;
  border-radius: 8px;
  transition: opacity 160ms ease;
}

.callout__links a:hover {
  opacity: 0.85;
}

.callout__links a:last-child {
  background: transparent;
  color: var(--ink) !important;
  border: 1px solid var(--rule);
}

.code-block {
  margin: 1.6em 0;
  background: var(--navy-950);
  border-radius: 12px;
  overflow: hidden;
}

.article-body p.code-block__label {
  padding: 10px 18px;
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(246, 243, 238, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-block pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
}

.code-block code {
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 0.86rem;
  line-height: 1.6;
  color: #f4f7fa;
  white-space: pre;
}

.code-block .cm {
  color: rgba(244, 247, 250, 0.46);
}

.code-explain {
  margin: 0.6em 0 2em;
  padding-left: 1.1em;
  border-left: 2px solid var(--rule);
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.footnote {
  margin-top: 2.4em;
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--ink-faint);
  font-style: italic;
}

@media (max-width: 640px) {
  .article-hero {
    padding: 32px 24px 40px;
  }
  .article-hero h1 {
    font-size: clamp(1.9rem, 8vw, 2.6rem);
  }
  .article-hero__dek {
    font-size: 1.02rem;
  }
}
