/* Re-skins the /thesis write-up to the v3 identity. Loaded after the page's own <style>.
   Content, data and charts are unchanged; this file only changes how they look and read. */
:root, :root.light {
  --bg: #F4F5F2; --bg2: #E9EBE6; --line: #CBD0D6;
  --text: #14263D; --muted: #566273; --accent: #14263D; --accent2: #566273; --white: #14263D;
  --neg: #B3261E; --c-grey: #7B8694; --band: rgba(20, 38, 61, .07); --hover: rgba(242, 185, 55, .22);
}
:root[data-theme="dark"] {
  --bg: #0F1D2E; --bg2: #13243A; --line: #2A3A50;
  --text: #E8ECEF; --muted: #9EAABA; --accent: #F2B937; --accent2: #C9D1DA; --white: #E8ECEF;
  --neg: #FF8A7A; --c-grey: #8B97A6; --band: rgba(232, 236, 239, .07); --hover: rgba(242, 185, 55, .14);
}
body { font-family: "Archivo", "Helvetica Neue", Arial, sans-serif; font-weight: 400; font-size: var(--fs-text); line-height: 1.6; overflow-x: clip; }
body::before { display: none; }
body, body * { cursor: auto; }
a, button, summary, th.sortable, input[type=range] { cursor: pointer; }
.progress-bar { background: var(--parma); height: 3px; z-index: 30; }
.top nav { position: static; inset: auto; z-index: auto; padding: 0; border: 0; background: none; backdrop-filter: none; }

/* header */
.thesis-title h1 { font-size: clamp(2.4rem, .6rem + 4.4vw, 5.5rem); max-width: 12.5em; }
.thesis-title .sub { grid-column: 1 / span 6; font-size: 1.25rem; }
.t-meta { grid-column: 8 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3) var(--gap); font-size: var(--fs-small); line-height: 1.35; }
.t-meta dt { color: var(--hero-fg-2); font-size: var(--fs-micro); }
.t-meta dd { font-weight: 650; }

/* layout: contents rail + reading column */
.article { padding: var(--s7) 0 var(--s6); }
.thesis-grid { align-items: start; }
.t-body { grid-column: 4 / span 6; min-width: 0; }
.toc ol { list-style: none; margin: 0 0 var(--s4); padding: 0; }
.toc li { border-top: 1px solid var(--line); }
.toc li a { display: block; padding: 9px 0; text-decoration: none; color: var(--fg-2); line-height: 1.3; }
.toc li a .num { display: inline-block; width: 1.9em; }
.toc li a:hover { color: var(--fg); }
.toc li a[aria-current="true"] { color: var(--fg); font-weight: 700; box-shadow: inset 3px 0 0 var(--parma); padding-left: 10px; }

/* the write-up itself */
.article section { padding: var(--s6) 0; border-bottom: 1px solid var(--line); }
.article section:first-child { padding-top: 0; }
.article section:first-child p { font-size: 1.25rem; line-height: 1.5; color: var(--text); }
.sec-num { font-size: var(--fs-small); letter-spacing: 0; text-transform: none; color: var(--fg-2); font-variant-numeric: tabular-nums; margin-bottom: var(--s2); }
.article h2 { font-family: inherit; font-size: clamp(2rem, 1.2rem + 2.2vw, 3.25rem); line-height: 1; letter-spacing: -.014em; font-weight: 740; font-variation-settings: "wdth" 76; color: var(--text); margin-bottom: var(--s4); }
.article h3 { font-family: inherit; font-size: 1.375rem; font-weight: 700; font-variation-settings: "wdth" 88; color: var(--text); margin: var(--s5) 0 var(--s3); }
.article p, .article li { color: var(--text); font-size: var(--fs-text); line-height: 1.62; margin-bottom: 1em; }
.article p strong, .article li strong { font-weight: 700; }
.article li { padding-left: 1.2em; }
.article li::before { content: "–"; left: 0; color: var(--fg-2); }
blockquote { font-family: inherit; font-style: normal; font-weight: 300; font-variation-settings: "wdth" 70; font-size: clamp(1.6rem, 1.1rem + 1.4vw, 2.25rem); line-height: 1.15; color: var(--text); border-left: 3px solid var(--parma); padding-left: var(--s4); }
.formula { font-family: inherit; font-size: 1rem; background: var(--bg2); border: 0; border-left: 3px solid var(--line); }
.formula .note { font-size: var(--fs-micro); letter-spacing: 0; color: var(--fg-2); }
.stats { background: transparent; border: 0; border-top: 2px solid var(--text); gap: 0 var(--s4); }
.stat { background: transparent; padding: var(--s3) 0 0; }
.stat-number { font-family: inherit; font-size: clamp(2rem, 1.4rem + 1.6vw, 2.75rem); font-weight: 720; font-variation-settings: "wdth" 70; color: var(--text); letter-spacing: -.01em; }
.stat-label { font-size: var(--fs-micro); letter-spacing: 0; text-transform: none; color: var(--fg-2); }
.chart-legend { font-size: var(--fs-micro); letter-spacing: 0; text-transform: none; color: var(--fg-2); }
.chart .tk, .chart .ann { font-family: "Archivo", sans-serif; font-size: 11px; }
.chart .s-gold { stroke: var(--accent); }
.chart .area { fill: var(--parma); opacity: .35; }
.tip { font-family: inherit; font-size: var(--fs-micro); }
.tip .t { letter-spacing: 0; text-transform: none; font-size: .75rem; }
.panel-title { font-size: var(--fs-micro); letter-spacing: 0; text-transform: none; white-space: normal; }
figcaption { font-size: var(--fs-small); letter-spacing: 0; line-height: 1.5; color: var(--fg-2); }
figcaption span { color: var(--text); font-weight: 650; }
.table-wrap { border: 0; border-top: 2px solid var(--text); }
table { font-size: .9375rem; }
th { font-size: var(--fs-micro); letter-spacing: 0; text-transform: none; color: var(--fg-2); font-weight: 650; background: transparent; }
td.hl { color: var(--text); font-weight: 700; }
tr.key td { background: var(--hover); }
.table-hint, .widget-note { font-size: var(--fs-micro); letter-spacing: 0; color: var(--fg-2); }
.widget { background: var(--bg2); border: 0; border-top: 2px solid var(--text); }
.widget-title, .widget label, .readout .k { font-size: var(--fs-micro); letter-spacing: 0; text-transform: none; font-weight: 650; color: var(--fg-2); }
.seg button { font-family: inherit; font-size: .9375rem; color: var(--text); border-color: var(--line); border-radius: 2px; }
.seg button:hover { border-color: var(--text); color: var(--text); }
.seg button.active { background: var(--parma); border-color: var(--parma); color: #14263D; }
.readout { background: var(--line); border: 0; }
.readout .v { font-family: inherit; font-weight: 720; font-variation-settings: "wdth" 70; font-size: 2rem; color: var(--text); }
input[type=range] { accent-color: var(--parma); }
.cta { font-size: 1.0625rem; letter-spacing: 0; text-transform: none; color: var(--text); border: 0; padding: 0; text-decoration: underline; text-underline-offset: .2em; font-weight: 700; }
.cta:hover { color: var(--text); text-decoration-thickness: 2px; }
.closing { font-family: inherit; font-style: normal; font-weight: 250; font-variation-settings: "wdth" 62; font-size: clamp(2.5rem, 1.2rem + 3.6vw, 5rem); line-height: .95; letter-spacing: -.02em; color: var(--text); margin: var(--s6) 0 0; }
.reveal { opacity: 1; transform: none; transition: none; }
.article .chart { margin-top: 0; }

/* "The results in one minute" */
.article section.glance { padding: var(--s5) 0 var(--s6); }
.glance h2 { font-size: clamp(1.75rem, 1.2rem + 1.4vw, 2.5rem) !important; }
.glance-list { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--gap); border-top: 2px solid var(--text); }
.glance-list li { padding: 0; margin: 0; border-bottom: 1px solid var(--line); }
.glance-list li::before { content: none; }
.glance-list a { display: block; padding: var(--s4) 0; text-decoration: none; }
.glance-list a:hover .g-txt { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.g-fig { display: block; font-size: clamp(2.25rem, 1.6rem + 1.6vw, 3.25rem); line-height: 1; font-weight: 720; font-variation-settings: "wdth" 68; letter-spacing: -.02em; color: var(--text); }
.g-fig.neg { color: var(--neg); }
.g-txt { display: block; margin-top: var(--s2); font-size: 1rem; line-height: 1.5; color: var(--text); max-width: 26em; }
.glance details.terms { margin-top: var(--s4); }
.glance details.terms dl { grid-template-columns: 1fr; gap: 2px; }
.glance details.terms dd { margin-bottom: var(--s3); font-size: 1rem; }

@media (max-width: 1100px) {
  .t-body { grid-column: 4 / -1; }
}
@media (max-width: 860px) {
  .thesis-title .sub, .t-meta { grid-column: 1 / -1; }
  .t-meta { margin-top: var(--s4); }
  .t-body { grid-column: 1 / -1; grid-row: 2; }
  .toc { grid-row: 1; margin: 0 0 var(--s5); }
  .toc .name { display: block; }
  .article { padding-top: var(--s5); }
  .glance-list { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .article h2 { font-size: 2.125rem; }
}
/* the page's own `nav { position: fixed }` and article list styles must not reach the contents rail */
nav.toc { position: sticky; left: auto; right: auto; bottom: auto; top: var(--s4); z-index: 1; display: block; padding: 0 var(--s3) 0 0; border: 0; background: none; backdrop-filter: none; }
.article .toc li { padding: 0; margin: 0; font-size: var(--fs-small); line-height: 1.3; }
.article .toc li::before { content: none; }
.article .toc p { font-size: var(--fs-small); }
@media (max-width: 860px) { nav.toc { position: static; padding-right: 0; } }
.lang-note { margin: var(--s3) 0 0; font-weight: 650; }
.lang-note:empty { display: none; }
