/* The Cross Section — tropical, vibey, auto light/dark. Coral, magenta, teal, mango. */

:root {
  /* dark: deep tropical night */
  --bg: #0c0a14;
  --bg-raise: #16121f;
  --ink: #f3ecec;
  --ink-muted: #a89bb4;
  --hairline: #2e2540;
  --beam-a: #ff4d94;   /* magenta */
  --beam-b: #ff7a5c;   /* coral */
  --beam-c: #ffc24d;   /* mango */
  --beam-d: #2ee6c6;   /* teal */
  --link: #ff7a5c;
  --accent: #2ee6c6;
  --serif: "Newsreader", Georgia, serif;
  --display: "Fraunces", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --grad: linear-gradient(100deg, var(--beam-a), var(--beam-b) 40%, var(--beam-c) 65%, var(--beam-d));
}

@media (prefers-color-scheme: light) {
  :root {
    /* light: warm guava paper */
    --bg: #fff6ef;
    --bg-raise: #ffeee2;
    --ink: #23131f;
    --ink-muted: #8a5a6e;
    --hairline: #f2d3cc;
    --beam-a: #e11d74;   /* magenta */
    --beam-b: #f0512f;   /* coral */
    --beam-c: #e0900a;   /* mango */
    --beam-d: #00a897;   /* teal */
    --link: #e11d74;
    --accent: #00a897;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
}

.beamline {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--beam-a) 15%, var(--beam-b) 40%, var(--beam-c) 62%, var(--beam-d) 85%, transparent);
}

/* ---------- masthead ---------- */

.masthead { text-align: center; padding: 0 1rem 1.6rem; }

.wordmark {
  display: inline-block;
  margin-top: 2.2rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.wordmark em {
  font-style: italic;
  font-weight: 400;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 0.7rem 0 1.1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.masthead nav {
  display: inline-flex;
  gap: 1.6rem;
  padding: 0.55rem 1.4rem;
  border: 1px solid var(--hairline);
  border-radius: 99px;
  /* Gradient painted across the whole nav, then clipped to the link text so
     the spectrum spans the bar as one sweep (rather than repeating per link). */
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
}
.masthead nav a {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  /* Transparent fill lets the nav's clipped gradient show through the glyphs. */
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 0.15s ease;
}
.masthead nav a:hover { filter: brightness(1.25); }
@media (max-width: 480px) {
  .masthead nav { gap: 1rem; padding: 0.5rem 1rem; }
  body { font-size: 17.5px; }
}

/* ---------- layout ---------- */

main { max-width: 46rem; margin: 0 auto; padding: 1.5rem 1.2rem 4rem; }

.issue {
  padding: 2.2rem 0 1rem;
  border-top: 1px solid var(--hairline);
}
.issue:first-child { border-top: none; }

.kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--beam-b);
}

.issue-date, .page-title {
  font-family: var(--display);
  font-weight: 560;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  letter-spacing: -0.015em;
  margin: 0.2rem 0 0.8rem;
  line-height: 1.12;
}

.meta { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin-bottom: 1.4rem; }
.count {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-right: 0.4rem;
}
.chip {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  padding: 0.18rem 0.6rem;
  border: 1px solid var(--hairline);
  border-radius: 99px;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* a chip that leads to a topic's own mirrored page */
.chip-link {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--hairline));
  color: var(--accent);
  transition: border-color 0.15s, color 0.15s;
}
.chip-link:hover { border-color: var(--accent); color: var(--ink); }

/* ---------- article typography ---------- */

.issue h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  margin: 2.4rem 0 0.7rem;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--hairline);
}
.issue h3 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.18rem;
  margin: 1.7rem 0 0.4rem;
}
.issue p { margin: 0.8rem 0; }
.issue li { margin: 0.45rem 0; }
.issue strong { font-weight: 700; }

.issue a, .lede a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
  text-underline-offset: 3px;
}
.issue a:hover { text-decoration-color: var(--link); }

/* arXiv ID links get the mono treatment */
.issue a[href*="arxiv.org/abs/"] {
  font-family: var(--mono);
  font-size: 0.82em;
  white-space: nowrap;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 2.5rem 0 0.8rem;
}

/* "From the community" — set it apart with a teal edge. */
.issue h2#from-the-community,
.issue h2[id^="from-the-community"] {
  border-top-color: var(--accent);
}

/* Watchlist page: give the topic briefings a coral spine. */
.watch-post { border-left: 2px solid transparent; border-image: var(--grad) 1; padding-left: 1.2rem; }

/* the subtle footer link to the watch page */
.secret {
  color: var(--ink-muted);
  opacity: 0.35;
  text-decoration: none;
  padding: 0 0.15em;
  transition: opacity 0.2s, color 0.2s;
}
.secret:hover { opacity: 1; color: var(--beam-a); }

/* ---------- issue lists (index + archive) ---------- */

.issue-list { list-style: none; margin: 0; padding: 0; }
.issue-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
  align-items: baseline;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--hairline);
}
.issue-list .date {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 560;
}
.issue-list a { color: var(--ink); text-decoration: none; }
.issue-list a:hover .date { color: var(--link); }
.issue-list .themes { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* ---------- misc ---------- */

.lede { color: var(--ink-muted); font-style: italic; margin-top: -0.4rem; }
.empty { color: var(--ink-muted); font-style: italic; text-align: center; padding: 3rem 0; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--hairline);
}
.pager a {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  text-decoration: none;
}
.pager a:hover { color: var(--link); }
.pager .next { margin-left: auto; }

.memory-archive { margin-top: 3rem; }
.memory-archive summary {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  cursor: pointer;
}

footer { text-align: center; padding-bottom: 2.5rem; }
footer p {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  padding: 1.4rem 1rem 0;
}

/* KaTeX sizing relative to body text */
.katex { font-size: 1.02em; }

/* ---------- mirrors (topic_default.html): a per-paper stream in house style ---------- */

.readout { margin: 0.6rem 0 1.2rem; }
.readout .chip-link { margin-left: auto; }
.topic-day .issue-date { font-size: clamp(1.4rem, 3.5vw, 1.9rem); }
.topic-day .issue-date a { color: var(--ink); text-decoration: none; }
.topic-day .issue-date a:hover { color: var(--link); }
.topic-intro { color: var(--ink-muted); }

.paper { margin: 1.6rem 0 0; padding-left: 1.2rem; border-left: 2px solid var(--hairline); }
.paper:target { border-left-color: var(--accent); }
.paper-id {
  margin: 0 0 0.2rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.paper-id a { color: var(--beam-c); text-decoration: none; }
.paper-id a:hover { color: var(--link); }
.paper-id .permalink { margin-left: 0.5rem; opacity: 0.4; }
.paper-id .permalink:hover { opacity: 1; }
/* Override the .issue h3 italic: paper titles are the primary heading here. */
.topic-day .paper-title {
  font-family: var(--display);
  font-style: normal;
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0 0 0.25rem;
}
.byline {
  margin: 0 0 0.6rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

/* year pagination on mirror pages */
.years { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; margin: 0 0 1rem; }
.years a {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-decoration: none;
  padding-bottom: 0.15rem;
  border-bottom: 2px solid transparent;
}
.years a .n { opacity: 0.6; font-size: 0.7rem; }
.years a:hover { color: var(--link); }
.years a.current { color: var(--ink); border-bottom-color: var(--accent); }
