/* ── Colours ───────────────────────────────────────────────
   Light is the default; <html data-theme="dark"> switches to dark (set by the
   script in _includes/head.html and the ☾ button). Use these variables for
   every colour so both themes keep working. */
:root {
  --container-bg: #fdf6e3;
  --body-bg: #f5e9c8;
  --text-color: #586e75;
  --card-bg: #ffffff;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --rule-color: #ccc;
  --accent-1: #cb4b16;
  --accent-2: #b58900;
  --accent-3: #859900;
  --accent-4: #2aa198;
  --accent-5: #268bd2;
  --accent-6: #6c71c4;
  --warning-bg: #e9c6c281;
  --warning-text: #751812;
  --warning-edge: #c0392b;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --container-bg: #0e1a2b;
  --body-bg: #0e1a2b;
  --text-color: #bfbfdb;
  --card-bg: #1c2b3a;
  --shadow-color: rgba(230, 218, 255, 0.1);
  --rule-color: #3a4a5c;
  --accent-1: #935047;
  --accent-2: #9b7b1c;
  --accent-3: #728f3f;
  --accent-4: #2e8582;
  --accent-5: #4677aa;
  --accent-6: #8a7fc4;
  --warning-bg: #7f2b2b2b;
  --warning-text: #d17b70;
}

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

body {
  margin: 0;
  font-family: sans-serif;
  line-height: 1.4;
  background-color: var(--body-bg);
  color: var(--text-color);
}

.container {
  position: relative;
  z-index: 1;
  width: calc(100% - 40px);
  max-width: 1300px;
  margin: 40px auto;
  padding: 40px 30px 24px;
  background: var(--container-bg);
  border-radius: 10px;
  box-shadow: 0 0 20px var(--shadow-color);
}

.container.narrow {
  max-width: 700px;
}

@media (max-width: 500px) {
  .container {
    width: calc(100% - 16px);
    margin: 16px auto;
    padding: 24px 16px 16px;
  }
}

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

a {
  color: inherit;
}

h1 {
  margin: 0;
  font-size: 2em;
}

main h1 {
  margin-bottom: 0.5em;
}

hr {
  clear: both;
  border: none;
  border-top: 1px solid var(--rule-color);
  margin: 10px 0 20px;
}

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

.centred {
  text-align: center;
}

/* ── Layout helpers ───────────────────────────────────── */

/* Two columns side by side on wide screens, one after the other on phones. */
.columns {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

@media (min-width: 800px) {
  .columns {
    flex-direction: row;
    align-items: flex-start;
    column-gap: 60px;
  }

  .columns > * {
    flex: 1;
    min-width: 0;
  }

  .columns > :last-child {
    flex: 1.2;
  }
}

/* A vertical pile of cards/tiles with even gaps. */
.stack {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.stack > hr {
  margin: 5px 0;
}

/* ── Text ─────────────────────────────────────────────── */
.subheading {
  margin-bottom: 30px;
  font-size: 1.1em;
}

.subheading > :last-child {
  margin-bottom: 0;
}

.section-header {
  margin: 0 0 10px;
  font-size: 0.9em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 700;
}

.prose {
  line-height: 1.5;
}

.prose h2:first-of-type {
  margin-top: 0;
}

.prose li {
  margin-bottom: 0.4em;
}

/* A heading that is a logo image (the alt text is the heading's text). */
.logo-heading {
  margin: 20px 0;
}

.logo-heading img {
  display: block;
  width: 100%;
  border-radius: 12px;
}

/* Homepage photo + bio. The photo only sits beside the text when there's
   room for a decent line length next to it; in a narrow column (phones,
   half-screen windows) it goes centred above the text instead. */
.intro {
  container-type: inline-size;
}

.intro p {
  text-wrap: pretty;   /* avoid one-word last lines where supported */
}

.profile-photo {
  display: block;
  width: 150px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 10px;
  border: 4px solid var(--text-color);
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
}

@container (min-width: 440px) {
  .profile-photo {
    float: left;
    margin: 0 20px 10px 0;
  }
}

.side-logo {
  float: left;
  width: 100px;
  margin: 0 20px 10px 0;
}

.file-meta {
  font-family: var(--mono);
  font-size: 0.8em;
  opacity: 0.85;
}

/* Red "heads up" box. Add .big for a standalone one. */
.warning {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 5px solid var(--warning-edge);
  border-radius: 8px;
  background: var(--warning-bg);
  color: var(--warning-text);
  font-size: 0.9em;
}

.warning strong {
  display: block;
  margin-bottom: 4px;
}

.warning p {
  margin: 0 0 0.6em;
}

.warning.big {
  margin: 20px 0;
  padding: 16px 18px;
  border-left-width: 6px;
  font-size: 1em;
  box-shadow: 0 2px 4px var(--shadow-color);
}

.warning.big strong {
  font-size: 1.05em;
  margin-bottom: 6px;
}

.button {
  display: inline-block;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: var(--text-color);
  color: var(--card-bg);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.redirect {
  text-align: center;
}

.footer {
  margin-top: 30px;
  font-family: var(--mono);
  font-size: 0.75em;
  opacity: 0.75;
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* People who've asked their device for less motion get no wobbles. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ── Header: name or back arrow, plus the light/dark button ── */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.home-link,
.toggle-theme {
  display: inline-block;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text-color);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-link {
  font-size: 1.8em;
}

.toggle-theme {
  font-size: 1.5em;
}

.home-link:hover,
.toggle-theme:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 6px var(--shadow-color);
}

/* Full name on wide screens, "Jools / Clarke" on narrow ones. */
.full-name {
  display: none;
}

@media (min-width: 500px) {
  .full-name {
    display: inline;
  }

  .short-name {
    display: none;
  }
}

/* ── Banner: strip across the top (front matter `banner:`) ── */
.banner {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 10px 15px;
  background: var(--accent-5);
  color: white;
  text-align: center;
  font-size: 0.95em;
}

.banner a {
  color: white;
  font-weight: bold;
}

.banner a:hover {
  text-decoration: none;
}

.banner-quiet {
  padding: 6px max(12px, env(safe-area-inset-right)) 6px 12px;
  background: var(--card-bg);
  color: var(--text-color);
  text-align: right;
  font-size: 0.8em;
  box-shadow: 0 2px 4px var(--shadow-color);
}

.banner-quiet a {
  color: var(--text-color);
  font-weight: normal;
  text-decoration: none;
}

.banner-quiet a:hover {
  text-decoration: underline;
}

/* ── Background: faint mission logos tiled behind the page ── */
.background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 40px;
  padding: 20px;
  justify-items: center;
  align-items: center;
}

.background img {
  opacity: 0.2;
}

[data-theme="dark"] .background img {
  filter: invert(100%);
  opacity: 0.4;
}

/* ── Card (_includes/card.html): white box, coloured left edge ── */
.link-box {
  display: block;
  padding: 20px;
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--text-color);
  text-decoration: none;
  box-shadow: 0 4px 6px var(--shadow-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a.link-box:hover,
.link-box[data-copy]:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 12px var(--shadow-color);
}

.link-box h3 {
  margin: 0 0 5px;
  font-size: 1.2em;
}

.link-box p {
  margin: 0 0 0.4em;
  font-size: 0.95em;
}

.link-box p:last-child {
  margin-bottom: 0;
}

.accent-1 { border-left: 6px solid var(--accent-1); }
.accent-2 { border-left: 6px solid var(--accent-2); }
.accent-3 { border-left: 6px solid var(--accent-3); }
.accent-4 { border-left: 6px solid var(--accent-4); }
.accent-5 { border-left: 6px solid var(--accent-5); }
.accent-6 { border-left: 6px solid var(--accent-6); }

/* A single big call to action. */
.link-box.big {
  margin: 20px 0;
  padding: 24px;
  font-size: 1.1em;
  font-weight: bold;
}

/* "Coming soon": greyed out, shakes its head when you hover. */
.not-ready {
  cursor: not-allowed;
  opacity: 0.7;
}

.not-ready:hover {
  animation: shake 0.3s;
}

@keyframes shake {
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
}

/* ── Picture tiles (_includes/tile.html) ─────────────────── */

/* Logo shown whole in a card. */
.logo-tile {
  text-align: center;
}

.logo-tile img {
  display: block;
  max-width: 160px;
  max-height: 120px;
  width: auto;
  margin: 0 auto;
  transition: transform 0.2s ease;
}

.logo-tile:hover img {
  transform: translateY(-5px);
}

/* Picture filling the card with a title over it. */
.cover-tile {
  padding: 0;
  overflow: hidden;
}

.cover {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 300px;   /* don't get huge when the column is full width */
  overflow: hidden;
}

/* Dimmed so the white title is readable over it. */
.cover > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(80%) saturate(0.5);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.cover-tile:hover .cover > img {
  transform: scale(1.05);
  filter: brightness(70%) saturate(1.1);
}

.cover-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  text-align: center;
  color: white;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

.cover-text h3 {
  margin: 0;
  font-size: 1.3em;
}

.cover-text p {
  margin: 5px 0 0;
  opacity: 0.9;
}

/* ── File card (_includes/file-card.html): preview + details ── */
.file-card {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.file-preview {
  flex: 0 1 220px;
}

.file-preview img {
  display: block;
  border-radius: 6px;
  box-shadow: 0 2px 6px var(--shadow-color);
  transition: transform 0.2s ease;
}

.file-preview:hover img {
  transform: translateY(-3px);
}

.file-info {
  flex: 1 1 200px;
}

.file-info .file-meta {
  margin: 0 0 0.8em;
}

.file-actions {
  display: flex;
  gap: 10px;
  margin-top: 1em;
}

/* ── Confetti: any element with class="has-confetti" (see site.js) ── */
.has-confetti {
  position: relative;
}

.confetti {
  position: absolute;
  inset: -20px;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  opacity: 0;
  animation: confetti-fall 1.2s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(80px) rotate(360deg);
    opacity: 0;
  }
}

/* ── Click-to-copy (site.js): the "Email address copied" pop-up ── */
[data-copy],
a[href="#copy"] {
  cursor: copy;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1000;
  padding: 12px 18px;
  border-left: 6px solid var(--accent-3);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-color);
  font-weight: bold;
  box-shadow: 0 8px 20px var(--shadow-color), 0 0 0 1px var(--shadow-color);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}


/* ── page-specific ─────────────────────────────────────── */
/* ── /conferences/: list on the left, map on the right ────── */
.map-layout {
  display: flex;
  gap: 20px;
  height: 75vh;
}

.conf-list {
  width: 320px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 15px;
  border-radius: 10px;
  background: var(--card-bg);
  box-shadow: 0 2px 6px var(--shadow-color);
}

.conf-list h1 {
  margin: 5px 0 15px;
  font-size: 1.5em;
  text-align: center;
}

.conf-item {
  margin-bottom: 10px;
  padding: 10px;
  border-left: 6px solid var(--accent-5);
  border-radius: 8px;
  background: var(--card-bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.conf-item:hover,
.conf-item.highlight {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow-color);
}

.conf-item[open] {
  border-left-color: var(--accent-3);
  background: rgba(133, 153, 0, 0.12);
}

.conf-item summary {
  font-weight: bold;
  cursor: pointer;
  list-style: none;
}

.conf-item summary::-webkit-details-marker {
  display: none;
}

.conf-item img {
  display: block;
  width: 100%;
  margin-top: 8px;
  border-radius: 6px;
}

.conf-item p {
  margin: 8px 0 0;
}

#map {
  flex: 1;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px var(--shadow-color);
}

@media (max-width: 900px) {
  .map-layout {
    flex-direction: column;
    height: auto;
  }

  .conf-list {
    order: 2;
    width: 100%;
    max-height: 40vh;
  }

  #map {
    order: 1;
    height: 60vh;
  }
}

/* ── /ariel/gallery/: grid of previews + a pop-up viewer ─── */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 25px;
}

.poster {
  margin: 0;
}

.poster-preview {
  display: block;
  aspect-ratio: 3 / 4.2;
  overflow: hidden;
  border-radius: 10px;
  background: var(--card-bg);
  box-shadow: 0 4px 8px var(--shadow-color);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.poster-preview:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 10px 16px var(--shadow-color);
}

.poster-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.poster figcaption {
  padding: 10px 4px 0;
  font-size: 0.9em;
}

.viewer {
  max-width: min(90vw, 900px);
  max-height: 90vh;
  padding: 20px;
  border: none;
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--text-color);
  text-align: center;
  box-shadow: 0 0 20px var(--shadow-color);
}

.viewer::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.viewer img {
  display: block;
  max-height: 70vh;
  width: auto;
  margin: 0 auto 15px;
  border-radius: 10px;
}

.viewer-close {
  float: right;
  border: none;
  background: none;
  color: inherit;
  font-size: 1.4em;
  cursor: pointer;
}

/* ── Countdown (perturb/perturb-c_arxiv_hook/index_legacy.html) ── */
.countdown {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 25px;
  font-size: 1.4em;
  font-weight: bold;
}

.time-box {
  min-width: 80px;
  padding: 15px 18px;
  border-radius: 10px;
  background: var(--card-bg);
  box-shadow: 0 4px 6px var(--shadow-color);
}

.time-box .label {
  display: block;
  margin-top: 4px;
  font-size: 0.6em;
  font-weight: normal;
  opacity: 0.8;
}

.note {
  margin-top: 35px;
  font-size: 0.95em;
  opacity: 0.8;
}

