/* AgentSSL project page — layout/typography after the "Beyond Accuracy" project page,
   recoloured to match the AgentSSL poster. */
:root {
  --lavender: #D1DAF9;
  --lavender-soft: #F2F4FE;
  --cream: #FFF9D4;
  --cream-soft: #FFFCEB;
  --purple: #846DA3;
  --purple-dark: #5B477D;
  --gold: #A18600;
  --ink: #1F1F1F;
  --body: #3A3A3A;
  --plus: #0B7A3B;
  --minus: #B22222;
}

body {
  font-family: 'Noto Sans', sans-serif;
  color: var(--body);
}

.title, .subtitle, .publication-title, .publication-authors, .button, .results-table, .callout {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
}
.title, .content .title { color: var(--ink); font-weight: 500; }

a { color: var(--purple); }
a:hover { color: var(--purple-dark); }

/* ---------- header ---------- */
.publication-title { font-weight: 500; letter-spacing: -0.01em; }
.publication-authors a { color: var(--purple) !important; }
.publication-authors a:hover { text-decoration: underline; }
.author-block { display: inline-block; }
.eql-cntrb { font-size: smaller; color: #666; }

.link-block a { margin-top: 5px; margin-bottom: 5px; }
.publication-links .button.is-dark { background-color: var(--purple-dark); }
.publication-links .button.is-dark:hover { background-color: var(--purple); }
.publication-links .button[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

/* ---------- teaser ---------- */
.teaser .hero-body { padding-top: 3rem; padding-bottom: 3rem; }
.teaser img { display: block; margin: 0 auto 1.5rem; max-width: 52%; height: auto; }
.teaser .subtitle { font-size: 1.2rem; line-height: 1.6; color: var(--body); }

/* ---------- full-width section bands ---------- */
.band { padding: 3.5rem 1.5rem; }
/* Old look: plain white page; bands kept only as spacing. */
.band-lavender, .band-cream { background: #fff; }

/* Lavender pill section headers, as on the poster. */
.section-title {
  display: table;
  margin: 0 auto 1.5rem !important;
  background: var(--lavender);
  border-radius: 999px;
  padding: 0.35rem 1.6rem;
  text-align: center;
}
.section-sub { text-align: center; font-size: 1.15rem; color: var(--ink); margin: -0.5rem 0 1.25rem; }

.lead { font-size: 1.1rem; line-height: 1.7; }
.content p, .content li { line-height: 1.7; }

.numbered p {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}
.numbered b { color: var(--purple-dark); }

/* ---------- figures ---------- */
.figure-card {
  background: #fff;
  border-radius: 18px;
  padding: 1rem;
  border: 3px solid var(--lavender);
}
.figure-card img { display: block; width: 100%; border-radius: 8px; }
.caption { font-size: 0.92rem; color: #555; margin-top: 0.75rem; line-height: 1.6; }
.figure-heading { text-align: center; font-size: 1.15rem; margin: 2rem 0 1rem !important; }

/* ---------- callout (poster's cream key-message bar) ---------- */
.callout {
  background: var(--cream);
  border-radius: 18px;
  padding: 1.1rem 1.4rem;
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--ink);
}
.callout .icon { color: var(--gold); font-size: 1.3rem; margin-top: 0.15rem; }
.callout.tldr { width: fit-content; max-width: 60rem; margin-left: auto; margin-right: auto; }

/* ---------- results table ---------- */
.results-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 18px;
  border: 3px solid var(--lavender);
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.results-table th, .results-table td { padding: 0.5rem 0.6rem; text-align: center; }
.results-table thead tr:first-child th { background: var(--lavender); font-weight: 600; color: var(--ink); }
.results-table thead tr:last-child th {
  background: var(--lavender-soft);
  font-weight: 400;
  color: #555;
  border-bottom: 2px solid var(--ink);
}
.results-table thead tr:last-child th:first-child { font-weight: 600; color: var(--ink); }
.results-table td:first-child, .results-table th:first-child { text-align: left; padding-left: 1rem; }
.results-table .grp { border-left: 2px solid #e2e2e2; }
.results-table tbody tr { border-bottom: 1px solid #eee; }
.results-table tr.agent { background: var(--cream); }
.results-table tr.agent td:first-child { font-weight: 600; }
.results-table tr.delta { background: #f1f1f1; font-weight: 700; }
.results-table .h { color: var(--purple); font-weight: 700; }
.results-table .a { color: var(--gold); font-weight: 700; }
.results-table .plus { color: var(--plus); }
.results-table .minus { color: var(--minus); }
.results-table .regret-a { color: #D98C8C; }
.results-table .regret-b { color: #CC5555; }
.results-table .regret-c { color: #B22222; }
.results-table .regret-d { color: #7A0000; }
.results-table sub, .results-table sup { font-weight: 400; color: #555; }

/* ---------- bibtex / footer ---------- */
pre { background: var(--lavender-soft); border-radius: 12px; }
.footer { background: var(--lavender-soft); }
.hero .callout { margin-top: 1.25rem; text-align: left; }
.footer .icon-link { font-size: 25px; color: var(--purple-dark); }

@media screen and (max-width: 768px) {
  .teaser img { max-width: 100%; }
}

/* ================= Interactive pieces ================= */

/* Sticky section nav */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--lavender);
  padding-top: env(safe-area-inset-top, 0px);
}
.site-nav .nav-inner {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.6rem 1rem;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
}
.site-nav a {
  color: var(--body);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.95rem;
  transition: background-color .2s, color .2s;
}
.site-nav a:hover { background: var(--lavender-soft); color: var(--purple-dark); }
.site-nav a.is-active { background: var(--lavender); color: var(--ink); }
section[id] { scroll-margin-top: 4rem; }
html { scroll-behavior: smooth; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* Results table filters + crosshair */
.table-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  margin-bottom: 0.9rem;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.95rem;
}
.table-filter { display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.table-filter .filter-label { color: #666; margin-right: 0.15rem; }
.table-filter button {
  border: 2px solid var(--lavender);
  background: #fff;
  color: var(--body);
  border-radius: 999px;
  padding: 0.2rem 0.8rem;
  font: inherit;
  cursor: pointer;
}
.table-filter button[aria-pressed="true"] { background: var(--purple-dark); border-color: var(--purple-dark); color: #fff; }
.table-filter button:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.results-table tbody tr:hover td { background-image: linear-gradient(rgba(132,109,163,.10), rgba(132,109,163,.10)); }
.results-table .xhair { background-image: linear-gradient(rgba(132,109,163,.10), rgba(132,109,163,.10)); }
.results-table tbody tr:hover td.xhair { background-image: linear-gradient(rgba(132,109,163,.22), rgba(132,109,163,.22)); }
.hint { font-size: 0.85rem; color: #777; }

/* Heatmap */
.hm-grid {
  display: grid;
  gap: 6px;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  overflow-x: auto;
}
.hm-corner { font-size: 0.75rem; color: #888; align-self: end; padding: 0 0.5rem 0.3rem 0; }
.hm-col { text-align: center; font-weight: 600; color: var(--ink); align-self: end; padding-bottom: 0.2rem; font-size: 0.95rem; }
.hm-row { text-align: right; font-weight: 600; color: var(--ink); align-self: center; padding-right: 0.6rem; }
.hm-cell {
  border-radius: 10px;
  padding: 0.8rem 0.3rem;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  cursor: default;
  transition: opacity .15s, transform .15s, box-shadow .15s;
}
.hm-cell.dark { color: #fff; }
.hm-cell.self { outline: 2px dashed #E6D98A; outline-offset: -4px; }
.hm-cell:hover, .hm-cell:focus { transform: scale(1.06); box-shadow: 0 4px 14px rgba(91,71,125,.25); outline: none; }
.hm-cell.dim { opacity: 0.35; }
.hm-tip {
  margin-top: 0.9rem;
  min-height: 1.6em;
  text-align: center;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  color: var(--purple-dark);
  font-size: 1rem;
}

/* Lightbox */
.zoomable { cursor: zoom-in; }
.zoomable:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(31, 24, 44, 0.86);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none !important; }
.lightbox img { max-width: 100%; max-height: 100%; background: #fff; border-radius: 10px; padding: 0.75rem; cursor: default; }
.lightbox-close {
  position: absolute; top: calc(1rem + env(safe-area-inset-top, 0px)); right: 1.25rem;
  font-size: 2.2rem; line-height: 1; color: #fff; background: none; border: 0; cursor: pointer;
}
body.no-scroll { overflow: hidden; }

/* Program viewer */
.program {
  margin-top: 1.25rem;
  border: 3px solid var(--lavender);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}
.program summary {
  cursor: pointer;
  padding: 0.9rem 1.25rem;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1.05rem;
  color: var(--ink);
  list-style: none;
  display: flex; align-items: center; gap: 0.6rem;
}
.program summary::-webkit-details-marker { display: none; }
.program summary .chev { transition: transform .2s; color: var(--purple); }
.program[open] summary .chev { transform: rotate(90deg); }
.program summary:hover { background: var(--lavender-soft); }
.program .program-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.5rem 1.25rem; border-top: 1px solid var(--lavender); background: var(--lavender-soft);
  font-size: 0.88rem; color: #555;
}
.program pre {
  margin: 0; border-radius: 0; max-height: 32rem; overflow: auto;
  background: #FBFAFE; font-size: 0.8rem; line-height: 1.5;
}
.copy-btn {
  border: 2px solid var(--lavender); background: #fff; color: var(--purple-dark);
  border-radius: 999px; padding: 0.2rem 0.8rem; cursor: pointer;
  font-family: 'Google Sans', 'Noto Sans', sans-serif; font-size: 0.88rem;
}
.copy-btn:hover { background: var(--lavender); }
.bibtex-wrap { position: relative; }
.bibtex-wrap .copy-btn { position: absolute; top: 0.75rem; right: 0.75rem; }

/* highlight.js theme in poster colours */
.hljs-keyword, .hljs-built_in { color: #5B477D; font-weight: 600; }
.hljs-string { color: #8A6D00; }
.hljs-number, .hljs-literal { color: #B35C00; }
.hljs-comment { color: #8C8C8C; font-style: italic; }
.hljs-title, .hljs-title.function_, .hljs-title.class_ { color: #846DA3; }
.hljs-params { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hm-cell, .reveal { transition: none; }
}

/* Keep the title on one line and the TL;DR on two on wide screens. */
.publication-title { font-size: clamp(2rem, 3.3vw, 3rem) !important; }
.callout.tldr { max-width: min(60rem, 100%); }
@media screen and (min-width: 1150px) {
  .publication-title { white-space: nowrap; }
  .tldr-line { display: block; white-space: nowrap; }
}
