/* ==========================================================================
   CarePlanTrack design system
   Body aligned: bone white plates, spinal slate ink, therapeutic teal.
   Motif: vertebra segment meters, anatomical line art, calm symmetry.
   ========================================================================== */

:root {
  /* --- brief palette --- */
  --bone: #F7F9FA;
  --surface: #FFFFFF;
  --ink: #16202A;
  --primary: #2C5F73;
  --accent: #4FB6A5;
  --muted: #5E6D77;

  /* --- derived tints and shades --- */
  --primary-900: #17313C;
  --primary-700: #224A5A;
  --primary-300: #7FA8B6;
  --primary-100: #DDE9ED;
  --primary-050: #EDF3F5;
  --accent-700: #2C8878;
  --accent-500: #3FA593;
  --accent-200: #BFE7DF;
  --accent-100: #E3F4F0;
  --ink-700: #2B3945;
  --ink-500: #45525D;
  --line: #DCE4E8;
  --line-strong: #C3D0D6;
  --seg-off: #E7EDF0;
  --plate: #F1F5F6;
  --warn: #B4643C;
  --warn-tint: #FBEDE5;

  /* --- spacing scale --- */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 88px;
  --s10: 120px;

  /* --- radii --- */
  --r-xs: 4px;
  --r-sm: 7px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* --- shadows --- */
  --sh-1: 0 1px 2px rgba(22, 32, 42, .05), 0 2px 6px rgba(22, 32, 42, .04);
  --sh-2: 0 2px 4px rgba(22, 32, 42, .05), 0 10px 24px rgba(22, 32, 42, .07);
  --sh-3: 0 6px 14px rgba(22, 32, 42, .07), 0 26px 60px rgba(22, 32, 42, .12);
  --sh-inset: inset 0 0 0 1px var(--line);

  /* --- type scale --- */
  --f-display: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-body: "Bree Serif", Georgia, "Times New Roman", serif;
  --t-xs: .78rem;
  --t-sm: .88rem;
  --t-base: 1rem;
  --t-md: 1.08rem;
  --t-lg: 1.25rem;
  --t-xl: 1.6rem;
  --t-2xl: 2.1rem;
  --t-3xl: 2.7rem;
  --t-4xl: 3.4rem;

  /* --- motion: calm easing, nothing hurried --- */
  --ease: cubic-bezier(.22, .72, .24, 1);
  --ease-soft: cubic-bezier(.4, .01, .2, 1);
  --dur: .55s;

  --wrap: 1180px;
}

/* ==========================================================================
   Reset and base
   ========================================================================== */

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

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

body {
  margin: 0;
  background-color: var(--bone);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.72;
  letter-spacing: .002em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* bone grain: a very quiet paper tooth over the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(22, 32, 42, .05) 1px, transparent 0),
    radial-gradient(1100px 600px at 50% -10%, rgba(79, 182, 165, .10), transparent 70%);
  background-size: 22px 22px, 100% 100%;
}

main, header, footer, section { position: relative; z-index: 1; }

h1, h2, h3, h4, h5 {
  font-family: var(--f-display);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -.022em;
  margin: 0 0 var(--s4);
  text-wrap: balance;
}

h1 { font-size: clamp(2.05rem, 1.35rem + 3.1vw, var(--t-4xl)); }
h2 { font-size: clamp(1.62rem, 1.2rem + 1.85vw, var(--t-3xl)); }
h3 { font-size: clamp(1.12rem, 1.02rem + .45vw, 1.32rem); font-weight: 700; }
h4 { font-size: 1.03rem; font-weight: 700; }

p { margin: 0 0 var(--s4); color: var(--ink-500); }
p.lead { font-size: clamp(1.06rem, 1rem + .35vw, 1.22rem); color: var(--ink-700); }

a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-700); }

ul, ol { margin: 0 0 var(--s4); padding-left: 1.15rem; }
li { margin-bottom: var(--s2); color: var(--ink-500); }

img { max-width: 100%; height: auto; display: block; }

strong, b { color: var(--ink); font-weight: 700; }

small { font-size: var(--t-sm); }

hr { border: 0; border-top: 1px solid var(--line); margin: var(--s7) 0; }

::selection { background: var(--accent-200); color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--accent-700);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s5); }
.wrap-narrow { max-width: 780px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--s4); top: -60px;
  z-index: 200;
  background: var(--primary);
  color: #fff;
  font-family: var(--f-display);
  font-weight: 700;
  padding: var(--s3) var(--s5);
  border-radius: 0 0 var(--r-md) var(--r-md);
  transition: top .25s var(--ease);
}
.skip-link:focus { top: 0; color: #fff; }

.eyebrow {
  font-family: var(--f-display);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-700);
  margin: 0 0 var(--s3);
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
}
.eyebrow::before {
  content: "";
  width: 26px; height: 8px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 11px, var(--accent) 11px 19px, transparent 19px 22px, var(--primary-300) 22px 26px);
}

.sec { padding: var(--s9) 0; }
.sec-tight { padding: var(--s8) 0; }

.sec-head { max-width: 720px; margin-bottom: var(--s7); }
.sec-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.sec-head--center .eyebrow { justify-content: center; }

.plate-bg { background: var(--plate); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.surface-bg { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* the slate band, used once for contrast, keeps the page calm */
.slate-bg {
  background:
    radial-gradient(900px 420px at 12% 0%, rgba(79, 182, 165, .18), transparent 65%),
    linear-gradient(180deg, var(--primary-900), #12262F);
  color: #E8F0F2;
}
.slate-bg h2, .slate-bg h3, .slate-bg strong { color: #FBFDFD; }
.slate-bg p { color: #C4D6DB; }
.slate-bg .eyebrow { color: var(--accent-200); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  font-family: var(--f-display);
  font-size: .96rem;
  font-weight: 700;
  letter-spacing: -.005em;
  padding: 14px 26px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--sh-2); }
.btn-primary:hover { background: var(--primary-700); color: #fff; box-shadow: var(--sh-3); }

.btn-accent { background: var(--accent); color: var(--primary-900); box-shadow: var(--sh-2); }
.btn-accent:hover { background: var(--accent-500); color: var(--primary-900); }

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 0 var(--accent-100);
}
.btn-ghost:hover { background: var(--accent-100); border-color: var(--accent-200); color: var(--primary-900); }

.btn-quiet { background: var(--surface); color: var(--primary); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--primary-300); background: var(--primary-050); }

.btn-sm { padding: 10px 18px; font-size: .88rem; }
.btn-block { width: 100%; }

.cta-row { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); align-items: center; }

/* ==========================================================================
   The motif: vertebra segment meters
   ========================================================================== */

.spine-meter {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--sh-inset);
}
.spine-meter--bare { background: transparent; box-shadow: none; padding: 0; }

.vert {
  position: relative;
  flex: 1 1 0;
  height: 17px;
  min-width: 7px;
  border-radius: 5px;
  background: var(--seg-off);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
/* transverse processes on each side of every vertebra */
.vert::before, .vert::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 4px;
  height: 7px;
  border-radius: 2px;
  background: inherit;
  box-shadow: inherit;
  transform: translateY(-50%);
}
.vert::before { left: -3px; }
.vert::after { right: -3px; }

.vert.is-on {
  background: linear-gradient(178deg, var(--accent) 0%, var(--accent-500) 45%, var(--primary) 100%);
  box-shadow: inset 0 0 0 1px rgba(23, 49, 60, .28);
}
.vert.is-next {
  background: var(--accent-100);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* segments seat themselves one vertebra at a time when the block reveals */
.reveal.is-in .vert.is-on {
  animation: seat .5s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 78ms);
}
@keyframes seat {
  from { transform: scaleY(.28); opacity: 0; }
  60%  { transform: scaleY(1.06); opacity: 1; }
  to   { transform: scaleY(1); opacity: 1; }
}

.meter-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  font-family: var(--f-display);
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--s2);
}
.meter-line span:last-child { color: var(--muted); font-weight: 600; }

/* vertical spinal rail, drawn in CSS, used beside the numbered steps */
.rail {
  position: absolute;
  top: 6px; bottom: 6px; left: 21px;
  width: 6px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(180deg,
      var(--primary-100) 0 16px,
      transparent 16px 22px);
}

/* ==========================================================================
   Header and navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(247, 249, 250, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: background-color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.site-header.is-stuck {
  background: rgba(255, 255, 255, .95);
  border-bottom-color: var(--line);
  box-shadow: 0 6px 22px rgba(22, 32, 42, .07);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
  min-height: 74px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.16rem;
  letter-spacing: -.028em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark svg { width: 34px; height: 34px; flex: none; }
.wordmark b { color: var(--primary); font-weight: 800; }
.wordmark:hover { color: var(--ink); }

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--s5);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list a {
  font-family: var(--f-display);
  font-size: .93rem;
  font-weight: 600;
  color: var(--ink-700);
  text-decoration: none;
  padding: 6px 2px;
  position: relative;
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) 0 9px, transparent 9px 13px, var(--accent) 13px 22px, transparent 22px 26px, var(--accent) 26px 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav-list a:hover::after, .nav-list a[aria-current="page"]::after { transform: scaleX(1); }
.nav-list li { margin: 0; }

.header-cta { display: flex; align-items: center; gap: var(--s3); }

.nav-toggle {
  display: none;
  width: 46px; height: 42px;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block;
  width: 20px; height: 2px;
  border-radius: 2px;
  background: var(--primary);
  content: "";
  position: relative;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* ==========================================================================
   Hero: calm symmetry, everything mirrored around the center line
   ========================================================================== */

.hero { padding: var(--s9) 0 var(--s8); text-align: center; overflow: hidden; }
.hero::after {
  content: "";
  position: absolute;
  left: 50%; top: 0;
  width: 1px; height: 74px;
  background: linear-gradient(180deg, transparent, var(--line-strong));
  transform: translateX(-50%);
}

.hero-inner { max-width: 860px; margin: 0 auto; }

.badge-row {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  padding: 7px 8px 7px 16px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
  font-family: var(--f-display);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--ink-700);
  margin-bottom: var(--s5);
}
.badge-row .chip {
  display: inline-flex;
  gap: 3px;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  background: var(--accent-100);
}
.badge-row .chip i {
  display: block;
  width: 5px; height: 12px;
  border-radius: 2px;
  background: var(--accent-700);
}
.badge-row .chip i:nth-child(4), .badge-row .chip i:nth-child(5) { background: var(--accent-200); }

.hero h1 { margin-bottom: var(--s5); }
.hero h1 .under {
  position: relative;
  white-space: nowrap;
  color: var(--primary);
}
.hero h1 .under::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -.14em;
  height: 9px;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 22px, transparent 22px 27px);
  opacity: .85;
}

.hero .lead { max-width: 660px; margin-left: auto; margin-right: auto; margin-bottom: var(--s6); }
.hero .cta-row { justify-content: center; margin-bottom: var(--s7); }

.trust-strip {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s4);
  max-width: 980px;
  text-align: left;
}
.trust-strip li {
  position: relative;
  margin: 0;
  padding: var(--s4) var(--s4) var(--s4) 52px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: var(--t-sm);
  color: var(--muted);
  line-height: 1.55;
  box-shadow: var(--sh-1);
}
.trust-strip li::before {
  content: "";
  position: absolute;
  left: 18px; top: 50%;
  width: 18px; height: 30px;
  transform: translateY(-50%);
  border-radius: 6px;
  background: linear-gradient(180deg, var(--accent) 0 9px, transparent 9px 12px, var(--primary-300) 12px 20px, transparent 20px 23px, var(--primary) 23px 30px);
}
.trust-strip b { display: block; font-family: var(--f-display); color: var(--ink); font-size: .96rem; }

/* framed clinical photograph with a floating plan card */
.photo-frame { position: relative; }
.photo-frame img {
  width: 100%;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  box-shadow: var(--sh-3);
}
.photo-frame::before {
  content: "";
  position: absolute;
  inset: -14px -14px -14px -14px;
  border-radius: calc(var(--r-xl) + 12px);
  border: 1px solid var(--line);
  background: repeating-linear-gradient(180deg, rgba(44, 95, 115, .05) 0 14px, transparent 14px 20px);
  z-index: -1;
}

.hero-photo { max-width: 1060px; margin: var(--s8) auto 0; }

.plan-card {
  position: absolute;
  right: -10px;
  bottom: -30px;
  width: min(340px, 84%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: var(--s5);
  text-align: left;
}
.plan-card h4 { margin-bottom: 2px; font-family: var(--f-display); font-size: .98rem; }
.plan-card .who { font-size: var(--t-xs); color: var(--muted); margin: 0 0 var(--s4); font-family: var(--f-display); }
.plan-card .note {
  margin: var(--s4) 0 0;
  font-size: var(--t-sm);
  line-height: 1.5;
  color: var(--muted);
  padding-top: var(--s3);
  border-top: 1px dashed var(--line-strong);
}
.plan-card .note b { color: var(--primary); }

/* ==========================================================================
   Problem plates
   ========================================================================== */

.plate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: var(--s5);
}

.plate {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s6) var(--s5) var(--s5);
  box-shadow: var(--sh-1);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.plate:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--primary-300); }
.plate::before {
  content: "";
  position: absolute;
  left: var(--s5); top: 0;
  width: 46px; height: 5px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--primary) 0 13px, transparent 13px 17px, var(--accent) 17px 30px, transparent 30px 34px, var(--primary-300) 34px 46px);
}
.plate h3 { margin-bottom: var(--s3); }
.plate p { font-size: .99rem; margin-bottom: var(--s4); }

.cost-tag {
  display: inline-block;
  font-family: var(--f-display);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--warn);
  background: var(--warn-tint);
  border-radius: var(--r-sm);
  padding: 7px 11px;
  line-height: 1.35;
}

.problem-note {
  margin-top: var(--s6);
  text-align: center;
  font-size: var(--t-sm);
  color: var(--muted);
}

/* ==========================================================================
   Steps
   ========================================================================== */

.split {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: var(--s8);
  align-items: center;
}
.split--flip > *:first-child { order: 2; }

.steps { position: relative; list-style: none; margin: 0; padding: 0; }
.steps > li {
  position: relative;
  padding: 0 0 var(--s6) 66px;
  margin: 0;
}
.steps > li:last-child { padding-bottom: 0; }
.steps > li .num {
  position: absolute;
  left: 0; top: 0;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-family: var(--f-display);
  font-weight: 800;
  color: var(--primary);
  box-shadow: var(--sh-1);
  z-index: 1;
}
.steps > li .num::before, .steps > li .num::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px; height: 13px;
  border-radius: 3px;
  background: var(--primary-100);
  transform: translateY(-50%);
}
.steps > li .num::before { left: -5px; }
.steps > li .num::after { right: -5px; }
.steps > li h3 { margin-bottom: var(--s2); }
.steps > li p { font-size: .99rem; margin-bottom: 0; }

/* ==========================================================================
   Features
   ========================================================================== */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: var(--s5);
}

.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s6) var(--s5);
  box-shadow: var(--sh-1);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }

.f-icon {
  width: 54px; height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--accent-100);
  border: 1px solid var(--accent-200);
  margin-bottom: var(--s4);
}
.f-icon svg { width: 30px; height: 30px; }
.f-icon svg [stroke] { stroke: var(--primary); }
svg.line-art {
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature h3 { margin-bottom: var(--s3); }
.feature p { font-size: .98rem; margin-bottom: 0; }

/* ==========================================================================
   Outcomes
   ========================================================================== */

.outcome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s5);
}

.outcome {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--r-lg);
  padding: var(--s6) var(--s5);
}
.outcome .figure {
  font-family: var(--f-display);
  font-size: clamp(2.3rem, 1.8rem + 2vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  color: #FFFFFF;
  margin-bottom: var(--s2);
}
.outcome .figure em { font-style: normal; font-size: .5em; color: var(--accent-200); }
.outcome h3 { font-size: 1.02rem; margin-bottom: var(--s3); color: var(--accent-200); }
.outcome p { font-size: .94rem; margin-bottom: var(--s4); }
.outcome .spine-meter { background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.outcome .vert { background: rgba(255, 255, 255, .10); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.outcome .vert.is-on { background: linear-gradient(178deg, var(--accent-200), var(--accent)); box-shadow: none; }

/* ==========================================================================
   Social proof
   ========================================================================== */

.quote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: var(--s5);
}

.testimonial {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s6) var(--s5) var(--s5);
  margin: 0;
  box-shadow: var(--sh-1);
}
.testimonial::before {
  content: "";
  position: absolute;
  top: var(--s5); right: var(--s5);
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--accent-200);
  background:
    radial-gradient(circle at 50% 50%, var(--accent) 0 5px, transparent 5px),
    linear-gradient(90deg, transparent 0 11px, var(--accent-200) 11px 15px, transparent 15px 100%);
}
.testimonial p {
  font-size: 1rem;
  color: var(--ink-700);
  margin-bottom: var(--s5);
}
.testimonial footer {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  border-top: 1px solid var(--line);
  padding-top: var(--s4);
}
.avatar {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-050);
  border: 1px solid var(--primary-100);
  font-family: var(--f-display);
  font-weight: 800;
  font-size: .86rem;
  color: var(--primary);
}
.testimonial cite {
  font-style: normal;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: .95rem;
  color: var(--ink);
  display: block;
}
.testimonial .role { font-size: var(--t-xs); color: var(--muted); line-height: 1.45; display: block; }

.results-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--s5);
  margin-top: var(--s7);
  padding: var(--s6) var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  text-align: center;
}
.results-strip div { position: relative; }
.results-strip div + div::before {
  content: "";
  position: absolute;
  left: calc(var(--s5) * -.5);
  top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: repeating-linear-gradient(180deg, var(--primary-100) 0 10px, transparent 10px 15px);
}
.results-strip .big {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -.035em;
  color: var(--primary);
  line-height: 1.1;
}
.results-strip span { font-size: var(--t-sm); color: var(--muted); }

/* ==========================================================================
   Pricing: recommended tier sits in the middle, taller, perfectly centered
   ========================================================================== */

.price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s5);
  align-items: center;
}

.tier {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--s6) var(--s5) var(--s5);
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
}
.tier h3 { font-family: var(--f-display); font-size: 1.06rem; margin-bottom: var(--s2); }
.tier .who { font-size: var(--t-sm); color: var(--muted); margin-bottom: var(--s5); min-height: 44px; }
.tier .price {
  font-family: var(--f-display);
  font-size: 2.7rem;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--ink);
  line-height: 1;
}
.tier .price span { font-size: .95rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.tier .price-note { font-size: var(--t-xs); color: var(--muted); margin: var(--s2) 0 var(--s5); }
.tier ul { list-style: none; margin: 0 0 var(--s6); padding: 0; }
.tier ul li {
  position: relative;
  padding-left: 28px;
  font-size: .95rem;
  margin-bottom: var(--s3);
  color: var(--ink-500);
}
.tier ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 15px; height: 11px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 9px, var(--accent) 9px 15px);
}
.tier .btn { margin-top: auto; }

.tier--featured {
  border: 2px solid var(--primary);
  padding: var(--s7) var(--s6) var(--s6);
  box-shadow: var(--sh-3);
  position: relative;
  background:
    linear-gradient(180deg, var(--primary-050), var(--surface) 180px);
}
.tier--featured::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -50%);
  width: 66px; height: 12px;
  border-radius: 6px;
  background: repeating-linear-gradient(90deg, var(--primary) 0 14px, var(--bone) 14px 18px);
}
.tier-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-family: var(--f-display);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--primary);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  margin-bottom: var(--s4);
}

.price-foot {
  margin-top: var(--s6);
  text-align: center;
  font-size: var(--t-sm);
  color: var(--muted);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   FAQ accordion
   ========================================================================== */

.faq-list { max-width: 860px; margin: 0 auto; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: var(--s3);
  overflow: hidden;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.faq-item:hover { border-color: var(--primary-300); }
.faq-item.is-open { border-color: var(--primary); box-shadow: var(--sh-1); }

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  padding: var(--s5);
  font-family: var(--f-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}
.faq-q .mark {
  flex: none;
  position: relative;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--accent-100);
  border: 1px solid var(--accent-200);
}
.faq-q .mark::before, .faq-q .mark::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  background: var(--primary);
  border-radius: 2px;
  transform: translate(-50%, -50%);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.faq-q .mark::before { width: 12px; height: 2px; }
.faq-q .mark::after { width: 2px; height: 12px; }
.faq-q[aria-expanded="true"] .mark::after { opacity: 0; transform: translate(-50%, -50%) rotate(90deg); }

.faq-a { padding: 0 var(--s5) var(--s5); }
.faq-a p { font-size: .99rem; margin: 0; }
.faq-a[hidden] { display: none; }

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: var(--s8);
  align-items: start;
}

.contact-aside .spine-meter { margin-bottom: var(--s5); max-width: 320px; }
.contact-points { list-style: none; margin: var(--s5) 0 0; padding: 0; }
.contact-points li {
  position: relative;
  padding-left: 34px;
  margin-bottom: var(--s4);
  font-size: .96rem;
}
.contact-points li::before {
  content: "";
  position: absolute;
  left: 0; top: 6px;
  width: 20px; height: 14px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--primary) 0 8px, transparent 8px 11px, var(--accent) 11px 20px);
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--s7) var(--s6);
  box-shadow: var(--sh-3);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4) var(--s5); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-family: var(--f-display);
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--ink);
}
.field input, .field select, .field textarea {
  font-family: var(--f-body);
  font-size: .98rem;
  color: var(--ink);
  background: var(--bone);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  width: 100%;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease);
}
.field textarea { min-height: 132px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-100);
}
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-color: var(--warn);
  background: var(--warn-tint);
}
.err {
  font-family: var(--f-display);
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--warn);
  min-height: 1em;
}
.err:empty { min-height: 0; }

.consent {
  grid-column: 1 / -1;
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  background: var(--primary-050);
  border: 1px solid var(--primary-100);
  border-radius: var(--r-md);
  padding: var(--s4);
}
.consent input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--primary); }
.consent label { font-family: var(--f-body); font-weight: 400; font-size: var(--t-sm); color: var(--ink-500); }

.form-foot {
  margin-top: var(--s5);
  font-size: var(--t-sm);
  color: var(--muted);
  text-align: center;
}

/* ==========================================================================
   Author byline
   ========================================================================== */

.byline {
  display: flex;
  gap: var(--s4);
  align-items: center;
  max-width: 760px;
  margin: 0 auto;
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--r-md);
}
.byline img { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; flex: none; }
.byline p { font-size: var(--t-sm); margin: 0; }
.byline b { font-family: var(--f-display); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: linear-gradient(180deg, #14272F, var(--primary-900));
  color: #C8D8DD;
  padding: var(--s9) 0 var(--s5);
  margin-top: var(--s10);
  border-top: 6px solid var(--accent);
}
.site-footer::before {
  content: "";
  display: block;
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--primary-900) 0 5px, transparent 5px 26px);
}
.footer-cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.25fr;
  gap: var(--s7) var(--s6);
}
.site-footer h4 {
  font-family: var(--f-display);
  font-size: var(--t-xs);
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent-200);
  margin-bottom: var(--s4);
}
.site-footer p { color: #A9BFC6; font-size: var(--t-sm); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: var(--s3); }
.site-footer a { color: #D9E6EA; text-decoration: none; font-size: var(--t-sm); }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: var(--s4);
  text-decoration: none;
}
.footer-mark svg { width: 32px; height: 32px; }

.social {
  display: flex;
  gap: var(--s2);
  margin-top: var(--s5);
}
.social a {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .05);
  transition: background-color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.social a:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.social svg { width: 17px; height: 17px; fill: #E6F0F2; }
.social a:hover svg { fill: var(--primary-900); }

.publisher-line { font-size: var(--t-xs); color: #94ADB5; margin-top: var(--s4); }

.footer-base {
  margin-top: var(--s8);
  padding-top: var(--s5);
  border-top: 1px solid rgba(255, 255, 255, .12);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3) var(--s5);
  justify-content: space-between;
  align-items: center;
  font-size: var(--t-xs);
  color: #93ACB4;
}
.footer-base a { font-size: var(--t-xs); }

/* ==========================================================================
   Inner pages: prose, page hero, site map
   ========================================================================== */

.page-hero {
  padding: var(--s8) 0 var(--s7);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.page-hero .wrap { max-width: 800px; }
.page-hero p { margin-bottom: 0; }

.crumbs {
  font-family: var(--f-display);
  font-size: var(--t-xs);
  color: var(--muted);
  margin-bottom: var(--s4);
}
.crumbs a { text-decoration: none; }
.crumbs span { margin: 0 6px; color: var(--line-strong); }

.prose { max-width: 820px; margin: 0 auto; padding: var(--s8) 0; }
.prose h2 {
  font-size: clamp(1.35rem, 1.15rem + .8vw, 1.75rem);
  margin-top: var(--s7);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
}
.prose h2:first-of-type { margin-top: 0; border-top: 0; padding-top: 0; }
.prose h3 { margin-top: var(--s5); }
.prose ul li, .prose ol li { font-size: 1.01rem; }
.prose .fact-list {
  list-style: none;
  padding: var(--s5);
  margin: 0 0 var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.prose .fact-list li { padding-left: 0; }
.prose .fact-list b { font-family: var(--f-display); }
.updated {
  display: inline-block;
  font-family: var(--f-display);
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-050);
  border: 1px solid var(--primary-100);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  margin-bottom: var(--s5);
}

.author-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--s8);
  align-items: start;
  padding: var(--s8) 0;
}
.author-card {
  position: sticky;
  top: 100px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s5);
  box-shadow: var(--sh-1);
  text-align: center;
}
.author-card img {
  width: 150px; height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto var(--s4);
  border: 4px solid var(--accent-100);
}
.author-card .role { font-family: var(--f-display); font-size: var(--t-sm); color: var(--muted); }
.profile-links { list-style: none; padding: 0; margin: var(--s4) 0 0; text-align: left; }
.profile-links li { margin-bottom: var(--s2); font-size: var(--t-sm); }

.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s5);
  padding: var(--s8) 0;
}
.map-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s5);
  box-shadow: var(--sh-1);
}
.map-card h2 { font-size: 1.12rem; margin-bottom: var(--s4); }
.map-card ul { list-style: none; padding: 0; margin: 0; }
.map-card li { margin-bottom: var(--s4); }
.map-card a { font-family: var(--f-display); font-weight: 700; font-size: .96rem; text-decoration: none; }
.map-card a:hover { text-decoration: underline; }
.map-card small { display: block; color: var(--muted); font-size: var(--t-xs); line-height: 1.5; }

.mini-hero {
  text-align: center;
  padding: var(--s10) 0 var(--s9);
}
.mini-hero .spine-meter { max-width: 300px; margin: 0 auto var(--s6); }
.mini-hero .cta-row { justify-content: center; }
.code-mark {
  font-family: var(--f-display);
  font-size: clamp(4rem, 3rem + 8vw, 7rem);
  font-weight: 800;
  letter-spacing: -.05em;
  color: var(--primary-100);
  line-height: .9;
  margin-bottom: var(--s4);
}

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease-soft), transform .7s var(--ease-soft);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1040px) {
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .split { gap: var(--s7); }
  .author-layout { grid-template-columns: 1fr; }
  .author-card { position: static; max-width: 420px; margin: 0 auto; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--sh-2);
    padding: var(--s4) var(--s5) var(--s6);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list li { border-bottom: 1px solid var(--line); }
  .nav-list a { display: block; padding: var(--s4) 0; font-size: 1rem; }
  .nav-list a::after { display: none; }
  .header-cta .btn-primary { display: none; }
  .site-nav .btn { margin-top: var(--s5); width: 100%; }

  .split, .contact-grid { grid-template-columns: 1fr; gap: var(--s7); }
  .split--flip > *:first-child { order: 0; }
  .price-grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .tier--featured { padding: var(--s6) var(--s5) var(--s5); }
  .trust-strip { grid-template-columns: 1fr; max-width: 480px; }
  .plan-card { position: static; width: auto; margin: calc(var(--s5) * -1) auto 0; }
  .results-strip div + div::before { display: none; }
}

@media (max-width: 620px) {
  .sec { padding: var(--s8) 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-card { padding: var(--s5) var(--s4); }
  .footer-cols { grid-template-columns: 1fr; }
  .byline { flex-direction: column; text-align: center; }
  .hero { padding-top: var(--s7); }
  .photo-frame::before { display: none; }
  .steps > li { padding-left: 56px; }
}

@media (max-width: 380px) {
  .wrap { padding: 0 var(--s4); }
  .btn { padding: 13px 20px; font-size: .92rem; }
  .vert { height: 15px; }
}

/* ==========================================================================
   Reduced motion: everything holds still
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .btn:hover, .plate:hover, .feature:hover, .social a:hover { transform: none; }
}

@media print {
  .site-header, .site-footer, .nav-toggle, .cta-row { display: none; }
  body { background: #fff; }
}

/* ==========================================================================
   The Adjusting Table: magazine index, article pages and cards
   Same bone plates, spinal slate ink and therapeutic teal as the rest of the
   site. Nothing new is invented here, the vocabulary is only extended.
   ========================================================================== */

/* --- breadcrumb ------------------------------------------------------- */

.mag-crumb { padding: var(--s6) 0 0; }
.mag-crumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  font-family: var(--f-display);
  font-size: var(--t-xs);
  letter-spacing: .01em;
}
.mag-crumb li { margin: 0; color: var(--muted); }
.mag-crumb li + li::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  margin-right: var(--s3);
  border-radius: 2px;
  background: var(--accent);
  vertical-align: middle;
}
.mag-crumb a { color: var(--primary); text-decoration: none; }
.mag-crumb a:hover { color: var(--accent-700); text-decoration: underline; }
.mag-crumb li[aria-current="page"] {
  color: var(--ink-500);
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* --- magazine masthead ------------------------------------------------ */

.mag-masthead { padding: var(--s6) 0 var(--s7); }
.mag-masthead .wrap { max-width: 860px; }
.mag-masthead h1 { margin-bottom: var(--s5); }
.mag-masthead-meta {
  font-family: var(--f-display);
  font-size: var(--t-xs);
  color: var(--muted);
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: var(--s4);
}
.mag-masthead .spine-meter { max-width: 260px; }

.mag-standfirst {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(1.06rem, 1rem + .45vw, 1.28rem);
  line-height: 1.55;
  color: var(--ink-700);
  max-width: 62ch;
  margin-bottom: var(--s5);
}

/* --- index grid and cards --------------------------------------------- */

.mag-index { padding-bottom: var(--s9); }

.mag-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s6);
  align-items: start;
}

.mag-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-1);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.mag-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-2);
  border-color: var(--primary-300);
}

.mag-card-media { position: relative; background: var(--plate); }
.mag-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.mag-card-media::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0 22%, var(--primary-100) 22% 100%);
}

.mag-card-body {
  padding: var(--s5);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.mag-card-angle {
  font-family: var(--f-display);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent-700);
  margin-bottom: var(--s3);
}

.mag-card-title {
  font-size: 1.12rem;
  line-height: 1.26;
  margin-bottom: var(--s3);
}
.mag-card-title a { color: var(--ink); text-decoration: none; }
.mag-card-title a:hover { color: var(--primary); text-decoration: underline; text-decoration-color: var(--accent); }

.mag-card-dek {
  font-size: .97rem;
  color: var(--ink-500);
  margin-bottom: var(--s5);
}

.mag-card-meta {
  margin: auto 0 0;
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
  font-family: var(--f-display);
  font-size: var(--t-xs);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}
.mag-card-meta span { color: var(--line-strong); }

/* the lead card takes the full width of the grid and reads as the cover */
.mag-card.lead {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: stretch;
  border-color: var(--primary-300);
  box-shadow: var(--sh-2);
}
.mag-card.lead .mag-card-media { flex: 0 0 55%; }
.mag-card.lead .mag-card-media img { height: 100%; aspect-ratio: auto; min-height: 320px; }
.mag-card.lead .mag-card-media::after {
  left: auto; top: 0; bottom: 0; right: 0;
  width: 4px; height: auto;
  background: linear-gradient(180deg, var(--accent) 0 30%, var(--primary-100) 30% 100%);
}
.mag-card.lead .mag-card-body { padding: var(--s7) var(--s6); justify-content: center; }
.mag-card.lead .mag-card-title { font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2rem); }
.mag-card.lead .mag-card-dek { font-size: 1.04rem; max-width: 46ch; }

.mag-index-foot {
  margin: var(--s7) 0 0;
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
  font-size: .99rem;
  max-width: 68ch;
}

/* --- article header --------------------------------------------------- */

.mag-article { padding-bottom: var(--s8); }
.mag-article > .wrap { max-width: 1180px; }

.mag-head {
  max-width: 78ch;
  padding: var(--s6) 0 var(--s6);
}
.mag-head h1 {
  font-size: clamp(1.9rem, 1.25rem + 2.6vw, 3rem);
  margin-bottom: var(--s5);
}

.mag-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s4);
  padding: var(--s4) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.mag-byline p { margin: 0; }
.mag-byline-mark { display: inline-flex; flex-direction: column; gap: 2px; flex: none; }
.mag-byline-mark i {
  display: block;
  width: 16px; height: 5px;
  border-radius: 2px;
  background: var(--accent);
}
.mag-byline-mark i:last-child { background: var(--primary-300); }
.mag-byline-who {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: .96rem;
  color: var(--ink);
}
.mag-byline-who a { color: var(--ink); text-decoration-color: var(--accent); }
.mag-byline-who a:hover { color: var(--primary); }
.mag-byline-meta {
  font-family: var(--f-display);
  font-size: var(--t-xs);
  color: var(--muted);
  letter-spacing: .01em;
}
.mag-byline-meta span { color: var(--line-strong); padding: 0 2px; }

.mag-figure {
  margin: 0 0 var(--s7);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.mag-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* --- article body typography ------------------------------------------ */

.mag-body {
  max-width: 68ch;
  font-size: 1.075rem;
  line-height: 1.78;
}
.mag-body > h2 {
  font-size: clamp(1.34rem, 1.1rem + 1vw, 1.78rem);
  margin: var(--s8) 0 var(--s4);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
  position: relative;
}
.mag-body > h2::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 54px; height: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.mag-body > h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.mag-body > h2:first-child::before { display: none; }
.mag-body h3 {
  font-size: 1.14rem;
  margin: var(--s6) 0 var(--s3);
  color: var(--primary-900);
}
.mag-body p { margin-bottom: var(--s5); }
.mag-body a { text-decoration-color: var(--accent); }
.mag-body ul, .mag-body ol { margin: 0 0 var(--s5); padding-left: 1.3rem; }
.mag-body li { margin-bottom: var(--s3); }
.mag-body ul li::marker { color: var(--accent-700); }
.mag-body ol li::marker { color: var(--primary); font-family: var(--f-display); font-weight: 700; }
.mag-body blockquote {
  margin: var(--s6) 0;
  padding: var(--s5) var(--s5) var(--s5) var(--s6);
  background: var(--primary-050);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 1.06rem;
  color: var(--ink-700);
}
.mag-body blockquote p:last-child { margin-bottom: 0; }
.mag-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 var(--s6);
  font-family: var(--f-display);
  font-size: .93rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.mag-body th, .mag-body td {
  text-align: left;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line);
}
.mag-body th { background: var(--plate); color: var(--ink); font-weight: 700; }
.mag-body td { color: var(--ink-500); }
.mag-body tr:last-child td { border-bottom: 0; }

/* the assembler drops these contextual pointers between sections */
.inline-read {
  margin: var(--s6) 0;
  padding: var(--s4) var(--s5);
  background: var(--accent-100);
  border: 1px solid var(--accent-200);
  border-radius: var(--r-md);
  font-family: var(--f-display);
  font-size: .94rem;
  font-weight: 600;
  color: var(--primary-900);
  position: relative;
  padding-left: calc(var(--s5) + 18px);
}
.mag-body .inline-read { margin-bottom: var(--s6); }
.inline-read::before {
  content: "";
  position: absolute;
  left: var(--s4); top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 22px;
  border-radius: 3px;
  background: var(--accent-700);
}
.inline-read a { color: var(--primary); text-decoration-color: var(--accent-700); }
.inline-read a:hover { color: var(--accent-700); }

/* --- call to action block --------------------------------------------- */

.mag-cta {
  margin: var(--s8) 0 var(--s7);
  padding: var(--s6);
  background: var(--primary-900);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  position: relative;
  overflow: hidden;
}
.mag-cta::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--accent) 0 18%, transparent 18% 22%,
              var(--accent-500) 22% 40%, transparent 40% 44%, var(--primary-300) 44% 100%);
}
.mag-cta h2 {
  color: #FBFDFD;
  font-size: clamp(1.24rem, 1.05rem + .8vw, 1.6rem);
  margin: var(--s2) 0 var(--s4);
  padding: 0;
  border: 0;
}
.mag-cta h2::before { display: none; }
.mag-cta p { color: #C4D6DB; font-size: 1rem; }
.mag-cta-act { margin: var(--s5) 0 0; }
.mag-cta .btn-primary { background: var(--accent); color: var(--primary-900); }
.mag-cta .btn-primary:hover { background: var(--accent-500); color: var(--primary-900); }

/* --- author box -------------------------------------------------------- */

.mag-author {
  display: flex;
  gap: var(--s5);
  align-items: flex-start;
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-md);
}
.mag-author img {
  width: 88px; height: 88px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px var(--accent-100);
}
.mag-author p { font-size: .96rem; margin-bottom: var(--s3); }
.mag-author p:last-child { margin-bottom: 0; }
.mag-author-name {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--ink);
}
.mag-author-link a { font-family: var(--f-display); font-weight: 600; font-size: .92rem; }

/* --- Read also --------------------------------------------------------- */

.mag-also { padding-bottom: var(--s8); }
.mag-also-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s5);
}
.mag-rel {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.mag-rel:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.mag-rel-media { background: var(--plate); }
.mag-rel-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.mag-rel-body { padding: var(--s4) var(--s5) var(--s5); display: flex; flex-direction: column; flex: 1; }
.mag-rel-title { font-size: 1.02rem; line-height: 1.3; margin-bottom: var(--s3); }
.mag-rel-title a { color: var(--ink); text-decoration: none; }
.mag-rel-title a:hover { color: var(--primary); text-decoration: underline; text-decoration-color: var(--accent); }
.mag-rel-dek {
  font-size: .93rem;
  color: var(--ink-500);
  margin-bottom: var(--s4);
}
.mag-rel-meta {
  margin: auto 0 0;
  font-family: var(--f-display);
  font-size: var(--t-xs);
  color: var(--muted);
}
.mag-also-all { margin: var(--s6) 0 0; }

/* --- home page magazine teaser ----------------------------------------- */

.mag-teaser-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s5);
  margin-bottom: var(--s6);
}
.mag-teaser {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-1);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.mag-teaser:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--primary-300); }
.mag-teaser-media { background: var(--plate); }
.mag-teaser-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.mag-teaser-body { padding: var(--s5); display: flex; flex-direction: column; flex: 1; }
.mag-teaser-body h3 { font-size: 1.06rem; line-height: 1.28; margin-bottom: var(--s3); }
.mag-teaser-body h3 a { color: var(--ink); text-decoration: none; }
.mag-teaser-body h3 a:hover { color: var(--primary); text-decoration: underline; text-decoration-color: var(--accent); }
.mag-teaser-body p { font-size: .96rem; margin-bottom: var(--s4); }
.mag-teaser-date {
  margin: auto 0 0;
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
  font-family: var(--f-display);
  font-size: var(--t-xs);
  color: var(--muted);
}

/* --- author page and site map listings --------------------------------- */

.mag-list { list-style: none; margin: 0; padding: 0; }
.mag-list li {
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s2) var(--s4);
}
.mag-list li:last-child { border-bottom: 0; }
.mag-list a { font-family: var(--f-display); font-weight: 600; text-decoration: none; }
.mag-list a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.mag-list time { font-family: var(--f-display); font-size: var(--t-xs); color: var(--muted); }

/* --- responsive: the magazine holds together down to 360px ------------- */

@media (max-width: 1040px) {
  .mag-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s5); }
  .mag-also-grid, .mag-teaser-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .mag-card.lead { flex-direction: column; }
  .mag-card.lead .mag-card-media { flex: none; }
  .mag-card.lead .mag-card-media img { min-height: 0; aspect-ratio: 3 / 2; }
  .mag-card.lead .mag-card-media::after {
    left: 0; right: 0; top: auto; bottom: 0;
    width: auto; height: 4px;
    background: linear-gradient(90deg, var(--accent) 0 22%, var(--primary-100) 22% 100%);
  }
  .mag-card.lead .mag-card-body { padding: var(--s5); }
  .mag-author { flex-direction: column; gap: var(--s4); }
}

@media (max-width: 620px) {
  .mag-grid, .mag-also-grid, .mag-teaser-grid { grid-template-columns: 1fr; }
  .mag-body { font-size: 1.03rem; }
  .mag-body > h2 { margin-top: var(--s7); }
  .mag-cta { padding: var(--s5) var(--s4); }
  .mag-cta .btn { width: 100%; justify-content: center; }
  .mag-head { padding-top: var(--s5); }
  .mag-byline { gap: var(--s2) var(--s3); }
  .mag-list li { gap: var(--s1) var(--s3); }
}

@media (max-width: 380px) {
  .mag-card-body, .mag-rel-body, .mag-teaser-body { padding: var(--s4); }
  .mag-figure { border-radius: var(--r-md); }
  .inline-read { padding-left: calc(var(--s4) + 16px); padding-right: var(--s4); }
  .mag-author img { width: 72px; height: 72px; }
}

.map-card--wide { grid-column: 1 / -1; }
.map-card--wide ul { columns: 2; column-gap: var(--s6); }
.map-card--wide li { break-inside: avoid; }

@media (max-width: 620px) {
  .map-card--wide ul { columns: 1; }
}



/* Network strip: five sibling products, rotated so every site is linked the same
   number of times. Spans the full footer grid rather than adding a fifth column,
   because each footer declares a fixed column count and a fifth item would wrap. */
.site-network { grid-column: 1 / -1; flex-basis: 100%; width: 100%;
  margin-top: 1.6rem; padding-top: 1.2rem;
  border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent); }
.site-network h2 { font: inherit; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase; margin: 0 0 0.7rem; opacity: 0.72; }
.site-network ul { list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-network li + li { margin-top: 0; }
.site-network a { font-size: 0.86rem; text-decoration: none; opacity: 0.9;
  border-bottom: 1px solid transparent; }
.site-network a:hover, .site-network a:focus-visible { opacity: 1; border-bottom-color: currentColor; }
@media (max-width: 620px) { .site-network ul { gap: 0.45rem 1.1rem; } }


/* Decorative bleed guard. Several sections intentionally hang a rotated or offset
   pseudo element past the viewport edge. overflow-x: clip contains them without
   creating a scroll container, so position: sticky keeps working, unlike overflow
   hidden. Genuine content overflow is still reported by the element level check in
   the browser pass. */
html { overflow-x: clip; }
body { overflow-x: clip; }


/* Wide content on phones. Class names for the prose wrapper differ from site to site,
   so this targets tables and pre blocks directly: they scroll inside their own box
   rather than pushing cells past the right edge, per the build contract. */
@media (max-width: 700px) {
  table { display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { overflow-wrap: anywhere; }
  pre { overflow-x: auto; max-width: 100%; }
}
