/* Shared article reading layout — linear, mobile-first */
:root {
  --ink: #0a1628;
  --ink-soft: #142338;
  --ink-mid: #1a2b42;
  --muted: #4a5a6e;
  --muted-light: #7a8a9c;
  --line: rgba(10, 22, 40, 0.1);
  --line-strong: rgba(10, 22, 40, 0.16);
  --paper: #f6f8fb;
  --white: #ffffff;
  --teal: #1f7a8c;
  --teal-deep: #166575;
  --mint: #5eead4;
  --blue: #2563eb;
  --amber: #d97706;
  --danger: #c2410c;
  --read: 38rem;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
  font-size: 1.0625rem;
}

/* —— Chrome —— */
.article-chrome {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1.15rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.article-chrome__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
  min-height: 2.5rem;
}

.article-chrome__back:hover {
  color: var(--teal-deep);
}

.article-chrome__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
}

.article-chrome__brand img {
  width: 24px;
  height: 24px;
}

.article-chrome__cta {
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--ink);
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  white-space: nowrap;
}

.article-chrome__cta:hover {
  background: var(--teal-deep);
}

/* —— Breadcrumbs —— */
.article-breadcrumbs {
  margin: 0 0 1.25rem;
  font-size: 0.75rem;
  color: var(--muted-light);
  line-height: 1.4;
}

.article-breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  align-items: center;
}

.article-breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: var(--line-strong);
}

.article-breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.article-breadcrumbs a:hover {
  color: var(--teal-deep);
}

.article-breadcrumbs [aria-current="page"] {
  color: var(--muted-light);
}

/* —— Related reading —— */
.related-reading {
  margin: 2.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.related-reading h2 {
  font-size: 1.15rem;
  margin-bottom: 0.85rem;
}

.related-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.related-list a {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0.85rem 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s ease;
}

.related-list a:hover {
  border-color: var(--teal);
}

.related-list .related-kind {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.25rem;
}

.related-list strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

@media (max-width: 480px) {
  .article-chrome__brand span {
    display: none;
  }
}

/* —— Reading column —— */
.article {
  width: min(100% - 2.3rem, var(--read));
  margin: 0 auto;
  padding: 1.75rem 0 3.5rem;
}

@media (min-width: 640px) {
  .article {
    width: min(100% - 3rem, var(--read));
    padding: 2.5rem 0 4.5rem;
  }
}

/* —— Masthead (linear, not a marketing hero) —— */
.article-masthead {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.article-kicker {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.85rem;
}

.article-masthead h1 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 5.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 0.9rem;
}

.article-masthead h1 .hl {
  color: var(--teal);
}

.article-lead {
  font-size: clamp(1.05rem, 2.8vw, 1.15rem);
  line-height: 1.55;
  color: var(--ink-mid);
  margin: 0;
}

/* —— Audience: quiet, inline, linear —— */
.audience {
  margin: 0 0 1.75rem;
  padding: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted-light);
}

.audience h2 {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0 0 0.35rem;
  color: var(--muted-light);
}

.audience-lead {
  margin: 0 0 0.35rem;
  color: inherit;
  font-size: inherit;
}

.audience-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
}

.audience-list li {
  font-weight: 400;
  color: inherit;
}

.audience-list li:not(:last-child)::after {
  content: "·";
  margin-left: 0.35rem;
  color: var(--line-strong);
}

/* —— Pull quote —— */
.pull-quote {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.5vw, 1.45rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--ink);
  padding: 1.15rem 0 1.15rem 1.1rem;
  margin: 0 0 2.25rem;
  background: transparent;
  border-left: 3px solid var(--teal);
  box-shadow: none;
}

.pull-quote em {
  font-style: italic;
  color: var(--teal-deep);
}

/* —— Body sections —— */
.article-body section {
  margin-bottom: 2.75rem;
  scroll-margin-top: 4.5rem;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.5vw, 1.65rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.85rem;
  color: var(--ink);
}

.article-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 1.5rem 0 0.45rem;
  color: var(--ink-soft);
}

.article-body p {
  color: var(--muted);
  margin-bottom: 1rem;
}

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

.article-body p strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.article-body code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.84em;
  background: rgba(10, 22, 40, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  color: var(--ink);
  word-break: break-word;
}

.lede {
  font-size: 1.1rem;
  color: var(--ink-mid);
  margin-bottom: 1.25rem;
}

/* —— Exact vs near (stacks on mobile) —— */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0 1.75rem;
}

@media (min-width: 700px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

.split-panel {
  padding: 1.15rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--white);
}

.split-panel.easy {
  border-color: rgba(31, 122, 140, 0.28);
  background: linear-gradient(165deg, #ffffff 0%, rgba(212, 238, 242, 0.55) 100%);
}

.split-panel.hard {
  border-color: rgba(194, 65, 12, 0.22);
  background: linear-gradient(165deg, #ffffff 0%, rgba(251, 146, 60, 0.1) 100%);
}

.split-label {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
}

.easy .split-label {
  color: var(--teal-deep);
  background: rgba(31, 122, 140, 0.12);
}

.hard .split-label {
  color: var(--danger);
  background: rgba(194, 65, 12, 0.1);
}

.split-panel h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.split-panel p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* —— Scenario list —— */
.scenarios {
  list-style: none;
  margin: 1.15rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.scenario {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem 0.85rem;
  align-items: baseline;
  padding: 0.85rem 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.scenario-num {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--teal);
  min-width: 1.35rem;
}

.scenario p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-mid);
  line-height: 1.45;
}

.scenario strong {
  color: var(--ink);
  font-weight: 600;
}

.how-trigger {
  appearance: none;
  border: 1px solid rgba(31, 122, 140, 0.35);
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.1rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: rgba(31, 122, 140, 0.08);
  color: var(--teal-deep);
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 2.75rem;
}

.how-trigger:hover {
  background: rgba(31, 122, 140, 0.14);
}

.how-trigger svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* —— Techniques (always linear on mobile) —— */
.techniques {
  display: flex;
  flex-direction: column;
  margin-top: 1.35rem;
  border-top: 1px solid var(--line-strong);
}

.technique {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 600px) {
  .technique {
    grid-template-columns: 7.5rem 1fr;
    gap: 1rem;
  }
}

.technique-name {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  padding-top: 0.15rem;
}

.technique p {
  margin: 0;
  font-size: 0.975rem;
}

/* —— Mistakes —— */
.mistakes {
  list-style: none;
  margin: 1.25rem 0 0;
  counter-reset: mistake;
}

.mistakes li {
  counter-increment: mistake;
  position: relative;
  padding: 1rem 0 1rem 2.5rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.975rem;
}

.mistakes li:last-child {
  border-bottom: none;
}

.mistakes li::before {
  content: counter(mistake, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--amber);
}

.mistakes strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

/* —— Takeaway —— */
.takeaway {
  margin: 0.5rem 0 0;
  padding: 1.5rem 1.25rem;
  background:
    radial-gradient(ellipse 60% 80% at 100% 0%, rgba(31, 122, 140, 0.22) 0%, transparent 55%),
    linear-gradient(145deg, var(--ink) 0%, var(--ink-soft) 100%);
  color: #e8eef6;
  border-radius: 14px;
}

@media (min-width: 640px) {
  .takeaway {
    padding: 1.85rem 1.6rem;
  }
}

.takeaway-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mint);
  margin-bottom: 0.65rem;
}

.takeaway p {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.3rem);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.015em;
  color: #e8eef6;
  margin: 0;
}

/* —— End CTA —— */
.cta-block {
  margin: 2.5rem 0 0;
  padding: 1.75rem 1.25rem;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
}

@media (min-width: 640px) {
  .cta-block {
    padding: 2rem 1.6rem;
  }
}

.cta-block h2 {
  margin: 0 0 0.65rem;
}

.cta-block p {
  margin: 0 0 1.25rem;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  background: var(--ink);
  min-height: 2.85rem;
}

.cta-btn:hover {
  background: var(--teal-deep);
}

.cta-btn svg {
  width: 1rem;
  height: 1rem;
}

/* —— Popup —— */
.popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(6, 16, 28, 0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

@media (min-width: 640px) {
  .popup-backdrop {
    align-items: center;
    padding: 1.25rem;
  }
}

.popup-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.popup {
  width: 100%;
  max-height: min(88vh, 40rem);
  overflow: auto;
  background: var(--white);
  border-radius: 16px 16px 0 0;
  padding: 1.35rem 1.2rem calc(1.35rem + env(safe-area-inset-bottom));
  box-shadow: 0 24px 60px rgba(6, 16, 28, 0.28);
  transform: translateY(16px);
  transition: transform 0.2s ease;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 640px) {
  .popup {
    width: min(100%, 34rem);
    border-radius: 14px;
    padding: 1.5rem 1.4rem 1.35rem;
    transform: translateY(12px) scale(0.98);
  }
}

.popup-backdrop.open .popup {
  transform: translateY(0) scale(1);
}

.popup-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.4rem;
}

.popup h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.7rem;
  line-height: 1.25;
}

.popup-lead {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.55;
}

.popup-points {
  list-style: none;
  margin: 0 0 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.popup-points li {
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.45;
}

.popup-points strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 0.15rem;
  font-size: 0.875rem;
}

.popup-close {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  width: 100%;
  min-height: 2.85rem;
}

body.popup-open {
  overflow: hidden;
}

/* —— Footer —— */
.article-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 1.15rem calc(2rem + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted-light);
  font-size: 0.8125rem;
}

.article-footer a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
}

.article-footer a:hover {
  text-decoration: underline;
}

/* —— Example cases with savings —— */
.examples {
  list-style: none;
  margin: 1.15rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.example {
  padding: 1rem 1.05rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.example h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.example p {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.example-savings {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--teal-deep);
}

.analytics-card {
  padding: 1rem 1.05rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.analytics-card h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.analytics-card p {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
}

.analytics-card .impact {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--teal-deep);
  line-height: 1.4;
}

.analytics-stack {
  list-style: none;
  margin: 1.15rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  counter-reset: otc;
}

.analytics-stack > li {
  counter-increment: otc;
}

.analytics-stack .analytics-card h3::before {
  content: counter(otc, decimal-leading-zero) ". ";
  color: var(--teal);
  font-weight: 700;
}

.ai-questions {
  list-style: none;
  margin: 1.15rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ai-questions li {
  padding: 0.85rem 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.975rem;
  color: var(--ink-mid);
  line-height: 1.45;
}

.ai-questions strong {
  color: var(--ink);
  font-weight: 600;
}

.contrast {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0 1.75rem;
}

@media (min-width: 700px) {
  .contrast {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

/* —— Framework phases —— */
.phase-label {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.45rem;
}

.framework-items {
  list-style: none;
  margin: 1.15rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.framework-item {
  padding: 1rem 1.05rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.framework-item h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.framework-item ul {
  margin: 0;
  padding: 0 0 0 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.framework-item li {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.framework-item .outcome {
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--teal-deep);
  line-height: 1.4;
}

.phase-flow {
  list-style: none;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.phase-flow li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.975rem;
  color: var(--ink-mid);
}

.phase-flow strong {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--teal);
  letter-spacing: 0.02em;
}

@media (max-width: 480px) {
  .phase-flow li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

/* —— Reveal —— */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
