/* Layout: a single reading column (~68ch) that opens up to full width for the canvas,
   which is the page's one bold moment. Three dimension hues carry meaning everywhere. */
:root {
  --paper: #fbfbf9;
  --surface: #ffffff;
  --ink: #0e1f3d;
  --ink-soft: #4d566a;
  --rule: #d8dbe2;
  --rule-strong: #0e1f3d;
  --accent: #002147;          /* Oxford blue */
  --accent-soft: #e8ecf3;
  --eco: #0b67a8;        /* economic */
  --soc: #c45200;        /* societal */
  --env: #00855f;        /* environmental */
  --eco-wash: #e4effa;
  --soc-wash: #fcebdf;
  --env-wash: #dff3ec;

  --display: "EB Garamond", Garamond, "Times New Roman", serif;
  --body: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --ui: "Source Sans 3", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.75rem;
  --step-3: 2.4rem;
  --step-4: clamp(2.8rem, 7vw, 5.2rem);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0c1322; --surface: #111a2d; --ink: #e9ecf2; --ink-soft: #a7b0c2;
    --rule: #26304a; --rule-strong: #c5cddb; --accent: #a9bfe9; --accent-soft: #18243d;
    --eco: #5eb0ec; --soc: #f2894a; --env: #33c49a;
    --eco-wash: #12263a; --soc-wash: #2e1d12; --env-wash: #0f2a22;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0c1322; --surface: #111a2d; --ink: #e9ecf2; --ink-soft: #a7b0c2;
  --rule: #26304a; --rule-strong: #c5cddb; --accent: #a9bfe9; --accent-soft: #18243d;
  --eco: #5eb0ec; --soc: #f2894a; --env: #33c49a;
  --eco-wash: #12263a; --soc-wash: #2e1d12; --env-wash: #0f2a22;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: var(--step-0); line-height: 1.65;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap {
  max-width: 1120px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.prose { max-width: 68ch; }

/* Header */
.top {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding-block: 18px; font-family: var(--ui); font-size: var(--step--1);
}
.mark { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600;
  font-size: 1.15rem; letter-spacing: 0.02em; color: var(--ink); text-decoration: none; }
.mark svg { width: 28px; height: 28px; flex: none; }
.top nav { display: flex; gap: 18px; flex-wrap: wrap; }
.top nav a { color: var(--ink-soft); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.lang { border: 1px solid var(--rule); padding: 2px 9px; border-radius: 3px; }

/* Hero */
.hero { padding-block: 40px 28px; border-top: 1px solid var(--rule); }
.eyebrow { font-family: var(--ui); font-size: var(--step--1); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 14px; }
h1 { font-family: var(--display); font-weight: 600; font-size: var(--step-4); line-height: 0.95;
  letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
.tagline { font-family: var(--display); font-weight: 500; font-size: var(--step-2); line-height: 1.15;
  margin: 18px 0 0; text-wrap: balance; }
.tagline .e { color: var(--eco); } .tagline .s { color: var(--soc); } .tagline .v { color: var(--env); }
.lede { margin: 22px 0 0; color: var(--ink-soft); max-width: 62ch; }
.byline { margin: 18px 0 0; font-family: var(--ui); font-size: var(--step--1); color: var(--ink-soft); }
.byline strong { color: var(--ink); font-weight: 600; }

/* Section rhythm */
section { padding-block: 44px; }
h2 { font-family: var(--display); font-weight: 600; font-size: var(--step-3); line-height: 1.05; margin: 0 0 16px;
  text-wrap: balance; }
h3 { font-family: var(--display); font-weight: 600; font-size: var(--step-1); line-height: 1.2; margin: 0; }
p { margin: 0 0 1em; }

/* Canvas */
.canvas-section { padding-top: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; font-family: var(--ui); }
.filters button {
  font: 500 var(--step--1)/1 var(--ui); padding: 9px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.filters button .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-soft); }
.filters button[data-dim="eco"] .dot { background: var(--eco); }
.filters button[data-dim="soc"] .dot { background: var(--soc); }
.filters button[data-dim="env"] .dot { background: var(--env); }
.filters button[aria-pressed="true"] { border-color: var(--rule-strong); background: var(--ink); color: var(--paper); }

.canvas-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.canvas {
  min-width: 860px; background: var(--surface); border: 2px solid var(--rule-strong);
  display: grid; grid-template-columns: 1fr 1fr 1.25fr 1fr 1fr; font-family: var(--display);
}
.col { display: grid; border-right: 2px solid var(--rule-strong); min-height: 400px; }
.col:nth-child(5) { border-right: 0; }
.col.split { grid-template-rows: 1fr 1fr; }
.col.split > .blk + .blk { border-top: 2px solid var(--rule-strong); }
.blk { position: relative; padding: 10px 10px 10px; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
a.blk:hover .blk-name, a.blk:focus-visible .blk-name { text-decoration: underline; text-underline-offset: 3px; }
.blk-name { font-weight: 600; font-size: 1.12rem; line-height: 1.1; text-align: center; }
.layers { flex: 1; display: grid; grid-template-rows: repeat(3, 1fr); margin: 10px -10px -10px; }
.layer { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-top: 1px dashed var(--rule);
  font-family: var(--ui); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; transition: background .25s, opacity .25s; }
.layer::before { content: ""; width: 4px; align-self: stretch; border-radius: 2px; }
.layer.eco { color: var(--eco); } .layer.eco::before { background: var(--eco); }
.layer.soc { color: var(--soc); } .layer.soc::before { background: var(--soc); }
.layer.env { color: var(--env); } .layer.env::before { background: var(--env); }
.bottom { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; border-top: 2px solid var(--rule-strong); }
.bottom .blk { min-height: 64px; border-top: 2px solid var(--rule-strong); transition: background .25s, opacity .25s; }
.bottom .blk:nth-child(-n+2) { border-top: 0; }
.bottom .blk:nth-child(odd) { border-right: 2px solid var(--rule-strong); }
.bottom .blk .blk-name::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 8px; vertical-align: 0.12em; }
.bottom .blk.eco .blk-name::before { background: var(--eco); }
.bottom .blk.soc .blk-name::before { background: var(--soc); }
.bottom .blk.env .blk-name::before { background: var(--env); }
.side-label { font-family: var(--ui); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft); text-align: center; margin-top: 4px; }

/* Filter states */
.canvas[data-focus="eco"] .layer.eco, .canvas[data-focus="eco"] .bottom .eco { background: var(--eco-wash); }
.canvas[data-focus="soc"] .layer.soc, .canvas[data-focus="soc"] .bottom .soc { background: var(--soc-wash); }
.canvas[data-focus="env"] .layer.env, .canvas[data-focus="env"] .bottom .env { background: var(--env-wash); }
.canvas[data-focus="eco"] .layer:not(.eco), .canvas[data-focus="eco"] .bottom .blk:not(.eco),
.canvas[data-focus="soc"] .layer:not(.soc), .canvas[data-focus="soc"] .bottom .blk:not(.soc),
.canvas[data-focus="env"] .layer:not(.env), .canvas[data-focus="env"] .bottom .blk:not(.env) { opacity: 0.3; }

.canvas-note { font-family: var(--ui); font-size: var(--step--1); color: var(--ink-soft); margin-top: 10px; }
.scroll-hint { display: none; }
@media (max-width: 900px) { .scroll-hint { display: inline; } }

/* Shifts */
.shifts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; border-top: 2px solid var(--rule-strong); margin-top: 8px; }
.shift { padding: 20px 20px 22px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.shift .from { font-family: var(--ui); font-size: var(--step--1); color: var(--ink-soft); text-decoration: line-through;
  text-decoration-color: var(--ink-soft); margin: 0 0 4px; }
.shift h3 { margin-bottom: 8px; }
.shift p { margin: 0; font-size: 0.98rem; }

/* Blocks reference */
.blocks { display: grid; gap: 0; margin-top: 8px; border-top: 2px solid var(--rule-strong); }
.block-row { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 24px; padding: 20px 0;
  border-bottom: 1px solid var(--rule); scroll-margin-top: 20px; }
.block-row h3 { font-size: 1.35rem; }
.block-row .fr { display: block; font-family: var(--ui); font-size: var(--step--1); color: var(--ink-soft); font-weight: 400; margin-top: 2px; }
.block-row p { margin: 0 0 0.6em; }
.block-row .q { font-style: italic; color: var(--ink-soft); margin: 0; }
.chips { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.chip { font-family: var(--ui); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 3px; border: 1px solid currentColor; }
.chip.eco { color: var(--eco); } .chip.soc { color: var(--soc); } .chip.env { color: var(--env); }
.block-row:target { background: linear-gradient(90deg, var(--eco-wash), transparent 70%); }
@media (max-width: 640px) { .block-row { grid-template-columns: 1fr; gap: 8px; } }

/* Balance */
.balance { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--rule-strong); background: var(--surface);
  font-family: var(--ui); margin-top: 20px; }
.balance div { padding: 12px 14px; border-top: 1px solid var(--rule); display: flex; align-items: center; gap: 10px; min-width: 0; }
.balance div:nth-child(odd) { border-right: 2px solid var(--rule-strong); }
.balance .head { font-family: var(--display); font-weight: 600; font-size: 1.1rem; border-top: 0; letter-spacing: 0.02em; }
.balance .sw { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* Author */
.author { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); gap: 40px; align-items: start; }
.facts { font-family: var(--ui); font-size: var(--step--1); border-top: 2px solid var(--rule-strong); }
.facts div { padding: 10px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 2px; }
.facts dt { color: var(--ink-soft); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.72rem; }
.facts dd { margin: 0; color: var(--ink); }
@media (max-width: 760px) { .author { grid-template-columns: 1fr; gap: 24px; } }

/* FAQ */
details { border-bottom: 1px solid var(--rule); padding: 14px 0; }
details:first-of-type { border-top: 2px solid var(--rule-strong); }
summary { cursor: pointer; font-family: var(--display); font-weight: 600; font-size: var(--step-1); list-style: none;
  display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--ui); font-weight: 400; color: var(--ink-soft); }
details[open] summary::after { content: "–"; }
details p { margin: 10px 0 0; max-width: 68ch; }

/* Footer */
footer { border-top: 1px solid var(--rule); padding-block: 28px 40px; font-family: var(--ui); font-size: var(--step--1); color: var(--ink-soft); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.cite { font-family: var(--ui); font-size: var(--step--1); color: var(--ink-soft); }

/* Mode switch */
.modes { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 4px; overflow: hidden; margin: 0 0 14px; }
.modes button { font: 500 var(--step--1)/1 var(--ui); padding: 11px 16px; border: 0; background: var(--surface); color: var(--ink); cursor: pointer; }
.modes button + button { border-left: 1px solid var(--rule-strong); }
.modes button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Byline avatar and portrait */
.byline { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--rule); }
.author-side { display: grid; gap: 20px; min-width: 0; }
.portrait { width: 100%; height: auto; max-width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; display: block; }
@media (max-width: 760px) { .portrait { max-width: 260px; } }

/* Fill-in canvas */
.fill-bar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 20px; margin: 0 0 14px; font-family: var(--ui); }
.fill-name { display: grid; gap: 4px; flex: 1 1 280px; max-width: 460px; font-size: var(--step--1); color: var(--ink-soft); }
.fill-name input { font: 500 1.05rem/1.3 var(--ui); padding: 10px 12px; border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--surface); color: var(--ink); width: 100%; }
.fill-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fill-actions button { font: 500 var(--step--1)/1 var(--ui); padding: 11px 16px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); }
.fill-actions button.primary { background: var(--ink); color: var(--paper); }
.fill-actions button.armed { border-color: var(--soc); color: var(--soc); }
.canvas.fill .col { min-height: 560px; }
.canvas.fill .blk { gap: 4px; }
.canvas.fill .blk > .field { flex: 1; }
.canvas.fill .layers { margin-top: 6px; }
.canvas.fill .layer { display: grid; grid-template-columns: 4px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 8px; align-items: stretch; padding: 6px 8px 4px; }
.canvas.fill .layer::before { grid-row: 1 / 3; }
.canvas.fill .lname { font-size: 0.7rem; }
.canvas.fill .bottom .blk { min-height: 110px; }
.field { display: flex; min-height: 0; }
.field textarea { flex: 1; width: 100%; min-height: 56px; resize: none; border: 0; border-radius: 3px; padding: 6px;
  background: transparent; color: var(--ink); font: 400 0.86rem/1.4 var(--ui); }
.field textarea::placeholder { color: var(--ink-soft); opacity: 0.75; font-style: italic; }
.field textarea:hover { background: var(--paper); }
.field textarea:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--paper); }
.pt, .print-head, .print-foot { display: none; }
.downloads { font-family: var(--ui); font-size: var(--step--1); color: var(--ink-soft); margin: 8px 0 0; }

@media print {
  html:root:not(#x) {
    --paper: #ffffff; --surface: #ffffff; --ink: #0e1f3d; --ink-soft: #4d566a; --rule: #c9ced9; --rule-strong: #0e1f3d;
    --eco: #0b67a8; --soc: #c45200; --env: #00855f; color-scheme: light;
  }
  @page { size: A4 landscape; margin: 8mm; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.fill-mode header, body.fill-mode footer, body.fill-mode .hero,
  body.fill-mode main > section:not(#canvas), body.fill-mode #canvas-title, body.fill-mode .modes,
  body.fill-mode .fill-bar, body.fill-mode .canvas-note, body.fill-mode .downloads { display: none !important; }
  body.fill-mode #canvas { padding: 0; }
  body.fill-mode .wrap { max-width: none; padding: 0; }
  .canvas-scroll { overflow: visible; }
  .canvas.fill { min-width: 0; width: 100%; break-inside: avoid; box-shadow: none; }
  .canvas.fill .col { min-height: 112mm; }
  .canvas.fill .bottom .blk { min-height: 18mm; }
  .field textarea { display: none; }
  .pt { display: block; white-space: pre-wrap; font: 400 8pt/1.35 var(--ui); color: var(--ink); padding: 2px 4px; }
  .print-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 0 0 4mm; font-family: var(--ui); }
  .print-title { font: 600 18pt/1 var(--display); }
  .print-project { font-size: 10pt; color: var(--ink-soft); }
  .print-name { display: inline-block; min-width: 70mm; border-bottom: 1px solid var(--rule-strong); color: var(--ink); font-weight: 500; }
  .print-foot { display: block; margin-top: 3mm; font: 8pt var(--ui); color: var(--ink-soft); text-align: right; }
}
.layer .field, .layer .pt, .field textarea { text-transform: none; letter-spacing: normal; }
.schools { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.schools li { display: grid; gap: 1px; }
.schools strong { font-weight: 500; }
.schools span { color: var(--ink-soft); }
.cite-box { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--rule); border-left: 3px solid var(--rule-strong); }
.cite-box p { margin: 0; flex: 1 1 320px; min-width: 0; overflow-wrap: anywhere; font-size: 0.98rem; }
.copy { font: 500 var(--step--1)/1 var(--ui); padding: 9px 14px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); }
.wrap.prose { max-width: 1120px; }
.wrap.prose > * { max-width: 68ch; }


/* ================= Academic edition =================
   Layout: a journal article. Masthead with double rule, title page with abstract,
   numbered sections, captioned figure and table, references. */
body { font-size: 1.0625rem; line-height: 1.7; font-feature-settings: "kern", "liga", "onum"; }
a { color: var(--accent); text-decoration-thickness: 1px; }
::selection { background: var(--accent-soft); }

/* Masthead */
header.top { border-bottom: 3px double var(--rule-strong); padding-block: 16px 14px; }
.mark { font-family: var(--display); font-weight: 500; font-size: 1.12rem; letter-spacing: 0.06em;
  font-variant: small-caps; text-transform: lowercase; gap: 12px; }
.mark-full { font-variant: small-caps; }
.mark-short { display: none; }
.mark svg { width: 24px; height: 24px; }
.top nav { gap: 22px; align-items: center; }
.top nav a { font-family: var(--ui); font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.lang { border: 0; border-left: 1px solid var(--rule); border-radius: 0; padding: 0 0 0 18px; }

/* Title page */
.hero { border-top: 0; padding-block: 64px 36px; }
.hero > * { max-width: 900px; }
.eyebrow { font-family: var(--ui); font-size: 0.8rem; letter-spacing: 0.2em; color: var(--accent); margin-bottom: 22px; }
h1 { font-family: var(--display); font-weight: 500; font-size: clamp(2.7rem, 6.2vw, 4.6rem); line-height: 1.02; letter-spacing: -0.012em; }
.tagline { font-family: var(--display); font-style: italic; font-weight: 400; font-size: clamp(1.35rem, 2.6vw, 1.8rem); line-height: 1.3; margin-top: 16px; color: var(--ink); }
.byline { margin-top: 30px; font-family: var(--ui); font-size: 0.95rem; color: var(--ink); gap: 14px; }
.byline strong { font-family: var(--display); font-size: 1.2rem; font-weight: 600; display: block; line-height: 1.2; }
.byline .affil { display: block; color: var(--ink-soft); font-size: 0.88rem; letter-spacing: 0.01em; }
.avatar { width: 46px; height: 46px; border: 0; box-shadow: 0 0 0 1px var(--rule); }
.abstract { margin-top: 34px; padding: 22px 0 6px; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule); max-width: 72ch; }
.abstract-label { font-family: var(--ui); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink); margin: 0 0 8px; }
.abstract .lede { max-width: none; margin: 0 0 14px; color: var(--ink); font-size: 1.06rem; text-align: justify; hyphens: auto; }
.keywords { font-family: var(--ui); font-size: 0.88rem; color: var(--ink-soft); margin: 0 0 14px; }
.keywords span { font-weight: 600; color: var(--ink); margin-right: 6px; font-style: normal; }

/* Numbered sections */
main { counter-reset: sec; }
main > section { border-top: 1px solid var(--rule); padding-block: 56px; }
main > section:first-of-type { border-top: 0; }
h2 { font-family: var(--display); font-weight: 500; font-size: clamp(1.9rem, 3.4vw, 2.5rem); line-height: 1.1; letter-spacing: -0.005em; margin-bottom: 20px; }
main > section h2::before { counter-increment: sec; content: counter(sec) "."; display: inline-block; min-width: 1.6em;
  color: var(--accent); font-feature-settings: "lnum"; }
h3 { font-family: var(--display); font-weight: 600; font-size: 1.3rem; letter-spacing: 0; }
.prose p, .block-row p, .shift p, details p { hyphens: auto; }

/* Figure: mode switch, dimension filters, canvas, caption */
.modes { border-radius: 0; border-color: var(--rule-strong); }
.modes button { font: 500 0.82rem/1 var(--ui); letter-spacing: 0.1em; text-transform: uppercase; padding: 12px 18px; }
.modes button[aria-pressed="true"] { background: var(--accent); color: var(--paper); }
.filters { gap: 0 22px; border-bottom: 1px solid var(--rule); margin-bottom: 18px; }
.filters button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 10px 0 9px;
  font: 500 0.95rem/1 var(--ui); color: var(--ink-soft); margin-bottom: -1px; }
.filters button[aria-pressed="true"] { background: none; color: var(--ink); border-bottom-color: var(--accent); }
.filters button .dot { width: 8px; height: 8px; }
.canvas { font-family: var(--ui); border-width: 1.5px; box-shadow: 0 1px 0 var(--rule), 0 18px 40px -28px rgba(14, 31, 61, 0.35); }
.col, .col.split > .blk + .blk, .bottom, .bottom .blk, .bottom .blk:nth-child(odd) { border-width: 1.5px; }
.blk-name { font-family: var(--ui); font-weight: 600; font-size: 0.98rem; letter-spacing: 0.01em; }
.bottom .blk .blk-name { font-weight: 600; }
.layer { font-size: 0.72rem; letter-spacing: 0.14em; border-top: 1px dotted var(--rule); }
.layer::before { width: 3px; border-radius: 0; }
.caption { font-family: var(--ui); font-size: 0.9rem; color: var(--ink-soft); margin: 12px 0 0; max-width: 80ch; }
.caption .fig { font-weight: 600; color: var(--ink); margin-right: 4px; }
p.caption:not(.canvas-note) { margin: 0 0 10px; }
.downloads { font-size: 0.9rem; }

/* What it changes */
.shifts { border-top: 1px solid var(--rule-strong); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.shift { padding: 22px 22px 24px 0; border-bottom: 0; }
.shift .from { font-family: var(--ui); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; }
.shift h3 { font-size: 1.35rem; }
.shift p { font-size: 0.97rem; color: var(--ink); }

/* Blocks as a glossary */
.blocks { border-top: 1px solid var(--rule-strong); }
.block-row { padding: 22px 0; gap: 32px; }
.block-row h3 { font-size: 1.4rem; }
.block-row .fr { font-family: var(--display); font-style: italic; font-size: 1rem; color: var(--ink-soft); }
.block-row .q { font-family: var(--display); font-size: 1.12rem; color: var(--ink-soft); }
.chip { border: 0; padding: 0 0 0 14px; position: relative; font-size: 0.72rem; letter-spacing: 0.14em; }
.chip::before { content: ""; position: absolute; left: 0; top: 50%; width: 7px; height: 7px; margin-top: -4px; border-radius: 50%; background: currentColor; }
.chips { gap: 14px; }
.block-row:target { background: linear-gradient(90deg, var(--accent-soft), transparent 80%); }

/* Table 1 */
.balance { border: 0; border-top: 1.5px solid var(--rule-strong); border-bottom: 1.5px solid var(--rule-strong); background: transparent; margin-top: 4px; }
.balance div:nth-child(odd) { border-right: 1px solid var(--rule); }
.balance .head { font-family: var(--ui); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  border-bottom: 1px solid var(--rule-strong); }
.balance div { font-family: var(--body); }

/* Author */
.portrait { border-radius: 0; filter: saturate(0.92); }
.facts { border-top: 1px solid var(--rule-strong); }
.facts dt { font-size: 0.72rem; letter-spacing: 0.16em; }

/* References and citation */
.refs { margin: 0; padding: 0; list-style: none; counter-reset: ref; display: grid; gap: 12px; font-size: 0.98rem; }
.refs li { padding-left: 2.2em; text-indent: -2.2em; overflow-wrap: anywhere; }
.refs li::before { counter-increment: ref; content: "[" counter(ref) "]"; display: inline-block; width: 2.2em; text-indent: 0;
  color: var(--accent); font-family: var(--ui); font-size: 0.9rem; }
.cite-box { border: 1px solid var(--rule); border-left: 3px solid var(--accent); background: var(--surface); padding: 16px 18px; }
.cite-box p { font-family: var(--body); }
.copy, .fill-actions button, .sheet-actions button { border-radius: 0; font-family: var(--ui); letter-spacing: 0.06em; }
.fill-actions button.primary, .sheet-actions .primary { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.fill-name input { border-radius: 0; font-family: var(--body); }

/* Questions */
details:first-of-type { border-top: 1px solid var(--rule-strong); }
summary { font-family: var(--display); font-weight: 500; font-size: 1.3rem; }
summary::after { font-family: var(--display); font-size: 1.4rem; line-height: 1; color: var(--accent); }

/* Footer colophon */
footer { border-top: 3px double var(--rule-strong); font-size: 0.85rem; letter-spacing: 0.02em; }
footer a { color: var(--ink); }

/* ---------- Phones and small tablets ---------- */
@media screen and (max-width: 760px) {
  /* Header: logo and language only; sections are one scroll away */
  .top { padding-block: 14px; }
  .top nav a:not(.lang) { display: none; }
  .eyebrow { letter-spacing: 0.1em; font-size: 0.78rem; }
  h1 { font-size: clamp(2.5rem, 12vw, 3.4rem); }
  .tagline { font-size: 1.45rem; }
  .lede { font-size: 1rem; }
  section { padding-block: 32px; }
  h2 { font-size: 2rem; }

  /* Academic edition on phones */
  .mark-full { display: none; }
  .mark-short { display: inline; }
  .hero { padding-block: 36px 24px; }
  h1 { font-size: clamp(2.3rem, 11vw, 3rem); }
  .tagline { font-size: 1.25rem; }
  .abstract .lede { text-align: left; font-size: 1rem; }
  main > section { padding-block: 40px; }
  h2 { font-size: 1.8rem; }
  .filters { gap: 0 16px; }
  .filters button { font-size: 0.88rem; }
  .blk-name { font-size: 0.68rem; }
  .shift { padding-right: 0; border-bottom: 1px solid var(--rule); }

  /* Canvas keeps its grid: everything scales down to the screen width */
  .canvas-scroll { overflow: visible; }
  .scroll-hint { display: none !important; }
  .canvas, .canvas.fill { min-width: 0; grid-template-columns: 1fr 1fr 1.2fr 1fr 1fr; border-width: 1.5px; }
  .col { min-height: 300px; border-right-width: 1.5px; }
  .canvas.fill .col { min-height: 420px; }
  .col.split > .blk + .blk, .bottom, .bottom .blk { border-top-width: 1.5px; }
  .bottom .blk:nth-child(odd) { border-right-width: 1.5px; }
  .blk { padding: 6px 4px; min-width: 0; }
  .blk-name { font-size: 0.68rem; line-height: 1.12; overflow-wrap: anywhere; hyphens: auto; }
  .layers, .canvas.fill .layers { margin: 6px -4px -6px; }
  .layer { gap: 4px; padding: 4px; min-width: 0; }
  .layer::before { width: 3px; }
  .canvas:not(.fill) .layer { font-size: 0; letter-spacing: 0; }
  .canvas:not(.fill) .layer::after, .canvas.fill .lname::after { font-size: 0.56rem; letter-spacing: 0.04em; }
  .canvas.fill .lname { font-size: 0; letter-spacing: 0; }
  .canvas:not(.fill) .layer.eco::after, .layer.eco .lname::after { content: "Econ."; }
  .canvas:not(.fill) .layer.soc::after, .layer.soc .lname::after { content: "Soc."; }
  .canvas:not(.fill) .layer.env::after, .layer.env .lname::after { content: "Env."; }
  :lang(fr) .canvas:not(.fill) .layer.eco::after, :lang(fr) .layer.eco .lname::after { content: "Éco."; }
  :lang(fr) .canvas:not(.fill) .layer.soc::after, :lang(fr) .layer.soc .lname::after { content: "Soc."; }
  :lang(fr) .canvas:not(.fill) .layer.env::after, :lang(fr) .layer.env .lname::after { content: "Env."; }
  .canvas.fill .layer { padding: 4px 4px 2px; column-gap: 4px; grid-template-columns: 3px minmax(0, 1fr); }
  .bottom .blk { min-height: 46px; padding: 6px; }
  .canvas.fill .bottom .blk { min-height: 64px; }
  .bottom .blk .blk-name { font-size: 0.68rem; }
  .bottom .blk .blk-name::before { width: 7px; height: 7px; margin-right: 4px; }

  /* Fill-in on phones: cells show the notes, tapping one opens the writing panel */
  .field textarea { min-height: 0; padding: 2px; font-size: 0.6rem; line-height: 1.25; background: var(--paper); cursor: pointer; }
  .field textarea::placeholder { color: transparent; }
  .canvas.fill .blk > .field { min-height: 28px; }
  .fill-name { max-width: none; }
  .fill-actions { width: 100%; }
  .fill-actions button { flex: 1 1 auto; padding-block: 13px; }
  .modes { display: flex; width: 100%; }
  .modes button { flex: 1; padding-block: 13px; }

  /* Balance table and citation */
  .balance div { padding: 10px; font-size: 0.9rem; align-items: flex-start; }
  .balance .sw { margin-top: 0.35em; }
  .cite-box .copy { width: 100%; padding-block: 12px; }
}



/* Writing panel (phones, fill-in mode) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 14, 25, 0.45); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--surface); color: var(--ink);
  border-top: 2px solid var(--rule-strong); border-radius: 12px 12px 0 0; display: grid; gap: 10px;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  max-height: 85vh; font-family: var(--ui); }
.sheet-label { font: 600 1.2rem/1.15 var(--display); margin: 0; display: flex; align-items: center; gap: 8px; }
.sheet-label .sw { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sheet-q { margin: 0; font-style: italic; color: var(--ink-soft); font-size: 0.92rem; }
.sheet textarea { width: 100%; min-height: 34vh; resize: none; border: 1px solid var(--rule-strong); border-radius: 6px; padding: 10px;
  font: 400 1rem/1.45 var(--ui); background: var(--paper); color: var(--ink); }
.sheet textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.sheet-actions { display: flex; gap: 8px; }
.sheet-actions button { flex: 1; font: 500 1rem/1 var(--ui); padding: 14px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); }
.sheet-actions .primary { background: var(--ink); color: var(--paper); }
@media print { .sheet, .sheet-backdrop { display: none !important; } }
