/* ==========================================================================
   Romain Fernex, personal website
   White page, dark blue accent, cool greys, one warm accent used sparingly
   ========================================================================== */

:root {
  color-scheme: light;
  /* Technical palette: white, neutral greys, near-black, one electric-blue accent.
     --blue / --warm keep their names so older rules pick up the new palette;
     --warm is now a neutral graphite used as the second series colour. */
  --paper: #ffffff;
  --ink: #0d0e10;
  --text: #1b1c1f;
  --muted: #5f636b;
  --faint: #9a9ea6;
  --line: #e3e5e8;
  --rule: #0d0e10;
  --soft: #f4f5f6;
  --tint: #eceef1;
  --blue: #1f3fff;
  --blue-mid: #4d66ff;
  --warm: #3a3d44;
  --warm-tint: #eceef1;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 0;
  --shadow: none;
  --shadow-hover: none;
}

/* --- Base typography ---------------------------------------------------- */
body { line-height: 1.7; color: var(--text); -webkit-font-smoothing: antialiased; }
p { max-width: 74ch; }
a { text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { color: var(--blue-mid); }
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -.012em; line-height: 1.2; }
h2 { margin-top: 3rem; margin-bottom: 1rem; font-size: 1.75rem; border-bottom: 0 !important; padding-bottom: 0 !important; }
h3 { font-size: 1.3rem; margin-top: 2rem; }
strong { color: var(--ink); font-weight: 600; }
::selection { background: #cfdcee; color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue-mid); outline-offset: 3px; border-radius: 2px; }

/* Short accent bar above section titles in long pages */
main.content > section.level2 > h2::before,
main.content > h2::before {
  content: ""; display: block; width: 2.4rem; height: 3px;
  background: var(--blue); border-radius: 2px; margin-bottom: .85rem;
}

/* --- Navbar ------------------------------------------------------------- */
.navbar {
  background: rgba(255, 255, 255, .96) !important;
  border-bottom: 1px solid var(--line);
  padding: .7rem 0;
  backdrop-filter: saturate(1.4) blur(6px);
}
.navbar-title { font-family: "Source Serif 4", Georgia, serif; font-weight: 700; font-size: 1.22rem; color: var(--ink) !important; }
.navbar-nav { font-size: .88rem; font-weight: 500; }
.navbar .nav-link { white-space: nowrap; }
.navbar .nav-link { color: #3b4554 !important; }
.navbar .nav-link:hover { color: var(--blue) !important; }
.navbar .nav-link.active { color: var(--blue) !important; box-shadow: inset 0 -2px 0 var(--blue); }
.navbar a.nav-link[href$="CV_Romain_Fernex.pdf"] {
  border: 1px solid var(--blue); border-radius: 999px; color: var(--blue) !important;
  padding: .28rem .9rem !important; margin: .2rem .4rem; line-height: 1.4;
}
.navbar a.nav-link[href$="CV_Romain_Fernex.pdf"]:hover { background: var(--blue); color: #fff !important; }
#quarto-content { padding-top: .5rem; }

/* --- Title banner on inner pages --------------------------------------- */
.quarto-title-banner {
  background: linear-gradient(180deg, #f3f6fa 0%, #f8fafc 100%) !important;
  border-bottom: 1px solid var(--line);
  padding: 2.6rem 0 2.2rem !important;
  margin-bottom: 1.5rem !important;
}
.quarto-title-banner .title { font-size: clamp(2rem, 4.2vw, 2.9rem); color: var(--ink); max-width: 26ch; }
.quarto-title-banner .subtitle, .quarto-title .subtitle { font-size: 1.12rem; color: var(--muted); max-width: 62ch; margin-top: .6rem; }

/* --- Table of contents and footer -------------------------------------- */
#TOC { font-size: .84rem; }
#TOC .nav-link.active { color: var(--blue); border-left-color: var(--blue); }
.nav-footer { border-top: 1px solid var(--line); margin-top: 4.5rem; font-size: .85rem; }
.nav-footer a { color: var(--muted); }
.nav-footer a:hover { color: var(--blue); }

/* --- Small building blocks --------------------------------------------- */
.eyebrow {
  display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .14em;
  font-weight: 600; color: var(--blue-mid); margin-bottom: .55rem;
}
.chip {
  display: inline-block; font-size: .78rem; font-weight: 500; color: var(--blue);
  background: var(--tint); border-radius: 999px; padding: .22rem .75rem; margin: 0 .3rem .45rem 0;
}
a.btn-cta, a.btn-ghost {
  display: inline-flex; align-items: center; gap: .4rem; font-size: .92rem; font-weight: 600;
  border-radius: 8px; padding: .62rem 1.15rem; text-decoration: none; transition: all .15s ease;
}
a.btn-cta { background: var(--blue); color: #fff; border: 1px solid var(--blue); }
a.btn-cta:hover { background: #173a64; color: #fff; transform: translateY(-1px); }
a.btn-ghost { background: #fff; color: var(--blue); border: 1px solid #c9d4e3; }
a.btn-ghost:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); }
.btn-row p { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.6rem 0 0; max-width: none; }

.meta { display: flex; flex-wrap: wrap; gap: .4rem .5rem; color: var(--muted); font-size: .8rem; margin: .7rem 0 1.4rem; }
.meta span { background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: .12rem .55rem; }
.meta .grade { background: var(--tint); border-color: #d3deeb; color: var(--blue); font-weight: 600; }
.paper-by { display: block; color: var(--muted); font-size: .88rem; font-style: italic; margin-top: -.3rem; }

.note {
  background: var(--soft); border: 1px solid var(--line); border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 1.1rem 1.35rem; font-size: .95rem; margin: 1.8rem 0;
}
.source-note { font-size: .84rem; color: var(--muted); margin-top: 1.2rem; }
.table { font-size: .92rem; }
.table > thead { border-bottom: 2px solid var(--blue); }

.center-cta p { display: flex; justify-content: center; max-width: none; margin: 2.8rem 0 1rem; }

/* --- Regression tables (thesis page) and appendix tables ------------- */
.table-scroll { overflow-x: auto; margin: 1.6rem 0 .4rem; -webkit-overflow-scrolling: touch; }
table.reg-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
table.reg-table caption { caption-side: top; text-align: left; font-weight: 600; font-size: .9rem; color: var(--ink); padding: 0 0 .55rem; }
table.reg-table th { font-weight: 600; color: var(--ink); text-align: center; padding: .5rem .55rem; border-bottom: 1px solid var(--line); vertical-align: bottom; }
table.reg-table thead tr:last-child th { border-bottom: 1.5px solid var(--blue); }
table.reg-table td { text-align: center; padding: .45rem .55rem; vertical-align: top; line-height: 1.35; }
table.reg-table td:first-child { text-align: left; color: var(--ink); font-weight: 500; }
table.reg-table tbody tr:nth-child(odd):not(.stats):not(.derived) { background: #fafbfc; }
table.reg-table .se { font-size: .78rem; color: var(--muted); }
table.reg-table sup { color: var(--blue); font-weight: 600; }
table.reg-table .th-sub { font-size: .74rem; font-weight: 400; color: var(--muted); }
table.reg-table tr.derived td { border-top: 1px dashed #cfd6e0; color: var(--blue); font-weight: 600; }
table.reg-table tr.derived td:first-child { color: var(--ink); font-weight: 500; }
table.reg-table tr.stats td { font-size: .8rem; color: var(--muted); }
table.reg-table tr.stats:first-of-type td, table.reg-table tr.derived + tr.stats td { border-top: 1px solid var(--line); }
.table-note { font-size: .8rem; color: var(--muted); line-height: 1.55; margin: .4rem 0 1.6rem; max-width: none; }

.appendix-page main table { display: block; overflow-x: auto; max-width: 100%; margin: 1.6rem auto .6rem; border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.appendix-page main table caption { caption-side: top; text-align: left; font-weight: 600; font-size: .88rem; color: var(--ink); padding: 0 0 .5rem; }
.appendix-page main table th { padding: .45rem .6rem; border-bottom: 1.5px solid var(--blue); color: var(--ink); vertical-align: bottom; }
.appendix-page main table td { padding: .28rem .6rem; border: 0; }
.appendix-page main table tbody tr:nth-child(odd) { background: #fafbfc; }
.appendix-page main table code { font-size: .78rem; background: transparent; padding: 0; }
.appendix-page main h2 { margin-top: 3.6rem; }
.appendix-page main h4 { font-size: 1.05rem; margin-top: 1.8rem; }
.appendix-page main p:has(> em:first-child) { font-size: .82rem; color: var(--muted); }
.appendix-page main .quarto-figure img { border: 1px solid var(--line); border-radius: 8px; }

/* --- Beyond economics page --------------------------------------------- */
.meta .lang { background: var(--warm-tint); border-color: #ecd9c2; color: #8a541f; font-weight: 600; }
/* Featured dossier */
.featured-work {
  position: relative; display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 1.9rem; align-items: center;
  margin: 1.6rem 0 2.8rem; padding: 1.7rem 1.8rem; border: 1px solid #304860; border-radius: var(--radius);
  background: linear-gradient(135deg, #172b43 0%, #243f58 100%); color: #e1e8ef; box-shadow: var(--shadow);
}
.featured-work::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 4px; background: #e2b778; border-radius: var(--radius) 0 0 var(--radius); }
.featured-cover { display: block; position: relative; border-radius: 4px; }
.featured-cover-surface {
  display: block; position: relative; overflow: hidden; border-radius: inherit;
  transform: perspective(850px) rotateX(0deg) rotateY(0deg);
  box-shadow: 0 2px 6px rgba(23, 34, 52, .12), 0 16px 34px rgba(23, 34, 52, .2);
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .3s ease;
}
.featured-cover-surface::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(ellipse at var(--light-x, 50%) var(--light-y, 50%), rgba(255, 244, 220, .24), rgba(255, 255, 255, .06) 40%, transparent 72%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
  opacity: 0; transition: opacity .3s ease;
}
.featured-cover img { display: block; width: 100%; height: auto; transition: filter .2s ease; }
@media (hover: hover) and (pointer: fine) {
  .featured-cover:hover img { filter: brightness(1.3); }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .featured-cover.is-tilting .featured-cover-surface {
    transform: perspective(850px) translateY(-3px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) scale(1.02);
    box-shadow: var(--shadow-x, 0px) 22px 40px rgba(8, 18, 30, .4);
    transition-duration: .12s, .3s;
  }
  .featured-cover.is-tilting .featured-cover-surface::after { opacity: 1; }
}
.featured-body .eyebrow { margin-bottom: .4rem; color: #e2b778; }
.featured-body h3 { margin: 0; font-size: 1.45rem; line-height: 1.28; }
.featured-body h3 a { color: #fff; text-decoration: none; }
.featured-body h3 a:hover { color: #f2d5ac; }
.featured-body .meta { margin: .8rem 0 .9rem; }
.featured-body .meta span { background: #304960; border-color: #50667c; color: #e1e8ef; }
.featured-body .meta .lang { background: #e2b778; border-color: #e2b778; color: #172b43; }
.featured-body p { font-size: .97rem; margin-bottom: 0; }
.featured-body .featured-actions { margin-top: 1.2rem; }
.featured-body a.btn-cta { background: #e2b778; border-color: #e2b778; color: #172b43; }
.featured-body a.btn-cta:hover { background: #f2d5ac; border-color: #f2d5ac; color: #172b43; }
.featured-work :focus-visible { outline-color: #f2d5ac; }

/* Portrait reader: a strip of figures, then the selected portrait's pages */
.pr { margin: 1.4rem 0 2.8rem; scroll-margin-top: 5.5rem; }
.pr-shelf { position: relative; }
.pr-strip { list-style: none; display: flex; gap: .85rem; margin: 0; padding: .45rem .25rem 1rem; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; }
.pr:not(.is-ready) .pr-strip { flex-wrap: wrap; overflow: visible; }
.pr-strip li { flex: 0 0 auto; margin: 0; padding: 0; scroll-snap-align: center; }
.pr-tile { display: block; width: 104px; color: var(--text); text-decoration: none; }
.pr-tile:hover { color: var(--text); }
.pr-thumb { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--warm-tint); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.pr-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(.45); opacity: .9; transition: filter .2s ease, opacity .2s ease; }
.pr-thumb-text { display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--warm-tint), #efdcc4); }
.pr-thumb-text span { writing-mode: vertical-rl; font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; font-size: 1.35rem; letter-spacing: .14em; color: #8a541f; }
.pr-tile:hover .pr-thumb { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.pr-tile:hover .pr-thumb img, .pr-tile[aria-current] .pr-thumb img { filter: none; opacity: 1; }
.pr-tile[aria-current] .pr-thumb { border-color: var(--warm); box-shadow: 0 0 0 2px var(--warm), var(--shadow); }
.pr-label { display: block; margin-top: .5rem; line-height: 1.25; }
.pr-tile-year { display: block; font-size: .66rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--warm); }
.pr-tile-name { display: block; font-size: .84rem; font-weight: 500; color: var(--ink); }
.pr-tile[aria-current] .pr-tile-name { font-weight: 700; }
.pr-arrow {
  position: absolute; top: 48px; z-index: 2; display: flex; align-items: center; justify-content: center;
  width: 2.3rem; height: 2.3rem; padding: 0 0 .15rem; border: 1px solid var(--line); border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-hover); color: var(--ink); font-size: 1.45rem; line-height: 1; cursor: pointer;
}
.pr-arrow:hover { border-color: var(--blue); color: var(--blue); }
.pr-arrow[hidden] { display: none; }
.pr-arrow-left { left: -.75rem; }
.pr-arrow-right { right: -.75rem; }

.pr:not(.is-ready) .pr-viewer { display: none; }
.pr-viewer { margin-top: .5rem; overflow: hidden; border: 1px solid var(--line); border-top: 3px solid var(--warm); border-radius: 0 0 var(--radius) var(--radius); background: #fff; box-shadow: var(--shadow); }
.pr-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .9rem 1.4rem; padding: 1.1rem 1.3rem 1rem; border-bottom: 1px solid #304860; background: linear-gradient(135deg, #172b43 0%, #243f58 100%); color: #e1e8ef; }
.pr-heading { flex: 1 1 320px; min-width: 0; }
.pr-kicker { display: flex; flex-wrap: wrap; align-items: center; margin: 0 0 .3rem; font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #e2b778; }
.pr-kicker > span + span::before { content: "·"; margin: 0 .5rem; color: #e1e8ef; }
.pr-title { color: #fff; margin: 0 0 .3rem; font-size: 1.38rem; }
.pr-kanji { white-space: nowrap; margin-left: .3rem; font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; font-size: 1.05rem; font-weight: 400; letter-spacing: .08em; color: #e1e8ef; }
.pr-desc { margin: 0; font-size: .92rem; line-height: 1.55; color: #e1e8ef; }
.pr-tools { display: flex; flex: 0 0 auto; align-items: center; gap: .35rem; }
.pr-tools button, .pr-open {
  display: inline-flex; align-items: center; justify-content: center; height: 2.15rem; min-width: 2.15rem; padding: 0 .55rem;
  border: 1px solid #71879c; border-radius: 7px; background: #304960; color: #fff; font-size: .95rem; line-height: 1;
  white-space: nowrap; text-decoration: none; cursor: pointer; transition: border-color .15s ease, color .15s ease;
}
.pr-tools button:hover:not(:disabled), .pr-open:hover { border-color: #f2d5ac; background: #405d77; color: #fff; }
.pr-tools button:disabled { opacity: .45; cursor: default; }
.pr-tools .pr-zoom { min-width: 3.3rem; font-size: .78rem; font-variant-numeric: tabular-nums; }
.pr-tools .pr-open { margin-left: .2rem; font-size: .84rem; font-weight: 600; background: #e2b778; border-color: #e2b778; color: #172b43; }
.pr-sep { width: 1px; height: 1.4rem; margin: 0 .2rem; background: #71879c; }
.pr-tools .pr-open:hover { background: #f2d5ac; border-color: #f2d5ac; color: #172b43; }
.pr-head :focus-visible { outline-color: #f2d5ac; }
.pr-pages { height: clamp(420px, 80vh, 1050px); overflow: auto; padding: 1.1rem; background: var(--soft); }
.pr-pages:focus-visible { outline-offset: -3px; }
.pr-sheet { width: min(100%, 860px); aspect-ratio: 595 / 842; margin: 0 auto 1rem; background: #fff; box-shadow: 0 1px 3px rgba(23, 34, 52, .08), 0 8px 22px rgba(23, 34, 52, .08); }
.pr-sheet:last-child { margin-bottom: 0; }
.pr-sheet canvas { display: block; width: 100%; height: 100%; }
.pr-sheet.is-loading { background: linear-gradient(100deg, #fff 30%, #eef1f6 50%, #fff 70%); background-size: 200% 100%; animation: pr-shimmer 1.3s linear infinite; }
@keyframes pr-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.pr-message { max-width: none; margin: 0; padding: 3rem 1rem; text-align: center; color: var(--muted); }
@media (max-width: 640px) {
  .featured-work { grid-template-columns: 1fr; gap: 1.3rem; padding: 1.3rem 1.2rem; }
  .featured-cover { width: min(190px, 62%); margin: 0 auto; }
  .featured-body h3 { font-size: 1.25rem; }
  .pr-tile { width: 88px; }
  .pr-arrow { display: none !important; }
  .pr-head { padding: 1rem; }
  .pr-tools { width: 100%; }
  .pr-tools .pr-open { margin-left: auto; }
  .pr-pages { height: 72vh; padding: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .pr-sheet.is-loading { animation: none; }
}

/* --- Home page ---------------------------------------------------------- */
.hero-band {
  margin-top: -9px !important;
  background:
    radial-gradient(1200px 380px at 85% -10%, rgba(58, 103, 159, .10), transparent 60%),
    linear-gradient(180deg, #f3f6fa 0%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
  margin-top: 0; margin-bottom: 3rem;
}
body:has(.hero-band) #quarto-content { padding-top: 0 !important; }
body:has(.hero-band) main.content { margin-top: 0 !important; padding-top: 0 !important; }
.hero-inner {
  max-width: 1080px; margin: 0 auto; padding: 3.6rem 1.5rem 3.4rem;
  display: grid; grid-template-columns: 168px 1fr; gap: 2.8rem; align-items: center;
}
.hero-photo img {
  display: block; width: 168px; height: 202px; object-fit: cover; object-position: center 30%;
  border-radius: 12px; box-shadow: var(--shadow); border: 3px solid #fff;
}
.hero-text h1 { font-size: clamp(2.5rem, 5.4vw, 3.8rem); margin: .1rem 0 .9rem; line-height: 1.04; }
.hero-text .intro p { font-size: 1.22rem; line-height: 1.55; color: var(--ink); margin-bottom: .7rem; }
.hero-text > p { color: var(--muted); }

.home-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 2.5rem; align-items: start; margin-bottom: 1rem; }
.home-grid h2 { margin-top: 0; }
.home-grid h2::before { display: none !important; }
.glance {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.4rem 1.5rem;
}
.glance h3 { margin: 0 0 .9rem; font-size: 1.1rem; }
.glance dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .55rem 1rem; font-size: .9rem; }
.glance dt { color: var(--muted); font-weight: 500; }
.glance dd { margin: 0; color: var(--ink); }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 3.2rem 0 1.2rem; }
.section-head h2 { margin: 0; }
.section-head h2::before { display: none !important; }
.section-head p { margin: 0; font-size: .9rem; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.work-card {
  position: relative; display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.4rem 1.4rem 1.2rem; transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.work-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  border-radius: var(--radius) var(--radius) 0 0; background: var(--blue);
}
.work-card.warm::before { background: var(--warm); }
.work-card.mid::before { background: var(--blue-mid); }
.work-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: #d3deeb; }
.work-card h3 { font-size: 1.18rem; margin: .1rem 0 .5rem; }
.work-card h3 a { color: var(--ink); text-decoration: none; }
/* Only the title link covers the card. Quarto adds an anchor link to every heading,
   which must not be stretched over the card or it swallows the click. */
.work-card h3 a:not(.anchorjs-link)::after { content: ""; position: absolute; inset: 0; }
.work-card h3 .anchorjs-link { display: none; }
.work-card p { font-size: .92rem; color: var(--muted); margin-bottom: .6rem; }
.work-card .meta { margin: .2rem 0 .7rem; }
.work-card .card-more { margin-top: auto; font-size: .87rem; font-weight: 600; color: var(--blue); }

.cta-band {
  margin-top: 3.5rem; background: var(--blue); color: #e8eef7; border-radius: 14px;
  padding: 2rem 2.2rem; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.cta-band h2 { color: #fff; margin: 0 0 .3rem; font-size: 1.45rem; }
.cta-band h2::before { display: none !important; }
.cta-band p { margin: 0; color: #d5e0ee; }
.cta-band a.btn-ghost { border-color: #fff; }
.cta-band .btn-row p { margin: 0; }

/* --- Coursework and project lists -------------------------------------- */
.work-entry {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.35rem 1.5rem 1.1rem; margin: 0 0 1.1rem; transition: box-shadow .18s ease, border-color .18s ease;
}
.work-entry:hover { box-shadow: var(--shadow-hover); border-color: #d3deeb; }
.work-entry h3 { margin: .1rem 0 .3rem; max-width: 48ch; font-size: 1.28rem; }
.work-entry h3 a { color: var(--ink); text-decoration: none; }
.work-entry h3 a:hover { color: var(--blue); }
.work-entry .meta { margin: .45rem 0 .8rem; }
.work-entry p { margin-bottom: .6rem; font-size: .97rem; }
.work-entry p:last-child a { font-weight: 600; font-size: .9rem; }

/* --- Research timeline -------------------------------------------------- */
.timeline { position: relative; margin: 1rem 0 2rem; padding-left: 2rem; }
.timeline::before { content: ""; position: absolute; left: 6px; top: .6rem; bottom: .6rem; width: 2px; background: var(--line); }
.role {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.4rem 1.6rem 1.1rem; margin: 0 0 1.6rem;
}
.role::before {
  content: ""; position: absolute; left: calc(-2rem + 1px); top: 1.7rem; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; border: 3px solid var(--blue);
}
.role h2 { margin: .1rem 0 .3rem; font-size: 1.45rem; }
.role h2::before { display: none !important; }
.role p { margin: .35rem 0; }
.role ul { margin: .8rem 0 .9rem; padding-left: 1.15rem; }
.role li { margin-bottom: .35rem; }
.role li::marker { color: var(--blue-mid); }
.role .chips p { margin: .4rem 0 0; }

/* --- Contact page ------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 1.6rem 0 2rem; }
.contact-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem 1.3rem; transition: box-shadow .18s ease, transform .18s ease;
}
.contact-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.contact-card p { margin: 0; }
.contact-card .eyebrow { margin-bottom: .2rem; }
.contact-card a { font-weight: 600; text-decoration: none; }
.contact-card a::after { content: ""; position: absolute; inset: 0; }

/* --- Thesis page -------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .9rem; margin: 1.8rem 0 1rem; }
.stat { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.stat strong { display: block; font-family: "Source Serif 4", Georgia, serif; font-size: 1.9rem; line-height: 1.1; color: var(--blue); margin-bottom: .35rem; }
.stat:nth-child(3) strong { color: var(--warm); }
.stat span { display: block; font-size: .8rem; line-height: 1.45; color: var(--muted); }

.policy-timeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .9rem; margin: 1.6rem 0 2rem; }
.policy-timeline div { background: var(--soft); border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: 0 0 var(--radius) var(--radius); padding: .9rem 1.05rem; }
.policy-timeline div:last-child { border-top-color: var(--warm); background: var(--warm-tint); }
.policy-timeline strong { display: block; font-family: "Source Serif 4", Georgia, serif; font-size: 1.3rem; color: var(--blue); line-height: 1.2; }
.policy-timeline div:last-child strong { color: var(--warm); }
.policy-timeline b { display: block; font-size: .92rem; color: var(--ink); font-weight: 600; margin: .25rem 0 .3rem; }
.policy-timeline span { display: block; font-size: .84rem; line-height: 1.5; color: var(--muted); }

.mechanism-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.6rem 0; }
.mechanism-flow div { background: var(--soft); border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: 0 0 var(--radius) var(--radius); padding: 1rem 1.1rem; }
.mechanism-flow strong { display: block; margin-bottom: .4rem; }
.mechanism-flow span { font-size: .9rem; color: var(--muted); }

/* Interactive illustrations */
.explorer {
  background: #fbfcfd; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin: 1.6rem 0 2.6rem; padding: 1.5rem 1.6rem;
}
.explorer h3 { margin-top: 0; }
.explorer .kicker { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; color: var(--warm); margin-bottom: .3rem; }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.5rem; margin: 1.2rem 0; }
.control label { display: flex; justify-content: space-between; gap: 1rem; font-size: .85rem; font-weight: 600; color: var(--ink); }
.control output { color: var(--blue); font-variant-numeric: tabular-nums; }
.control input { width: 100%; accent-color: var(--blue); }
.control select { width: 100%; padding: .42rem .5rem; border: 1px solid #cfd6e0; border-radius: 6px; background: #fff; color: var(--ink); }
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: "Inter", Arial, sans-serif; font-size: 13px; fill: var(--muted); }
.chart .axis { stroke: #cfd6e0; stroke-width: 1; }
.chart path { fill: none; stroke-width: 3; }
.chart path:nth-of-type(2) { stroke-dasharray: 7 4; }
.chart-caption { font-size: .83rem; color: var(--muted); margin: .5rem 0; }
.chart-summary { font-size: .92rem; min-height: 3em; margin: .5rem 0; color: var(--ink); }
.legend { display: flex; gap: 1.3rem; font-size: .8rem; flex-wrap: wrap; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 1.1rem; height: 3px; margin-right: .45rem; vertical-align: middle; background: var(--blue); }
.legend span.alt::before { background: var(--warm); }
.reset-button { font-size: .8rem; font-weight: 600; border: 1px solid #c9d4e3; color: var(--blue); background: #fff; padding: .38rem .85rem; border-radius: 6px; cursor: pointer; }
.reset-button:hover { border-color: var(--blue); background: var(--tint); }
.choice-bars { display: grid; gap: .7rem; margin: 1.5rem 0; }
.choice-row { display: grid; grid-template-columns: 155px 1fr 55px; gap: .7rem; align-items: center; font-size: .85rem; }
.bar-track { height: 18px; background: var(--tint); border-radius: 4px; }
.bar-fill { height: 100%; background: var(--blue); min-width: 1px; border-radius: 4px; }
.choice-row:nth-child(2) .bar-fill, .choice-row:nth-child(3) .bar-fill { background: var(--warm); }
.choice-value { font-variant-numeric: tabular-nums; text-align: right; }

.math.display { display: block; max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: .5rem 0; }
mjx-container[display="true"] { max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: .4rem 0; }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 991px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
  .navbar a.nav-link[href$="CV_Romain_Fernex.pdf"] { display: inline-block; margin: .3rem 0; }
}
@media (max-width: 767px) {
  .hero-inner { grid-template-columns: 1fr; gap: 1rem; padding: 2rem 1rem 2.4rem; }
  .hero-photo img { width: 76px; height: 76px; border-radius: 50%; object-position: center 22%; border-width: 2px; }
  .hero-text h1 { font-size: 2.5rem; }
  .hero-text .intro p { font-size: 1.1rem; }
  .home-grid, .card-grid, .contact-grid, .mechanism-flow, .controls { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; gap: .3rem; }
  .cta-band { padding: 1.5rem; }
  .timeline { padding-left: 1.4rem; }
  .role { padding: 1.1rem 1.1rem .9rem; }
  .role::before { left: calc(-1.4rem + 1px); }
  .explorer { padding: 1rem; }
  .choice-row { grid-template-columns: 115px 1fr 50px; font-size: .75rem; }
  .chart text { font-size: 12px; }
  .quarto-title-banner { padding: 1.8rem 0 1.5rem !important; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  * { transition: none !important; }
}
@media print {
  .controls, .reset-button, .navbar, .nav-footer { display: none; }
  .work-card, .work-entry, .role, .explorer { box-shadow: none; break-inside: avoid; }
}


/* ==========================================================================
   Technical layer (redesign, Nov 2026)
   IBM Plex Sans + Mono, white and neutral greys, one electric-blue accent,
   square corners, hairline grids instead of cards, numbered sections, a
   margin column for dates. Live bits (dot field, paper counter, progress
   line) live in assets/site.js. Overrides the rules above; delete to roll back.
   ========================================================================== */

/* Square everything; true circles only where they mean something */
*, *::before, *::after { border-radius: 0 !important; }
.rl-ping, .rl-ping::before, .rl-ping::after, .rh-burst, .rh-sweep, .rh-sweep::before, .rh-sweep::after, .live-dot { border-radius: 50% !important; }

body { background: var(--paper); color: var(--text); line-height: 1.65; }
p { max-width: 70ch; }
h1, h2, h3, h4 { font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif; letter-spacing: -.02em; font-weight: 600; color: var(--ink); }
::selection { background: #d6dcff; color: var(--ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--ink); }
code, kbd, .mono { font-family: var(--mono); }

/* Numbered sections: 01, 02 ... in mono above a hairline */
main.content { counter-reset: sec; }
main.content > section.level2:not(.unnumbered) > h2::before,
main.content > h2:not(.unnumbered)::before {
  counter-increment: sec; content: counter(sec, decimal-leading-zero);
  display: block; width: auto; height: auto; background: none; margin: 0 0 .35rem;
  font-family: var(--mono); font-size: .78rem; font-weight: 500; letter-spacing: .04em; color: var(--blue);
}
main.content > section.level2 > h2 { border-top: 1px solid var(--line) !important; padding-top: 1rem !important; }

/* Reading progress line under the navbar (assets/site.js sets --progress) */
.navbar { background: rgba(255, 255, 255, .97) !important; border-bottom: 1px solid var(--line); backdrop-filter: none; }
.navbar::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: calc(var(--progress, 0) * 100%); background: var(--blue); transition: width .08s linear; }
.navbar-title { font-family: "IBM Plex Sans", sans-serif; font-weight: 600; font-size: 1.12rem; letter-spacing: -.01em; }
.navbar-nav { font-size: .92rem; font-weight: 400; }
.navbar .nav-link { color: var(--text) !important; }
.navbar .nav-link:hover { color: var(--blue) !important; }
.navbar .nav-link.active { color: var(--ink) !important; box-shadow: inset 0 -2px 0 var(--blue); }
.navbar a.nav-link[href$="CV_Romain_Fernex.pdf"] { border: 1px solid var(--rule); color: var(--ink) !important; }
.navbar a.nav-link[href$="CV_Romain_Fernex.pdf"]:hover { background: var(--ink); color: #fff !important; }

@media (min-width: 768px) {
  .navbar.navbar-expand-md .navbar-nav .nav-item { padding-top: 0; }
  .navbar.navbar-expand-md .navbar-nav .nav-link {
    display: flex;
    align-items: center;
    min-height: 2.5rem;
    padding-block: .35rem;
    line-height: 1.4;
  }
}

@media (min-width: 992px) {
  .navbar.navbar-expand-md > .navbar-container,
  .navbar.navbar-expand-md .navbar-brand-container { align-items: baseline; }
  .navbar.navbar-expand-md .navbar-title { position: relative; inset-block-start: 1px; }
  .navbar.navbar-expand-md #quarto-search { align-self: center; }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .navbar.navbar-expand-md .navbar-nav .nav-link { padding-inline: .3rem; }
  .navbar.navbar-expand-md .navbar-nav { font-size: .875rem; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .navbar.navbar-expand-md > .navbar-container { flex-wrap: wrap; padding-inline: 1rem; }
  .navbar.navbar-expand-md .navbar-nav .nav-link { padding-inline: .24rem; }
  .navbar.navbar-expand-md #quarto-search { order: 3; margin-left: auto; }
  .navbar.navbar-expand-md .navbar-collapse {
    order: 5;
    flex-basis: 100%;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 767.98px) {
  .navbar.navbar-expand-md { padding-block: .45rem; }
  .navbar.navbar-expand-md #quarto-search { order: 3; margin-left: auto; }
  .navbar.navbar-expand-md .navbar-toggler {
    order: 4;
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    height: 44px;
    margin: 0 0 0 .35rem;
    padding: 0;
    border: 1px solid var(--line);
  }
  .navbar.navbar-expand-md .navbar-toggler:focus { box-shadow: none; }
  .navbar.navbar-expand-md .navbar-toggler:focus-visible { outline: 2px solid var(--blue); }
  .navbar.navbar-expand-md .navbar-toggler-icon { width: 1.25em; height: 1.25em; }
  .navbar.navbar-expand-md .navbar-toggler[aria-expanded="true"] { background-color: var(--soft); }
  .navbar.navbar-expand-md .navbar-collapse { order: 5; }
  .navbar.navbar-expand-md .navbar-collapse.show {
    max-height: 70vh;
    max-height: min(70vh, calc(100dvh - 65px));
    overflow-y: auto;
  }
  .navbar.navbar-expand-md .navbar-nav {
    --bs-scroll-height: none;
    margin-top: .35rem;
    padding-top: .35rem;
    border-top: 1px solid var(--line);
  }
  .navbar.navbar-expand-md .navbar-nav .nav-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: .45rem .75rem;
  }
  .navbar.navbar-expand-md .navbar-nav .nav-link.active {
    background-color: var(--soft);
    box-shadow: inset 2px 0 0 var(--blue);
  }
  .navbar.navbar-expand-md .navbar-nav .nav-link:focus-visible { outline-offset: -2px; }
  .navbar.navbar-expand-md .navbar-nav.ms-auto { flex-direction: row; gap: .25rem; }
}

/* Inner page titles: white, one hairline, a mono path above the title */
.quarto-title-banner { background: #fff !important; border-bottom: 1px solid var(--line); padding: 3rem 0 2rem !important;
  background-image: radial-gradient(circle at 1px 1px, #d9dce1 1px, transparent 1.2px) !important; background-size: 22px 22px !important; }
.quarto-title-banner .title { font-size: clamp(2.2rem, 4.6vw, 3.3rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.05; }
.quarto-title-banner .subtitle, .quarto-title .subtitle { font-size: 1.08rem; color: var(--muted); }

/* Labels: mono, small caps-like uppercase, neutral */
.eyebrow, .explorer .kicker, .pr-kicker, .pr-tile-year {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; font-size: .74rem; font-weight: 500; font-style: normal; color: var(--muted);
}

/* Tags: square mono labels */
.chip { font-family: var(--mono); background: none; border: 1px solid var(--line); color: var(--muted); font-size: .74rem; font-weight: 400; padding: .1rem .5rem; }

/* Buttons: flat, square; no lifting */
a.btn-cta, a.btn-ghost { font-size: .92rem; font-weight: 500; padding: .6rem 1.1rem; transform: none !important; text-decoration: none; }
a.btn-cta { background: var(--ink); border: 1px solid var(--ink); color: #fff; }
a.btn-cta:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
a.btn-cta.btn-casd { background: var(--blue); border-color: var(--blue); text-align: start; }
a.btn-cta.btn-casd:hover { background: var(--ink); border-color: var(--ink); }
a.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
a.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

/* Meta line: mono, slash-separated */
.meta { gap: 0; font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.meta span { background: none !important; border: 0 !important; padding: 0; color: var(--muted) !important; }
.meta span + span::before { content: "/"; margin: 0 .6rem; color: var(--faint); }
.meta .grade { color: var(--ink) !important; font-weight: 500; }
.meta .lang { color: var(--blue) !important; }

.note { background: var(--soft); border: 0; border-left: 2px solid var(--blue); }
table.reg-table, .appendix-page main table { font-family: var(--mono); font-size: .78rem; }
table.reg-table tbody tr:nth-child(odd):not(.stats):not(.derived), .appendix-page main table tbody tr:nth-child(odd) { background: var(--soft); }

/* Home -------------------------------------------------------------------- */
.hero-band { position: relative; overflow: hidden; background: #fff; border-bottom: 1px solid var(--line); }
.hero-field { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-inner { position: relative; grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "text aside"; gap: 3.5rem; align-items: center; padding: 4.2rem 1.5rem 3.6rem; }
.hero-text { grid-area: text; }
.hero-aside { grid-area: aside; position: relative; background: #fff; padding: .9rem 1rem .4rem; box-shadow: 0 0 0 1px var(--line); }
.hero-text h1 { font-size: clamp(2.8rem, 6.2vw, 4.6rem); font-weight: 600; letter-spacing: -.04em; line-height: 1; margin: .5rem 0 1.1rem; }
.hero-text .intro p { font-size: 1.2rem; line-height: 1.55; }
.hero-photo { width: 120px; height: 148px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 1.1rem; background: var(--soft); }
.hero-photo img { display: block; width: 100%; height: calc(100% + 8px); object-fit: cover; object-position: center top; border: 0; box-shadow: none; }
.spec { margin: 0; border-top: 1px solid var(--rule); font-size: .88rem; }
.spec dt { font-family: var(--mono); font-size: .68rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding-top: .55rem; }
.spec dd { margin: .1rem 0 0; padding-bottom: .55rem; border-bottom: 1px solid var(--line); color: var(--ink); }
.spec dd a { text-decoration: none; }
.spec [data-radar-count] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: .45rem; background: #18a957; vertical-align: .1em; animation: live-pulse 2.4s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .35; } }

.home-grid { gap: 3rem; }
.home-grid > div:first-child > section > h2 { border-top: 1px solid var(--line); padding-top: .9rem; margin-top: 0; }
.glance { background: var(--soft); border: 1px solid var(--line); padding: 1.2rem 1.3rem; }
.glance h3 { font-family: var(--mono); font-size: .74rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.glance dl { grid-template-columns: 6.5rem 1fr; font-size: .92rem; }
.glance dt { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 400; color: var(--faint); padding-top: .15rem; }
.glance dt, .glance dd { padding-bottom: .5rem; border-bottom: 1px solid var(--line); }

.section-head { border-top: 1px solid var(--line); padding-top: .9rem; }
.section-head p a { font-family: var(--mono); font-size: .8rem; }

/* Selected work: a ruled grid, numbered cells, the arrow moves on hover */
.card-grid { counter-reset: card; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.work-card { background: #fff; border: 0; padding: 1.4rem 1.4rem 1.2rem; transform: none !important; transition: background .15s ease; }
.work-card::before { counter-increment: card; content: counter(card, decimal-leading-zero); position: static; height: auto; background: none;
  display: block; margin-bottom: 1rem; font-family: var(--mono); font-size: .74rem; color: var(--faint); }
.work-card:hover { background: var(--soft); }
.work-card:hover::before { color: var(--blue); }
.work-card h3 { font-size: 1.2rem; line-height: 1.25; }
.work-card p { font-size: .95rem; color: var(--muted); }
.work-card .card-more { font-family: var(--mono); font-size: .78rem; font-weight: 500; color: var(--ink); transition: transform .15s ease; }
.work-card:hover .card-more { color: var(--blue); transform: translateX(4px); }

.work-card::after {
  content: "";
  position: absolute;
  inset: -1px 0 auto;
  height: 2px;
  background: var(--blue);
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}

.work-card:has(a:focus-visible)::after { transform: scaleX(1); }

@media (hover: hover) and (pointer: fine) {
  .work-card:hover::after { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .work-card::after { transition: none; }
}

.cta-band { background: var(--ink); color: #fff; }
.cta-band h2 { color: #fff; }
.cta-band p, .cta-band a { color: #c9ccd2 !important; }
.cta-band a.btn-ghost { background: transparent; border-color: #fff; color: #fff !important; }
.cta-band a.btn-ghost:hover { background: #fff; color: var(--ink) !important; }

/* Lists of work and the CV: mono dates/labels in a margin column, like a changelog */
.work-entry, .role {
  display: grid; grid-template-columns: 10.5rem minmax(0, 1fr); column-gap: 2rem;
  background: none; border: 0; border-top: 1px solid var(--line); box-shadow: none; padding: 1.4rem 0 1rem; margin: 0;
}
.work-entry > *, .role > * { grid-column: 2; }
.work-entry > p:first-child, .role > p:first-child { grid-column: 1; grid-row: 1 / span 8; margin: .3rem 0 0; }
.work-entry:hover { box-shadow: none; }
.work-entry h3 { font-size: 1.3rem; }
.work-entry h3 a { color: var(--ink); }
.work-entry h3 a:hover { color: var(--blue); }
.work-entry p:last-child a { font-family: var(--mono); font-size: .8rem; font-weight: 500; }
.timeline { padding-left: 0; }
.timeline::before, .role::before { display: none; }
.role h2 { font-size: 1.45rem; border: 0 !important; padding: 0 !important; }
.role li::marker { content: "▪  "; color: var(--faint); font-size: .8em; }

/* Contact: ruled grid */
.contact-grid { gap: 1px; background: var(--line); border: 1px solid var(--line); }
.contact-card { background: #fff; border: 0; transform: none !important; }
.contact-card:hover { background: var(--soft); }
.contact-card a { font-weight: 500; }

/* Thesis page */
.stat, .policy-timeline div, .mechanism-flow div { background: #fff; border: 1px solid var(--line); border-top: 2px solid var(--ink); }
.policy-timeline div:last-child { border-top-color: var(--blue); background: #fff; }
.stat strong, .policy-timeline strong { font-family: "IBM Plex Sans", sans-serif; font-weight: 600; letter-spacing: -.02em; }
.stat:nth-child(3) strong, .policy-timeline div:last-child strong { color: var(--ink); }
.explorer { background: #fff; border: 1px solid var(--line); }
.chart text { font-family: var(--mono); font-size: 12px; }
.reset-button, .control select { border: 1px solid var(--line); background: #fff; color: var(--ink); font-family: var(--mono); }
.reset-button:hover { border-color: var(--ink); background: #fff; }

/* Beyond economics: flat near-black instead of navy gradients */
.featured-work { background: var(--ink); border-color: var(--ink); }
.featured-work::before { background: var(--blue); }
.pr-head { background: var(--ink); border-bottom-color: var(--ink); }
.pr-viewer { border-top-color: var(--blue); }

/* Footer */
.nav-footer { border-top: 1px solid var(--line); font-family: var(--mono); font-size: .76rem; }

@media (max-width: 991px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr) 240px; gap: 2rem; }
}
@media (max-width: 767px) {
  .hero-inner { grid-template-columns: 1fr; grid-template-areas: "text" "aside"; gap: 1.6rem; padding: 2.4rem 1rem 2.2rem; }
  .hero-text h1 { font-size: 2.7rem; }
  .hero-photo { width: 64px; height: 78px; float: left; margin: 0 1rem .6rem 0; }
  .spec { clear: both; }
  .work-entry, .role { grid-template-columns: 1fr; }
  .work-entry > *, .role > *, .work-entry > p:first-child, .role > p:first-child { grid-column: 1; grid-row: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

/* Linked titles keep the heading weight (a base rule set links in headings to 400) */
h1 a, h2 a, h3 a, h4 a { font-weight: inherit; }

/* EconRadar banner: the same reactive dot field as the home page, in light dots on dark */
.radar-hero > .hero-field { z-index: -2; }

/* Title banners with a live dot field (assets/site.js adds the canvas) */
.quarto-title-banner.has-field { position: relative; overflow: hidden; background-image: none !important; }
.quarto-title-banner.has-field > .hero-field { z-index: 0; }
.quarto-title-banner.has-field > .quarto-title-banner-inner, .quarto-title-banner.has-field > :not(.hero-field) { position: relative; z-index: 1; }

/* Tighter gap between the page title banner and the content */
.quarto-title-banner { margin-bottom: .4rem !important; padding-bottom: 1.7rem !important; }
body:has(.quarto-title-banner) #quarto-content { margin-top: 0 !important; padding-top: 0 !important; }
body:has(.quarto-title-banner) main.content { margin-top: 0 !important; padding-top: 0 !important; }
body:has(.quarto-title-banner) main.content > section.level2:first-of-type > h2 { border-top: 0 !important; padding-top: 0 !important; margin-top: 1.6rem !important; }

/* Topic tags are labels, not buttons: plain mono text separated by a dot */
.chip { border: 0 !important; padding: 0 !important; margin: 0 .2rem .3rem 0 !important; background: none !important; color: var(--muted) !important; }
.chip:not(:last-child)::after { content: "·"; margin-left: .45rem; color: var(--faint); }

/* Selected work: stronger contrast for the label and the number above each title */
.work-card .eyebrow { color: #2b2e34; }
.work-card::before { color: var(--muted); }

/* Topic tags are labels, not buttons: plain mono text separated by a dot */
.chip { border: 0 !important; padding: 0 !important; margin: 0 .2rem .3rem 0 !important; background: none !important; color: var(--muted) !important; }
.chip:not(:last-child)::after { content: "·"; margin-left: .45rem; color: var(--faint); }

/* Selected work: stronger contrast for the label and the number above each title */
.work-card .eyebrow { color: #2b2e34; }
.work-card::before { color: var(--muted); }
.work-card.mid::before, .work-card.warm::before { background: none; }

/* Phones: justified body text, with hyphenation so lines don't open wide gaps */
@media (max-width: 767px) {
  main.content p:not(.btn-row p):not(.meta):not(.rh-stats), main.content li, .rx-tabs .rx-desc, .hero-text p {
    text-align: justify; -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 7 3 3;
  }
  main.content .btn-row p, main.content figcaption, .work-entry > p:first-child, .role > p:first-child,
  .hero-text .intro p, .rh-sub, .rx-lead p { text-align: left !important; -webkit-hyphens: manual !important; hyphens: manual !important; }
}
