/* Clinical negligence: the reality behind the myths. Prototype web edition. */
:root {
  --slate: #3f5f8b;
  --slate-deep: #2f4c74;
  --navy: #0b2f63;
  --blue: #0a4fb3;
  --orange: #f37321;
  --mist: #e3e9f3;
  --sky: #b9cbe8;
  --ink: #14213d;
  --muted: #4b5873;
  --paper: #ffffff;
  --wrap: 1120px;
  --gut: 24px;
  --head: "Montserrat", Arial, sans-serif;
  --cond: "Oswald", "Arial Narrow", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--head); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--blue); }
p { margin: 0 0 1em; }
h1, h2, h3 { font-family: var(--head); line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* Edition note */
.edition { background: var(--navy); color: #d7e1f0; font-size: 13px; line-height: 1.5; padding: 8px var(--gut); text-align: center; }
.edition a { color: #fff; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--mist); }
.top .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex: none; }
.brand img { width: auto; height: 34px; }
.brand span { font-weight: 700; font-size: 14px; line-height: 1.2; }
.top nav { min-width: 0; margin-left: auto; }
.chapters { display: flex; gap: 4px; margin: 0; list-style: none; padding: 0; overflow-x: auto; scrollbar-width: none; }
.chapters::-webkit-scrollbar { display: none; }
.chapters a { display: block; white-space: nowrap; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 99px; }
.chapters a:hover { color: var(--blue); }
.chapters a[aria-current="true"] { background: var(--mist); color: var(--navy); }
.progress { position: absolute; left: 0; bottom: -1px; height: 3px; width: 100%; background: var(--orange); transform-origin: 0 50%; transform: scaleX(0); }

/* Hero */
.hero { background: var(--slate); color: #fff; padding: 88px 0 72px; }
.hero h1 { font-family: var(--cond); font-weight: 600; text-transform: uppercase; font-size: clamp(48px, 9vw, 112px); line-height: .95; letter-spacing: 0; }
.hero .sub { font-family: var(--cond); font-weight: 400; text-transform: uppercase; font-size: clamp(22px, 3.2vw, 36px); margin-top: 14px; color: #dbe5f4; }
.hero .lede { max-width: 640px; font-size: 19px; margin-top: 36px; color: #eef3fa; }
.hero .meta { margin-top: 28px; font-size: 14px; color: #c9d6ea; }

/* Contents */
.toc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin-top: 56px; }
.toc a { background: var(--slate-deep); color: #fff; text-decoration: none; padding: 22px 20px 24px; min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; transition: background .2s; }
.toc a:hover { background: var(--navy); }
.toc strong { font-size: 16px; line-height: 1.3; }
.toc span { font-size: 13px; color: #c9d6ea; margin-top: 16px; }

/* Sections */
section { padding: 96px 0; }
section.tint { background: var(--mist); }
.sec-head { max-width: 760px; margin-bottom: 48px; }
.sec-head h2 { font-size: clamp(30px, 4vw, 44px); color: var(--navy); text-transform: uppercase; }
.sec-head p { margin-top: 16px; font-size: 19px; color: var(--muted); }
.opener { background: var(--slate); color: #fff; padding: 120px 0 104px; }
.opener h2 { font-size: clamp(32px, 7vw, 84px); text-transform: uppercase; max-width: 900px; line-height: 1; }
.opener p { max-width: 640px; font-size: 19px; color: #e4ebf6; margin-top: 24px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.prose { max-width: 680px; }
.prose p { color: #26324d; }
h3.q { color: var(--blue); font-style: italic; font-weight: 700; font-size: 20px; text-transform: uppercase; margin: 0 0 20px; }
.note { border: 2px solid var(--blue); padding: 24px 28px; background: #fff; }
.note h3 { font-size: 17px; margin-bottom: 10px; color: var(--navy); }
.note p { font-size: 15px; margin-bottom: .6em; }
.note p:last-child { margin-bottom: 0; }

/* Big numbers */
.numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--mist); }
.numbers > div { background: #fff; padding: 32px 28px 30px; }
.big { font-family: var(--head); font-weight: 800; color: var(--blue); font-size: clamp(36px, 4.2vw, 54px); line-height: 1; display: block; }
.numbers p { margin: 14px 0 0; font-size: 15px; font-weight: 600; color: var(--ink); }

/* Context rows */
.context { display: grid; gap: 2px; }
.context > div { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: center; background: #fff; padding: 26px 28px; }
.context .big { font-size: clamp(34px, 4vw, 48px); }
.context p { margin: 0; font-size: 17px; }

/* Waffle */
.waffle-wrap { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center; }
.waffle { display: grid; grid-template-columns: repeat(10, 26px); gap: 4px; }
.waffle i { width: 26px; height: 26px; background: var(--sky); position: relative; overflow: hidden; }
.waffle i::after { content: ""; position: absolute; inset: 0; background: var(--orange); transform: scaleX(var(--f, 0)); transform-origin: 0 50%; transition: transform .5s ease; }
.waffle:not(.in) i::after { transform: scaleX(0); }
.waffle-key { font-size: 15px; color: var(--muted); }
.waffle-key b { color: var(--ink); }
.pair-waffles { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.pair-waffles h3 { font-size: 15px; color: var(--muted); margin-top: 16px; font-weight: 600; }

/* Bars */
.bars { display: grid; gap: 14px; }
.bar { display: grid; grid-template-columns: 96px 1fr; gap: 20px; align-items: center; background: var(--mist); padding: 16px 20px; }
.tint .bar { background: #fff; }
.bar .big { font-size: 38px; }
.bar p { margin: 0 0 8px; font-size: 15px; font-style: italic; }
.track { height: 10px; background: rgba(10,79,179,.12); }
.fill { height: 100%; background: var(--blue); transform-origin: 0 50%; transform: scaleX(var(--v)); transition: transform 1.1s cubic-bezier(.2,.7,.2,1); }
.js .fill { transform: scaleX(0); }
.js .in .fill, .js .fill.in { transform: scaleX(var(--v)); }
.fill.o { background: var(--orange); }
.fill.n { background: var(--navy); }
.lead-in { font-weight: 700; color: var(--blue); font-style: italic; margin: 28px 0 14px; }

/* Public opinion */
.poll { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.poll > div { background: #fff; padding: 24px; }
.poll h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .02em; margin-bottom: 18px; color: var(--navy); }
.poll .row { display: grid; grid-template-columns: 1fr 52px; gap: 10px; align-items: center; margin-bottom: 4px; font-size: 13px; }
.poll .row b { font-size: 18px; }
.poll .track { height: 18px; background: transparent; margin-bottom: 14px; grid-column: 1 / -1; }

/* Split / compare */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.split > div { background: #fff; padding: 32px; }
.compare { display: grid; gap: 22px; }
.compare .lab { display: flex; justify-content: space-between; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.compare .lab span:last-child { font-family: var(--head); font-weight: 800; color: var(--navy); font-size: 20px; }
.compare .track { height: 34px; background: transparent; }
.stack { display: flex; height: 64px; }
.stack div { height: 100%; transform-origin: 0 50%; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.stack .a { background: var(--blue); width: 98%; }
.stack .b { background: var(--orange); width: 2%; transition-delay: .9s; }
.js .stack div { transform: scaleX(0); }
.js .in .stack div { transform: scaleX(1); }
.stack-key { display: flex; justify-content: space-between; gap: 20px; margin-top: 14px; font-size: 15px; }
.stack-key b { color: var(--blue); }
.stack-key .o { color: var(--orange); }

/* Rising arrows */
.arrows { display: flex; align-items: flex-end; gap: 48px; height: 300px; padding-top: 40px; }
.arrows > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.arrows .shaft { width: 64px; background: var(--blue); height: calc(var(--h) * 1%); transform-origin: 50% 100%; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); position: relative; }
.arrows .shaft::before { content: ""; position: absolute; left: 50%; top: -36px; transform: translateX(-50%); border: 48px solid transparent; border-top: 0; border-bottom: 38px solid var(--blue); }
.arrows .o .shaft { background: var(--orange); }
.arrows .o .shaft::before { border-bottom-color: var(--orange); }
.js .arrows .shaft { transform: scaleY(0); }
.js .in .arrows .shaft { transform: scaleY(1); }
.arrows .big { margin-bottom: 52px; font-size: 34px; }
.arrows .o .big { color: var(--orange); }
.arrows p { margin: 14px 0 0; font-weight: 700; text-align: center; font-size: 15px; }

/* Babies */
.babies { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; max-width: 520px; }
.babies svg { width: 100%; height: auto; fill: var(--blue); opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .4s; }
.in .babies svg { opacity: 1; transform: none; }
.saves { margin-top: 28px; display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.saves .big { font-size: clamp(44px, 6vw, 72px); color: var(--orange); }

/* Line chart */
.line svg { width: 100%; height: auto; overflow: visible; }
.line .path { fill: none; stroke: var(--navy); stroke-width: 3; stroke-linejoin: round; }
.line .dot { fill: var(--navy); opacity: 0; transition: opacity .3s; }
.line.in .dot { opacity: 1; }
.line .grid { stroke: #c8d3e4; stroke-width: 1; }
.line text { font: 600 12px var(--head); fill: var(--muted); }
.line .up { stroke: var(--orange); stroke-width: 3; }
.line .up-head { fill: var(--orange); }
.line .callout { font: 800 20px var(--head); fill: var(--orange); }

/* Myth and fact */
.myths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.myth { background: #fff; border-top: 6px solid var(--orange); padding: 28px; display: flex; flex-direction: column; }
.myth .tag { align-self: flex-start; font-family: var(--cond); font-size: 15px; text-transform: uppercase; letter-spacing: .06em; padding: 3px 12px; background: var(--orange); color: #fff; margin-bottom: 16px; }
.myth h3 { font-size: 17px; text-transform: uppercase; color: var(--navy); margin-bottom: 14px; }
.myth p { font-size: 15px; }
.js .myth .fact { display: none; }
.myth.flipped { border-top-color: var(--blue); }
.myth.flipped .tag { background: var(--blue); }
.js .myth.flipped .fact { display: block; }
.js .myth.flipped .says { display: none; }
/* Without the script, and on paper, both statements show, each labelled, and the button goes. */
html:not(.js) .myth .tag, html:not(.js) .myth button { display: none; }
html:not(.js) .myth .says::before { content: "Myth: "; font-weight: 700; color: var(--orange); }
html:not(.js) .myth .fact::before { content: "Fact: "; font-weight: 700; color: var(--blue); }
.myth button { margin-top: auto; align-self: flex-start; font: 700 14px var(--head); color: var(--blue); background: none; border: 2px solid var(--blue); padding: 10px 16px; cursor: pointer; }
.myth button:hover { background: var(--blue); color: #fff; }
.myth .more { font-size: 13px; color: var(--muted); }

/* Feelings */
.feelings { display: grid; gap: 12px; }
.feelings .row { display: grid; grid-template-columns: 110px 1fr 56px; gap: 14px; align-items: center; font-weight: 600; }
.feelings .row b { font-size: 18px; color: var(--navy); }
.feelings .track { height: 22px; background: transparent; }

/* No-fault */
.claims { display: grid; gap: 28px; }
.claims .lab { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; margin-bottom: 10px; }
.claims .lab span:last-child { color: var(--navy); font-weight: 800; }
.claims .track { height: 40px; background: transparent; }
.claims .sliver .fill { min-width: 3px; }

/* Quotes */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.quotes blockquote { margin: 0; background: #fff; border-radius: 22px; padding: 26px 28px; font-weight: 700; font-size: 18px; line-height: 1.4; color: var(--navy); position: relative; transition: opacity .5s, transform .5s; }
.js .quotes blockquote { opacity: 0; transform: translateY(12px); }
.quotes blockquote::after { content: ""; position: absolute; left: 36px; bottom: -14px; border: 14px solid transparent; border-bottom: 0; border-top-color: #fff; }
.quotes blockquote:nth-child(2n) { background: var(--navy); color: #fff; }
.quotes blockquote:nth-child(2n)::after { border-top-color: var(--navy); }
.js .quotes.in blockquote { opacity: 1; transform: none; }
.quotes.in blockquote:nth-child(2) { transition-delay: .12s; }
.quotes.in blockquote:nth-child(3) { transition-delay: .24s; }
.quotes.in blockquote:nth-child(4) { transition-delay: .36s; }
.quotes.in blockquote:nth-child(5) { transition-delay: .48s; }
.quotes.in blockquote:nth-child(6) { transition-delay: .6s; }
.quotes .wide { grid-column: span 2; }

/* Safety */
.safety { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.safety > div { background: var(--mist); padding: 28px; }
.safety .rank { font-family: var(--head); font-weight: 800; font-size: 48px; color: var(--blue); line-height: 1; margin-bottom: 12px; }
.safety p { font-size: 15px; }

/* Plan */
.plan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--mist); }
.plan > div { background: #fff; padding: 32px 28px; }
.plan h3 { font-size: 22px; color: var(--blue); text-transform: uppercase; font-style: italic; margin-bottom: 16px; }
.plan p, .plan li { font-size: 15px; }
.plan ul { padding-left: 18px; margin: 0; }
.plan li { margin-bottom: 8px; }

/* Sources */
.sources ul { padding-left: 18px; margin: 0 0 24px; }
.sources li { margin-bottom: 8px; }
.sources .small { font-size: 14px; color: var(--muted); }

/* Footer */
footer { background: var(--navy); color: #c9d6ea; padding: 48px 0; font-size: 14px; }
footer a { color: #fff; }
footer p { max-width: 760px; }

/* Reveal */
.reveal { transition: opacity .7s, transform .7s; }
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .toc { grid-template-columns: 1fr 1fr; }
  .numbers, .poll, .myths, .plan, .quotes { grid-template-columns: 1fr; }
  .quotes .wide { grid-column: auto; }
  .cols, .split, .pair-waffles, .safety { grid-template-columns: 1fr; gap: 32px; }
  .waffle-wrap { grid-template-columns: 1fr; }
  .context > div { grid-template-columns: 1fr; gap: 6px; }
  section { padding: 72px 0; }
  .brand span { display: none; }
}
@media (max-width: 560px) {
  :root { --gut: 16px; }
  .toc { grid-template-columns: 1fr; }
  .toc a { min-height: 0; }
  .waffle { grid-template-columns: repeat(10, 1fr); }
  .waffle i { width: auto; aspect-ratio: 1; height: auto; }
  .bar { grid-template-columns: 1fr; gap: 8px; }
  .arrows { gap: 20px; }
  .feelings .row { grid-template-columns: 100px 1fr 46px; gap: 10px; }
  .split > div { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .quotes blockquote, .babies svg { opacity: 1; transform: none; transition: none; }
  .fill, .stack div, .arrows .shaft, .waffle i::after { transition: none; }
}
@media print {
  *, *::before, *::after { transition: none !important; }
  .top, .edition { position: static; }
  .js .reveal, .js .quotes blockquote, .babies svg { opacity: 1; transform: none; }
  .js .fill { transform: scaleX(var(--v)); }
  .js .stack div, .js .arrows .shaft { transform: none; }
  .js .myth .says, .js .myth .fact, .js .myth.flipped .says, .js .myth.flipped .fact { display: block; }
  .myth .tag, .myth button { display: none; }
  .myth .says::before { content: "Myth: "; font-weight: 700; color: var(--orange); }
  .myth .fact::before { content: "Fact: "; font-weight: 700; color: var(--blue); }
}
