:root {
  --accent: #ffbb00;
  --content-bg: #ffffff;
  --content-text: #1a1a1a;
  --panel-text: #ffffff;
  --separator: #e0e0e0;
  --hairline: 0.0625rem;
  --sidebar-width: clamp(12.5rem, 33%, 28rem);
  --panel-bg: center / cover no-repeat url("assets/bg.jpg");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: system-ui, sans-serif;
  color: var(--content-text);
  background: var(--content-bg);
}

/* Sidebar dissolves on mobile so content can sit between identity and the
   bottom panel; children fall back to plain document flow, reordered with
   `order` to match the mobile wireframe (identity, content, radio, links). */
.sidebar {
  display: contents;
}

.identity-block {
  order: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 1rem;
  background: var(--panel-bg);
  color: var(--panel-text);
  text-align: center;
}

.identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}

/* Deliberately not --accent: that yellow is Fréquence Banane's alone. A
   plain outline in the panel's own text color stays prominent (it's still
   a clear button, breaking up the photo background) without competing. */
.cv-link {
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  border: var(--hairline) solid var(--panel-text);
  color: var(--panel-text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.cv-link:hover,
.cv-link:focus {
  background: var(--panel-text);
  color: var(--content-text);
}

.identity-photo {
  width: 50%;
  min-width: 4rem;
  max-width: 9rem;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
}

.identity-name {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 600;
}

.identity-title {
  font-size: clamp(0.8rem, 1.4vw, 1rem);
  opacity: 0.85;
}

.content {
  order: 2;
  flex: 1;
  padding: 1.5rem;
}

.switcher {
  display: flex;
  gap: 1.75rem;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: var(--hairline) solid var(--separator);
}

.switcher a {
  position: relative;
  padding-bottom: 0.6rem;
  color: var(--content-text);
  text-decoration: none;
  font-weight: 500;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.switcher a:hover,
.switcher a:focus {
  opacity: 0.85;
}

/* The active tab is set by content.js's shared section() router, which
   already knows which section is showing — mirrors the js-active class it
   toggles on the section itself. The bar exists on every tab, collapsed to
   a point at its center, so toggling .active can animate it growing
   outward rather than popping in. */
.switcher a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.125rem;
  border-radius: 999px;
  background: var(--content-text);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.switcher a.active {
  opacity: 1;
}

.switcher a.active::after {
  transform: scaleX(1);
}

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

section {
  display: none;
}

#home {
  display: block;
}

#research:target,
#projects:target,
#notes:target {
  display: block;
}

#research:target ~ #home,
#projects:target ~ #home,
#notes:target ~ #home {
  display: none;
}

/* Research, Projects and Notes support "#research/<id>" / "#projects/<id>" /
   "#notes/<id>" deep routes, which :target can't match since ids come from
   JSON, not the stylesheet. Their scripts toggle this class to keep the
   section visible for those routes. */
#research.js-active,
#projects.js-active,
#notes.js-active {
  display: block;
}

#research.js-active ~ #home,
#projects.js-active ~ #home,
#notes.js-active ~ #home {
  display: none;
}

.panel-bottom {
  order: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1rem;
  background: var(--panel-bg);
  color: var(--panel-text);
}

.radio {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#radio-toggle {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

#radio-toggle:disabled {
  background: transparent;
  color: inherit;
  opacity: 0.7;
  cursor: default;
}

.icon-play {
  width: 0;
  height: 0;
  margin-left: 0.15rem;
  border-top: 0.5rem solid transparent;
  border-bottom: 0.5rem solid transparent;
  border-left: 0.8rem solid currentColor;
}

.icon-pause {
  display: none;
  width: 0.9rem;
  height: 1rem;
  background:
    linear-gradient(currentColor, currentColor) left / 30% 100% no-repeat,
    linear-gradient(currentColor, currentColor) right / 30% 100% no-repeat;
}

#radio-toggle[aria-pressed="true"] .icon-play {
  display: none;
}

#radio-toggle[aria-pressed="true"] .icon-pause {
  display: block;
}

.radio-label {
  font-size: 0.9rem;
  color: inherit;
}

.links {
  display: flex;
  gap: 1rem;
}

.links a {
  color: inherit;
}

.home-intro {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 40rem;
  margin-bottom: 2.5rem;
}

.home-intro p {
  margin: 0;
}

.home-heading {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.paper-list,
.project-list,
.home-work {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.paper-item,
.project-item,
.home-item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 1.5rem;
  border-bottom: var(--hairline) solid var(--separator);
}

.paper-item:last-child,
.project-item:last-child {
  border-bottom: none;
}

.paper-teaser-link,
.project-teaser-link,
.home-teaser-link {
  display: block;
}

.paper-teaser,
.project-teaser,
.home-teaser {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.paper-text,
.project-text,
.home-text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.paper-text h3,
.project-text h3,
.note-item h3,
.home-text h3 {
  margin: 0;
}

.paper-text h3 a,
.project-text h3 a,
.note-item h3 a,
.home-text h3 a {
  color: inherit;
  text-decoration: none;
}

.paper-text h3 a:hover,
.paper-text h3 a:focus,
.project-text h3 a:hover,
.project-text h3 a:focus,
.note-item h3 a:hover,
.note-item h3 a:focus,
.home-text h3 a:hover,
.home-text h3 a:focus {
  text-decoration: underline;
}

.paper-authors,
.paper-venue,
.project-context,
.note-date,
.home-kind {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.paper-summary,
.project-summary,
.note-summary,
.home-summary {
  margin: 0;
}

.paper-quicklinks,
.project-quicklinks,
.note-quicklinks {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

.paper-quicklinks a,
.project-quicklinks a,
.note-quicklinks a {
  color: inherit;
}

/* Selected work is 3 curated items, not a scannable list of many — more air
   between rows, no separator rule, and a framed teaser (plot/render images
   here have white backgrounds of their own, which otherwise disappear
   against the page). */
.home-work {
  gap: 2.5rem;
}

.home-item {
  border-bottom: none;
  padding-bottom: 0;
}

.home-teaser {
  border: var(--hairline) solid var(--separator);
}

.paper-detail,
.project-detail,
.note-detail {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 40rem;
}

.paper-header,
.project-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}

.paper-heading,
.project-heading {
  display: flex;
  flex: 1 1 16rem;
  flex-direction: column;
  gap: 0.5rem;
}

.paper-heading h2,
.project-heading h2,
.note-detail h2 {
  margin: 0;
}

.paper-visual,
.project-visual {
  flex: 0 1 16rem;
  width: 100%;
  max-width: 16rem;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.paper-links,
.project-links,
.note-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.paper-links a,
.project-links a,
.note-links a {
  color: inherit;
}

.paper-visuals,
.project-media {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.paper-visuals img,
.paper-visuals video,
.project-media img,
.project-media video {
  width: 100%;
  max-width: 30rem;
}

.paper-bibtex {
  overflow-x: auto;
  padding: 1rem;
  border: var(--hairline) solid var(--separator);
  font-size: 0.85rem;
  white-space: pre-wrap;
}

/* Notes have no imagery: each item is just its text column (title, date,
   summary, links) with no teaser to sit beside, so it needs neither the
   .paper-item/.project-item row wrapper nor a .paper-text/.project-text
   inner column — the two collapse into one element. Tighter padding than
   Research/Projects keeps the list dense (see design/notes.md). */
.note-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.note-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-bottom: 1rem;
  border-bottom: var(--hairline) solid var(--separator);
}

.note-item:last-child {
  border-bottom: none;
}

@media (min-width: 720px) {
  body {
    flex-direction: row;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 0 0 var(--sidebar-width);
    /* Keep the player/links reachable when .content scrolls past one screen. */
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--panel-bg);
  }

  .identity-block,
  .panel-bottom {
    background: none;
  }

  .content {
    flex: 1;
  }

  .paper-item,
  .project-item,
  .home-item {
    flex-direction: row;
    align-items: stretch;
    gap: 1.5rem;
  }

  .paper-teaser-link,
  .project-teaser-link,
  .home-teaser-link {
    flex: 0 0 14rem;
  }

  .paper-teaser,
  .project-teaser,
  .home-teaser {
    height: 100%;
  }
}
