/* Colours from Setup/dotfiles/palette.sh (ATLAS palette), fonts are the thesis ones.
   Minimal, neutral layout: a large name, one visual, rounded "bento" cards, a frosted top bar.
   No JavaScript: page changes animate with cross-document view transitions, sections reveal with
   scroll-driven animations, "Learn more" boxes are <details>. Browsers without them just skip the motion. */
@font-face { font-family: "TeX Gyre Heros"; src: url(fonts/texgyreheros-regular.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "TeX Gyre Heros"; src: url(fonts/texgyreheros-bold.woff2) format("woff2"); font-weight: bold; font-display: swap; }
@font-face { font-family: "TeX Gyre Heros"; src: url(fonts/texgyreheros-italic.woff2) format("woff2"); font-style: italic; font-display: swap; }
@font-face { font-family: "Latin Modern Roman"; src: url(fonts/lmroman10-bold.woff2) format("woff2"); font-weight: bold; font-display: swap; }
@font-face { font-family: "Latin Modern Math"; src: url(fonts/latinmodern-math.woff2) format("woff2"); font-display: swap; }

:root {
  --night: #0f2c42;   /* ATLAS_NIGHT */
  --accent: #0b80c3;  /* ATLAS */
  --light: #42cafd;   /* ATLAS_BLUE_LIGHT */
  --bg: #ffffff;
  --soft: #f3f4f2;
  --card: #ffffff;
  --fg: #111417;
  --muted: #646b72;
  --line: #e4e6e8;
  --glass: rgb(255 255 255 / .62);
  --radius: 22px;
  --wide: 1180px;
  interpolate-size: allow-keywords;
}
@media (prefers-color-scheme: dark) {
  :root { --accent: #42cafd; --bg: #0a0e12; --soft: #12181e; --card: #141b22; --fg: #eef1f3; --muted: #9aa4ad;
    --line: #232c35; --glass: rgb(20 27 34 / .62); }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 80px; overflow-x: clip; }
img, svg, video { max-width: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 17px/1.6 "TeX Gyre Heros", "Helvetica Neue", Helvetica, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: 4px 8px; z-index: 9; }
h1, h2, h3 { font-family: "TeX Gyre Heros", "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: bold; }

/* Top bar: monogram left, tabs right, frosted over the page. */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(16px, calc((100% - var(--wide)) / 2)); background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  view-transition-name: top; }
.mono { font-weight: bold; letter-spacing: -.04em; font-size: 1.15rem; color: var(--fg); }
.mono:hover { text-decoration: none; }
.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.tabs a { color: var(--muted); padding: 6px 12px; border-radius: 999px; white-space: nowrap; font-size: .92rem; transition: color .2s, background .2s; }
.tabs a:hover { color: var(--fg); text-decoration: none; background: var(--soft); }
.tabs > a[aria-current], .drop summary.current { color: var(--bg); background: var(--fg); view-transition-name: active-tab; }
/* Research menu: a <details>, so it opens on click or tap without JavaScript, and on hover with a mouse. */
.drop { position: relative; }
.drop summary { list-style: none; cursor: pointer; color: var(--muted); padding: 6px 12px; border-radius: 999px; font-size: .92rem;
  white-space: nowrap; transition: color .2s, background .2s; }
.drop summary::-webkit-details-marker { display: none; }
.drop summary::after { content: ""; display: inline-block; width: .38em; height: .38em; margin-left: .45em; vertical-align: .2em;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; rotate: 45deg; transition: rotate .2s; }
.drop[open] summary::after { rotate: 225deg; vertical-align: -.05em; }
.drop summary:hover { color: var(--fg); background: var(--soft); }
.drop summary.current:hover { color: var(--bg); background: var(--fg); }
.menu { display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 6; min-width: 15em; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 32px rgb(0 0 0 / .14); }
.drop[open] .menu { display: grid; }
@media (hover: hover) { .drop:hover .menu { display: grid; } .drop::before { content: ""; position: absolute; inset: 100% 0 -10px; } }
.menu a { color: var(--fg); padding: 8px 12px; border-radius: 10px; white-space: nowrap; font-size: .92rem; }
.menu a:hover { background: var(--soft); text-decoration: none; }
.menu a[aria-current] { color: var(--accent); font-weight: bold; }

/* Side bar: a hidden checkbox and two labels open and close it without JavaScript.
   Open by default on wide screens (it pushes the page), closed on narrow ones (it covers the page). */
.side { position: fixed; inset: 0 auto 0 0; z-index: 8; width: 250px; overflow-y: auto; padding: 18px 14px 28px;
  background: var(--bg); border-right: 1px solid var(--line); transition: transform .3s ease; font-size: .9rem; }
.side { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.side:hover, .side:focus-within { scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
.side a { display: block; color: var(--muted); padding: 5px 10px; border-radius: 10px; }
.side a:hover { color: var(--fg); background: var(--soft); text-decoration: none; }
.side a[aria-current] { color: var(--accent); font-weight: bold; }
.side a.sub { padding-left: 22px; }
.side-toc a.sub { padding: 3px 10px 3px 42px; font-size: .84rem; }
h3.sub { margin: 26px 0 12px; font-size: 1.15rem; color: var(--accent); }
.side-group, .side-title { display: block; margin: 12px 10px 4px; color: var(--fg); font-weight: bold; font-size: .78rem;
  letter-spacing: .12em; text-transform: uppercase; }
.side-title { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }
.side-toc b, .sections .menu b { color: var(--accent); display: inline-block; min-width: 2.2em; }
.side-close { display: block; margin: 0 0 10px auto; width: 32px; height: 32px; border-radius: 50%; text-align: center; line-height: 32px;
  font-size: 1.3rem; color: var(--muted); cursor: pointer; }
.side-close:hover, .side-open:hover { background: var(--soft); color: var(--fg); }
.side-open { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 6px; border-radius: 10px; cursor: pointer; flex: none; }
.side-open span, .side-open span::before, .side-open span::after { display: block; width: 16px; height: 1.5px; background: currentColor; position: relative; }
.side-open span::before, .side-open span::after { content: ""; position: absolute; left: 0; }
.side-open span::before { top: -5px; } .side-open span::after { top: 5px; }
.top > .mono { margin-right: auto; }
/* The checkbox stays focusable (Tab, then Space opens or closes the side bar); its labels show the focus. */
.side-toggle { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.side-toggle:focus-visible ~ .side .side-close, .side-toggle:focus-visible ~ .page .side-open { outline: 2px solid var(--accent); outline-offset: 2px; }
.page { transition: margin-left .3s ease; }
@media (min-width: 1200px) {
  .side-toggle:not(:checked) ~ .page { margin-left: 250px; }
  .side-toggle:checked ~ .side { transform: translateX(-100%); }
  .side-toggle:not(:checked) ~ .page .side-open { visibility: hidden; }
}
@media (max-width: 1199px) {
  .side { transform: translateX(-100%); box-shadow: 0 0 40px rgb(0 0 0 / .25); }
  .side-toggle:checked ~ .side { transform: none; }
}
.tabs .lang { font-weight: bold; }

/* \LaTeX and \TikZ logos, as TeX typesets them. */
.latex, .tikz { white-space: nowrap; }
.latex > span:first-child { font-size: .72em; vertical-align: .28em; margin-left: -.32em; margin-right: -.12em; text-transform: uppercase; }
.latex > span:last-child { vertical-align: -.22em; margin-left: -.14em; margin-right: -.1em; text-transform: uppercase; }

/* Home hero: name and summary on the left, the Standard Model in Lego bricks on the right, key numbers below. */
.hero { max-width: var(--wide); margin: 0 auto; padding: 56px 16px 0; display: grid; grid-template-columns: 1.25fr 1fr;
  gap: 24px 48px; align-items: center; }
.hero-text .eyebrow { color: var(--accent); }
.hero-visual { display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--radius); padding: 8%;
  background: radial-gradient(85% 85% at 30% 22%, color-mix(in srgb, #42cafd 30%, #fff), color-mix(in srgb, #0b80c3 55%, #fff) 80%);  /* ATLAS blues, light and main */
  border: 1px solid var(--line); transition: transform .4s ease; }
.hero-visual:hover { transform: translateY(-4px) rotate(-.4deg); }
.hero-visual img { width: 100%; height: 100%; object-fit: contain; }
.actions { margin: 22px 0 10px; }
.links { color: var(--muted); font-size: .92rem; margin: 0; }
.btn { display: inline-block; padding: 9px 18px; border-radius: 999px; background: var(--accent); color: var(--bg); font-size: .9rem; font-weight: bold; }
.btn:hover { text-decoration: none; opacity: .85; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); margin-left: 8px; }
.btn.ghost:hover { border-color: var(--fg); background: transparent; }
.giant { margin: 6px 0 18px; font-size: clamp(3.2rem, 9vw, 7.5rem); line-height: .9; letter-spacing: -.05em;
  view-transition-name: title; }
.role { margin: 0; max-width: 32em; color: var(--muted); font-size: 1.08rem; }
.hero .bento { grid-column: 1 / -1; }

/* Research axes: one card per axis, with its scheme, each leading to its own page. */
.axes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.axis { display: flex; flex-direction: column; gap: 6px; margin: 0; color: var(--fg); }
.axis:hover { text-decoration: none; transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.axis img { width: 100%; height: 170px; object-fit: contain; background: #fff; border-radius: 14px; padding: 10px;
  border: 1px solid var(--line); margin-bottom: 8px; }
.axis p { color: var(--muted); font-size: .95rem; }
.more-link { margin-top: auto; color: var(--accent); font-weight: bold; font-size: .92rem; }
.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.subnav a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: .9rem; color: var(--fg); }
.subnav a:hover { text-decoration: none; border-color: var(--accent); }
.subnav.sticky { position: sticky; top: 62px; z-index: 4; padding: 10px 0; margin: 8px 0 0; background: var(--glass); backdrop-filter: blur(14px); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 56px 0 0; }
.pager a { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; color: var(--fg); font-weight: bold; transition: border-color .3s; }
.pager a:hover { text-decoration: none; border-color: var(--accent); }
.pager span { display: block; color: var(--muted); font-size: .85rem; font-weight: normal; }
.pager .next { text-align: right; }
.subnav a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* Other pages: an eyebrow and a giant title. */
.pagehead { max-width: var(--wide); margin: 0 auto; padding: 48px 16px 8px; }
.pagehead .giant { font-size: clamp(2.8rem, 9vw, 6.5rem); margin: 0 0 18px; }
.eyebrow { color: var(--muted); font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 6px; }

main { max-width: var(--wide); margin: 0 auto; padding: 8px 16px 72px; view-transition-name: main; counter-reset: sec; }
main > section > h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.03em; line-height: 1.05; margin: 72px 0 20px; counter-increment: sec; }
main > section > h2::before { content: counter(sec, upper-roman) "."; display: block; font-size: .85rem; letter-spacing: .14em;
  color: var(--accent); font-weight: normal; margin-bottom: 8px; }
h3 { font-size: 1.1rem; margin: 0 0 4px; letter-spacing: -.01em; }
p { margin: .5em 0; }
.meta { color: var(--muted); font-size: .92rem; margin: 0; }
ul { padding-left: 1.2em; margin: .4em 0; }
li { margin: 4px 0; }
.lead { font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.45; letter-spacing: -.01em; }

/* Maths: MathML written by pandoc from the thesis LaTeX, in the thesis's math font. */
.smallcaps { font-variant: small-caps; }
.nobr { white-space: nowrap; }
math { font-family: "Latin Modern Math", math; font-size: 1.08em; }
math[display="block"] { margin: 14px 0; padding: 14px 10px; overflow-x: auto; overflow-y: hidden; background: var(--soft); border-radius: 14px; }

/* Cards and bento grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 14px 0;
  transition: transform .3s ease, border-color .3s; }
.grid2 .card:hover, .bento .card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.entry { display: grid; grid-template-columns: 8.5em 1fr; gap: 0 18px; }
.when { color: var(--muted); font-size: .9rem; padding-top: 1px; font-variant-numeric: tabular-nums; }
.list .entry { padding: 12px 0; border-top: 1px solid var(--line); }
.list .entry:first-child { border-top: 0; }
.tag { display: inline-block; font-size: .75rem; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); margin-left: 6px; vertical-align: 1px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 0 14px; }
.grid2.wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0 0; }
@media (max-width: 1000px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--soft); border-radius: var(--radius); padding: 20px 22px; border-top: 3px solid var(--accent); }
.stat { color: var(--fg); transition: transform .3s ease, background .3s; }
.stat:hover { text-decoration: none; transform: translateY(-3px); background: color-mix(in srgb, var(--accent) 8%, var(--soft)); }
.stat b { display: block; color: var(--accent); font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.2; letter-spacing: -.02em; margin-bottom: 10px; }
.stat span { font-size: .9rem; color: var(--muted); }

/* Figures: the TikZ schemes and plots are drawn for white paper, so they keep a white card in dark mode too. */
figure { margin: 18px 0; }
figure > a { display: block; background: #fff; border-radius: 18px; padding: 16px; border: 1px solid var(--line); overflow: hidden; }
figure img { display: block; width: 100%; height: auto; max-height: 480px; object-fit: contain; transition: transform .5s ease; }
figure > a:hover img { transform: scale(1.03); }
figure.small img { max-height: 320px; }
figure.small > a { max-width: 520px; margin: 0 auto; }
figure.plot > a { max-width: 640px; margin: 0 auto; }
figure.plot img { max-height: 560px; }
.split figure.plot > a { max-width: none; }
figcaption { color: var(--muted); font-size: .86rem; margin-top: 8px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }

/* Scheme bank */
.bank { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.scheme { margin: 0; padding: 12px; display: flex; flex-direction: column; }
.scheme figure { margin: 0; }
.scheme figure > a { padding: 8px; }
.scheme figure img { height: 180px; }
.scheme figcaption { font-size: .85rem; color: var(--fg); }
.bankmore { margin-top: 18px; }
.bankmore > .bank { margin-top: 14px; }
.scheme .dl { margin: auto 0 0; padding-top: 8px; font-size: .88rem; font-weight: bold; }
.scheme details.more { padding-top: 4px; }
pre.bib { font-size: .74rem; line-height: 1.4; background: var(--soft); border-radius: 12px;
  padding: 10px 12px; overflow-x: auto; user-select: all; cursor: copy; white-space: pre; }

/* "Learn more" boxes */
details.more { margin: 14px 0 0; }
details.more summary { cursor: pointer; display: inline-block; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  font-size: .9rem; font-weight: bold; list-style: none; transition: background .2s; }
details.more summary:hover { background: var(--soft); }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; display: inline-block; width: 1.1em; transition: rotate .25s; }
details.more[open] summary::before { rotate: 45deg; }
details.more::details-content { block-size: 0; overflow: hidden; transition: block-size .4s ease, content-visibility .4s allow-discrete; }
details.more[open]::details-content { block-size: auto; }

/* Motion: page changes wipe in (Chrome, Edge, Safari 18.2+), the title morphs, sections reveal while scrolling. */
@view-transition { navigation: auto; }
::view-transition-old(main) { animation: .25s ease-in both out; }
::view-transition-new(main) { animation: .55s .05s cubic-bezier(.2, .7, .1, 1) both wipe; }
::view-transition-group(title) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2, .7, .1, 1); }
@keyframes out { to { opacity: 0; transform: scale(.985); } }
@keyframes wipe { from { clip-path: inset(100% 0 0 0 round var(--radius)); transform: translateY(40px); } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .card, figure, main > section > h2, .stat { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
  }
}
@keyframes reveal { from { opacity: 0; transform: translateY(32px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  details.more::details-content { transition: none; }
}

@media (max-width: 700px) {
  html { scroll-padding-top: 120px; }
  .top { flex-wrap: wrap; gap: 4px 6px; padding: 8px 12px; }
  .top > .tabs { flex-basis: 100%; }
  .tabs a, .drop summary { padding: 5px 9px; font-size: .86rem; }
  .menu { position: fixed; left: 12px; right: 12px; top: auto; min-width: 0; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 24px; gap: 20px; }
  .hero-visual { aspect-ratio: 1; width: min(100%, 420px); justify-self: center; padding: 6%; }
  .bento { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .stat { padding: 12px; }
  .stat b { font-size: .95rem; hyphens: auto; overflow-wrap: anywhere; }
  .stat span { font-size: .78rem; }
  .entry, .split { grid-template-columns: minmax(0, 1fr); }
  .subnav.sticky { position: static; }
  .card { padding: 16px 18px; }
  .giant { overflow-wrap: anywhere; }
  math[display="block"] { font-size: .95em; }
}
@media (max-width: 380px) { .bento { grid-template-columns: minmax(0, 1fr); } }

footer { max-width: var(--wide); margin: 0 auto; padding: 28px 16px 48px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }

/* Print = paper CV: no top bar, black on white, URLs after external links, "Learn more" boxes open. */
@page { size: A4; margin: 14mm 16mm; }
@media print {
  :root { --accent: #0f2c42; --bg: #fff; --soft: #fff; --card: #fff; --fg: #000; --muted: #444; }
  body { font-size: 10.5pt; }
  .side, .side-open, .top, .skip, footer, figure, .hero-visual, .bento, .actions, .axis img, .more-link, .subnav, .pager { display: none; }
  .page { margin: 0 !important; }
  .giant { font-size: 28pt; letter-spacing: -.02em; }
  .hero { display: block; padding: 0; }
  .card { border: 0; padding: 0; margin: 8px 0; animation: none !important; }
  main > section > h2 { margin-top: 14px; margin-bottom: 4px; font-size: 14pt; break-after: avoid; animation: none !important; }
  main > section > h2::before { display: none; }
  .abstract, .axis p { display: none; }
  .list .entry { padding: 2px 0; border: 0; }
  .entry { grid-template-columns: 6.5em 1fr; }
  .axes { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .axis .when { font-size: 8pt; }
  h3 { break-after: avoid; }
  section { break-inside: auto; }
  .entry, li { break-inside: avoid; }
  details.more::details-content { block-size: auto; content-visibility: visible; }
  main a[href^="http"]::after { content: " <" attr(href) ">"; font-size: .8em; color: #444; }
}

/* The Lego bricks of the Standard Model, one by one, under its card in the scheme bank. */
.bricks { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 10px; }
.bricks figure { margin: 0; text-align: center; }
.bricks img { width: 100%; height: 90px; object-fit: contain; background: #fff; border-radius: 10px; padding: 4px; }
.bricks figcaption { font-size: .75rem; margin-top: 4px; }
