/* napdivad.com — palette taken from the logo: neon cyan and magenta on near-black */

:root {
  --bg:        #04040a;
  --text:      #e8e8f2;
  --muted:     #8a8aa6;
  --rule:      #1b1b2c;
  --cyan:      #22e0ff;
  --magenta:   #ff3df0;

  --mono:      ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --measure:   36rem;   /* comfortable reading width */
  --gutter:    1.5rem;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 0.9375rem/1.75 var(--mono);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Backdrop layers — all fixed, non-interactive, behind content
   ============================================================ */

.fx-grid, .fx-bloom, .fx-scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

/* Faint circuit grid, faded out toward the bottom of the viewport. */
.fx-grid {
  z-index: -2;
  background-image:
    linear-gradient(rgba(34, 224, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 224, 255, 0.055) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
          mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
}

/* Cyan/magenta bloom echoing the logo's glow. */
.fx-bloom {
  z-index: -1;
  background:
    radial-gradient(44rem 32rem at 20% -10%, rgba(34, 224, 255, 0.15), transparent 70%),
    radial-gradient(40rem 30rem at 86%   2%, rgba(255, 61, 240, 0.12), transparent 70%);
}

/* CRT scanlines. Kept very low contrast — enough to read as texture,
   not enough to interfere with the type. */
.fx-scanlines {
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(180, 240, 255, 0.030) 0px,
    rgba(180, 240, 255, 0.030) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* ============================================================
   Layout
   ============================================================ */

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 5.5rem) var(--gutter) clamp(4rem, 12vw, 7rem);
}

.intro {
  margin-bottom: 4rem;
  text-align: center;
}

/* ---------- logo ---------- */

/* Block-level so the name drops to its own line; `fit-content` keeps the
   bloom pseudo-element anchored to the image rather than the column. */
.logo-wrap {
  position: relative;
  display: block;
  width: fit-content;
  margin: 0 auto 1.5rem;
}

/* Soft round bloom behind the mark. Done as a gradient rather than a
   drop-shadow filter because the source is an opaque JPEG — a filter
   would trace its square edge instead of the artwork. */
.logo-wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 220%;
  height: 220%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(34, 224, 255, 0.18), rgba(255, 61, 240, 0.09) 42%, transparent 68%);
  animation: bloom-pulse 5s ease-in-out infinite;
  pointer-events: none;
}

.logo {
  position: relative;
  display: block;
  /* The artwork sits inside a lot of black padding, so the box runs larger
     than the mark actually appears. */
  width: clamp(9.5rem, 28vw, 12.5rem);
  height: auto;
  /* The source image is neon artwork on a solid black field. `screen` blends
     that black away, so the mark sits on the page background with no visible
     box — no transparent PNG needed. */
  mix-blend-mode: screen;
}

@keyframes bloom-pulse {
  0%, 100% { opacity: 0.75; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.07); }
}

/* ---------- name ---------- */

h1 {
  position: relative;
  display: inline-block;
  margin: 0;
  font-size: clamp(1.9rem, 7vw, 2.9rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-shadow: 0 0 22px rgba(34, 224, 255, 0.28);
}

/* Chromatic aberration: two colored copies sit under the text, offset in
   opposite directions. Static — the fringe is the effect, no animation. */
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  mix-blend-mode: screen;
  pointer-events: none;
}

.glitch::before {
  color: var(--magenta);
  transform: translate(-0.022em, 0);
}

.glitch::after {
  color: var(--cyan);
  transform: translate(0.022em, 0);
}

/* ============================================================
   Sections
   ============================================================ */

section { margin-bottom: 3.5rem; }
section:last-of-type { margin-bottom: 0; }

h2 {
  position: relative;
  margin: 0 0 1.5rem;
  padding-bottom: 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(34, 224, 255, 0.45);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(to right, var(--cyan), rgba(34, 224, 255, 0.12) 45%, transparent) 1;
}

h2::before {
  content: "// ";
  color: var(--magenta);
  text-shadow: 0 0 14px rgba(255, 61, 240, 0.5);
}

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

/* ---------- papers ---------- */

.entries, .links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry + .entry {
  margin-top: 2.25rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--rule);
}

/* Classed rather than tag-based: entries nest one level deeper inside a
   series, so the heading level varies while the presentation does not. */
.entry-title {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.005em;
}

/* ---------- series ---------- */

/* A run of related entries, presented as one unit rather than as peers in
   a dated list. The left rules draw the trunk-and-branches shape. */
.series {
  margin-bottom: 3.5rem;
  padding-left: 1.15rem;
  border-left: 1px solid rgba(255, 61, 240, 0.3);
}

.series-title {
  margin: 0 0 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--magenta);
  text-shadow: 0 0 14px rgba(255, 61, 240, 0.4);
}

.series-note {
  margin: 0 0 2.25rem;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.8;
}

/* The three notes extend the paper above them; they do not follow it. */
.branches {
  margin-top: 2.25rem;
  padding-left: 1.15rem;
  border-left: 1px solid var(--rule);
}

.branch-label {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.branch-label::before {
  content: "\21B3\00A0\00A0";  /* ↳ */
  color: var(--magenta);
}

.meta {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sep { color: var(--rule); }

.tag {
  color: var(--magenta);
  font-weight: 700;
  text-shadow: 0 0 12px rgba(255, 61, 240, 0.45);
}

.tag::before { content: "["; opacity: 0.55; }
.tag::after  { content: "]"; opacity: 0.55; }

.summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.8;
}

/* Row of access links under an entry — full text, alternate versions, DOI. */
.assets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin: 1rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.assets a {
  color: var(--muted);
  border-bottom-color: transparent;
}

.assets a:hover, .assets a:focus-visible {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.assets .tag { margin-right: 0.35rem; }

/* ---------- links ---------- */

.links li { margin-bottom: 0.6rem; }
.links li:last-child { margin-bottom: 0; }

a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(34, 224, 255, 0.3);
  transition: color 0.16s ease, border-color 0.16s ease, text-shadow 0.16s ease;
}

a:hover, a:focus-visible {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  text-shadow: 0 0 16px rgba(34, 224, 255, 0.6);
}

a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Two nested indents cost real measure on a phone, so tighten them. */
@media (max-width: 30rem) {
  .series, .branches { padding-left: 0.8rem; }
}

/* ============================================================
   Accessibility
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
