/* Rosetta Neuron Scaling — project page
   Visual language borrowed from avdravid.github.io */

:root {
  --ink: #0a0a0a;
  --muted: #737373;
  --rule: #e5e5e5;
  --accent: #6e9999;
  --accent-soft: rgba(110, 153, 153, 0.35);
  --bg: #ffffff;
  --surface: #f7f7f6;
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 18.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
}

/* ---------- links ---------- */
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 4px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

/* ---------- hero ---------- */
.hero {
  text-align: center;
}

.hero h1 {
  margin: 0 auto;
  max-width: 48rem;
  font-size: clamp(1.9rem, 4.4vw, 2.7rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.authors {
  margin: 1.6rem auto 0;
  max-width: 44rem;
  font-size: 1.0625rem;
}
.authors sup {
  font-size: 0.7em;
  color: var(--muted);
}

.affil {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.affil .sep {
  margin: 0 0.6rem;
  color: var(--rule);
}

/* ---------- link buttons ---------- */
.links {
  margin-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--surface);
}
.btn i {
  font-size: 0.9em;
  color: var(--accent);
}

/* ---------- sections ---------- */
section {
  margin-top: 3.5rem;
}

.section-heading {
  margin: 0 0 1.4rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--rule);
  font-size: 1.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

p {
  margin: 0 0 1.15rem;
}
section p:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: 1.0625rem;
  max-width: 58rem;
}

em {
  font-style: italic;
}

/* ---------- teaser ---------- */
.teaser {
  margin: 2.6rem auto 0;
  max-width: 56rem;
}
.teaser img {
  display: block;
  width: 100%;
  height: auto;
}
.teaser figcaption {
  margin: 0.9rem auto 0;
  max-width: 58rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}
.teaser figcaption b {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- gallery: intro + tab bar ---------- */
.gallery-intro {
  max-width: 58rem;
  color: var(--ink);
}

.tab-bar {
  margin-top: 1.6rem;
  display: flex;
  gap: 1.6rem;
  border-bottom: 1px solid var(--rule);
}

.tab-btn {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0.85rem 0.2rem;
  margin-bottom: -1px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab-btn:hover {
  color: var(--ink);
}
.tab-btn.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ---------- gallery: panels ---------- */
.gallery-panel {
  display: none;
  padding-top: 1.8rem;
}
.gallery-panel.active {
  display: block;
}

.picker-label {
  text-align: center;
  font-size: 0.95rem;
}
.picker-axis {
  font-weight: 500;
}
.picker-arrow {
  display: inline-block;
  margin-left: 0.55rem;
  width: 1.9em;
  height: 0.95em;
  color: var(--accent);
  vertical-align: -0.12em;
  overflow: visible;
}

.picker {
  margin: 0.9rem auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
.picker button {
  appearance: none;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.45rem 1.05rem;
  border: 1px solid #c4c4c4;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease,
    color 0.15s ease;
}
.picker button:hover {
  border-color: var(--ink);
  background: var(--surface);
}
.picker button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.picker-subhead {
  margin-top: 0.7rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
  min-height: 1.4em;
}

.panels {
  margin-top: 1.8rem;
  display: grid;
  gap: 1.6rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  margin: 0;
  position: relative;
}
.panel::after {
  content: "";
  position: absolute;
  top: -10px;
  right: -10px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background-color: rgba(10, 10, 10, 0.78);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='11' y1='8' x2='11' y2='14'/><line x1='8' y1='11' x2='14' y2='11'/><line x1='20.5' y1='20.5' x2='16' y2='16'/></svg>");
  background-size: 14px 14px;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.panel:hover::after {
  transform: scale(1.08);
  background-color: var(--ink);
}
.panel img {
  display: block;
  width: 100%;
  height: auto;
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: #fff;
  cursor: zoom-in;
  transition: opacity 0.18s ease, border-color 0.15s ease;
}
.panel img:hover {
  border-color: #c4c4c4;
}
.panel figcaption {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--muted);
  text-align: center;
  word-break: break-word;
}

.hint {
  color: var(--muted);
  font-style: italic;
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
}
.lightbox[hidden] {
  display: none;
}
.lightbox img {
  max-width: min(96vw, 1600px);
  max-height: 82vh;
  width: auto;
  height: auto;
  padding: 16px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  cursor: default;
}
.lightbox-cap {
  margin: 1rem 0 0;
  max-width: min(96vw, 1600px);
  color: rgba(255, 255, 255, 0.88);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: center;
  word-break: break-word;
}
.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.2rem;
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}
.lightbox-close:hover {
  opacity: 1;
}

/* ---------- bibtex ---------- */
pre {
  margin: 1.2rem 0 0;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink);
}

/* ---------- acknowledgements ---------- */
.ack {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 58rem;
}

/* ---------- footer ---------- */
footer {
  margin-top: 4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}
footer a {
  color: var(--muted);
}

@media (max-width: 720px) {
  .wrap {
    padding: 2.5rem 1.2rem 3.5rem;
  }
  body {
    font-size: 16px;
  }
  .panels {
    grid-template-columns: 1fr;
  }
  .panel figcaption {
    font-size: 0.78rem;
  }
}
