/* ==========================================================================
   carrickchristian.github.io: one stylesheet.
   1. Tokens (Meadow palette: misty sky, forest, meadow green, ochre)
   2. Base structure and components
   3. Lounge look: sleeves, cards, arched portrait
   4. Spectral-sequence motifs
   ========================================================================== */

:root {
  --measure: 880px;
  --gutter: 16px;
  --bg: #e8ece6;
  --surface: #f5f6f1;
  --surface-2: #dce3da;
  --ink: #1f2d27;
  --muted: #536460;
  --rule: #c5cfc5;
  --accent: #b8801c;
  --accent-ink: #ffffff;
  --accent-2: #4f7a1a;
  --accent-3: #d6a136;
  --accent-4: #7f9bab;
  --link: #3f6a12;
  --sleeve: #394d33;
  --sleeve-ink: #f1efe4;
  --font-display: "DM Serif Display", Georgia, serif;
  --font-body: "Space Grotesk", system-ui, sans-serif;
  --font-meta: "Space Grotesk", system-ui, sans-serif;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d2a25;
    --surface: #26362f;
    --surface-2: #30433a;
    --ink: #eef0e6;
    --muted: #aebcb2;
    --rule: #3c5146;
    --accent: #e3ae48;
    --accent-ink: #1d2a25;
    --accent-2: #a2c25c;
    --accent-4: #b6cbd8;
    --link: #b9d675;
    --sleeve: #30433a;
  }
}
:root[data-theme="dark"] {
  --bg: #1d2a25; --surface: #26362f; --surface-2: #30433a; --ink: #eef0e6; --muted: #aebcb2;
  --rule: #3c5146; --accent: #e3ae48; --accent-ink: #1d2a25; --accent-2: #a2c25c; --accent-4: #b6cbd8;
  --link: #b9d675; --sleeve: #30433a;
}


*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 1.6em 0 .5em;
  color: var(--ink);
}

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

code, pre, .message {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: .85em;
}

.message, pre {
  display: block;
  background: var(--surface-2);
  border-left: 3px solid var(--accent-2);
  padding: .9rem 1rem;
  overflow-x: auto;
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-break: break-word;
}

table { width: 100%; border-collapse: collapse; font-size: .95em; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }

.MathJax_Display { overflow-x: auto; overflow-y: hidden; }

/* --- Layout ------------------------------------------------------------ */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main.wrap { padding-top: 2.5rem; padding-bottom: 4rem; }

@media (min-width: 720px) {
  :root { --gutter: 32px; }
}

/* --- Masthead / nav ---------------------------------------------------- */

.masthead { border-bottom: 1px solid var(--rule); background: var(--bg); }

.masthead-inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1rem var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .01em;
}

.brand-mark { width: 30px; height: 30px; flex: none; overflow: visible; }
.brand-mark .bm-line { stroke: var(--muted); stroke-width: 2.5; }
.brand-mark .bm-z { fill: var(--accent-3); }
.brand-mark .bm-1 { fill: var(--accent-2); }
.brand-mark .bm-2 { fill: var(--accent); }


.nav {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .25rem;
  margin-left: auto;
  font-family: var(--font-meta);
  font-size: .9rem;
}

.nav-item {
  color: var(--ink);
  text-decoration: none;
  padding: .35rem .65rem;
  border-radius: 999px;
  white-space: nowrap;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--ink); color: var(--bg); }

@media (max-width: 719px) {
  .nav {
    margin-left: -.65rem;
    width: calc(100% + 1.3rem);
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
            mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .nav::-webkit-scrollbar { display: none; }
}

/* --- Page heads -------------------------------------------------------- */

.page-head { margin-bottom: 2rem; }
.page-title { font-size: clamp(2.1rem, 6vw, 3.2rem); margin: .2em 0 .3em; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 40em; margin: 0; }

.kicker {
  font-family: var(--font-meta);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent);
  margin: 0 0 .4rem;
}
.kicker a { color: inherit; text-decoration: none; }

/* --- Hero (home) ------------------------------------------------------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 3.5rem;
}

@media (min-width: 720px) {
  .hero { grid-template-columns: 240px 1fr; gap: 3rem; }
}

.hero-portrait { position: relative; max-width: 240px; isolation: isolate; }
@media (max-width: 719px) { .hero-portrait { max-width: 200px; } }
.hero-portrait img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Spectral sequence chart behind the hero (shown by themes that want it). */
.hero-chart { display: none; }
.ss-grid line { stroke: var(--rule); stroke-width: 1; }
.ss-line line { stroke: var(--muted); stroke-width: 2; }
.ss-dot { fill: var(--ink); }
.ss-diff line { stroke: var(--accent-2); stroke-width: 2.2; }
.ss-diff-head { fill: var(--accent-2); }


.hero-title { font-size: clamp(2.4rem, 7vw, 3.6rem); margin: 0 0 .8rem; }
.hero-text p { margin: 0 0 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem !important; }

/* --- Buttons, pills, badges ------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font-meta);
  font-size: .9rem;
  font-weight: 500;
  padding: .55rem 1rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
  word-break: break-all;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); }

.pill {
  display: inline-block;
  font-family: var(--font-meta);
  font-size: .78rem;
  padding: .15rem .6rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }

.badge {
  display: inline-block;
  font-family: var(--font-meta);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 4px;
}
.badge-journal { background: var(--accent-2); color: #fff; }
.badge-preprint { background: var(--surface-2); color: var(--muted); }
.badge-award { background: var(--accent-3); color: #1d1d1b; }

/* --- Sections ---------------------------------------------------------- */

.section { margin-top: 3rem; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 2px solid var(--ink);
  padding-bottom: .6rem;
  margin-bottom: 1.2rem;
}

.section-title { font-size: clamp(1.5rem, 4vw, 2rem); margin: 0; }

.prose > h2, .prose h2 {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  border-bottom: 2px solid var(--ink);
  padding-bottom: .4rem;
  margin-top: 2.6rem;
}
.prose > h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.2rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: .35rem 0; }
.prose ul.toc, .prose ul.facts, .prose ul.course-list { padding-left: 0; }
.prose ul:not([class]) > li::marker { color: var(--accent); }

/* --- Filter ------------------------------------------------------------ */

.filter { display: inline-flex; gap: .3rem; flex-wrap: wrap; }
.filter button {
  font: 500 .82rem var(--font-meta);
  padding: .35rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.filter button span { color: var(--muted); margin-left: .2rem; }
.filter button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.filter button[aria-pressed="true"] span { color: inherit; opacity: .7; }

/* --- Publications ------------------------------------------------------ */

.pubs { list-style: none; margin: 0; padding: 0; }

.pub {
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  gap: 1rem;
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--rule);
}
.pub[hidden] { display: none; }

.pub-year {
  font-family: var(--font-meta);
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  padding-top: .2rem;
}

.pub-title { font-size: 1.15rem; margin: 0 0 .25rem; line-height: 1.3; }
.pub-authors { margin: 0 0 .55rem; color: var(--muted); font-size: .95rem; }
.pub-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0; }

@media (max-width: 519px) {
  .pub { grid-template-columns: 1fr; gap: .2rem; }
}

/* --- Disclosure (abstracts, folds) ------------------------------------ */

details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

details.abstract { margin-top: .6rem; }
details.abstract > summary {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font: 500 .82rem var(--font-meta);
  color: var(--accent);
}
details.abstract > summary::before,
details.fold > summary::before {
  content: "";
  width: .5em;
  height: .5em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .2s ease;
  flex: none;
}
details[open].abstract > summary::before,
details[open].fold > summary::before { transform: rotate(45deg); }
details.abstract > p {
  margin: .6rem 0 0;
  padding: .9rem 1.1rem;
  background: var(--surface-2);
  border-radius: var(--radius);
  font-size: .95rem;
  line-height: 1.6;
}

details.fold {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  margin: .8rem 0;
}
details.fold > summary {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .9rem 1.1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}
details.fold > summary .fold-meta {
  margin-left: auto;
  font: 400 .8rem var(--font-meta);
  color: var(--muted);
  text-align: right;
}
details.fold > .fold-body { padding: 0 1.1rem 1rem; border-top: 1px solid var(--rule); }
details.fold details.fold { background: var(--bg); }

/* --- Feature card ------------------------------------------------------ */

.feature {
  position: relative;
  border-radius: calc(var(--radius) * 2);
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.6rem;
  margin: 0 0 2.5rem;
  overflow: hidden;
}
.feature h2, .feature h3 { margin: .1rem 0 .6rem; border: 0; padding: 0; font-size: clamp(1.4rem, 4vw, 1.9rem); }
.feature p { margin: 0 0 .8rem; }
.feature .facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .8rem 1.5rem;
  margin: 1.2rem 0;
  padding: 0;
  list-style: none;
}
.feature .facts li { margin: 0; }
.feature .facts b {
  display: block;
  font: 600 .72rem var(--font-meta);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.feature .actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }

/* --- Talks (seminar schedules) ---------------------------------------- */

.talk { padding: .9rem 0; border-bottom: 1px dashed var(--rule); }
.talk:last-child { border-bottom: 0; }
.talk-title { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; margin: 0 0 .15rem; line-height: 1.35; }
.talk-speaker { margin: 0; color: var(--muted); font-size: .92rem; }
.talk details.abstract > p { font-size: .9rem; }
.where { font-family: var(--font-meta); font-size: .85rem; color: var(--muted); margin: .9rem 0 .2rem; }

/* --- Course / teaching lists ------------------------------------------ */

.course-list { list-style: none; padding: 0; margin: .6rem 0 0; }
.course-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .2rem 1rem;
  padding: .6rem 0;
  border-bottom: 1px dashed var(--rule);
  margin: 0;
}
.course-list li:last-child { border-bottom: 0; }
.course-list .when { font-family: var(--font-meta); font-size: .82rem; color: var(--muted); text-align: right; }
@media (max-width: 519px) {
  .course-list li { grid-template-columns: 1fr; }
  .course-list .when { text-align: left; }
}

/* --- Notes list -------------------------------------------------------- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.card {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 1.2rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
a.card:hover { border-color: var(--accent); }
.card h3 { margin: 0; font-size: 1.1rem; }
.card p { margin: 0; font-size: .93rem; color: var(--muted); }
.card .card-tag { font: 600 .7rem var(--font-meta); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

.toc { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 2rem; padding: 0; list-style: none; }
.toc li { margin: 0; }

/* --- Footer ------------------------------------------------------------ */

.site-foot { border-top: 1px solid var(--rule); padding: 1.6rem 0 2.5rem; font-family: var(--font-meta); font-size: .85rem; color: var(--muted); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; }
.site-foot a { color: var(--muted); }
.foot-sep { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-3); }

/* ==========================================================================
   Lounge look
   ========================================================================== */

body {
  background:
    radial-gradient(circle at 92% -10%, color-mix(in srgb, var(--accent-2) 22%, transparent) 0 18rem, transparent 18rem),
    radial-gradient(circle at -10% 40%, color-mix(in srgb, var(--accent-3) 10%, transparent) 0 14rem, transparent 14rem),
    var(--bg);
  background-attachment: fixed;
}

.masthead { background: transparent; border-bottom: 0; }
.brand { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--accent); color: var(--accent-ink); }

h1, h2, h3 { font-weight: 400; }
.hero-title { font-size: clamp(2.8rem, 8vw, 4.4rem); line-height: 1; }
.hero-title em, .page-title { font-style: italic; }
.kicker { color: var(--accent-2); }

/* Section heads as colour-block "sleeves". */
.section-head,
.prose > h2 {
  border-bottom: 0;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  position: relative;
  overflow: hidden;
}
.section-head::after,
.prose > h2::after {
  content: "";
  position: absolute;
  right: -1.5rem;
  top: 50%;
  width: 6rem;
  height: 6rem;
  transform: translateY(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--surface) 0 18%, transparent 19%),
    conic-gradient(var(--accent) 0 25%, var(--accent-2) 0 50%, var(--accent-4) 0 75%, var(--accent-3) 0);
  opacity: .9;
  pointer-events: none;
}
.section-head .filter { position: relative; z-index: 1; margin-right: 4.5rem; }
.prose > h2 { padding-right: 6rem; }
.prose > h2:nth-of-type(2n)::after {
  background:
    radial-gradient(circle, var(--surface) 0 18%, transparent 19%),
    conic-gradient(var(--accent-4) 0 33%, var(--accent) 0 66%, var(--accent-2) 0);
}

/* Hero: arched portrait on a coral pill. */
.hero-portrait img { border-radius: 999px 999px var(--radius) var(--radius); }
.hero-portrait::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -14px; right: 14px; top: 22px; bottom: -14px;
  border-radius: 999px 999px var(--radius) var(--radius);
  background: var(--accent-2);
}
.hero-portrait::after {
  content: "";
  position: absolute;
  width: 54px; height: 54px;
  right: -10px; top: -6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Papers as cards. */
.pubs { display: grid; gap: .9rem; }
.pub {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  transition: transform .15s ease, border-color .15s ease;
}
.pub:hover { border-color: var(--accent); }
.pub-year {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
}
.pub-title { font-family: var(--font-body); font-weight: 600; font-size: 1.08rem; }
.badge-journal { background: var(--accent-4); color: #13292c; }
.badge-preprint { background: var(--surface-2); color: var(--ink); }
.badge-award { background: var(--accent); color: var(--accent-ink); }
details.abstract > summary { color: var(--accent); }
details.abstract > p { background: var(--bg); }
.filter button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.btn { border-color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }

.feature {
  background: var(--accent-2);
  border: 0;
  color: #1a1410;
}
.feature-event { background: var(--accent); }
.feature h2, .feature h3 { color: #1a1410; }
.feature a:not(.btn) { color: #1a1410; }
.feature .kicker, .feature .facts b { color: rgba(26,20,16,.65); }
.feature .btn { border-color: #1a1410; color: #1a1410; }
.feature .btn-primary { background: #1a1410; color: #f3e9d2; }
.feature .btn:hover { background: #1a1410; color: #f3e9d2; }
.feature details.abstract > summary { color: #1a1410; }
.feature details.abstract > p { background: rgba(255,255,255,.3); }
.feature::after {
  content: "";
  position: absolute;
  right: -50px; bottom: -50px;
  width: 170px; height: 170px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  box-shadow: -60px -40px 0 -40px rgba(26,20,16,.25);
  pointer-events: none;
}

details.fold { background: var(--surface); }
details.fold details.fold { background: var(--bg); }
details.fold > summary { font-family: var(--font-body); font-weight: 600; }
details.fold[open] > summary { color: var(--accent); }
.message, pre { border-left-color: var(--accent); }
.prose img { border-radius: var(--radius); }

/* --- Spectral-sequence variants (C1, C2) ------------------------------- */

.hero-chart {
  display: block;
  position: absolute;
  z-index: -1;
  top: -3.5rem;
  right: calc(-1 * var(--gutter) - 2rem);
  width: min(900px, 100%);
  opacity: .3;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(100deg, transparent 10%, #000 60%, #000 85%, transparent 100%), linear-gradient(0deg, transparent 15%, #000 55%);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(100deg, transparent 10%, #000 60%, #000 85%, transparent 100%), linear-gradient(0deg, transparent 15%, #000 55%);
          mask-composite: intersect;
}
.hero { isolation: isolate; }
.hero-chart svg { display: block; width: 100%; height: auto; }
@media (max-width: 719px) {
  .hero-chart { width: 120%; top: -1.5rem; opacity: .4; }
}

/* Section heads: the Adams chart for ko instead of the record disc. */
.section-head::after,
.prose > h2::after,
.prose > h2:nth-of-type(2n)::after {
  right: 1rem;
  width: 5.2rem;
  height: 3.6rem;
  border-radius: 0;
  background: var(--accent);
  -webkit-mask: url(/public/img/ko-adams.svg) no-repeat center / contain;
          mask: url(/public/img/ko-adams.svg) no-repeat center / contain;
  opacity: .9;
}
.prose > h2:nth-of-type(2n)::after { background: var(--accent-2); }

/* Abstract toggles read like a chart: a class and its d_3. */
details.abstract > summary::before {
  border: 0;
  width: .55em;
  height: .55em;
  border-radius: 50%;
  background: currentColor;
  transform: none;
}
details[open].abstract > summary::before {
  border-radius: 2px;
  transform: rotate(45deg);
}

.section-head .filter { margin-right: 6rem; }
.ss-diff { opacity: 1; }
.ss-dot, .ss-line { opacity: .75; }

/* --- Meadow specifics ------------------------------------------------- */

body {
  background:
    radial-gradient(circle at 96% -10%, rgba(127, 155, 171, .22) 0 20rem, transparent 20rem),
    radial-gradient(circle at -12% 50%, rgba(108, 147, 28, .10) 0 16rem, transparent 16rem),
    var(--bg);
  background-attachment: fixed;
}

/* Forest-green record sleeves for section heads. */
.section-head,
.prose > h2 { background: var(--sleeve); color: var(--sleeve-ink); }
.section-title { color: var(--sleeve-ink); }
.section-head .filter button { color: var(--sleeve-ink); border-color: rgba(241, 239, 228, .3); }
.section-head .filter button span { color: rgba(241, 239, 228, .7); }
.section-head .filter button[aria-pressed="true"] { background: var(--accent-3); border-color: var(--accent-3); color: #1f2d27; }
.section-head::after,
.prose > h2::after { background: var(--accent-3) !important; }
.prose > h2:nth-of-type(2n)::after { background: #a8c662 !important; }

.ss-dot { fill: var(--sleeve); }
.ss-line line { stroke: var(--accent-4); }
.ss-diff line { stroke: #c2603f; }
.ss-diff-head { fill: #c2603f; }

.nav-item.active { background: var(--sleeve); color: var(--sleeve-ink); }
.kicker { color: var(--accent-2); }
.hero-portrait::before { background: var(--accent-2); }
.hero-portrait::after { background: var(--accent-3); }
.pub-year { color: var(--accent-2); }
.badge-journal { background: var(--accent-2); color: #fff; }
.btn-primary { background: var(--sleeve); border-color: var(--sleeve); color: var(--sleeve-ink); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.filter button[aria-pressed="true"] { background: var(--accent-3); border-color: var(--accent-3); color: #1f2d27; }
details.abstract > summary { color: var(--accent-2); }
details.fold[open] > summary { color: var(--accent-2); }

.feature { background: var(--sleeve); color: var(--sleeve-ink); }
.feature h2, .feature h3,
.feature a:not(.btn), .feature details.abstract > summary { color: var(--sleeve-ink); }
.feature .kicker, .feature .facts b { color: #b9d675; }
.feature .btn { border-color: var(--sleeve-ink); color: var(--sleeve-ink); }
.feature .btn-primary { background: var(--accent-3); border-color: var(--accent-3); color: #1f2d27; }
.feature .btn:hover { background: var(--sleeve-ink); color: var(--sleeve); }
.feature details.abstract > p { background: rgba(255, 255, 255, .1); }
.feature-event { background: var(--accent-3); color: #1f2d27; }
.feature-event h3, .feature-event a:not(.btn),
.feature-event details.abstract > summary { color: #1f2d27; }
.feature-event .kicker, .feature-event .facts b { color: rgba(31, 45, 39, .65); }
.feature-event .btn { border-color: #1f2d27; color: #1f2d27; }
.feature-event .btn-primary { background: #1f2d27; color: #f1efe4; }
.feature-event details.abstract > p { background: rgba(255, 255, 255, .3); }
.section-head .filter button[aria-pressed="true"] span { color: inherit; }

/* --- Page transitions (cross-document View Transitions) --------------- */

@view-transition { navigation: auto; }

.masthead { view-transition-name: masthead; }
main.wrap { view-transition-name: page; }

::view-transition-old(page) { animation: page-out .18s ease-in both; }
::view-transition-new(page) { animation: page-in .32s cubic-bezier(.2, .7, .2, 1) both; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }

@keyframes page-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } }

/* Browsers without View Transitions get a gentle fade-in on load. */
@supports not (view-transition-name: none) {
  main.wrap { animation: page-in .35s cubic-bezier(.2, .7, .2, 1) both; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  main.wrap { animation: none; }
}
