/* Under The Microscope — modern editorial redesign */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter+Tight:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --paper: oklch(98% 0.005 85);
  --paper-2: oklch(95.5% 0.008 85);
  --rule: oklch(86% 0.01 85);
  --ink: oklch(18% 0.01 260);
  --ink-soft: oklch(38% 0.01 260);
  --ink-mute: oklch(55% 0.01 260);
  --accent: oklch(82% 0.19 130);   /* acid lime */
  --accent-ink: oklch(35% 0.12 130);
  --deep: oklch(28% 0.07 260);     /* ink blue */
  --highlight: oklch(95% 0.13 110); /* highlighter yellow-green */

  --serif: 'Instrument Serif', 'Times New Roman', Georgia, serif;
  --sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

  --maxw: 1240px;
  --maxw-narrow: 720px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  padding: 0;
}

img { max-width: 100%; display: block; }

/* ---------- Utility ---------- */
.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}
.serif { font-family: var(--serif); font-weight: 400; }
.muted { color: var(--ink-mute); }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklch, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 14px 32px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 28%, var(--ink) 28.5%, var(--ink) 30%, transparent 30.5%),
    radial-gradient(circle at 50% 50%, var(--accent) 0 38%, var(--paper) 38.5% 100%);
  border: 1.5px solid var(--ink);
  position: relative;
}
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px dashed var(--ink-mute);
}
.brand-name {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand-sub {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 3px;
}
.nav {
  display: flex;
  gap: 28px;
  justify-content: center;
}
.nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding: 6px 0;
  transition: color .15s;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); }
.nav a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 6px;
  background: var(--accent);
  z-index: -1;
  opacity: 0.55;
}
.cta-sub {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  transition: transform .15s, background .15s;
}
.cta-sub:hover { transform: translateY(-1px); background: var(--deep); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--ink);
  transition: all .15s;
  cursor: pointer;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--deep); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-accent { background: var(--accent); color: var(--ink); border-color: var(--ink); }
.btn-accent:hover { background: oklch(78% 0.2 130); }

/* ---------- Tag / pill ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s;
}
.tag:hover { border-color: var(--ink); color: var(--ink); }
.tag.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.tag-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 28px;
  border-bottom: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}
.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 70% 90% at 100% 30%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 100% 30%, black 30%, transparent 75%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.hero-eyebrow .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 oklch(82% 0.19 130 / 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 oklch(82% 0.19 130 / 0.6); }
  70% { box-shadow: 0 0 0 12px oklch(82% 0.19 130 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(82% 0.19 130 / 0); }
}
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 7vw, 104px);
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  max-width: 14ch;
}
.hero-title em {
  font-style: italic;
  color: var(--ink-soft);
  position: relative;
}
.hero-title em::after {
  content: '';
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: 8%;
  height: 28%;
  background: var(--accent);
  z-index: -1;
  opacity: 0.6;
  transform: skew(-3deg);
}
.hero-lede {
  font-size: 19px;
  max-width: 56ch;
  color: var(--ink-soft);
  margin: 0 0 36px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.hero-meta-row {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  border-top: 1px solid var(--rule);
  padding-top: 28px;
}
.hero-stat .num {
  font-family: var(--serif);
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.hero-stat .label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  margin-top: 8px;
}

/* ---------- Section header ---------- */
.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--rule);
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}
.section-head .eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(36px, 4.5vw, 56px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 8px 0 0;
  font-weight: 400;
}
.section-link {
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.section-link:hover { color: var(--accent-ink); }

/* ---------- Featured (large editorial) ---------- */
.featured-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: stretch;
}
.feat-hero {
  cursor: pointer;
}
.feat-cover {
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  margin-bottom: 24px;
  transition: transform .3s;
}
.feat-hero:hover .feat-cover { transform: translateY(-3px); }
.feat-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.feat-cat {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 3px 8px;
  border-radius: 3px;
}
.feat-time { font-family: var(--mono); font-size: 11px; color: var(--ink-mute); }
.feat-title {
  font-family: var(--serif);
  font-size: clamp(32px, 3.5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  font-weight: 400;
}
.feat-hero:hover .feat-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.feat-excerpt {
  color: var(--ink-soft);
  font-size: 16px;
  margin: 0 0 20px;
  max-width: 50ch;
}
.byline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-mute);
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--deep), var(--accent));
  display: inline-block;
  border: 1px solid var(--ink);
}

.feat-side {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.feat-mini {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  cursor: pointer;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}
.feat-mini:last-child { border-bottom: 0; padding-bottom: 0; }
.feat-mini-cover {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  overflow: hidden;
  transition: transform .3s;
}
.feat-mini:hover .feat-mini-cover { transform: translateY(-2px); }
.feat-mini h3 {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-weight: 400;
  margin: 6px 0 10px;
}
.feat-mini:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* ---------- Article cards grid ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px 28px;
}
.card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.card-cover {
  aspect-ratio: 5 / 4;
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  margin-bottom: 18px;
  transition: transform .3s;
}
.card:hover .card-cover { transform: translateY(-3px); }
.card h3 {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 10px 0 10px;
  font-weight: 400;
}
.card:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.card p {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: 0 0 14px;
}

/* ---------- Cover artworks (svg placeholders w/ science motifs) ---------- */
.cover-art {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Lab notebook ---------- */
.notebook {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 28px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 36px;
}
.notebook h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 12px;
  color: var(--ink-mute);
}
.notebook .nb-title {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.1;
  margin: 0;
}
.nb-entries {
  display: flex;
  flex-direction: column;
}
.nb-entry {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  font-size: 14.5px;
}
.nb-entry:first-child { border-top: 0; padding-top: 0; }
.nb-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 2px;
}
.nb-entry strong { font-weight: 600; }

/* ---------- Newsletter ---------- */
.newsletter {
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  padding: 56px 64px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.newsletter::before {
  content: '';
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 65%);
  opacity: 0.25;
  right: -80px; top: -80px;
  filter: blur(20px);
}
.newsletter h2 {
  font-family: var(--serif);
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  font-weight: 400;
  position: relative;
}
.newsletter p {
  color: oklch(85% 0.01 85);
  margin: 0 0 4px;
  font-size: 15px;
  max-width: 42ch;
  position: relative;
}
.nl-form {
  display: flex;
  background: var(--paper);
  border-radius: 999px;
  padding: 6px;
  position: relative;
}
.nl-form input {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  padding: 12px 18px;
  color: var(--ink);
  outline: none;
}
.nl-form button {
  background: var(--accent);
  color: var(--ink);
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600;
  font-size: 14px;
  transition: background .15s;
}
.nl-form button:hover { background: oklch(78% 0.2 130); }
.nl-fineprint {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: oklch(75% 0.01 85);
  margin-top: 14px !important;
}

/* ---------- Press ticker ---------- */
.press {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 36px;
}
.press-list { display: flex; flex-direction: column; }
.press-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  cursor: pointer;
  transition: padding-left .2s;
}
.press-item:hover { padding-left: 12px; }
.press-item:first-child { border-top: 0; }
.press-headline {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
  font-weight: 400;
}
.press-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding: 80px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
.footer h5 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 16px;
  color: oklch(75% 0.01 85);
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 10px; font-size: 14px; color: oklch(88% 0.01 85); cursor: pointer; }
.footer li:hover { color: var(--accent); }
.footer-brand {
  font-family: var(--serif);
  font-size: 36px;
  line-height: 1;
  margin: 0 0 16px;
}
.footer-bottom {
  border-top: 1px solid oklch(30% 0.02 260);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: oklch(70% 0.01 85);
}

/* ---------- Article reader ---------- */
.article-hero {
  padding: 56px 0 36px;
  border-bottom: 1px solid var(--rule);
}
.article-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.article-title {
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 76px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 0 0 24px;
  max-width: 18ch;
}
.article-deck {
  font-size: 21px;
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 0 0 36px;
  line-height: 1.45;
}
.article-byline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.article-cover {
  aspect-ratio: 21 / 9;
  width: 100%;
  background: var(--paper-2);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--rule);
  margin: 36px 0 56px;
}

.article-body {
  max-width: var(--maxw-narrow);
  margin: 0 auto;
  padding: 0 32px 72px;
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
}
.article-body p { margin: 0 0 22px; }
.article-body p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 4.6em;
  float: left;
  line-height: 0.85;
  margin: 0.05em 0.08em 0 -0.04em;
  color: var(--ink);
}
.article-body h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 36px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 56px 0 18px;
}
.article-body blockquote {
  margin: 36px 0;
  padding: 0 0 0 28px;
  border-left: 3px solid var(--accent);
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.article-body a {
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}
.article-body strong { font-weight: 600; }

.share-rail {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.share-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
  transition: all .15s;
}
.share-btn:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }

.read-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform-origin: left;
  z-index: 100;
  transition: transform .1s;
}

/* ---------- About ---------- */
.about-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
  padding: 64px 0;
}
.about-portrait {
  aspect-ratio: 4 / 5;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.about-mission {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 28px;
}
.mission-card .num {
  font-family: var(--serif);
  font-size: 56px;
  line-height: 1;
  color: var(--ink-mute);
}
.mission-card h4 {
  font-family: var(--serif);
  font-size: 28px;
  margin: 8px 0 8px;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.mission-card p {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- Infographics gallery ---------- */
.gallery {
  columns: 3;
  column-gap: 24px;
}
.gallery > * {
  break-inside: avoid;
  margin-bottom: 24px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: transform .2s;
  background: var(--paper-2);
  position: relative;
}
.gallery > *:hover { transform: translateY(-3px); }
.gallery .gallery-cap {
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  background: var(--paper);
}

/* ---------- Topics index ---------- */
.topics-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

/* ---------- Page transitions ---------- */
.page {
  animation: pageIn .35s ease both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .featured-grid, .press, .about-hero, .newsletter { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .hero-meta-row { grid-template-columns: 1fr 1fr; }
  .gallery { columns: 2; }
  .nav { display: none; }
  .topbar-inner { grid-template-columns: 1fr auto; }
  .about-mission { grid-template-columns: 1fr; }
  .newsletter { padding: 36px; }
}
@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr; }
  .gallery { columns: 1; }
  .feat-mini { grid-template-columns: 80px 1fr; }
  .hero { padding: 36px 0 20px; }
  .container { padding: 0 20px; }
}
