/*
  "How it was made": the advertorial feature, after style.css. A spotlit
  headline, then the story on paper: figures drawn as technical
  illustrations, a spec sheet, numbered steps and the results.
*/

.feature {
  --measure: 860px;
  --wide: 1000px;
  --bar-base: #6e757d;
  padding-bottom: 72px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .feature { --bar-base: #7c838c; }
}

:root[data-theme="dark"] .feature { --bar-base: #7c838c; }

.feature article > * {
  width: min(var(--measure), 100% - 40px);
  margin-left: auto;
  margin-right: auto;
}

.feature article > .feature-head { width: 100%; }
.feature article > .fig-rig { width: min(var(--wide), 100% - 40px); }

/* Headline under the light, fading to the paper the rig is drawn on. */
.feature-head {
  padding-bottom: clamp(72px, 10vw, 140px);
  background:
    var(--noise),
    linear-gradient(to bottom, var(--black) 0%, var(--black) 52%, var(--spot-2) 70%, var(--spot-3) 84%, var(--spot-4) 94%, var(--paper) 100%);
}

.feature-head .headline {
  margin-bottom: 26px;
  font-size: clamp(2.4rem, 5.8vw, 4.9rem);
}

.deck {
  max-width: 700px;
  margin: 0 auto;
  color: rgb(242 238 228 / 0.82);
  font-style: italic;
  font-size: clamp(19px, 2vw, 23px);
  line-height: 1.4;
  text-align: center;
  text-wrap: balance;
}

/* Figures */
.fig { margin: 0; }

.fig figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-style: italic;
  font-size: 16px;
  line-height: 1.4;
}

.fig figcaption p { margin: 0; }

.fig-no {
  color: var(--text);
  font-style: normal;
  font-weight: 600;
}

/* Fig. 1, drawn in ink like a patent figure. */
/* Drawn over the foot of the spotlight, so it has to paint above it. */
.fig-rig { position: relative; margin-top: clamp(-56px, -5vw, -24px); }

.fig-rig svg {
  display: block;
  width: 100%;
  height: auto;
  color: var(--text);
}

.fig-rig .ink * {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.fig-rig .ink .paper-fill { fill: var(--paper); }
.fig-rig .ink .leather { fill: url(#hatch); }
.fig-rig .hatch { stroke: currentColor; stroke-width: 1.1; opacity: 0.4; }
.fig-rig .ink .glass { fill: color-mix(in srgb, var(--accent) 14%, var(--paper)); }
.fig-rig .ink .glint { stroke-width: 3.2; opacity: 0.6; }
.fig-rig .ink .cable { stroke-width: 6; }
.fig-rig .ink .screen { fill: #141518; }

.fig-rig .flow {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.6;
  color: var(--accent);
}

.fig-rig marker path { fill: var(--accent); }

.callouts path { fill: none; stroke: currentColor; stroke-width: 1.4; }
.callouts circle { fill: var(--paper); stroke: currentColor; stroke-width: 2; }

.callouts text {
  fill: currentColor;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  text-anchor: middle;
}

.legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 28px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.legend li { display: flex; gap: 10px; align-items: baseline; }

.legend b {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--text);
  border-radius: 50%;
  color: var(--text);
  font-style: normal;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  translate: 0 -1px;
}

/* The opening paragraph, with a drop cap. */
.intro {
  margin-top: clamp(48px, 7vw, 80px);
  font-size: clamp(19px, 2vw, 21.5px);
  line-height: 1.5;
}

.intro p { margin: 0; }

.intro p::first-letter {
  float: left;
  margin: 0.06em 0.09em 0 0;
  color: var(--accent);
  font-size: 4.4em;
  font-weight: 500;
  line-height: 0.78;
}

/* The figures at a glance, as a catalogue spec list with dotted leaders. */
.specs {
  margin-top: 48px;
  padding: 16px 0 6px;
  border-top: 3px solid var(--text);
  border-bottom: 1px solid var(--text);
}

.specs h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.specs dl {
  margin: 0;
  columns: 2 300px;
  column-gap: 40px;
}

.specs dl > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  break-inside: avoid;
}

.specs dl > div::before {
  content: "";
  order: 2;
  flex: 1 1 12px;
  min-width: 12px;
  border-bottom: 2px dotted var(--line);
  translate: 0 -4px;
}

.specs dt {
  order: 1;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
}

.specs dd {
  order: 3;
  margin: 0;
  max-width: 62%;
  font-size: 17px;
  text-align: right;
}

/* Pass after pass: the loop, beside a few words on it. */
.loop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  align-items: center;
  gap: 24px 48px;
  margin-top: clamp(56px, 8vw, 96px);
}

.loop h2,
.section-title {
  margin: 0 0 14px;
  font-size: clamp(30px, 3.6vw, 42px);
  font-weight: 500;
  line-height: 1.08;
}

.loop p { margin: 0 0 12px; font-size: 19px; line-height: 1.5; }

.ring {
  display: block;
  width: 100%;
  height: auto;
  color: var(--accent);
}

.ring-arcs path { fill: none; stroke: currentColor; stroke-width: 2.6; }

.ring-labels text {
  fill: var(--text);
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  text-anchor: middle;
}

.ring-centre {
  fill: var(--muted);
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  text-anchor: middle;
}

/* Step by step */
.section-title {
  padding-top: 12px;
  border-top: 3px solid var(--text);
}

.steps { margin-top: clamp(56px, 8vw, 96px); }

.steps ol {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  column-gap: 26px;
  padding: 26px 0 30px;
  border-bottom: 1px solid var(--line);
}

.step:last-child { border-bottom: 0; }

.step::before {
  content: counter(step);
  grid-column: 1;
  grid-row: 1 / span 6;
  color: var(--accent);
  font-size: 68px;
  font-weight: 500;
  line-height: 0.8;
  font-variant-numeric: oldstyle-nums;
  text-align: right;
}

.step > * { grid-column: 2; }

.step h3 {
  margin: 0 0 8px;
  font-size: clamp(24px, 2.6vw, 29px);
  font-weight: 600;
  line-height: 1.15;
}

.step p { margin: 0 0 12px; font-size: 19px; line-height: 1.5; }
.step p:last-child { margin-bottom: 0; }

.formula {
  font-variant-numeric: lining-nums;
  white-space: nowrap;
}

sup, sub { font-size: 0.68em; line-height: 0; }

.findings {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.findings li {
  position: relative;
  margin: 0 0 8px;
  padding-left: 22px;
  font-size: 18px;
  line-height: 1.45;
}

.findings li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 8px;
  height: 8px;
  background: var(--accent);
}

/* Fig. 2: four renders of one chart. */
.fig-charts { margin-top: 22px; }

.charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.charts img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
}

.charts span {
  display: block;
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 650;
}

/* Fig. 3: results as bars against the visibility thresholds. */
.results { margin-top: clamp(56px, 8vw, 96px); }

.results-lede { margin: 0 0 22px; font-size: 19px; line-height: 1.5; }

.bars {
  --label-w: 340px;
  --value-w: 44px;
  --gap: 16px;
  --top: 30px;
  --bottom: 28px;
  position: relative;
  padding: var(--top) 0 var(--bottom);
}

.bars ul {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bars li {
  display: grid;
  grid-template-columns: var(--label-w) minmax(0, 1fr) var(--value-w);
  align-items: center;
  gap: var(--gap);
  padding: 8px 0;
}

.bar-label { font-size: 17px; line-height: 1.25; }

.bar-track { height: 16px; }

.bar-fill {
  --v: 0;
  display: block;
  width: calc(var(--v) / 6 * 100%);
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.baseline .bar-fill { background: var(--bar-base); }

.de-580 { --v: 5.8; }
.de-160 { --v: 1.6; }
.de-150 { --v: 1.5; }
.de-116 { --v: 1.16; }
.de-053 { --v: 0.53; }

.bar-value {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* The scale sits behind the bars, over their column only. */
.bars-scale {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--label-w) + var(--gap));
  right: calc(var(--value-w) + var(--gap));
  background:
    linear-gradient(to right, color-mix(in srgb, var(--text) 7%, transparent) 0 calc(100% / 6), transparent 0) 0 var(--top) / 100% calc(100% - var(--top) - var(--bottom)) no-repeat,
    linear-gradient(to right, transparent calc(200% / 6), color-mix(in srgb, var(--text) 11%, transparent) 0 calc(300% / 6), transparent 0) 0 var(--top) / 100% calc(100% - var(--top) - var(--bottom)) no-repeat,
    repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px calc(100% / 6)) 0 var(--top) / calc(100% + 1px) calc(100% - var(--top) - var(--bottom)) no-repeat;
}

.tick, .zone {
  position: absolute;
  translate: -50% 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.tick { bottom: 6px; font-variant-numeric: tabular-nums; }
.t0 { left: 0; }
.t1 { left: calc(100% / 6); }
.t2 { left: calc(200% / 6); }
.t3 { left: calc(300% / 6); }
.t4 { left: calc(400% / 6); }
.t5 { left: calc(500% / 6); }
.t6 { left: 100%; }

.zone { top: 8px; font-family: var(--serif); font-style: italic; font-size: 15px; }
.zone-1 { left: calc(50% / 6); }
.zone-2 { left: calc(250% / 6); }

.spec-table {
  width: 100%;
  margin-top: 36px;
  border-collapse: collapse;
  font-size: 17px;
}

.spec-table caption {
  margin-bottom: 8px;
  color: var(--muted);
  font-style: italic;
  text-align: left;
}

.spec-table th, .spec-table td {
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: baseline;
}

.spec-table thead th {
  border-bottom: 2px solid var(--text);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 650;
}

.spec-table tbody th { font-weight: 400; }
.spec-table td { font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }

/* What it leaves out */
.limits { margin-top: clamp(56px, 8vw, 96px); }

.limits ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 36px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.limits li { font-size: 18px; line-height: 1.45; }
.limits b { font-weight: 600; }

/* The closing coupon. */
.feature .closing {
  width: min(560px, 100% - 40px);
  margin-top: clamp(64px, 9vw, 104px);
  padding: 30px 28px 28px;
  text-align: center;
}

.closing .scissors { left: 50%; translate: -50% 0; }
.closing .coupon-title { font-size: 28px; }
.closing p { margin: 0 0 18px; font-size: 18px; }
.closing .btn { display: inline-block; padding: 11px 22px; font-size: 15px; }

@media (max-width: 760px) {
  .legend { grid-template-columns: minmax(0, 1fr); }
  .loop { grid-template-columns: minmax(0, 1fr); }
  .ring { max-width: 360px; margin: 0 auto; }
  .limits ul { grid-template-columns: minmax(0, 1fr); }
  .specs dd { max-width: 55%; }
}

@media (max-width: 640px) {
  .step { grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; }
  .step::before { font-size: 48px; }
  .step > .fig { grid-column: 1 / -1; }
  .formula { white-space: normal; }
  .charts { gap: 10px; }
  .bars { --label-w: 0px; --gap: 12px; }
  .bars li { grid-template-columns: minmax(0, 1fr) var(--value-w); row-gap: 6px; padding: 9px 0; }
  .bar-label { grid-column: 1 / -1; font-size: 16px; }
  .bars-scale { left: 0; }
  .spec-table { font-size: 15.5px; }
  .spec-table td { white-space: normal; }
}
